Customizer: Ensure we have a string that's JSON parseable.
props mattwiebe. fixes #postmessage-check.diff. Built from https://develop.svn.wordpress.org/trunk@26542 git-svn-id: http://core.svn.wordpress.org/trunk@26434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3fe7726bd4
commit
67c504cf23
|
@ -533,6 +533,11 @@ window.wp = window.wp || {};
|
|||
if ( this.origin() && event.origin !== this.origin() )
|
||||
return;
|
||||
|
||||
// Ensure we have a string that's JSON.parse-able
|
||||
if ( typeof event.data !== 'string' || event.data[0] !== '{' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
message = JSON.parse( event.data );
|
||||
|
||||
// Check required message properties.
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue