WP PLUGIN 申請指摘事項の修正
・$_POSTのサニタイズ ・echoのエスケープ ・readmeの修正
This commit is contained in:
@@ -119,8 +119,7 @@ if ( ! class_exists( 'APOP_POST' ) ) {
|
||||
if ( count( $this->name_keys ) > 0 ) {
|
||||
foreach ( $this->name_keys as $name_key ) {
|
||||
$save_key = APOP_CUSTOM_FIELD_PREFIX . $name_key;
|
||||
update_post_meta( $post_id, $save_key, $_POST[ $save_key ] ?? '' );
|
||||
update_post_meta( $post_id, $save_key, $_POST[ $save_key ] ?? '' );
|
||||
update_post_meta( $post_id, $save_key, APOP_UI::input_post_filter( $save_key, 'str' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,10 +433,10 @@ value="meta_value_num"' . self::set_search_normal_checked( $value_type, 'meta_va
|
||||
|
||||
public static function input_post_filter( $var_name, $type ) {
|
||||
if ( $type == 'array' ) {
|
||||
return filter_input( INPUT_POST, $var_name, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
|
||||
return filter_input( INPUT_POST, $var_name, FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
||||
}
|
||||
if ( $type == 'str' ) {
|
||||
return filter_input( INPUT_POST, $var_name );
|
||||
return filter_input( INPUT_POST, $var_name, FILTER_SANITIZE_STRING );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user