Make WordPress Core


Ignore:
Timestamp:
11/17/2020 08:50:21 PM (4 years ago)
Author:
SergeyBiryukov
Message:

I18N: Avoid PHP notices for relative URLs in load_script_textdomain().

Props hellofromTonya, SeBsZ, archon810, nourma, justinahinon, SergeyBiryukov.
Fixes #49145.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n.php

    r49566 r49639  
    10411041    if (
    10421042        ( ! isset( $content_url['path'] ) || strpos( $src_url['path'], $content_url['path'] ) === 0 ) &&
    1043         ( ! isset( $src_url['host'] ) || $src_url['host'] === $content_url['host'] )
     1043        ( ! isset( $src_url['host'] ) || ! isset( $content_url['host'] ) || $src_url['host'] === $content_url['host'] )
    10441044    ) {
    10451045        // Make the src relative the specific plugin or theme.
     
    10581058    } elseif (
    10591059        ( ! isset( $plugins_url['path'] ) || strpos( $src_url['path'], $plugins_url['path'] ) === 0 ) &&
    1060         ( ! isset( $src_url['host'] ) || $src_url['host'] === $plugins_url['host'] )
     1060        ( ! isset( $src_url['host'] ) || ! isset( $plugins_url['host'] ) || $src_url['host'] === $plugins_url['host'] )
    10611061    ) {
    10621062        // Make the src relative the specific plugin.
     
    10731073        $relative = array_slice( $relative, 1 ); // Remove <plugin name>.
    10741074        $relative = implode( '/', $relative );
    1075     } elseif ( ! isset( $src_url['host'] ) || $src_url['host'] === $site_url['host'] ) {
     1075    } elseif ( ! isset( $src_url['host'] ) || ! isset( $site_url['host'] ) || $src_url['host'] === $site_url['host'] ) {
    10761076        if ( ! isset( $site_url['path'] ) ) {
    10771077            $relative = trim( $src_url['path'], '/' );
Note: See TracChangeset for help on using the changeset viewer.