autoloader: check if class name is namespaced before trying to split it
This commit is contained in:
父節點
331ded21ba
當前提交
a2d1fa5b14
共有 1 個文件被更改,包括 5 次插入 和 1 次删除
|
@ -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
|
||||
|
||||
|
|
載入中…
Reference in a new issue