aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/class_loader.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-03-28 17:33:36 +0100
committerAndreas Fischer <bantu@phpbb.com>2014-03-28 21:47:23 +0100
commitbd0ba372078d10a093bd09b1b58839fa7b39daf0 (patch)
tree8b768cf25b7c1a42ca1924d82b0dd338f180c20e /phpBB/phpbb/class_loader.php
parente742d1ec2698388372a7eecf9dfe6c0403c929e3 (diff)
downloadforums-bd0ba372078d10a093bd09b1b58839fa7b39daf0.tar
forums-bd0ba372078d10a093bd09b1b58839fa7b39daf0.tar.gz
forums-bd0ba372078d10a093bd09b1b58839fa7b39daf0.tar.bz2
forums-bd0ba372078d10a093bd09b1b58839fa7b39daf0.tar.xz
forums-bd0ba372078d10a093bd09b1b58839fa7b39daf0.zip
[ticket/12314] Workaround HHVM SPL autoloader sometimes using leading backslash
PHPBB3-12314
Diffstat (limited to 'phpBB/phpbb/class_loader.php')
-rw-r--r--phpBB/phpbb/class_loader.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/phpbb/class_loader.php b/phpBB/phpbb/class_loader.php
index 37b62fff24..ee9767148b 100644
--- a/phpBB/phpbb/class_loader.php
+++ b/phpBB/phpbb/class_loader.php
@@ -142,7 +142,13 @@ class class_loader
*/
public function load_class($class)
{
- $class = '\\' . $class;
+ // In general $class is not supposed to contain a leading backslash,
+ // but sometimes it does. See tickets PHP-50731 and HHVM-1840.
+ if ($class[0] !== '\\')
+ {
+ $class = '\\' . $class;
+ }
+
if (substr($class, 0, strlen($this->namespace)) === $this->namespace)
{
$path = $this->resolve_path($class);