Index: typo3/sysext/cms/tslib/index_ts.php
===================================================================
--- typo3/sysext/cms/tslib/index_ts.php	(revision 7262)
+++ typo3/sysext/cms/tslib/index_ts.php	(working copy)
@@ -79,6 +79,11 @@
 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
 // *********************
@@ -567,7 +572,7 @@
 // *************
 // Debugging Output
 // *************
-if(@is_callable(array($error,'debugOutput'))) {
+if(is_object($error) && @is_callable(array($error,'debugOutput'))) {
 	$error->debugOutput();
 }
 if (TYPO3_DLOG) {
Index: typo3/init.php
===================================================================
--- typo3/init.php	(revision 7262)
+++ typo3/init.php	(working copy)
@@ -177,6 +177,10 @@
 	}
 }
 
+// *********************
+// Unset variable(s) in global scope (fixes #13959)
+// *********************
+unset($error);
 
 // *************************************************
 // t3lib_div + extention management class included
Index: t3lib/class.t3lib_autoloader.php
===================================================================
--- t3lib/class.t3lib_autoloader.php	(revision 7262)
+++ t3lib/class.t3lib_autoloader.php	(working copy)
@@ -107,7 +107,11 @@
 			t3lib_div::requireFile($classPath);
 		} else {
 			try {
-				spl_autoload($className);
+				// Regular expression for a valid classname taken from
+				// http://www.php.net/manual/en/language.oop5.basic.php
+				if (preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $className)) {
+					spl_autoload($className);
+				}
 			} catch (LogicException $exception) {
 			}
 		}
Index: t3lib/config_default.php
===================================================================
--- t3lib/config_default.php	(revision 7262)
+++ t3lib/config_default.php	(working copy)
@@ -470,7 +470,7 @@
 		// If you wish to use the debug()-function, and it does not output something, please edit the IP mask in TYPO3_CONF_VARS
 	if (!t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']))	return;
 
-	if(@is_callable(array($GLOBALS['error'],'debug'))) {
+	if(is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'],'debug'))) {
 		$GLOBALS['error']->debug($variable, $name, $line, $file, $recursiveDepth, $debugLevel);
 	} else {
 		$br = ($name == '*variable*') ? 0 : $name;
@@ -478,12 +478,12 @@
 	}
 }
 function debugBegin() {
-	if(@is_callable(array($GLOBALS['error'],'debugBegin'))) {
+	if(is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'],'debugBegin'))) {
 		$GLOBALS['error']->debugBegin();
 	}
 }
 function debugEnd() {
-	if(@is_callable(array($GLOBALS['error'],'debugEnd'))) {
+	if(is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'],'debugEnd'))) {
 		$GLOBALS['error']->debugEnd();
 	}
 }

