From 9cc6345f920042bae3e63b5d596ff658ceff3c5b Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 9 Feb 2013 02:03:07 +0100 Subject: [PATCH] Bug workaround for (undocumented?) autoload change in PHP 5.3.? Our local vanilla 5.3.8 always receives classes for autoloading fully-qualified without leading slash (as written in the PHP doc), but a customers 5.3.2-1ubuntu4.18 sometimes receives it with an leading slash. Simple way of handling that, breaks nothing and normally won't affect anything. --- wcfsetup/install/files/lib/system/WCF.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 01fa9fcbe3..eba5af5ef1 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -534,6 +534,8 @@ class WCF { $namespaces = explode('\\', $className); if (count($namespaces) > 1) { $applicationPrefix = array_shift($namespaces); + if($applicationPrefix === '') + $applicationPrefix = array_shift($namespaces); if (isset(self::$autoloadDirectories[$applicationPrefix])) { $classPath = self::$autoloadDirectories[$applicationPrefix] . implode('/', $namespaces) . '.class.php'; if (file_exists($classPath)) { -- 2.20.1