WordPress.org

Make WordPress Core

Changeset 40405


Ignore:
Timestamp:
04/10/17 21:14:50 (4 months ago)
Author:
westonruter
Message:

Customize: Verify availability of history.replaceState (in IE9) before attempting to populate changeset_uuid parameter.

Props westonruter, timmydcrawford for testing.
Amends [39686].
See #39227.
Fixes #40405.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r40395 r40405  
    47634763            populateChangesetUuidParam = function( isIncluded ) { 
    47644764                var urlParser, queryParams; 
     4765 
     4766                // Abort on IE9 which doesn't support history management. 
     4767                if ( ! history.replaceState ) { 
     4768                    return; 
     4769                } 
     4770 
    47654771                urlParser = document.createElement( 'a' ); 
    47664772                urlParser.href = location.href; 
     
    47814787            }; 
    47824788 
    4783             if ( history.replaceState ) { 
    4784                 changesetStatus.bind( function( newStatus ) { 
    4785                     populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus ); 
    4786                 } ); 
    4787             } 
     4789            changesetStatus.bind( function( newStatus ) { 
     4790                populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus ); 
     4791            } ); 
    47884792 
    47894793            // Expose states to the API. 
Note: See TracChangeset for help on using the changeset viewer.