Skip to content

Commit

Permalink
Fixed Saved Layouts gallery images resets data (#209)
Browse files Browse the repository at this point in the history
* fixed security issue an error checking the image gallery id

* Changed image ID to sanitize as a number. Fixed issue where adding a new image to the gallery resets data in saved layouts.

---------

Co-authored-by: Nikita <[email protected]>
Fellan-91 and nk-o authored May 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent cf19bd4 commit 566f9f6
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion classes/class-security.php
Original file line number Diff line number Diff line change
@@ -406,6 +406,7 @@ public static function sanitize_gallery( $attribute ) {
$attribute[ $key ][ $attribute_key ] = null;
}
break;
case 'id':
case 'custom_popup_image':
case 'hover_image':
$attribute[ $key ][ $attribute_key ] = self::sanitize_number( $media_attribute );
@@ -423,7 +424,6 @@ public static function sanitize_gallery( $attribute ) {
case 'description':
$attribute[ $key ][ $attribute_key ] = wp_kses_post( wp_unslash( $media_attribute ) );
break;
case 'id':
case 'author':
case 'format':
case 'deep_link_pid':
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 566f9f6

Please sign in to comment.