Make WordPress Core

Changeset 43757


Ignore:
Timestamp:
10/18/2018 08:48:17 PM (6 years ago)
Author:
danielbachhuber
Message:

REST API: generate a valid fallback URI in wp.api.utils.getRootURL.

When window.location.origin isn't set, correctly insert two slashes between the protocol and host when constructing the fallback URL.

Props abdullahramzan.
Merges [43566] into the 5.0 branch.
Fixes #44764.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/js/wp-api.js

    r42854 r43757  
    142142        return window.location.origin ?
    143143            window.location.origin + '/' :
    144             window.location.protocol + '/' + window.location.host + '/';
     144            window.location.protocol + '//' + window.location.host + '/';
    145145    };
    146146
Note: See TracChangeset for help on using the changeset viewer.