diff --git a/application/admin/common.php b/application/admin/common.php index a034f03880f06983e04a1f61c65a3c74c70e7810..3efbc8d119f72942ba63ff2dc4223b531909468f 100755 --- a/application/admin/common.php +++ b/application/admin/common.php @@ -18,8 +18,8 @@ if (!function_exists('build_select')) { */ function build_select($name, $options, $selected = [], $attr = []) { - $options = is_array($options) ? $options : explode(',', $options); - $selected = is_array($selected) ? $selected : explode(',', $selected); + $options = is_array($options) ? $options : explode(',', $options ?? ''); + $selected = is_array($selected) ? $selected : explode(',', $selected ?? ''); return Form::select($name, $options, $selected, $attr); } } diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 8d11cf4af6966bcdf7cd7ef54697287b90fbde52..355ddab6354c55092802ae3dc4afa71560a9d49c 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -319,9 +319,8 @@ class Addon extends Backend { $offset = (int)$this->request->get("offset"); $limit = (int)$this->request->get("limit"); - $filter = $this->request->get("filter"); - $search = $this->request->get("search"); - $search = htmlspecialchars(strip_tags($search)); + $filter = $this->request->get("filter", ''); + $search = $this->request->get("search", '', 'strip_tags,htmlspecialchars'); $onlineaddons = $this->getAddonList(); $filter = (array)json_decode($filter, true); $addons = get_addon_list(); diff --git a/application/common.php b/application/common.php index e51f8626393c4f9e2966ec69eb47d8cbfbca7c83..13c9cf0cc9fadf77b6c6fa275edf52fc3f8f9a38 100755 --- a/application/common.php +++ b/application/common.php @@ -10,7 +10,7 @@ if (!function_exists('__')) { /** * 获取语言变量值 * @param string $name 语言变量名 - * @param array $vars 动态变量值 + * @param string | array $vars 动态变量值 * @param string $lang 语言 * @return mixed */ diff --git a/application/common/behavior/Common.php b/application/common/behavior/Common.php index af9e1cfe36f993cc4e274e89c037a267d03e95ab..369adb3de3add38b87fcaa5d783b64f98e953174 100644 --- a/application/common/behavior/Common.php +++ b/application/common/behavior/Common.php @@ -63,7 +63,7 @@ class Common } // 切换多语言 if (Config::get('lang_switch_on')) { - $lang = $request->get('lang'); + $lang = $request->get('lang', ''); if (preg_match("/^([a-zA-Z\-_]{2,10})\$/i", $lang)) { \think\Cookie::set('think_var', $lang); } diff --git a/application/common/library/token/Driver.php b/application/common/library/token/Driver.php index 034630245a0cfc15ff89e06257ba91537043fcb8..4d53b6b4802ab0d24f26468fc65a3cecfba94724 100644 --- a/application/common/library/token/Driver.php +++ b/application/common/library/token/Driver.php @@ -76,6 +76,7 @@ abstract class Driver protected function getEncryptedToken($token) { $config = \think\Config::get('token'); + $token = $token ?? ''; // 为兼容 php8 return hash_hmac($config['hashalgo'], $token, $config['key']); } diff --git a/application/common/library/token/driver/Redis.php b/application/common/library/token/driver/Redis.php index 0aa0caaaf28f6f7f123e2a557a7e3feaa065c3e4..ecf275024853c848388777411108097dabaec7cf 100644 --- a/application/common/library/token/driver/Redis.php +++ b/application/common/library/token/driver/Redis.php @@ -60,6 +60,7 @@ class Redis extends Driver protected function getEncryptedToken($token) { $config = \think\Config::get('token'); + $token = $token ?? ''; // 为兼容 php8 return $this->options['tokenprefix'] . hash_hmac($config['hashalgo'], $token, $config['key']); } diff --git a/composer.json b/composer.json index 5dbdbc3d89681c38102577d956e4868c86db6fff..bc10261968af2668073afefd01d54eb82769f2e5 100755 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": ">=7.2.0", "topthink/framework": "dev-master", - "topthink/think-captcha": "^1.0", + "topthink/think-captcha": "^1.0.9", "topthink/think-installer": "^1.0.14", "topthink/think-queue": "1.1.6", "topthink/think-helper": "^1.0.7", @@ -25,7 +25,6 @@ "overtrue/pinyin": "^3.0", "phpoffice/phpspreadsheet": "1.19", "overtrue/wechat": "^4.6", - "nelexa/zip": "^3.3", "ext-json": "*", "ext-curl": "*", "ext-pdo": "*", @@ -39,6 +38,10 @@ { "type": "git", "url": "https://gitee.com/fastadminnet/framework.git" + }, + { + "type": "git", + "url": "https://gitee.com/fastadminnet/think-captcha.git" } ] }