WordPress.org

Make WordPress Core

Changeset 26542


Ignore:
Timestamp:
12/02/2013 10:48:15 PM (8 years ago)
Author:
nacin
Message:

Customizer: Ensure we have a string that's JSON parseable.

props mattwiebe.
fixes #postmessage-check.diff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/customize-base.js

    r26195 r26542  
    534534                return;
    535535
     536            // Ensure we have a string that's JSON.parse-able
     537            if ( typeof event.data !== 'string' || event.data[0] !== '{' ) {
     538                return;
     539            }
     540
    536541            message = JSON.parse( event.data );
    537542
Note: See TracChangeset for help on using the changeset viewer.