Changeset 3468278
- Timestamp:
- 02/24/2026 06:24:26 AM (5 weeks ago)
- Location:
- cloudsecure-wp-security/trunk
- Files:
-
- 3 edited
-
cloudsecure-wp.php (modified) (1 diff)
-
modules/waf-engine.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cloudsecure-wp-security/trunk/cloudsecure-wp.php
r3465476 r3468278 14 14 * Plugin URI: https://wpplugin.cloudsecure.ne.jp/cloudsecure_wp_security 15 15 * Description: 管理画面とログインURLをサイバー攻撃から守る、安心の国産・日本語対応プラグインです。かんたんな設定を行うだけで、不正アクセスや不正ログインからあなたのWordPressを保護し、セキュリティが向上します。また、各機能の有効・無効(ON・OFF)や設定などをお好みにカスタマイズし、いつでも保護状態を管理できます。 16 * Version: 1.4. 116 * Version: 1.4.2 17 17 * Requires PHP: 7.1 18 18 * Author: CloudSecure,Inc. -
cloudsecure-wp-security/trunk/modules/waf-engine.php
r3465476 r3468278 650 650 * @return array 651 651 */ 652 public function is_remove_rule( $rule_id, $request_items, $remove_rules, $acf_post_types ): array {652 public function is_remove_rule( $rule_id, $request_items, $remove_rules, $acf_post_types, $cptui_post_types ): array { 653 653 $is_rule_removed = false; 654 654 $modify_remove_variables = array(); … … 800 800 } 801 801 } 802 803 // Custom Post Type UI の場合はcontentキーを除外 804 // カスタム投稿タイプキーは小文字、アンダースコア、ダッシュのみを許容するが、念のためarray_mapで正規表現用にエスケープする 805 } elseif ( ! empty( $cptui_post_types ) && preg_match( '/wp\/v2\/(' . implode( '|', array_map( 'preg_quote', $cptui_post_types ) ) . ')/', $rest_endpoint ) === 1 ) { 806 if ( in_array( $rule_id, $remove_rules['rest_api'], true ) ) { 807 if ( preg_match( '/_locale\=user/', $_SERVER['QUERY_STRING'] ?? '' ) === 1 ) { 808 $modify_remove_variables['args'] = array( 'content' ); 809 } 810 } 802 811 } 803 812 } … … 947 956 948 957 /** 958 * Custom Post Type UIプラグイン除外対応 959 * 有効なカスタム投稿タイプキーを取得する 960 * 961 * @return array 962 */ 963 public function get_cptui_post_types(): array { 964 $active_plugins = get_option( 'active_plugins' ); 965 $cptui_post_types = array(); 966 967 if ( is_array( $active_plugins ) && preg_match( '/custom-post-type-ui/', implode( ',', $active_plugins ) ) ) { 968 $cptui_data = get_option( 'cptui_post_types' ); 969 970 if ( is_string( $cptui_data ) ) { 971 $cptui_data = unserialize( $cptui_data, [ 'allowed_classes' => false ] ); 972 } 973 974 if ( is_array( $cptui_data ) ) { 975 foreach ( $cptui_data as $post_type ) { 976 if ( is_array( $post_type ) && isset( $post_type['name'] ) ) { 977 $cptui_post_types[] = $post_type['name']; 978 } 979 } 980 } 981 } 982 983 return $cptui_post_types; 984 } 985 986 987 /** 949 988 * waf_engine 950 989 * … … 966 1005 // Advanced Custom Fieldsプラグイン除外対応で追加 967 1006 $acf_post_types = $this->get_acf_post_types(); 1007 // Custom Post Type UIプラグイン除外対応で追加 1008 $cptui_post_types = $this->get_cptui_post_types(); 968 1009 969 1010 foreach ( $waf_rules as $waf_rule ) { … … 1000 1041 1001 1042 // 特定の操作の場合、特定のルールを除外する 1002 $remove_rule_result = $this->is_remove_rule( $waf_rule['id'], $request_items, $remove_rules, $acf_post_types );1043 $remove_rule_result = $this->is_remove_rule( $waf_rule['id'], $request_items, $remove_rules, $acf_post_types, $cptui_post_types ); 1003 1044 1004 1045 if ( $remove_rule_result['is_removed'] ) { -
cloudsecure-wp-security/trunk/readme.txt
r3465476 r3468278 4 4 Requires at least: 5.3.15 5 5 Tested up to: 6.9 6 Stable tag: 1.4. 16 Stable tag: 1.4.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 107 107 == Changelog == 108 108 109 = 1.4.2 = 110 * 軽微な修正 111 109 112 = 1.4.1 = 110 113 * 軽微な修正
Note: See TracChangeset
for help on using the changeset viewer.