diff options
author | Andrew Dolgov <[email protected]> | 2018-07-18 13:25:18 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-07-18 13:25:18 +0300 |
commit | a2d1fa5b14104013bab8ca4d9d5e115ebedaab42 (patch) | |
tree | 082c43c8d85fdec0f64b97d8c6f7a2a9bdea0551 /include/autoload.php | |
parent | 331ded21ba0ba0439d9843840b015366921a9148 (diff) |
autoloader: check if class name is namespaced before trying to split it
Diffstat (limited to 'include/autoload.php')
-rw-r--r-- | include/autoload.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/autoload.php b/include/autoload.php index 2e73a9722..1f1dbe5e9 100644 --- a/include/autoload.php +++ b/include/autoload.php @@ -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 |