Actions
Bug #31139
closedbetter condition in versionOL of t3lib_tstemplate
Start date:
2011-10-20
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
Description
Hello Core-Team,
in current TYPO3 4.5.7 you have following method in class.t3lib_tstemplate.php:
function versionOL(&$row) { if (is_object($GLOBALS['TSFE'])) { // Frontend: $GLOBALS['TSFE']->sys_page->versionOL('sys_template', $row); } else { // Backend: t3lib_BEfunc::workspaceOL('sys_template', $row); } }
You only need to set something:
$GLOBALS['TSFE']->register['hello'] = 1;
or play with cObj in BE Mode and $GLOBALS['TSFE'] get's a value.
In this case is_object($GLOBALS['TSFE']) returns true, because it is of class stdClass now.
So...to prevent calling $GLOBALS['TSFE']->sys_page->versionOL in BE-Mode it's better to modify the condition that way:
function versionOL(&$row) { if (isset($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE']) && get_class($GLOBALS['TSFE']) == 'tslib_fe') { // Frontend: $GLOBALS['TSFE']->sys_page->versionOL('sys_template', $row); } else { // Backend: t3lib_BEfunc::workspaceOL('sys_template', $row); } }
Stefan
Actions