diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
index 19d25049c4..24f5ad248b 100644
a
|
b
|
function _wp_normalize_relative_css_links( $css, $stylesheet_url ) { |
3056 | 3056 | if ( |
3057 | 3057 | str_starts_with( $url, 'http:' ) || |
3058 | 3058 | str_starts_with( $url, 'https:' ) || |
3059 | | str_starts_with( $url, '//' ) || |
| 3059 | str_starts_with( $url, '/' ) || |
3060 | 3060 | str_starts_with( $url, '#' ) || |
3061 | 3061 | str_starts_with( $url, 'data:' ) |
3062 | 3062 | ) { |
diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php
index 8746c09533..9cb6283c48 100644
a
|
b
|
class Tests_Dependencies_Styles extends WP_UnitTestCase { |
228 | 228 | 'css' => 'p {background-image: url(\'../image1.jpg\');}', |
229 | 229 | 'expected' => 'p {background-image: url(\'/wp-content/themes/test/../image1.jpg\');}', |
230 | 230 | ), |
| 231 | 'URLs with absolute path, shouldn\'t change' => array( |
| 232 | 'css' => 'p {background:url( "/image0.svg" );}', |
| 233 | 'expected' => 'p {background:url( "/image0.svg" );}', |
| 234 | ), |
231 | 235 | 'External URLs, shouldn\'t change' => array( |
232 | 236 | 'css' => 'p {background-image: url(\'http://foo.com/image2.png\');}', |
233 | 237 | 'expected' => 'p {background-image: url(\'http://foo.com/image2.png\');}', |