From d6db014f9988474ec0bbccf73c65be13544db48b Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 8 Dec 2022 14:00:14 +0800 Subject: [PATCH 1/2] * Fix checkPriv error. --- module/common/model.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 0174708a20..9321f7c661 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -395,9 +395,9 @@ class commonModel extends model /** * Deny access. * - * @param varchar $module - * @param varchar $method - * @param bool $reload + * @param string $module + * @param string $method + * @param bool $reload * @access public * @return mixed */ @@ -2454,6 +2454,8 @@ EOD; } catch(EndResponseException $endResponseException) { + if($this->app->getViewType() == 'json' || (defined('RUN_MODE') && RUN_MODE == 'api')) die($endResponseException->getContent()); + echo $endResponseException->getContent(); } } From 91d4f420ec741ce1271ad9aad81bb37761673397 Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 8 Dec 2022 14:00:48 +0800 Subject: [PATCH 2/2] * Change resetFileName. --- module/user/control.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index 081176c229..8d3c27350b 100755 --- a/module/user/control.php +++ b/module/user/control.php @@ -1090,8 +1090,7 @@ class user extends control } /* Remove the real path for security reason. */ - $pathPos = strrpos($this->app->getBasePath(), DIRECTORY_SEPARATOR, -2); - $resetFileName = substr($resetFileName, $pathPos + 1); + $resetFileName = str_replace($this->app->getBasePath(), '', $resetFileName); $this->view->title = $this->lang->user->resetPassword; $this->view->status = 'reset';