Plugin Directory

Changeset 3468278


Ignore:
Timestamp:
02/24/2026 06:24:26 AM (5 weeks ago)
Author:
cloudsecure
Message:

軽微な修正

Location:
cloudsecure-wp-security/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cloudsecure-wp-security/trunk/cloudsecure-wp.php

    r3465476 r3468278  
    1414 * Plugin URI:    https://wpplugin.cloudsecure.ne.jp/cloudsecure_wp_security
    1515 * Description:   管理画面とログインURLをサイバー攻撃から守る、安心の国産・日本語対応プラグインです。かんたんな設定を行うだけで、不正アクセスや不正ログインからあなたのWordPressを保護し、セキュリティが向上します。また、各機能の有効・無効(ON・OFF)や設定などをお好みにカスタマイズし、いつでも保護状態を管理できます。
    16  * Version:       1.4.1
     16 * Version:       1.4.2
    1717 * Requires PHP:  7.1
    1818 * Author:        CloudSecure,Inc.
  • cloudsecure-wp-security/trunk/modules/waf-engine.php

    r3465476 r3468278  
    650650     * @return array
    651651     */
    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 {
    653653        $is_rule_removed         = false;
    654654        $modify_remove_variables = array();
     
    800800                    }
    801801                }
     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                }
    802811            }
    803812        }
     
    947956
    948957    /**
     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    /**
    949988     * waf_engine
    950989     *
     
    9661005        // Advanced Custom Fieldsプラグイン除外対応で追加
    9671006        $acf_post_types = $this->get_acf_post_types();
     1007        // Custom Post Type UIプラグイン除外対応で追加
     1008        $cptui_post_types = $this->get_cptui_post_types();
    9681009
    9691010        foreach ( $waf_rules as $waf_rule ) {
     
    10001041
    10011042            // 特定の操作の場合、特定のルールを除外する
    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 );
    10031044
    10041045            if ( $remove_rule_result['is_removed'] ) {
  • cloudsecure-wp-security/trunk/readme.txt

    r3465476 r3468278  
    44Requires at least: 5.3.15
    55Tested up to: 6.9
    6 Stable tag: 1.4.1
     6Stable tag: 1.4.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    107107== Changelog ==
    108108
     109= 1.4.2 =
     110* 軽微な修正
     111
    109112= 1.4.1 =
    110113* 軽微な修正
Note: See TracChangeset for help on using the changeset viewer.