Script Loader: Prevent normalizing data URIs in `_wp_normalize_relative_css_links()`.

This prevents making data URIs as in `mask-image:url('data:image/svg+xml;utf8,<svg...` relative to the WordPress installation.

Props staatic.
See #54243.
Fixes #55177.
Built from https://develop.svn.wordpress.org/trunk@52754


git-svn-id: http://core.svn.wordpress.org/trunk@52343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2022-02-17 14:47:04 +00:00
parent 007dec9ec6
commit f42e80b077
2 changed files with 6 additions and 1 deletions

View File

@ -2781,6 +2781,11 @@ function _wp_normalize_relative_css_links( $css, $stylesheet_url ) {
continue;
}
// Skip if the URL is a data URI.
if ( str_starts_with( $src_result, 'data:' ) ) {
continue;
}
// Build the absolute URL.
$absolute_url = dirname( $stylesheet_url ) . '/' . $src_result;
$absolute_url = str_replace( '/./', '/', $absolute_url );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-alpha-52752';
$wp_version = '6.0-alpha-52754';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.