From 35d651438147ce0a9b04a00c911e6e2eb0661ec5 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sun, 16 Jul 2023 15:27:20 +0800 Subject: [PATCH 1/7] =?UTF-8?q?api=20=E7=94=9F=E6=88=90=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=20php8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/command/Api.php b/application/admin/command/Api.php index d9d79c4e..d8098414 100644 --- a/application/admin/command/Api.php +++ b/application/admin/command/Api.php @@ -163,7 +163,7 @@ class Api extends Command if ($getting_namespace === true) { //If the token is a string or the namespace separator... - if (is_array($token) && in_array($token[0], [T_STRING, T_NS_SEPARATOR])) { + if (is_array($token) && in_array($token[0], version_compare(PHP_VERSION, '8.0.0', '<') ? [T_STRING, T_NS_SEPARATOR] : [T_NAME_QUALIFIED])) { //Append the token's value to the name of the namespace $namespace .= $token[1]; -- Gitee From c7da57a109940791192ce125d5521570c8c009e2 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sun, 16 Jul 2023 17:20:14 +0800 Subject: [PATCH 2/7] =?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 --- 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 8d11cf4a..d8e391f4 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 927510f5ad4f517411c670a1d4c1ad7a9f41f5a7 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Mon, 17 Jul 2023 11:09:58 +0800 Subject: [PATCH 3/7] =?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 --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9ea4c30e..1108d7f4 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", @@ -38,6 +38,10 @@ { "type": "git", "url": "https://gitee.com/fastadminnet/framework.git" + }, + { + "type": "git", + "url": "https://gitee.com/fastadminnet/think-captcha.git" } ] } -- Gitee From a64cf1173f9834e2824ee4f6682047d485c3d9ec Mon Sep 17 00:00:00 2001 From: F4nniu Date: Mon, 17 Jul 2023 15:04:20 +0800 Subject: [PATCH 4/7] =?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 --- 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 d8e391f4..ee1431c7 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 af9e1cfe..369adb3d 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 85271d1cf7729196926b03e428f999e9b13b6b08 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sat, 22 Jul 2023 23:40:58 +0800 Subject: [PATCH 5/7] =?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 --- 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 ee1431c7..355ddab6 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 dd63aa594805a3363a2d5f0c66948c9b62f9f9b9 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sat, 22 Jul 2023 23:52:07 +0800 Subject: [PATCH 6/7] =?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 --- application/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/common.php b/application/common.php index 68b9e582..69eb22cb 100755 --- a/application/common.php +++ b/application/common.php @@ -11,7 +11,7 @@ if (!function_exists('__')) { /** * 获取语言变量值 * @param string $name 语言变量名 - * @param array $vars 动态变量值 + * @param string | array $vars 动态变量值 * @param string $lang 语言 * @return mixed */ -- Gitee From 7fe625cf5b702570f3dc9091fb78a51d2ee32d26 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Tue, 25 Jul 2023 18:27:20 +0800 Subject: [PATCH 7/7] =?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 --- 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 c9db617f..2622b4ac 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