From db4eca22ae3c07aed42141cf494b8f064441f0b6 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 15 Jun 2017 11:37:04 +0800 Subject: [PATCH] * merge framework. --- config/config.php | 4 ++-- framework/base/router.class.php | 7 ++----- lib/base/pager/pager.class.php | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/config/config.php b/config/config.php index abf1fdc31e..d253bf00f4 100644 --- a/config/config.php +++ b/config/config.php @@ -125,9 +125,9 @@ if(file_exists($myConfig)) include $myConfig; /* 文件上传设置。 Upload settings. */ $config->file = new stdclass(); // 危险文件类型。 Dangerous file types. -$config->file->dangers = ',php,php3,php4,phtml,php5,jsp,py,rb,asp,aspx,ashx,asa,cer,cdx,aspl,shtm,shtml,html,htm,'; +$config->file->dangers = 'php,php3,php4,phtml,php5,jsp,py,rb,asp,aspx,ashx,asa,cer,cdx,aspl,shtm,shtml,html,htm'; // 允许上传的文件类型。 Allowed file types. -$config->file->allowed = ',txt,doc,docx,dot,wps,wri,pdf,ppt,xls,xlsx,ett,xlt,xlsm,csv,jpg,jpeg,png,psd,gif,ico,bmp,swf,avi,rmvb,rm,mp3,mp4,3gp,flv,mov,movie,rar,zip,bz,bz2,tar,gz,'; +$config->file->allowed = 'txt,doc,docx,dot,wps,wri,pdf,ppt,xls,xlsx,ett,xlt,xlsm,csv,jpg,jpeg,png,psd,gif,ico,bmp,swf,avi,rmvb,rm,mp3,mp4,3gp,flv,mov,movie,rar,zip,bz,bz2,tar,gz'; /* 配置参数过滤。Filter param settings. */ /* Like $config->filterParam->param[moduleName][methodname][ruleType] = rule. */ diff --git a/framework/base/router.class.php b/framework/base/router.class.php index b5d957a5c8..5ea0578fb7 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1066,7 +1066,8 @@ class baseRouter elseif(isset($_SERVER['REQUEST_URI'])) { $value = $_SERVER['REQUEST_URI']; - $subpath = '/' . str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname($_SERVER['SCRIPT_FILENAME'])); + $subpath = str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname($_SERVER['SCRIPT_FILENAME'])); + if($subpath != '/') $subpath = '/' . $subpath; if($subpath != '' and $subpath != '/' and strpos($value, $subpath) === 0) $value = substr($value, strlen($subpath)); } else @@ -2011,10 +2012,6 @@ class baseRouter $view->expiredTime = ini_get('session.gc_maxlifetime'); $view->serverTime = time(); - $ip = gethostbyname($_SERVER['HTTP_HOST']); - $view->ip = strpos($ip, ':') === false ? $ip : substr($ip, 0, strpos($ip, ':')); - $view->name = isset($this->config->socket->name) ? $this->config->socket->name : ''; - $view->port = isset($this->config->socket->port) ? $this->config->socket->port : ''; echo json_encode($view); } diff --git a/lib/base/pager/pager.class.php b/lib/base/pager/pager.class.php index 73de3b0093..ddedb63612 100644 --- a/lib/base/pager/pager.class.php +++ b/lib/base/pager/pager.class.php @@ -605,7 +605,8 @@ EOT; global $config; if($config->requestType != 'GET' && method_exists('uri', 'create' . $this->moduleName . $this->methodName)) { - $link = strip_tags(urldecode($_SERVER['REQUEST_URI'])); + $link = strip_tags(urldecode($_SERVER['REQUEST_URI'])); + $link = htmlspecialchars($link,ENT_QUOTES); if($this->params['pageID'] == 1) return html::a(preg_replace('/\/p\d+\./', '.', $link), $title);