diff options
Diffstat (limited to 'src/class-draggable-post-order.php')
-rw-r--r-- | src/class-draggable-post-order.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/class-draggable-post-order.php b/src/class-draggable-post-order.php index a976816..ee9156c 100644 --- a/src/class-draggable-post-order.php +++ b/src/class-draggable-post-order.php @@ -136,11 +136,10 @@ class Draggable_Post_Order { $page = intval( $_POST['page'] ); $per_page = intval( $_POST['perPage'] ); - //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - parse_str( $_POST['postOrder'], $post_order ); + parse_str( sanitize_text_field( wp_unslash( $_POST['postOrder'] ) ), $post_order ); - foreach ( $post_order['post'] as $order => $post_id ) { - $order = intval( $order ) + 1; + foreach ( $post_order['post'] as $idx => $post_id ) { + $order = intval( $idx ) + 1; update_post_meta( $post_id, self::$meta_key, ( ( $page - 1 ) * $per_page ) + $order ); } } |