场景:
windows :
$_SERVER['PHP_SELF'] /index.php/module/controller/action
linux : __ACTION__获取路径重复
$_SERVER['PHP_SELF'] /index.php/module/controller/action/module/controller/action
定位:
ThinkPHP/ThinkPHP.php第82行:
if(!IS_CLI) {
// 当前文件名
if(!defined('_PHP_FILE_')) {
if(IS_CGI) {
//CGI/FASTCGI模式下
//$_temp = explode('.php',$_SERVER['PHP_SELF']);
//改为
$_temp = explode('.php',$_SERVER['SCRIPT_NAME']);
define('_PHP_FILE_', rtrim(str_replace($_SERVER['HTTP_HOST'],'',$_temp[0].'.php'),'/'));
}else {
define('_PHP_FILE_', rtrim($_SERVER['SCRIPT_NAME'],'/'));
}
}
}