// *******************************
// Set error reporting
// *******************************
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+ error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+ error_reporting(E_ALL ^ E_NOTICE);
+}
// ******************
// Constants defined
// ******************
-$TYPO3_MISC['microtime_start'] = microtime();
+$TYPO3_MISC['microtime_start'] = microtime(true);
define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
define('TYPO3_MODE','FE');
-if (!defined('PATH_thisScript')) define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
+if (!defined('PATH_thisScript')) define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (PHP_SAPI=='cgi'||PHP_SAPI=='isapi' ||PHP_SAPI=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
if (!defined('PATH_site')) define('PATH_site', dirname(PATH_thisScript).'/');
if (!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');
if (!@is_dir(PATH_typo3conf)) die('Cannot find configuration. This file is probably executed from the wrong location.');
// *********************
+// Unset variable(s) in global scope (fixes #13959)
+// *********************
+unset($error);
+
+// *********************
// Prevent any output until AJAX/compression is initialized to stop
// AJAX/compression data corruption
// *********************
// *********************
// Timetracking started
// *********************
-require_once(PATH_t3lib.'class.t3lib_timetrack.php');
-$TT = new t3lib_timeTrack;
+if ($_COOKIE['be_typo_user']) {
+ require_once(PATH_t3lib.'class.t3lib_timetrack.php');
+ $TT = new t3lib_timeTrack;
+} else {
+ require_once(PATH_t3lib.'class.t3lib_timetracknull.php');
+ $TT = new t3lib_timeTrackNull;
+}
+
$TT->start();
$TT->push('','Script start');
}
+
+
// *********************
-// Autoloader
+// Error & Exception handling
// *********************
-$TT->push('Register Autoloader', '');
- require_once(PATH_t3lib . 'class.t3lib_autoloader.php');
- t3lib_autoloader::registerAutoloader();
-$TT->pull();
-
+if ($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler'] !== '') {
+ $TT->push('Register Exceptionhandler', '');
+ if ($TYPO3_CONF_VARS['SYS']['errorHandler'] !== '') {
+ // register an error handler for the given errorHandlerErrors
+ $errorHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SYS']['errorHandler'], $TYPO3_CONF_VARS['SYS']['errorHandlerErrors']);
+ // set errors which will be converted in an exception
+ $errorHandler->setExceptionalErrors($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors']);
+ }
+ $exceptionHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler']);
+ $TT->pull();
+}
$TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
$TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];
// *********
// BE_USER
// *********
-$BE_USER='';
+$BE_USER = NULL;
if ($_COOKIE['be_typo_user']) { // If the backend cookie is set, we proceed and checks if a backend user is logged in.
- $TYPO3_MISC['microtime_BE_USER_start'] = microtime();
+ $TYPO3_MISC['microtime_BE_USER_start'] = microtime(true);
$TT->push('Back End user initialized','');
- require_once (PATH_t3lib.'class.t3lib_befunc.php');
- require_once (PATH_t3lib.'class.t3lib_userauthgroup.php');
- require_once (PATH_t3lib.'class.t3lib_beuserauth.php');
- require_once (PATH_t3lib.'class.t3lib_tsfebeuserauth.php');
// the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
$BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth'); // New backend user object
}
// Unset the user initialization.
if (!$BE_USER->checkLockToIP() || !$BE_USER->checkBackendAccessSettingsFromInitPhp() || !$BE_USER->user['uid']) {
- $BE_USER='';
+ $BE_USER = NULL;
$TSFE->beUserLogin=0;
}
$TT->pull();
- $TYPO3_MISC['microtime_BE_USER_end'] = microtime();
+ $TYPO3_MISC['microtime_BE_USER_end'] = microtime(true);
} elseif ($TSFE->ADMCMD_preview_BEUSER_uid) {
- require_once (PATH_t3lib.'class.t3lib_befunc.php');
- require_once (PATH_t3lib.'class.t3lib_userauthgroup.php');
- require_once (PATH_t3lib.'class.t3lib_beuserauth.php');
- require_once (PATH_t3lib.'class.t3lib_tsfebeuserauth.php');
// the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
$BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth'); // New backend user object
$BE_USER->fetchGroupData();
$TSFE->beUserLogin = 1;
} else {
- $BE_USER = '';
+ $BE_USER = NULL;
$TSFE->beUserLogin = 0;
}
}
// ***********
// Statistics
// ***********
-$TYPO3_MISC['microtime_end'] = microtime();
+$TYPO3_MISC['microtime_end'] = microtime(true);
$TSFE->setParseTime();
if ($TSFE->isOutputting() && ($TSFE->TYPO3_CONF_VARS['FE']['debug'] || $TSFE->config['config']['debug'])) {
echo '
// ******************
// Publishing static
// ******************
-if (is_object($BE_USER) && ($BE_USER->adminPabel instanceof tslib_AdminPanel)) {
+if (is_object($BE_USER) && ($BE_USER->adminPanel instanceof tslib_AdminPanel)) {
if ($BE_USER->adminPanel->isAdminModuleEnabled('publish') && $BE_USER->adminPanel->getExtPublishList()) {
include_once(PATH_tslib.'publish.php');
}
// *************
// Admin panel
// *************
-if (is_object($BE_USER) && $TSFE->beUserLogin) {
+if (is_object($BE_USER) && $BE_USER->isAdminPanelVisible() && $TSFE->beUserLogin) {
echo $BE_USER->displayAdminPanel();
}
// *************
// Debugging Output
// *************
-if(@is_callable(array($error,'debugOutput'))) {
+if(is_object($error) && @is_callable(array($error,'debugOutput'))) {
$error->debugOutput();
}
if (TYPO3_DLOG) {