Commit 9edcceb0 authored by Dries's avatar Dries
Browse files

- Patch #444228 by Tri, raulgigea, mikeytown2, JohnAlbin: optimize CSS option...

- Patch #444228 by Tri, raulgigea, mikeytown2, JohnAlbin: optimize CSS option causes php cgi to segfault in pcre function 'match'.
parent 12ead318
......@@ -3465,9 +3465,13 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
if ($optimize) {
// Perform some safe CSS optimizations.
$contents = preg_replace('{
(?<=\\\\\*/)([^/\*]+/\*)([^\*/]+\*/) # Add a backslash also at the end ie-mac hack comment, so the next pass will not touch it.
# The added backshlash does not affect the effectiveness of the hack.
}x', '\1\\\\\2', $contents);
$contents = preg_replace('<
\s*([@{}:;,]|\)\s|\s\()\s* | # Remove whitespace around separators, but keep space around parentheses.
/\*([^*\\\\]|\*(?!/))+\*/ # Remove comments that are not CSS hacks.
\s*([@{}:;,]|\)\s|\s\()\s* | # Remove whitespace around separators, but keep space around parentheses.
/\*[^*\\\\]*\*+([^/*][^*]*\*+)*/ | # Remove comments that are not CSS hacks.
>x', '\1', $contents);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment