From dd146a6bfcc3ccc14288dd8d0be556238d60fc19 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 11 Sep 2017 13:03:37 +0800 Subject: [PATCH] * add pptx in allowed file config and fix svn cat in action. --- config/config.php | 2 +- module/action/model.php | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/config/config.php b/config/config.php index 53475a302a..1c6cee85bf 100644 --- a/config/config.php +++ b/config/config.php @@ -105,7 +105,7 @@ $config->framework->detectDevice['en'] = true; // 在en语言情况下,是 /* 文件上传设置。 Upload settings. */ $config->file = new stdclass(); $config->file->dangers = 'php,php3,php4,phtml,php5,jsp,py,rb,asp,aspx,ashx,asa,cer,cdx,aspl,shtm,shtml,html,htm'; -$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,pptx,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. */ $filterConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'filter.php'; diff --git a/module/action/model.php b/module/action/model.php index ea71e3097d..d10c603f54 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -222,12 +222,10 @@ class actionModel extends model if($actionName == 'svncommited' and isset($commiters[$action->actor])) { $action->actor = $commiters[$action->actor]; - if($this->config->requestType == 'GET') $action->comment = str_replace('+', '%2B', $action->comment); } elseif($actionName == 'gitcommited' and isset($commiters[$action->actor])) { $action->actor = $commiters[$action->actor]; - if($this->config->requestType == 'GET') $action->comment = str_replace('+', '%2B', $action->comment); } elseif($actionName == 'linked2project') { @@ -324,6 +322,23 @@ class actionModel extends model } } $action->history = isset($histories[$actionID]) ? $histories[$actionID] : array(); + + $actionName = strtolower($action->action); + if($actionName == 'svncommited') + { + foreach($action->history as $history) + { + if($history->field == 'subversion') $history->diff = str_replace('+', '%2B', $history->diff); + } + } + elseif($actionName == 'gitcommited') + { + foreach($action->history as $history) + { + if($history->field == 'git') $history->diff = str_replace('+', '%2B', $history->diff); + } + } + $action->comment = $this->file->setImgSize($action->comment, $this->config->action->commonImgSize); $actions[$actionID] = $action; }