Skip to content
Permalink
Browse files

Embeds: Avoid a JS error in `wp.receiveEmbedMessage` if `data` parame…

…ter is not set.

Props dsifford, kadamwhite.
Merges [43593] and [43597] to the 4.9 branch.
Fixes #44832.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43600 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Aug 31, 2018
1 parent d7b6719 commit 216ff77268d9b7927ca3c62db1b0666580da24bc
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/wp-includes/js/wp-embed.js
@@ -28,6 +28,11 @@

window.wp.receiveEmbedMessage = function( e ) {
var data = e.data;

if ( ! data ) {
return;
}

if ( ! ( data.secret || data.message || data.value ) ) {
return;
}

0 comments on commit 216ff77

Please sign in to comment.
You can’t perform that action at this time.