diff --git a/framework/base/control.class.php b/framework/base/control.class.php index f0d4a82df5..f064823e5c 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -892,7 +892,14 @@ class baseControl $data = (array) $data; if(helper::isAjaxRequest() or $this->viewType == 'json') { - print(json_encode($data)); + /* Process for zh-cn in json. */ + foreach($data as $key => $value) + { + if(!is_string($value)) continue; + $data[$key] = urlencode($value); + } + + print(urldecode(json_encode($data))); $response = helper::removeUTF8Bom(ob_get_clean()); if(defined('RUN_MODE') and RUN_MODE == 'api') return print($response); diff --git a/module/common/model.php b/module/common/model.php index c3adb1b9ba..779d3dfeef 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1739,7 +1739,8 @@ EOD; { /* Check program priv. */ $viewProjects = trim($this->app->user->view->projects, ','); - if($this->session->project and $viewProjects and strpos(",{$viewProjects},", ",{$this->session->project},") === false and !$this->app->user->admin) $this->loadModel('project')->accessDenied(); + $accessDenied = ($this->session->project and $viewProjects and strpos(",{$viewProjects},", ",{$this->session->project},") === false); + if($accessDenied and !$this->app->user->admin) $this->loadModel('project')->accessDenied(); $this->resetProgramPriv($module, $method); if(!commonModel::hasPriv($module, $method)) $this->deny($module, $method, false); }