[BUGFIX] Incorrect TYPO3 environment check
authorRens Admiraal <r.admiraal@drecomm.nl>
Tue, 15 Mar 2011 16:25:48 +0000 (17:25 +0100)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Mon, 6 Jun 2011 19:03:56 +0000 (21:03 +0200)
class.t3lib_tstemplate.php uses if (is_object($GLOBALS['TSFE'])) to check
for the frontend environment, this should be if (TYPO3_MODE == 'FE')

This patch already has a +1 on the core list. Made this changeset to get
it into gerrit.

Change-Id: I57fbbc9258b6db4af20a983791b38087f71ed31d
Resolves: #M17725
Reviewed-on: http://review.typo3.org/1174
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
t3lib/class.t3lib_tstemplate.php

index b513b1a..521f709 100644 (file)
@@ -748,7 +748,7 @@ class t3lib_TStemplate {
         * @return      void            Row is passed by reference.
         */
        function versionOL(&$row) {
-               if (is_object($GLOBALS['TSFE'])) { // Frontend:
+               if (TYPO3_MODE === 'FE') { // Frontend:
                        $GLOBALS['TSFE']->sys_page->versionOL('sys_template', $row);
                } else { // Backend:
                        t3lib_BEfunc::workspaceOL('sys_template', $row);
@@ -1601,4 +1601,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tstemplate.php']);
 }
 
-?>
\ No newline at end of file
+?>