Skip to content

Commit

Permalink
fixed security issue an error checking the image gallery id
Browse files Browse the repository at this point in the history
  • Loading branch information
Fellan-91 committed May 27, 2024
1 parent cf19bd4 commit 5634f4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/class-security.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ public static function sanitize_gallery( $attribute ) {
$attribute[ $key ][ $attribute_key ] = wp_kses_post( wp_unslash( $media_attribute ) );
break;
case 'id':
if ( is_int( $media_attribute ) ) {
$attribute[ $key ][ $attribute_key ] = self::sanitize_number( $media_attribute );
} else {
$attribute[ $key ][ $attribute_key ] = sanitize_text_field( wp_unslash( $media_attribute ) );
}
break;
case 'author':
case 'format':
case 'deep_link_pid':
Expand Down

0 comments on commit 5634f4b

Please sign in to comment.