Permalink
Browse files

Optimized charset replace pattern.

1) Added optional leading whitespace
2) Changed capturing to non-capturing group for speed-improvement
  • Loading branch information...
1 parent 0f724a4 commit fe1a1c1b2fee24dff7dba63eee4e9987a57ffd4a @druu druu committed Dec 18, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 libraries/Minify/drivers/Minify_css.php
@@ -94,7 +94,7 @@ public function min($file = '', $compact = TRUE, $is_aggregated = NULL)
*/
private function remove_charsets($contents)
{
- return preg_replace('/^@charset\s+[\'"](\S*)\b[\'"];/i', '', $contents);
+ return preg_replace('/^\s*@charset\s+[\'"](?:\S*)\b[\'"];/i', '', $contents);
}
// ------------------------------------------------------------------------

0 comments on commit fe1a1c1

Please sign in to comment.