Skip to content

Commit

Permalink
Merge pull request #41 from WordPress/fix/context-attr-json-escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski authored Mar 27, 2023
2 parents 90e7ea7 + 61519f4 commit 9aa902e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/interactive/movie-trailer-button/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$trailer_id = substr( $trailer_url, strpos( $trailer_url, '?v=' ) + 3 );
?>

<div <?php echo $wrapper_attributes; ?> data-wp-context='{ "videoId": "<?php echo $trailer_id; ?>" }'>
<div <?php echo $wrapper_attributes; ?> data-wp-context='<?php echo esc_attr( wp_json_encode( array( 'videoId' => $trailer_id ) ) ); ?>'>
<div class="wpmovies-page-button-parent" data-wp-on.click="actions.wpmovies.setVideo">
<div class="wpmovies-page-button-child">
<?php echo $play_icon; ?><span>Play trailer</span>
Expand Down

0 comments on commit 9aa902e

Please sign in to comment.