Make WordPress Core

Ticket #49145: 49145.diff

File 49145.diff, 1.6 KB (added by SergeyBiryukov, 4 years ago)
  • src/wp-includes/l10n.php

     
    969969        // If the host is the same or it's a relative URL.
    970970        if (
    971971                ( ! isset( $content_url['path'] ) || strpos( $src_url['path'], $content_url['path'] ) === 0 ) &&
    972                 ( ! isset( $src_url['host'] ) || $src_url['host'] === $content_url['host'] )
     972                ( ! isset( $src_url['host'] ) || ! isset( $content_url['host'] ) || $src_url['host'] === $content_url['host'] )
    973973        ) {
    974974                // Make the src relative the specific plugin or theme.
    975975                if ( isset( $content_url['path'] ) ) {
     
    986986                $relative = implode( '/', $relative );
    987987        } elseif (
    988988                ( ! isset( $plugins_url['path'] ) || strpos( $src_url['path'], $plugins_url['path'] ) === 0 ) &&
    989                 ( ! isset( $src_url['host'] ) || $src_url['host'] === $plugins_url['host'] )
     989                ( ! isset( $src_url['host'] ) || ! isset( $plugins_url['host'] ) || $src_url['host'] === $plugins_url['host'] )
    990990        ) {
    991991                // Make the src relative the specific plugin.
    992992                if ( isset( $plugins_url['path'] ) ) {
     
    10011001
    10021002                $relative = array_slice( $relative, 1 ); // Remove <plugin name>.
    10031003                $relative = implode( '/', $relative );
    1004         } elseif ( ! isset( $src_url['host'] ) || $src_url['host'] === $site_url['host'] ) {
     1004        } elseif ( ! isset( $src_url['host'] ) || ! isset( $site_url['host'] ) || $src_url['host'] === $site_url['host'] ) {
    10051005                if ( ! isset( $site_url['path'] ) ) {
    10061006                        $relative = trim( $src_url['path'], '/' );
    10071007                } elseif ( ( strpos( $src_url['path'], trailingslashit( $site_url['path'] ) ) === 0 ) ) {