mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Update/Install: Reject invalid messages in the Shiny Updates postMessage handler.
This prevents conflicts with third-party messages (e.g. sent by browser extensions). The updates script expects a specific JSON-encoded message and now bails early if it's not valid JSON. Fixes #37125. git-svn-id: https://develop.svn.wordpress.org/trunk@37976 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2144,7 +2144,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
message = $.parseJSON( originalEvent.data );
|
||||
try {
|
||||
message = $.parseJSON( originalEvent.data );
|
||||
} catch ( e ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'undefined' === typeof message.action ) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user