Skip to content

Commit e45c635

Browse files
Sanitize nonce input in crop settings API for improved security
1 parent 4869c89 commit e45c635

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/admin/class-coblocks-crop-settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function hide_cropped_from_library( $query ) {
8686
* Retrieve the original image.
8787
*/
8888
public function get_original_image() {
89-
if ( ! wp_verify_nonce( filter_input( INPUT_POST, 'nonce' ), 'cropSettingsOriginalImageNonce' ) ) {
89+
if ( ! wp_verify_nonce( sanitize_text_field( filter_input( INPUT_POST, 'nonce' ) ), 'cropSettingsOriginalImageNonce' ) ) {
9090
wp_send_json_error( 'Invalid nonce value.', 403 );
9191
}
9292

@@ -123,7 +123,7 @@ public function get_original_image() {
123123
* Cropping.
124124
*/
125125
public function api_crop() {
126-
if ( ! wp_verify_nonce( filter_input( INPUT_POST, 'nonce' ), 'cropSettingsNonce' ) ) {
126+
if ( ! wp_verify_nonce( sanitize_text_field( filter_input( INPUT_POST, 'nonce' ) ), 'cropSettingsNonce' ) ) {
127127
wp_send_json_error( 'Invalid nonce value.', 403 );
128128
}
129129

0 commit comments

Comments
 (0)