Skip to content

Commit

Permalink
[Block Library - Cover]: Ensure url is not malformed due to sanitiz…
Browse files Browse the repository at this point in the history
…ation through `wp_kses` (#47906)
  • Loading branch information
ntsekouras authored Feb 9, 2023
1 parent 5bd27ba commit 44e6ff6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-library/src/cover/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ function CoverEdit( {
// we define the url and background type
// depending on the value of the useFeaturedImage flag
// to preview in edit the dynamic featured image
const url = useFeaturedImage ? mediaUrl : attributes.url;
const url = useFeaturedImage
? mediaUrl
: // Ensure the url is not malformed due to sanitization through `wp_kses`.
attributes.url?.replaceAll( '&', '&' );
const backgroundType = useFeaturedImage
? IMAGE_BACKGROUND_TYPE
: attributes.backgroundType;
Expand Down

0 comments on commit 44e6ff6

Please sign in to comment.