autoloader: check if class name is namespaced before trying to split it
This commit is contained in:
parent
331ded21ba
commit
a2d1fa5b14
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,10 @@
|
|||
require_once "functions.php";
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
$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
|
||||
|
|
Loading…
Reference in a new issue