--- typo3_src-4.3.3/typo3/sysext/cms/tslib/class.tslib_fe_orginal.php 2010-04-28 17:22:57.000000000 +0200 +++ typo3_src-4.3.3/typo3/sysext/cms/tslib/class.tslib_fe.php 2010-04-28 18:56:50.000000000 +0200 @@ -3315,7 +3315,7 @@ * @return string Keyword: "all", "cached" or "output" */ function doLocalAnchorFix() { - return $this->config['config']['prefixLocalAnchors']; + return isset($this->config['config']['prefixLocalAnchors']) ? $this->config['config']['prefixLocalAnchors'] : null; } @@ -3371,18 +3371,18 @@ function processOutput() { // Set header for charset-encoding unless disabled - if (!$this->config['config']['disableCharsetHeader']) { + if (empty($this->config['config']['disableCharsetHeader'])) { $headLine = 'Content-Type: text/html; charset='.trim($this->metaCharset); header($headLine); } // Set cache related headers to client (used to enable proxy / client caching!) - if ($this->config['config']['sendCacheHeaders']) { + if (!empty($this->config['config']['sendCacheHeaders'])) { $this->sendCacheHeaders(); } // Set headers, if any - if ($this->config['config']['additionalHeaders']) { + if (!empty($this->config['config']['additionalHeaders'])) { $headerArray = explode('|', $this->config['config']['additionalHeaders']); while(list(,$headLine)=each($headerArray)) { $headLine = trim($headLine); @@ -3421,7 +3421,7 @@ } // Hook for post-processing of page content before output: - if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'])) { + if (isset($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output']) && is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'])) { $_params = array('pObj' => &$this); foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'] as $_funcRef) { t3lib_div::callUserFunction($_funcRef,$_params,$this); @@ -3430,7 +3430,7 @@ // Send content-lenght header. // Notice that all HTML content outside the length of the content-length header will be cut off! Therefore content of unknown length from included PHP-scripts and if admin users are logged in (admin panel might show...) or if debug mode is turned on, we disable it! - if ($this->config['config']['enableContentLengthHeader'] && + if (!empty($this->config['config']['enableContentLengthHeader']) && !$this->isEXTincScript() && !$this->beUserLogin && !$this->TYPO3_CONF_VARS['FE']['debug'] && @@ -3454,7 +3454,7 @@ $doCache = $this->isStaticCacheble(); // This variable will be TRUE unless cache headers are configured to be sent ONLY if a branch does not allow logins and logins turns out to be allowed anyway... - $loginsDeniedCfg = !$this->config['config']['sendCacheHeaders_onlyWhenLoginDeniedInBranch'] || !$this->loginAllowedInBranch; + $loginsDeniedCfg = empty($this->config['config']['sendCacheHeaders_onlyWhenLoginDeniedInBranch']) || empty($this->loginAllowedInBranch); // Finally, when backend users are logged in, do not send cache headers at all (Admin Panel might be displayed for instance). if ($doCache @@ -3537,12 +3537,12 @@ if ($this->fe_user->user['uid']) { // User name: - $token = trim($this->config['config']['USERNAME_substToken']); + $token = isset($this->config['config']['USERNAME_substToken']) ? trim($this->config['config']['USERNAME_substToken']) : ''; $search[] = ($token ? $token : ''); $replace[] = $this->fe_user->user['username']; // User uid (if configured): - $token = trim($this->config['config']['USERUID_substToken']); + $token = isset($this->config['config']['USERUID_substToken']) ? trim($this->config['config']['USERUID_substToken']) : ''; if ($token) { $search[] = $token; $replace[] = $this->fe_user->user['uid']; @@ -3581,7 +3581,7 @@ * @see tslib_cObj::PHP_SCRIPT */ function isEXTincScript() { - return is_array($this->config['EXTincScript']); + return (isset($this->config['EXTincScript']) && is_array($this->config['EXTincScript'])); } /** @@ -3601,9 +3601,13 @@ */ function setParseTime() { // Compensates for the time consumed with Back end user initialization. - $this->scriptParseTime = $GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_end']) - - $GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_start']) - - ($GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_BE_USER_end']) - $GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_BE_USER_start'])); + $microtime_start = isset($GLOBALS['TYPO3_MISC']['microtime_start']) ? $GLOBALS['TYPO3_MISC']['microtime_start'] : null; + $microtime_end = isset($GLOBALS['TYPO3_MISC']['microtime_end']) ? $GLOBALS['TYPO3_MISC']['microtime_end'] : null; + $microtime_BE_USER_start = isset($GLOBALS['TYPO3_MISC']['microtime_BE_USER_start']) ? $GLOBALS['TYPO3_MISC']['microtime_BE_USER_start'] : null; + $microtime_BE_USER_end = isset($GLOBALS['TYPO3_MISC']['microtime_BE_USER_end']) ? $GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'] : null; + + $this->scriptParseTime = $GLOBALS['TT']->getMilliseconds($microtime_end) - $GLOBALS['TT']->getMilliseconds($microtime_start) + - ($GLOBALS['TT']->getMilliseconds($microtime_BE_USER_end) - $GLOBALS['TT']->getMilliseconds($microtime_BE_USER_start)); } /** @@ -3713,13 +3717,13 @@ * @return void */ function statistics() { - if ($this->config['config']['stat'] && + if (!empty($this->config['config']['stat']) && (!strcmp('',$this->config['config']['stat_typeNumList']) || t3lib_div::inList(str_replace(' ','',$this->config['config']['stat_typeNumList']), $this->type)) && - (!$this->config['config']['stat_excludeBEuserHits'] || !$this->beUserLogin) && - (!$this->config['config']['stat_excludeIPList'] || !t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'),str_replace(' ','',$this->config['config']['stat_excludeIPList'])))) { + (empty($this->config['config']['stat_excludeBEuserHits']) || !$this->beUserLogin) && + (empty($this->config['config']['stat_excludeIPList']) || !t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'),str_replace(' ','',$this->config['config']['stat_excludeIPList'])))) { $GLOBALS['TT']->push('Stat'); - if (t3lib_extMgm::isLoaded('sys_stat') && $this->config['config']['stat_mysql']) { + if (t3lib_extMgm::isLoaded('sys_stat') && !empty($this->config['config']['stat_mysql'])) { // Jumpurl: $sword = t3lib_div::_GP('sword'); @@ -3765,7 +3769,7 @@ ); // Hook for preprocessing the list of fields to insert into sys_stat: - if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sys_stat-PreProcClass'])) { + if (isset($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sys_stat-PreProcClass']) && is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sys_stat-PreProcClass'])) { foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sys_stat-PreProcClass'] as $_classRef) { $_procObj = t3lib_div::getUserObj($_classRef); $insertFields = $_procObj->sysstat_preProcessFields($insertFields,$this); @@ -3779,7 +3783,7 @@ } // Apache: - if ($this->config['config']['stat_apache'] && $this->config['stat_vars']['pageName']) { + if (!empty($this->config['config']['stat_apache']) && !empty($this->config['stat_vars']['pageName'])) { if (@is_file($this->config['stat_vars']['logFile'])) { // Build a log line (format is derived from the NCSA extended/combined log format) // Log part 1: Remote hostname / address @@ -3852,7 +3856,7 @@ function hook_eofe() { // Call hook for end-of-frontend processing: - if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'])) { + if (isset($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']) && is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'])) { $_params = array('pObj' => &$this); foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'] as $_funcRef) { t3lib_div::callUserFunction($_funcRef,$_params,$this); @@ -3866,7 +3870,7 @@ * @return string HTML, a tag for a link to the backend. */ function beLoginLinkIPList() { - if ($this->config['config']['beLoginLinkIPList']) { + if (!empty($this->config['config']['beLoginLinkIPList'])) { if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $this->config['config']['beLoginLinkIPList'])) { $label = !$this->beUserLogin ? $this->config['config']['beLoginLinkIPList_login'] : $this->config['config']['beLoginLinkIPList_logout']; if ($label) {