Browse Source

优化 php8 兼容

(cherry picked from commit a64cf1173f9834e2824ee4f6682047d485c3d9ec)
F4nniu 1 year ago
parent
commit
e76eba0c21
2 changed files with 3 additions and 3 deletions
  1. 2 2
      application/admin/controller/Addon.php
  2. 1 1
      application/common/behavior/Common.php

+ 2 - 2
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);

+ 1 - 1
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);
             }