Make WordPress Core

Changeset 43566


Ignore:
Timestamp:
08/11/2018 06:50:23 PM (6 years ago)
Author:
kadamwhite
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.
Fixes #44764.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/api.js

    r43347 r43566  
    146146        return window.location.origin ?
    147147            window.location.origin + '/' :
    148             window.location.protocol + '/' + window.location.host + '/';
     148            window.location.protocol + '//' + window.location.host + '/';
    149149    };
    150150
Note: See TracChangeset for help on using the changeset viewer.