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:
parent
e34157ceb8
commit
146e6665c8
@ -2144,7 +2144,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
message = $.parseJSON( originalEvent.data );
|
||||
try {
|
||||
message = $.parseJSON( originalEvent.data );
|
||||
} catch ( e ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'undefined' === typeof message.action ) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user