]> git.wh0rd.org Git - tt-rss.git/commitdiff
autoloader: check if class name is namespaced before trying to split it
authorAndrew Dolgov <noreply@fakecake.org>
Wed, 18 Jul 2018 10:25:18 +0000 (13:25 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Wed, 18 Jul 2018 10:25:18 +0000 (13:25 +0300)
include/autoload.php

index 2e73a9722330e887603a61d7c97487e628897012..1f1dbe5e993ff7bc9218e1fd55dd6382c560330e 100644 (file)
@@ -2,7 +2,11 @@
        require_once "functions.php";
 
        spl_autoload_register(function($class) {
-               list ($namespace, $class_name) = explode('\\', $class, 2);
+               $namespace = '';
+               $class_name = $class;
+
+               if (strpos($class, '\\') !== FALSE)
+                       list ($namespace, $class_name) = explode('\\', $class, 2);
 
                $root_dir = dirname(__DIR__); // we're in tt-rss/include