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.
Merges [52754] to the 5.9 branch.
See #54243.
Fixes #55177.
Built from https://develop.svn.wordpress.org/branches/5.9@52762


git-svn-id: http://core.svn.wordpress.org/branches/5.9@52351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya
2022-02-17 18:00:00 +00:00
parent 5b69c32e30
commit 93fbf22647
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 = '5.9.1-alpha-52761';
$wp_version = '5.9.1-alpha-52762';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.