WordPress.org

Make WordPress Core

Ticket #39175: 39175.2.diff

File 39175.2.diff, 1.0 KB (added by westonruter, 3 years ago)
  • src/wp-includes/js/customize-preview.js

    diff --git src/wp-includes/js/customize-preview.js src/wp-includes/js/customize-preview.js
    index a4cb196..42d0ba3 100644
     
    4949                history.replaceState = ( function( nativeReplaceState ) {
    5050                        return function historyReplaceState( data, title, url ) {
    5151                                currentHistoryState = data;
    52                                 return nativeReplaceState.call( history, data, title, injectUrlWithState( url ) );
     52                                return nativeReplaceState.call( history, data, title, ! _.isUndefined( url ) && null !== url ? injectUrlWithState( url ) : null );
    5353                        };
    5454                } )( history.replaceState );
    5555
    5656                history.pushState = ( function( nativePushState ) {
    5757                        return function historyPushState( data, title, url ) {
    5858                                currentHistoryState = data;
    59                                 return nativePushState.call( history, data, title, injectUrlWithState( url ) );
     59                                return nativePushState.call( history, data, title, ! _.isUndefined( url ) && null !== url ? injectUrlWithState( url ) : null );
    6060                        };
    6161                } )( history.pushState );
    6262