diff --git a/library/think/loader.php b/library/think/loader.php index cc0cfa80..8715da81 100644 --- a/library/think/loader.php +++ b/library/think/loader.php @@ -36,8 +36,8 @@ class Loader include $file; } else { // 命名空间自动加载 - $name = strtolower(strstr($class, '\\', true)); - $class = substr($class, strlen($name) + 1); + list($name, $class) = explode('\\', $class, 2); + $name = strtolower($name); if (isset(self::$namespace[$name])) { // 注册的命名空间 $path = self::$namespace[$name];