diff --git a/application/admin/command/Api.php b/application/admin/command/Api.php index d9d79c4ebf98c180228a36501a9c81ee42371e3f..d8098414525e188ebe399ccd6a2eb26676699db7 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]; diff --git a/application/admin/common.php b/application/admin/common.php index c9db617fc7a874624213d109d0495d44bf5677d8..2622b4ac11377ba5660cf99042cded29c3782112 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 68b9e58237d705f4e4e96de6f4cae876c152dfe4..69eb22cb54b0ea8cab90ec46a071514e15b10d30 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 */ 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/composer.json b/composer.json index 9ea4c30e38d0e7cd45e09aba0efd661826342dcd..1108d7f44af4b70b94a524e76295b693a0213195 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" } ] }