From 52882750dcd475e45fe9ab1f448435dca95d393d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 3 Jun 2016 16:43:42 +0800 Subject: [PATCH] * fix and adjust code. --- framework/base/router.class.php | 2 +- module/user/model.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 7b0bd69ac7..0834e02b19 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1531,7 +1531,7 @@ class baseRouter foreach($passedParams as $param => $value) { if(preg_match('/[^a-zA-Z0-9_\.]/', $param)) die('Bad Request!'); - if(preg_match('/[^a-zA-Z0-9=_,`#+\/\.%\|\x7f-\xff]/', trim($value))) die('Bad Request!'); + if(preg_match('/[^a-zA-Z0-9=_,`#+\^\/\.%\|\x7f-\xff]/', trim($value))) die('Bad Request!'); } unset($passedParams['onlybody']); diff --git a/module/user/model.php b/module/user/model.php index afe637f5f9..ee9adcebda 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -297,6 +297,19 @@ class userModel extends model $data[$i]->address = $users->address[$i]; $data[$i]->zipcode = $users->zipcode[$i]; + /* Change for append field, such as feedback.*/ + if(!empty($this->config->user->batchAppendFields)) + { + $appendFields = explode(',', $this->config->user->batchAppendFields); + foreach($appendFields as $appendField) + { + if(empty($appendField)) continue; + if(!isset($users->$appendField)) continue; + $fieldList = $users->$appendField; + $data[$i]->$appendField = $fieldList[$i]; + } + } + $accounts[$i] = $data[$i]->account; $prev['dept'] = $data[$i]->dept; $prev['role'] = $data[$i]->role;