From bb68eb4254ff0624ece5d3381872d0e78c86e9ab Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sun, 16 Jul 2023 17:20:14 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=8F=92=E4=BB=B6=E5=88=97=E8=A1=A8=E6=97=B6?= =?UTF-8?q?=E7=9A=84=20null=20=E5=80=BC=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit c7da57a109940791192ce125d5521570c8c009e2) --- application/admin/controller/Addon.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 8d11cf4af..d8e391f47 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -319,8 +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"); + $filter = $this->request->get("filter") ?? ''; + $search = $this->request->get("search") ?? ''; $search = htmlspecialchars(strip_tags($search)); $onlineaddons = $this->getAddonList(); $filter = (array)json_decode($filter, true); -- Gitee From 7b66d0bf587f9dcb4a377328333bcd6592097372 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Mon, 17 Jul 2023 11:09:58 +0800 Subject: [PATCH 2/8] =?UTF-8?q?captcha=20=E4=B8=BA=E4=BA=86=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=20php8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 927510f5ad4f517411c670a1d4c1ad7a9f41f5a7) --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5dbdbc3d8..266055b3b 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", @@ -39,6 +39,10 @@ { "type": "git", "url": "https://gitee.com/fastadminnet/framework.git" + }, + { + "type": "git", + "url": "https://gitee.com/fastadminnet/think-captcha.git" } ] } -- Gitee From e76eba0c217d19c0b304114956053dbd6a58e96c Mon Sep 17 00:00:00 2001 From: F4nniu Date: Mon, 17 Jul 2023 15:04:20 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=20php8=20=E5=85=BC?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit a64cf1173f9834e2824ee4f6682047d485c3d9ec) --- application/admin/controller/Addon.php | 4 ++-- application/common/behavior/Common.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index d8e391f47..ee1431c76 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -319,8 +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") ?? ''; + $filter = $this->request->get("filter", ''); + $search = $this->request->get("search", ''); $search = htmlspecialchars(strip_tags($search)); $onlineaddons = $this->getAddonList(); $filter = (array)json_decode($filter, true); diff --git a/application/common/behavior/Common.php b/application/common/behavior/Common.php index af9e1cfe3..369adb3de 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); } -- Gitee From d8acbf8abeeaf40847612521bb55843ca9073fa1 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sat, 22 Jul 2023 23:40:58 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=A1=86=E6=9E=B6=20get?= =?UTF-8?q?=20=E8=87=AA=E5=B8=A6=E7=9A=84=E8=BF=87=E6=BB=A4=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 85271d1cf7729196926b03e428f999e9b13b6b08) --- application/admin/controller/Addon.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index ee1431c76..355ddab63 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -320,8 +320,7 @@ 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)); + $search = $this->request->get("search", '', 'strip_tags,htmlspecialchars'); $onlineaddons = $this->getAddonList(); $filter = (array)json_decode($filter, true); $addons = get_addon_list(); -- Gitee From e3779a1f05c1b28b5bc4ba6932bc48ad7a0f7282 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sat, 22 Jul 2023 23:52:07 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=AE=A9=20IDE=20=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=8F=8B=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit dd63aa594805a3363a2d5f0c66948c9b62f9f9b9) --- application/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/common.php b/application/common.php index e51f86263..13c9cf0cc 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 */ -- Gitee From 2e4fe16f442f83b7613a8b788f78f424cb2c6680 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Tue, 25 Jul 2023 18:27:20 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20select=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=9C=A8=20php8=20=E7=8E=AF=E5=A2=83=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 7fe625cf5b702570f3dc9091fb78a51d2ee32d26) --- application/admin/common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/admin/common.php b/application/admin/common.php index a034f0388..3efbc8d11 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); } } -- Gitee From b0a3851d934a8cfcd1f5bd662a4fe8759f2eb9a4 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sun, 11 Feb 2024 21:46:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix(common):=20getEncryptedToken=20?= =?UTF-8?q?=E7=9A=84=20php8=20=E5=85=BC=E5=AE=B9=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 198604c584ed098ad6ac7d8bcfb888bcec92585c) --- application/common/library/token/Driver.php | 1 + application/common/library/token/driver/Redis.php | 1 + 2 files changed, 2 insertions(+) diff --git a/application/common/library/token/Driver.php b/application/common/library/token/Driver.php index 034630245..4d53b6b48 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 0aa0caaaf..ecf275024 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']); } -- Gitee From 1c7d0b710e49362b6e42f4d121a46348361d41d1 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Tue, 2 May 2023 12:21:05 +0000 Subject: [PATCH 8/8] =?UTF-8?q?nelexa=20zip=20=E7=BB=84=E4=BB=B6=E4=BB=A5?= =?UTF-8?q?=20fastadmin-addons=20=E7=BB=84=E4=BB=B6=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E4=B8=BA=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit db487a52df9a10c246e65dcbf264e58da7d16034) --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 266055b3b..bc1026196 100755 --- a/composer.json +++ b/composer.json @@ -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": "*", -- Gitee