Skip to content

Commit 6ae3f32

Browse files
authored
Merge pull request #362 from skaut/meta-fix
Fixed meta sanitization
2 parents a5f0d94 + a5eab56 commit 6ae3f32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/php/src/utils/class-request-parameter-helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static function post_int_variable( $name, $default = -1 ) {
8585
* @return mixed The POST variable value
8686
*/
8787
public static function post_meta_variable( $name, $meta_name, $default = '' ) {
88-
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
89-
return isset( $_POST[ $name ] ) ? sanitize_meta( $meta_name, wp_unslash( strval( $_POST[ $name ] ) ), 'post' ) : $default;
88+
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash
89+
return isset( $_POST[ $name ] ) ? sanitize_meta( $meta_name, $_POST[ $name ], 'post' ) : $default;
9090
}
9191
}

0 commit comments

Comments
 (0)