From 5924091515195ddd8bd25931acaef4b2ac3ca6b7 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 5 Jul 2017 13:17:45 +0800 Subject: [PATCH] * adjust for framework and fix bug for search use today. --- framework/base/router.class.php | 2 +- module/common/lang/en.php | 2 +- module/common/view/kindeditor.html.php | 2 +- module/file/model.php | 4 ++-- module/search/model.php | 14 +++++++------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 0222aa9647..785c222ff7 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1789,7 +1789,7 @@ class baseRouter { if(isset($passedParams[$i])) { - $defaultParams[$key] = strip_tags(urldecode($passedParams[$i])); + $defaultParams[$key] = strip_tags($passedParams[$i]); } else { diff --git a/module/common/lang/en.php b/module/common/lang/en.php index b340351844..2c9b16a47f 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -452,7 +452,7 @@ $lang->noticePasteImg = "Paste image to editor."; define('DT_DATETIME1', 'Y-m-d H:i:s'); define('DT_DATETIME2', 'y-m-d H:i'); define('DT_MONTHTIME1', 'n/d H:i'); -define('DT_MONTHTIME2', 'n月d日 H:i'); +define('DT_MONTHTIME2', 'M d H:i'); define('DT_DATE1', 'Y-m-d'); define('DT_DATE2', 'Ymd'); define('DT_DATE3', 'Y年m月d日'); diff --git a/module/common/view/kindeditor.html.php b/module/common/view/kindeditor.html.php index 39620936bf..da35135c1b 100755 --- a/module/common/view/kindeditor.html.php +++ b/module/common/view/kindeditor.html.php @@ -62,7 +62,7 @@ function initKindeditor(afterInit) items:editorTool, filterMode: true, bodyClass:'article-content', - urlType:'relative', + urlType:'absolute', uploadJson: createLink('file', 'ajaxUpload', 'uid=' + kuid), allowFileManager:true, langType:'', diff --git a/module/file/model.php b/module/file/model.php index 778cc84aae..9ce7405dc8 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -627,8 +627,8 @@ class fileModel extends model public function processImgURL($data, $editorList, $uid = '') { if(is_string($editorList)) $editorList = explode(',', str_replace(' ', '', $editorList)); - $readLinkReg = basename(helper::createLink('file', 'read', 'fileID=(%fileID%)', '(%viewType%)')); - $readLinkReg = str_replace(array('%fileID%', '%viewType%', '?'), array('[0-9]+', '\w+', '\?'), $readLinkReg); + $readLinkReg = helper::createLink('file', 'read', 'fileID=(%fileID%)', '(%viewType%)'); + $readLinkReg = str_replace(array('%fileID%', '%viewType%', '?', '/'), array('[0-9]+', '\w+', '\?', '\/'), $readLinkReg); foreach($editorList as $editorID) { if(empty($editorID) or empty($data->$editorID)) continue; diff --git a/module/search/model.php b/module/search/model.php index 340c5bc4da..dd23f2942f 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -425,16 +425,16 @@ class searchModel extends model $lastMonth = date::getLastMonth(); $thisMonth = date::getThisMonth(); $yesterday = date::yesterday(); - $today = date::today(); + $today = date(DT_DATE1); if(strpos($query, '$') !== false) { $query = str_replace('$@me', $this->app->user->account, $query); - $query = str_replace("'\$lastMonth'", "'" . $lastMonth['begin'] . "' and '" . $lastMonth['end'] . "'", $query); - $query = str_replace("'\$thisMonth'", "'" . $thisMonth['begin'] . "' and '" . $thisMonth['end'] . "'", $query); - $query = str_replace("'\$lastWeek'", "'" . $lastWeek['begin'] . "' and '" . $lastWeek['end'] . "'", $query); - $query = str_replace("'\$thisWeek'", "'" . $thisWeek['begin'] . "' and '" . $thisWeek['end'] . "'", $query); - $query = str_replace("'\$yesterday'", "'" . $yesterday . "' and '" . $yesterday . "'", $query); - $query = str_replace("'\$today'", "'" . $today . "' and '" . $today . "'", $query); + $query = str_replace("'\$lastMonth'", "'" . $lastMonth['begin'] . "' and '" . $lastMonth['end'] . "'", $query); + $query = str_replace("'\$thisMonth'", "'" . $thisMonth['begin'] . "' and '" . $thisMonth['end'] . "'", $query); + $query = str_replace("'\$lastWeek'", "'" . $lastWeek['begin'] . "' and '" . $lastWeek['end'] . "'", $query); + $query = str_replace("'\$thisWeek'", "'" . $thisWeek['begin'] . "' and '" . $thisWeek['end'] . "'", $query); + $query = str_replace("'\$yesterday'", "'" . $yesterday . ' 00:00:00' . "' and '" . $yesterday . ' 23:59:59' . "'", $query); + $query = str_replace("'\$today'", "'" . $today . ' 00:00:00' . "' and '" . $today . ' 23:59:59' . "'", $query); } return $query; }