diff --git a/Library/Think/App.php b/Library/Think/App.php index 94105879..8a69f663 100644 --- a/Library/Think/App.php +++ b/Library/Think/App.php @@ -212,11 +212,11 @@ class App { // URL后缀 define('__EXT__', strtolower(pathinfo($_SERVER['PATH_INFO'],PATHINFO_EXTENSION))); $_SERVER['PATH_INFO'] = __INFO__; - if(!defined('BIND_MODULE')){ - if($config['url_deny_suffix'] && preg_match('/\.('.$config['url_deny_suffix'].')$/i', $_SERVER['PATH_INFO'])){ + if(__INFO__ && !defined('BIND_MODULE')){ + if($config['url_deny_suffix'] && preg_match('/\.('.$config['url_deny_suffix'].')$/i', __INFO__)){ exit; } - $paths = explode($config['pathinfo_depr'], $_SERVER['PATH_INFO']); + $paths = explode($config['pathinfo_depr'], __INFO__,2); // 获取URL中的模块名 if($config['require_module'] && !isset($_GET[$config['var_module']])) { $_GET[$config['var_module']] = array_shift($paths); diff --git a/Library/Think/Loader.php b/Library/Think/Loader.php index f9ad45e9..f5e077a6 100644 --- a/Library/Think/Loader.php +++ b/Library/Think/Loader.php @@ -33,7 +33,6 @@ class Loader { $path = APP_PATH; } $filename = $path . str_replace('\\', '/', str_replace('\\_','\\',strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $class), "_")))) . EXT; - var_dump($filename); if(is_file($filename)) { include $filename; } @@ -138,8 +137,7 @@ class Loader { }else{ $module = MODULE_NAME; } - $layer = ucwords($layer); - $class = $module . '\\' . $layer . '\\' . parse_name($name, 1). $layer; + $class = $module . '\\' . $layer . '\\' . parse_name($name, 1); if(class_exists($class)) { $model = new $class($name); }else { @@ -166,14 +164,13 @@ class Loader { }else{ $module = MODULE_NAME; } - $layer = ucwords($layer); - $class = $module . '\\' . $layer . '\\' . parse_name($name, 1) . $layer; + $class = $module . '\\' . $layer . '\\' . parse_name($name, 1) ; if(class_exists($class)) { $action = new $class; $_instance[$name . $layer] = $action; return $action; - }elseif(class_exists($module . '\\' . $layer . '\\Empty' . $layer)){ - $class = $module . '\\' . $layer . '\\Empty' . $layer; + }elseif(class_exists($module . '\\' . $layer . '\\Empty')){ + $class = $module . '\\' . $layer . '\\Empty'; return new $class; }else{ return false;