3.2.3 - 普通 - 未处理
设置了模块映射后,部分url不能进行替换,比如设置了'URL_MODULE_MAP' => array('admin2018'=>'admin'),后类似如U('Admin/index/index/param1/1/param2/2/p3/3')的就不能正确映射,这是由于U函数的问题,更多参数时无法查找到对应映射关系。修改如下:
将文件 Common/functions.php 中U函数
if($maps = C('URL_MODULE_MAP')) {
if($_module = array_search(strtolower($var[$varModule]),$maps)){
$var[$varModule] = $_module;
}
}修改为: if($maps = C('URL_MODULE_MAP')) {
$temp = explode($depr,$var[$varModule]);
if($temp[0] = array_search(strtolower($temp[0]),$maps)){
$var[$varModule] = implode($depr,$temp);
}
}问题解决。 