Project

General

Profile

Actions

Bug #28007

closed

TCEmain::clear_cacheCmd relies on active BE_USER

Added by Jochen Weiland over 13 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2011-07-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Sympton:

An extension (like ve_guestbook) might clear the cache with this command:

$GLOBALS ['TSFE']->clearPageCacheContent_pidList ( $GLOBALS ['TSFE']->id );

Since clearing of the cache is now written to the system log, the following call in function clear_cacheCmd() class.t3lib_tcemain.php will fail if no BE_USER is logged in:

$this->BE_USER->writelog(3, 1, 0, 0, 'User %s has cleared the cache (cacheCmd=%s)', array($this->BE_USER->user['username'], $cacheCmd));

Solution: check whether a BE_USER object exists before making the call to the log (otherwise the log message would have no user name either)

if ($this->BE_USER) {
$this->BE_USER->writelog(3, 1, 0, 0, 'User %s has cleared the cache (cacheCmd=%s)', array($this->BE_USER->user['username'], $cacheCmd));
}


Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #32666: Fatal error during install processClosedOliver Hader2011-12-18

Actions
Related to TYPO3 Core - Bug #24406: error when using t3lib_TCEmain->clear_cacheCmd in frontendClosedSteffen Gebert2010-12-23

Actions
Related to TYPO3 Core - Bug #25287: error when using t3lib_TCEmain->clear_cacheCmd in CLI modeClosedSteffen Gebert2011-03-09

Actions
Related to TYPO3 Core - Bug #51829: TCEmain::log relies on active BE_USERRejected2013-09-07

Actions
Actions

Also available in: Atom PDF