refactor(admin): consolidate duplicate configuration

Remove duplicate comment, captcha, filing, and website-security configuration paths.

Move front submission verification to the captcha scene matrix and retire obsolete admin routes and components.
This commit is contained in:
2026-08-13 02:26:17 +08:00
parent 0752a2fbf6
commit ab70a5eae9
32 changed files with 86 additions and 912 deletions
-154
View File
@@ -36,27 +36,6 @@ class ExtensionController extends ControllerBase {
'permission_callback' => [$this, 'check_permission'],
]);
// Security settings summary
register_rest_route(self::API_NAMESPACE, '/settings/security', [
'methods' => 'GET',
'callback' => [$this, 'get_security_settings'],
'permission_callback' => [$this, 'check_permission'],
]);
// Security settings — save risk switches
register_rest_route(self::API_NAMESPACE, '/settings/security', [
'methods' => 'POST',
'callback' => [$this, 'save_security_settings'],
'permission_callback' => [$this, 'check_permission'],
]);
// Security audit log
register_rest_route(self::API_NAMESPACE, '/security/audit-log', [
'methods' => 'GET',
'callback' => [$this, 'get_audit_log'],
'permission_callback' => [$this, 'check_permission'],
]);
// IP geo test tool
register_rest_route(self::API_NAMESPACE, '/extensions/ip-test', [
'methods' => 'POST',
@@ -151,139 +130,6 @@ class ExtensionController extends ControllerBase {
]);
}
/**
* GET /settings/security — security settings summary with real service status.
*/
public function get_security_settings(): \WP_REST_Response {
$services = $this->collect_service_statuses();
$settings = \AKSRT\Settings\Settings::get_all();
$email_gate_enabled = true;
if (defined('AKSRT_NO_EMAIL_GATE') && AKSRT_NO_EMAIL_GATE) {
$email_gate_enabled = false;
}
$captcha = function_exists('aksrt_get_captcha_status_summary')
? aksrt_get_captcha_status_summary()
: ['enabled' => false, 'provider' => '', 'configured' => false, 'scenes' => []];
$features = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_cms_features() : [];
$scenes = is_array($captcha['scenes'] ?? null) ? $captcha['scenes'] : [];
$risk_switches = [
'show_unapproved_comments' => !empty($settings['show_unapproved_comments']),
'skip_submit_moderation' => !empty($settings['skip_submit_moderation']),
'guest_comment' => !empty($settings['guest_comment']),
];
return $this->success([
'data' => [
'email_gate_enabled' => $email_gate_enabled,
'captcha' => [
'enabled' => !empty($captcha['enabled']),
'provider' => (string) ($captcha['provider'] ?? ''),
'configured' => !empty($captcha['configured']),
'scenes' => $scenes,
'download_required' => !empty($scenes['download']),
'download_active' => !empty($scenes['download']),
],
'content_audit' => [
'enabled' => !empty($services['audit']['enabled']),
'configured' => !empty($services['audit']['configured']),
],
'ip_geo' => [
'enabled' => !empty($services['ip_geo']['enabled']),
'configured' => !empty($services['ip_geo']['configured']),
],
'risk_switches' => $risk_switches,
'services' => $services,
],
]);
}
/**
* POST /settings/security — save risk switches.
*/
public function save_security_settings(\WP_REST_Request $request): \WP_REST_Response {
$params = $this->get_json_params($request);
$risk_switches = $params['risk_switches'] ?? [];
if (!is_array($risk_switches)) {
return $this->error('无效的风险设置数据');
}
$allowed = [
'show_unapproved_comments' => 'bool',
'skip_submit_moderation' => 'bool',
'guest_comment' => 'bool',
];
$sanitized = $this->sanitize_fields($risk_switches, $allowed);
// Merge into main settings
$all = \AKSRT\Settings\Settings::get_all();
foreach ($sanitized as $key => $val) {
$all[$key] = $val;
}
update_option('aksrt_settings', $all);
return $this->success([
'message' => __('风险设置已保存', 'aksrt'),
'data' => $sanitized,
]);
}
/**
* GET /security/audit-log — recent security audit entries.
*/
public function get_audit_log(): \WP_REST_Response {
global $wpdb;
$limit = 20;
$logs = [];
// Recent user registrations
$recent_users = get_users([
'number' => $limit,
'orderby' => 'registered',
'order' => 'DESC',
'fields' => ['ID', 'display_name', 'user_email', 'user_registered'],
]);
foreach ($recent_users as $user) {
$logs[] = [
'id' => 'reg_' . $user->ID,
'action' => '用户注册',
'detail' => sprintf('%s (%s) 完成注册', $user->display_name, $user->user_email),
'time' => $user->user_registered,
'type' => 'auth',
];
}
// Content audit log
$audit_log = get_option('aksrt_content_audit_log', []);
foreach (array_slice(array_reverse($audit_log), 0, 10) as $i => $entry) {
$logs[] = [
'id' => 'audit_' . $i,
'action' => '内容审核',
'detail' => sprintf('%s — %s', $entry['content'] ?? '', ($entry['passed'] ?? false) ? '通过' : '拦截'),
'time' => $entry['time'] ?? '',
'type' => 'audit',
];
}
// Sort by time descending
usort($logs, function ($a, $b) {
return strcmp($b['time'] ?? '', $a['time'] ?? '');
});
return $this->success([
'data' => [
'logs' => array_slice($logs, 0, $limit),
],
]);
}
/**
* POST /extensions/ip-test — test current IP provider with a given IP.
*
+1 -3
View File
@@ -20,14 +20,12 @@ class GlobalSchema {
'version' => '1.0.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'comment', 'title' => '评论功能', 'fields' => [
['key' => 'comment_enabled', 'label' => '开启评论', 'type' => 'switch', 'default' => true],
]],
['key' => 'performance', 'title' => '性能优化', 'fields' => [
['key' => 'lazyload_enabled', 'label' => '图片懒加载', 'type' => 'switch', 'default' => true],
]],
['key' => 'filing', 'title' => '备案信息', 'fields' => [
['key' => 'icp_filing', 'label' => 'ICP 备案号', 'type' => 'input', 'default' => ''],
['key' => 'police_filing', 'label' => '公安备案号', 'type' => 'input', 'default' => ''],
['key' => 'footer_text', 'label' => '页脚附加文字', 'type' => 'input', 'default' => ''],
]],
],
-1
View File
@@ -17,7 +17,6 @@ class SchemaExtensions {
'ip' => SchemaExtensionsIP::build(),
'audit' => SchemaExtensionsAudit::build(),
'push' => SchemaExtensionsPush::build(),
'security' => SchemaExtensionsSecurity::build(),
],
];
}
@@ -1,88 +0,0 @@
<?php
/**
* @package AKSRT
*/
namespace AKSRT\Admin\Schema;
defined('ABSPATH') || exit;
class SchemaExtensionsSecurity {
public static function build(): array {
return [
'key' => 'security',
'title' => '网站安全',
'version' => '1.0.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'basic', 'title' => '基础安全', 'fields' => [
['key' => 'hide_admin_bar', 'label' => '前台关闭顶部 admin_bar', 'type' => 'switch', 'default' => true],
['key' => 'remove_emoji', 'label' => '移除Emoji脚本', 'type' => 'switch', 'default' => true],
['key' => 'remove_open_sans', 'label' => '移除Open Sans字体', 'type' => 'switch', 'default' => true],
['key' => 'disabled_pingback', 'label' => '禁用Pingback', 'type' => 'switch', 'default' => true],
['key' => 'disabled_xmlrpc', 'label' => '禁用XML-RPC', 'type' => 'switch', 'default' => true],
['key' => 'close_attachment_page', 'label' => '关闭附件页面', 'type' => 'switch', 'default' => true],
['key' => 'user_disable_admin', 'label' => '非管理员禁止进入后台', 'type' => 'switch', 'default' => true],
]],
['key' => 'upload', 'title' => '上传设置', 'fields' => [
['key' => 'split_upload_s', 'label' => '分片上传', 'type' => 'switch', 'default' => true],
['key' => 'split_minimum_size', 'label' => '最小分片大小(MB)', 'type' => 'number', 'default' => 20, 'min' => 4, 'max' => 100, 'step' => 2],
['key' => 'newfilename', 'label' => '上传文件自动重命名', 'type' => 'switch', 'default' => false],
['key' => 'newfilename_type', 'label' => '重命名格式', 'type' => 'radio', 'default' => 'time', 'options' => [
['label' => '随机字符串', 'value' => 'random'],
['label' => '时间+原文件名', 'value' => 'time'],
]],
['key' => 'disabled_large_thumbnail', 'label' => '禁用大缩略图', 'type' => 'switch', 'default' => true],
]],
['key' => 'admin', 'title' => '后台设置', 'fields' => [
['key' => 'remove_dashboard_widgets', 'label' => 'WP 后台加速:移除站点健康/活动/禁止浏览器&PHP版本检测', 'type' => 'switch', 'default' => true],
['key' => 'display_wp_update', 'label' => '禁止 WP 检测更新', 'type' => 'switch', 'default' => true],
['key' => 'close_gutenberg', 'label' => '关闭古腾堡编辑器', 'type' => 'switch', 'default' => false, 'help' => '禁用后编辑器增强全部失效'],
['key' => 'disabled_autoembed', 'label' => '禁用自动嵌入', 'type' => 'switch', 'default' => true],
['key' => 'mce_float_toolbar', 'label' => '浮动工具栏', 'type' => 'checkbox', 'default' => ['pc_s', 'm_s'], 'sanitize_type' => 'array', 'options' => [
['label' => 'PC', 'value' => 'pc_s'],
['label' => '移动端', 'value' => 'm_s'],
]],
['key' => 'admin_user_del_fields', 'label' => '关闭后台用户编辑多余选项', 'type' => 'switch', 'default' => true],
['key' => 'admin_frontend_set', 'label' => '前台设置入口', 'type' => 'switch', 'default' => true],
]],
['key' => 'format', 'title' => '格式设置', 'fields' => [
['key' => 'time_ago_s', 'label' => '时间格式', 'type' => 'switch', 'default' => true],
['key' => 'time_format', 'label' => '时间显示格式', 'type' => 'input', 'default' => 'n月j日 H:i'],
['key' => 'remove_more_wp_head', 'label' => '移除WP head多余代码', 'type' => 'switch', 'default' => true],
]],
['key' => 'captcha-note', 'title' => '人机验证', 'fields' => [
['key' => 'captcha_redirect_hint', 'label' => '配置入口', 'type' => 'notice', 'alertType' => 'info', 'alertContent' => '人机验证(腾讯云 / 阿里云 / Cloudflare / 极验)请到「功能&权限 → 人机验证」统一配置;本页不再维护验证码字段。'],
]],
['key' => 'rate-limit', 'title' => '频率限制', 'fields' => [
['key' => 'brush_limit_post_enabled', 'label' => '文章发布限制', 'type' => 'switch', 'default' => false],
['key' => 'brush_limit_post_minutes_10', 'label' => '文章 10 分钟限制', 'type' => 'number', 'default' => 20, 'min' => 1, 'max' => 200],
['key' => 'brush_limit_post_day_1', 'label' => '文章每日限制', 'type' => 'number', 'default' => 50, 'min' => 1, 'max' => 2000],
['key' => 'brush_limit_comment_enabled', 'label' => '评论频率限制', 'type' => 'switch', 'default' => false],
['key' => 'brush_limit_comment_minutes_10', 'label' => '评论 10 分钟限制', 'type' => 'number', 'default' => 20, 'min' => 1, 'max' => 200],
['key' => 'brush_limit_comment_day_1', 'label' => '评论每日限制', 'type' => 'number', 'default' => 100, 'min' => 1, 'max' => 2000],
['key' => 'brush_limit_upload_enabled', 'label' => '上传频率限制', 'type' => 'switch', 'default' => false],
['key' => 'brush_limit_upload_minutes_10', 'label' => '上传 10 分钟限制', 'type' => 'number', 'default' => 50, 'min' => 1, 'max' => 200],
['key' => 'brush_limit_upload_day_1', 'label' => '上传每日限制', 'type' => 'number', 'default' => 200, 'min' => 1, 'max' => 2000],
['key' => 'brush_limit_register_enabled', 'label' => '注册频率限制', 'type' => 'switch', 'default' => false],
['key' => 'brush_limit_register_minutes_10', 'label' => '注册 10 分钟限制', 'type' => 'number', 'default' => 20, 'min' => 1, 'max' => 200],
['key' => 'brush_limit_register_day_1', 'label' => '注册每日限制', 'type' => 'number', 'default' => 100, 'min' => 1, 'max' => 2000],
['key' => 'brush_limit_order_enabled', 'label' => '订单频率限制', 'type' => 'switch', 'default' => false],
['key' => 'brush_limit_order_minutes_10', 'label' => '订单 10 分钟限制', 'type' => 'number', 'default' => 30, 'min' => 1, 'max' => 200],
['key' => 'brush_limit_order_day_1', 'label' => '订单每日限制', 'type' => 'number', 'default' => 100, 'min' => 1, 'max' => 2000],
['key' => 'error_frequency_limit', 'label' => '错误频率限制', 'type' => 'switch', 'default' => true],
]],
['key' => 'content-audit', 'title' => '内容审核', 'fields' => [
['key' => 'audit_comment', 'label' => '审核评论', 'type' => 'switch', 'default' => false],
['key' => 'audit_new_post', 'label' => '审核新文章', 'type' => 'switch', 'default' => false],
['key' => 'audit_upload_img', 'label' => '审核上传图片', 'type' => 'switch', 'default' => false],
['key' => 'audit_user_desc', 'label' => '审核用户简介', 'type' => 'switch', 'default' => false],
['key' => 'audit_msg_private', 'label' => '审核私信', 'type' => 'switch', 'default' => false],
['key' => 'audit_be_like_text', 'label' => '文本允许疑似合规', 'type' => 'switch', 'default' => false],
['key' => 'audit_be_like_img', 'label' => '图片允许疑似合规', 'type' => 'switch', 'default' => false],
]],
],
];
}
}
-2
View File
@@ -452,9 +452,7 @@ class SchemaPageDisplay {
['key' => 'footer_columns', 'label' => '页脚列数', 'type' => 'number', 'default' => 3, 'min' => 1, 'max' => 4],
['key' => 'footer_copyright', 'label' => '显示版权信息', 'type' => 'switch', 'default' => true],
['key' => 'footer_icp', 'label' => '显示ICP备案', 'type' => 'switch', 'default' => true],
['key' => 'icp_number', 'label' => 'ICP备案号', 'type' => 'input', 'default' => '', 'help' => '例如:ICP 备 xxxxxxxx 号'],
['key' => 'footer_police', 'label' => '显示公安备案', 'type' => 'switch', 'default' => true],
['key' => 'police_number', 'label' => '公安备案号', 'type' => 'input', 'default' => '', 'help' => '例如:公网安备 xxxxxx 号'],
]],
['key' => 'color', 'title' => '页脚颜色', 'fields' => [
['key' => 'footer_theme_custom', 'label' => '自定义页脚颜色', 'type' => 'switch', 'default' => false],
+1
View File
@@ -44,6 +44,7 @@ class SchemaPermissions {
['label' => '邮箱验证', 'value' => 'verify_email'],
['label' => '资源下载', 'value' => 'download'],
['label' => '每日签到', 'value' => 'signin'],
['label' => '前台投稿', 'value' => 'front_submit'],
]],
]],
['key' => 'providers', 'title' => '服务商配置', 'fields' => [
-1
View File
@@ -354,7 +354,6 @@ class SchemaPostList {
['key' => 'post_article_cat', 'label' => '允许投稿分类', 'type' => 'taxonomy_select', 'taxonomy' => 'category', 'multiple' => true, 'default' => [], 'help' => '为空则允许全部分类'],
['key' => 'front_submit_guest_enabled', 'label' => '允许免登录投稿', 'type' => 'switch', 'default' => false, 'help' => '开启后访客可投稿;文章归属到下方用户'],
['key' => 'post_article_user', 'label' => '免登录归属用户', 'type' => 'user_select', 'default' => 0, 'help' => '免登录投稿时文章归属的用户,搜索选择'],
['key' => 'front_submit_captcha', 'label' => '提交人机验证', 'type' => 'switch', 'default' => false, 'help' => '提交正式投稿时校验人机验证'],
['key' => 'front_submit_tags', 'label' => '标签输入', 'type' => 'switch', 'default' => true],
['key' => 'post_article_topics_s', 'label' => '专题选择', 'type' => 'switch', 'default' => false, 'help' => '投稿时可选择专题分类'],
['key' => 'post_article_custom_filter_s', 'label' => '高级筛选选择', 'type' => 'switch', 'default' => true, 'help' => '投稿时可选择自定义筛选维度值'],
+10 -21
View File
@@ -306,10 +306,10 @@ class SchemaProvider {
}
}
// Captcha: always surface normalized enabled_scenarios (legacy disabled list inverted).
if ($option_key === 'aksrt_captcha_config' && function_exists('aksrt_get_captcha_config')) {
$normalized = aksrt_get_captcha_config();
foreach (['enabled', 'active_provider', 'enabled_scenarios', 'disabled_scenarios', 'tencent', 'aliyun', 'cloudflare', 'geetest', 'mode'] as $key) {
// Captcha: always surface the normalized positive scene list.
if ($option_key === 'aksrt_captcha_config' && function_exists('aksrt_get_captcha_config')) {
$normalized = aksrt_get_captcha_config();
foreach (['enabled', 'active_provider', 'enabled_scenarios', 'tencent', 'aliyun', 'cloudflare', 'geetest', 'mode'] as $key) {
if (array_key_exists($key, $normalized)) {
$data[$key] = $normalized[$key];
}
@@ -340,23 +340,12 @@ class SchemaProvider {
unset($stored['pay_rebate_withdraw_text_details'], $stored['pay_balance_withdraw_lowest_money']);
}
// Captcha: keep enabled_scenarios / disabled_scenarios mirrors in sync.
if ($option_key === 'aksrt_captcha_config' && function_exists('aksrt_captcha_scenes')) {
$all = array_keys(aksrt_captcha_scenes());
if (array_key_exists('enabled_scenarios', $stored)) {
$enabled = function_exists('aksrt_captcha_sanitize_scene_list')
? aksrt_captcha_sanitize_scene_list($stored['enabled_scenarios'])
: (array) $stored['enabled_scenarios'];
$stored['enabled_scenarios'] = $enabled;
$stored['disabled_scenarios'] = array_values(array_diff($all, $enabled));
} elseif (array_key_exists('disabled_scenarios', $stored)) {
$disabled = function_exists('aksrt_captcha_sanitize_scene_list')
? aksrt_captcha_sanitize_scene_list($stored['disabled_scenarios'])
: (array) $stored['disabled_scenarios'];
$stored['disabled_scenarios'] = $disabled;
$stored['enabled_scenarios'] = array_values(array_diff($all, $disabled));
}
}
// Captcha stores a single positive scene list.
if ($option_key === 'aksrt_captcha_config' && function_exists('aksrt_captcha_scenes')) {
$stored['enabled_scenarios'] = function_exists('aksrt_captcha_sanitize_scene_list')
? aksrt_captcha_sanitize_scene_list($stored['enabled_scenarios'] ?? [])
: (array) ($stored['enabled_scenarios'] ?? []);
}
$updated = update_option($option_key, $stored);
\AKSRT\Settings\Settings::flush_settings_cache();
+7 -13
View File
@@ -295,7 +295,7 @@ class FrontSubmit {
public function ajax_submit_post(): void {
$this->verify_nonce();
$this->maybe_verify_captcha();
$this->verify_captcha();
$data = wp_unslash($_POST);
$result = $this->persist(is_array($data) ? $data : [], 'posts_save');
@@ -385,21 +385,15 @@ class FrontSubmit {
}
}
private function maybe_verify_captcha(): void {
$settings = $this->settings();
if (empty($settings['captcha'])) {
return;
}
private function verify_captcha(): void {
if (!function_exists('aksrt_require_captcha')) {
return;
}
$payload = [];
if (isset($_POST['captcha']) && is_array($_POST['captcha'])) {
$payload = wp_unslash($_POST['captcha']);
}
$verify = aksrt_require_captcha('submit', is_array($payload) ? $payload : []);
if (is_wp_error($verify)) {
wp_send_json_error(['message' => $verify->get_error_message()]);
$verify = aksrt_require_captcha('front_submit', $_POST);
if ($verify !== true) {
wp_send_json_error([
'message' => is_string($verify) ? $verify : __('人机验证失败,请重试', 'aksrt'),
], 400);
}
}
-10
View File
@@ -9,18 +9,8 @@ defined('ABSPATH') || exit;
trait AuthReader {
/** 评论是否启用 */
public static function comment_enabled(): bool {
$s = self::get_all();
return !isset($s['comment_enabled']) || !empty($s['comment_enabled']);
}
/** 是否要求注册用户才能评论 */
public static function comment_requires_registration(): bool {
if (!self::comment_enabled()) {
return true;
}
$user_id = get_current_user_id();
return !class_exists(Capabilities::class) || !Capabilities::user_can('comment_add', $user_id);
}
-42
View File
@@ -153,48 +153,6 @@ class Capabilities {
return false;
}
/**
* 获取"网站安全"设置(人机验证见 aksrt_get_captcha_status_summary)。
*/
public static function get_security_settings(): array {
$s = Settings::get_all();
$captcha = function_exists('aksrt_get_captcha_status_summary')
? aksrt_get_captcha_status_summary()
: ['enabled' => false, 'provider' => '', 'configured' => false, 'scenes' => []];
return [
'captcha' => $captcha,
'brush_limit_post' => [
'enabled' => !empty($s['brush_limit_post_enabled']),
'minutes_10' => (int) ($s['brush_limit_post_minutes_10'] ?? 20),
'day_1' => (int) ($s['brush_limit_post_day_1'] ?? 50),
],
'brush_limit_comment' => [
'enabled' => !empty($s['brush_limit_comment_enabled']),
'minutes_10' => (int) ($s['brush_limit_comment_minutes_10'] ?? 20),
'day_1' => (int) ($s['brush_limit_comment_day_1'] ?? 100),
],
'brush_limit_upload' => [
'enabled' => !empty($s['brush_limit_upload_enabled']),
'minutes_10' => (int) ($s['brush_limit_upload_minutes_10'] ?? 50),
'day_1' => (int) ($s['brush_limit_upload_day_1'] ?? 200),
],
'brush_limit_register' => [
'enabled' => !empty($s['brush_limit_register_enabled']),
'minutes_10' => (int) ($s['brush_limit_register_minutes_10'] ?? 20),
'day_1' => (int) ($s['brush_limit_register_day_1'] ?? 100),
],
'brush_limit_order' => [
'enabled' => !empty($s['brush_limit_order_enabled']),
'minutes_10' => (int) ($s['brush_limit_order_minutes_10'] ?? 30),
'day_1' => (int) ($s['brush_limit_order_day_1'] ?? 100),
],
'error_frequency_limit' => !empty($s['error_frequency_limit'] ?? true),
];
}
/**
* 获取"系统工具"设置
*/
-1
View File
@@ -137,7 +137,6 @@ trait DisplayPageGroups {
'header_newposts' => self::get_header_newposts_config(),
'header_theme' => self::get_header_theme_config(),
'friend_links' => self::get_friend_links(),
'comment_enabled' => self::comment_enabled(),
'cms_features' => self::get_cms_features(),
'page_display' => self::get_page_display_settings(),
'footer_theme' => self::get_footer_theme_config(),
-7
View File
@@ -158,13 +158,6 @@ trait DomainGroups {
return Capabilities::user_can($cap, $user_id, $context);
}
/**
* 获取"网站安全"设置
*/
public static function get_security_settings(): array {
return Capabilities::get_security_settings();
}
/**
* 获取"系统工具"设置
*/
+7 -8
View File
@@ -362,21 +362,20 @@ trait FacadeBulk {
/**
* 获取备案配置(统一 page-display footer schema 和全局设置)
* @return array {icp_enabled, icp_number, police_enabled, police_number}
* 获取备案配置。
* @return array {icp_enabled, icp_filing, police_enabled, police_filing}
*/
public static function get_filing_settings(): array {
$s = self::get_all();
$icp_enabled = !isset($s['footer_icp']) || !empty($s['footer_icp']);
$police_enabled = !isset($s['footer_police']) || !empty($s['footer_police']);
// 优先读 footer schema 的 icp_number,回退到全局 icp_filing
$icp_number = trim((string) ($s['icp_number'] ?? $s['icp_filing'] ?? ''));
$police_number = trim((string) ($s['police_number'] ?? ''));
$icp_filing = trim((string) ($s['icp_filing'] ?? ''));
$police_filing = trim((string) ($s['police_filing'] ?? ''));
return [
'icp_enabled' => $icp_enabled,
'icp_number' => $icp_number,
'icp_filing' => $icp_filing,
'police_enabled' => $police_enabled,
'police_number' => $police_number,
'police_filing' => $police_filing,
];
}
@@ -398,7 +397,7 @@ trait FacadeBulk {
/** 获取公安备案号 */
public static function police_filing(): string {
return trim((string) self::get_value('police_number', ''));
return trim((string) self::get_value('police_filing', ''));
}
+1 -2
View File
@@ -23,8 +23,7 @@ class HomeCms {
$s = Settings::get_all();
$bridge_keys = [
'footer_columns', 'footer_copyright', 'footer_icp', 'icp_number',
'footer_police', 'police_number',
'footer_columns', 'footer_copyright', 'footer_icp', 'footer_police',
'footer_theme_custom', 'footer_theme_bg_custom', 'footer_theme_bg', 'footer_theme_color_custom',
'footer_contact_wechat_img', 'footer_contact_qq', 'footer_contact_weibo', 'footer_contact_email',
];
-1
View File
@@ -429,7 +429,6 @@ class PostDisplay {
'editor_mode' => $editor_mode,
'draft_save' => !isset($settings['front_submit_draft_save']) || !empty($settings['front_submit_draft_save']),
'leave_warning' => !isset($settings['front_submit_leave_warning']) || !empty($settings['front_submit_leave_warning']),
'captcha' => !empty($settings['front_submit_captcha']) || !empty($settings['verification_newposts_s']),
'pay_free_s' => !isset($settings['post_article_pay_free_s']) || !empty($settings['post_article_pay_free_s']),
'pay_price_min' => max(0, (float) ($settings['post_article_pay_price_min'] ?? 0)),
'pay_price_max' => max(0, (float) ($settings['post_article_pay_price_max'] ?? 100)),