Skip to content
Snippets Groups Projects
Commit 8f1ec56d authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #584370 by JoshuaRogers, JacobSingh | mattyoung: fixed bug with CSS...

- Patch #584370 by JoshuaRogers, JacobSingh | mattyoung: fixed bug with CSS file inclusion in the CSS optimization code.
parent dd7a450a
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -3052,9 +3052,6 @@ function drupal_load_stylesheet($file, $optimize = NULL) {
* Contents of the stylesheet including the imported stylesheets.
*/
function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
// Replaces @import commands with the actual stylesheet content.
// This happens recursively but omits external files.
$contents = preg_replace_callback('/@import\s*(?:url\()?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\)?;/', '_drupal_load_stylesheet', $contents);
// Remove multiple charset declarations for standards compliance (and fixing Safari problems).
$contents = preg_replace('/^@charset\s+[\'"](\S*)\b[\'"];/i', '', $contents);
......@@ -3066,6 +3063,10 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
[\n\r] # Remove line breaks.
>x', '\1', $contents);
}
// Replaces @import commands with the actual stylesheet content.
// This happens recursively but omits external files.
$contents = preg_replace_callback('/@import\s*(?:url\()?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\)?;/', '_drupal_load_stylesheet', $contents);
return $contents;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment