From 1ed42f8badfc4c31f3a6df64fbb46ba53cafe0ce Mon Sep 17 00:00:00 2001 From: xiaoz Date: Sun, 24 Apr 2022 22:29:49 +0800 Subject: [PATCH] 20220424 --- class/Api.php | 7 ++++- data/update.log | 7 ++++- templates/admin/add_category.php | 2 +- templates/admin/add_link.php | 2 +- templates/admin/add_link_tpl.php | 2 +- templates/admin/add_quick_tpl.php | 2 +- templates/admin/category_list.php | 2 +- templates/admin/edit_category.php | 2 +- templates/admin/edit_link.php | 2 +- templates/admin/imp_link.php | 2 +- templates/admin/index.php | 2 +- templates/admin/link_list.php | 2 +- templates/admin/setting/api.php | 2 +- templates/admin/setting/site.php | 2 +- templates/admin/setting/theme.php | 2 +- templates/admin/setting/transition_page.php | 2 +- templates/admin/static/style.css | 4 +++ templates/default/index.php | 23 +++++++++++++++- templates/default/static/embed.js | 30 ++++++++++++++++++++- templates/default/static/style.css | 8 +++--- 20 files changed, 86 insertions(+), 21 deletions(-) diff --git a/class/Api.php b/class/Api.php index 783606d..ab27e77 100755 --- a/class/Api.php +++ b/class/Api.php @@ -54,6 +54,7 @@ class Api { */ public function edit_category($token,$id,$name,$property = 0,$weight = 0,$description = '',$font_icon = '',$fid = 0){ $this->auth($token); + $fid = intval($fid); //如果id为空 if( empty($id) ){ $this->err_msg(-1003,'The category ID cannot be empty!'); @@ -69,7 +70,8 @@ class Api { $count = $this->db->count("on_categorys", [ "fid" => $id ]); - if( $count > 0 ) { + //改分类下的子分类数量大于0,并且将父级ID修改为其它分类 + if( ( $count > 0 ) && ( $fid !== 0 ) ) { $this->err_msg(-2000,'修改失败,该分类下已存在子分类!'); } $data = [ @@ -681,6 +683,9 @@ class Api { if( !preg_match($pattern,$url) ){ $this->err_msg(-1010,'只支持识别http/https协议的链接!'); } + else if( !filter_var($url, FILTER_VALIDATE_URL) ) { + $this->err_msg(-2000,'只支持识别http/https协议的链接!'); + } //获取网站标题 $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); diff --git a/data/update.log b/data/update.log index 93dce3a..c01bf44 100755 --- a/data/update.log +++ b/data/update.log @@ -91,4 +91,9 @@ CREATE INDEX on_options_key_IDX ON on_options ("key"); 1. 新增环境检测 2. 新增用户初始化设置界面 3. 新增版本更新检查 -4. 修复未登录情况下不显示分类的BUG \ No newline at end of file +4. 修复未登录情况下不显示分类的BUG + +20220424 +1. 默认主题新增夜间模式切换 +2. 修复修改分类无法更新的BUG +3. 优化后台底部窗口遮挡问题 \ No newline at end of file diff --git a/templates/admin/add_category.php b/templates/admin/add_category.php index 0700449..e916329 100755 --- a/templates/admin/add_category.php +++ b/templates/admin/add_category.php @@ -3,7 +3,7 @@
-
+
diff --git a/templates/admin/add_link.php b/templates/admin/add_link.php index a87d338..ceb06d3 100755 --- a/templates/admin/add_link.php +++ b/templates/admin/add_link.php @@ -3,7 +3,7 @@
-
+
diff --git a/templates/admin/add_link_tpl.php b/templates/admin/add_link_tpl.php index be47eda..650571b 100755 --- a/templates/admin/add_link_tpl.php +++ b/templates/admin/add_link_tpl.php @@ -17,7 +17,7 @@
- +
diff --git a/templates/admin/add_quick_tpl.php b/templates/admin/add_quick_tpl.php index 888cbe5..135dfee 100755 --- a/templates/admin/add_quick_tpl.php +++ b/templates/admin/add_quick_tpl.php @@ -20,7 +20,7 @@
- +
diff --git a/templates/admin/category_list.php b/templates/admin/category_list.php index bf4480c..259810e 100755 --- a/templates/admin/category_list.php +++ b/templates/admin/category_list.php @@ -3,7 +3,7 @@
-
+
diff --git a/templates/admin/edit_category.php b/templates/admin/edit_category.php index cd7750e..63376f5 100755 --- a/templates/admin/edit_category.php +++ b/templates/admin/edit_category.php @@ -3,7 +3,7 @@
-
+
diff --git a/templates/admin/edit_link.php b/templates/admin/edit_link.php index d1865c7..9b06127 100755 --- a/templates/admin/edit_link.php +++ b/templates/admin/edit_link.php @@ -3,7 +3,7 @@
-
+