Get rid of another regular expression

This commit is contained in:
Matthias Mullie 2014-10-12 10:32:52 +02:00
parent c1606f07e9
commit 85db14d29d

View File

@ -274,13 +274,12 @@ class JS extends Minify
// uniform line endings, make them all line feed
$content = str_replace(array("\r\n", "\r"), "\n", $content);
// strip leading & trailing whitespace
$content = preg_replace('/^\s+/m', '', $content);
$content = preg_replace('/\s+$/m', '', $content);
// collapse all non-line feed whitespace into single space
// collapse all non-line feed whitespace into a single space
$content = preg_replace('/[^\S\n]+/', ' ', $content);
// strip leading & trailing whitespace
$content = str_replace(array(" \n", "\n "), "\n", $content);
// collapse consecutive line feeds into just 1
$content = preg_replace('/\n+/', "\n", $content);
@ -326,7 +325,7 @@ class JS extends Minify
*/
$content = preg_replace('/;\}/s', '}', $content);
return $content;
return trim($content);
}
/**