fix: nav
This commit is contained in:
@@ -21,7 +21,7 @@ class Check
|
||||
}
|
||||
|
||||
// 判断自动转换状态
|
||||
if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
|
||||
if (PHP_VERSION < '7.0' && function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
|
||||
error('您的服务器环境PHP.ini中magic_quotes_gpc配置为On状态,会导致数据存储异常,请设置为Off状态或切换为更高版本PHP。');
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -118,16 +118,16 @@ class Url
|
||||
$suffix = '/';
|
||||
}
|
||||
|
||||
// 去除默认模块及控制器部分
|
||||
$path = trim($path, '/');
|
||||
$path = str_replace('home/Index', '', $path);
|
||||
$path = trim($path, '/');
|
||||
|
||||
// 去除默认模块及控制器部分
|
||||
$path = str_replace('home/Index/', '', $path);
|
||||
|
||||
if (! $path) {
|
||||
if (! $path) { // 地址前缀
|
||||
if ($url_rule_type == 1) {
|
||||
$link = SITE_INDEX_DIR . '/index.php';
|
||||
$link = SITE_INDEX_DIR . '/index.php/';
|
||||
} elseif ($url_rule_type == 2) {
|
||||
$link = SITE_INDEX_DIR;
|
||||
$link = SITE_INDEX_DIR . '/';
|
||||
} else {
|
||||
$link = SITE_INDEX_DIR . '/?';
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ function path_list($path)
|
||||
* 是否删除目录,true删除目录,false则只删除文件保留目录
|
||||
* @return bool 返回删除状态
|
||||
*/
|
||||
function path_delete($path, $delDir = false)
|
||||
function path_delete($path, $delDir = false, $exFile = array())
|
||||
{
|
||||
$result = true; // 对于空目录直接返回true状态
|
||||
if (! file_exists($path)) {
|
||||
@@ -123,9 +123,9 @@ function path_delete($path, $delDir = false)
|
||||
if (is_dir($path)) {
|
||||
if (! ! $dirs = scandir($path)) {
|
||||
foreach ($dirs as $value) {
|
||||
if ($value != "." && $value != "..") {
|
||||
if ($value != "." && $value != ".." && ! in_array($value, $exFile)) {
|
||||
$dir = $path . '/' . $value;
|
||||
$result = is_dir($dir) ? path_delete($dir, $delDir) : unlink($dir);
|
||||
$result = is_dir($dir) ? path_delete($dir, $delDir, $exFile) : unlink($dir);
|
||||
}
|
||||
}
|
||||
if ($result && $delDir) {
|
||||
|
||||
@@ -406,8 +406,8 @@ function decode_string($string)
|
||||
} else { // 字符串处理
|
||||
$string = stripcslashes($string);
|
||||
$string = htmlspecialchars_decode($string, ENT_QUOTES);
|
||||
$string = preg_replace_r('/pboot:if/i', 'pboot@if', $string); // 避免解码绕过问题
|
||||
}
|
||||
$string = preg_replace_r('/pboot:if/i', 'pboot@if', $string); // 避免解码绕过问题
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
@@ -237,8 +237,8 @@ class Paging
|
||||
// 对于路径保留变量给予去除
|
||||
$qs = $_SERVER["QUERY_STRING"];
|
||||
if ((M == 'home' && Config::get('url_rule_type') == 2) || (M != 'home' && Config::get('app_url_type') == 2)) {
|
||||
$qs = preg_replace('/[&\?]?p=([\w\/\.]+)?/i', '', $qs);
|
||||
$qs = preg_replace('/[&\?]?s=([\w\/\.]+)?/i', '', $qs);
|
||||
$qs = preg_replace('/[&\?]?p=([\w\/\.]+)?&?/i', '', $qs);
|
||||
$qs = preg_replace('/[&\?]?s=([\w\/\.]+)?&?/i', '', $qs);
|
||||
}
|
||||
$qs = preg_replace('/[&\?]?page=([0-9]+)?/i', '', $qs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user