WordPress.org

Make WordPress Core

Ticket #45528: 45528.patch

File 45528.patch, 1.5 KB (added by herregroen, 12 months ago)
  • src/wp-includes/l10n.php

     
    900900
    901901        $obj = $wp_scripts->registered[ $handle ];
    902902
     903        $src = $obj->src;
     904        if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && 0 === strpos( $src, $wp_scripts->content_url ) ) ) {
     905                $src = $wp_scripts->base_url . $src;
     906        }
    903907        /** This filter is documented in wp-includes/class.wp-scripts.php */
    904         $src = esc_url( apply_filters( 'script_loader_src', $obj->src, $handle ) );
     908        $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
    905909
    906910        $relative       = false;
    907911        $languages_path = WP_LANG_DIR;
     
    916920                ( ! isset( $src_url['host'] ) || $src_url['host'] !== $content_url['host'] )
    917921        ) {
    918922                // Make the src relative the specific plugin or theme.
    919                 $relative = trim( substr( $src, strlen( $content_url['path'] ) ), '/' );
     923                $relative = trim( substr( $src_url['path'], strlen( $content_url['path'] ) ), '/' );
    920924                $relative = explode( '/', $relative );
    921925
    922926                $languages_path = WP_LANG_DIR . '/' . $relative[0];
     
    928932                        $relative = trim( $src_url['path'], '/' );
    929933                } elseif ( ( strpos( $src_url['path'], $site_url['path'] ) === 0 ) ) {
    930934                        // Make the src relative to the WP root.
    931                         $relative = substr( $src, strlen( $site_url['path'] ) );
     935                        $relative = substr( $src_url['path'], strlen( $site_url['path'] ) );
    932936                        $relative = trim( $relative, '/' );
    933937                }
    934938        }