Skip to content

Commit

Permalink
quick fix and test for css min with missing closing curly brace (#192)
Browse files Browse the repository at this point in the history
great @zytzagoo !!!
  • Loading branch information
zytzagoo authored and futtta committed Oct 7, 2018
1 parent 5d74905 commit ae97310
Show file tree
Hide file tree
Showing 2 changed files with 2,490 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/external/php/yui-php-cssmin-bundled/Minifier.php
Expand Up @@ -515,6 +515,11 @@ private function processRuleBodies($css)

while (($blockStartPos = strpos($css, '{', $searchOffset)) !== false) {
$blockEndPos = strpos($css, '}', $blockStartPos);
// When ending curly brace is missing, let's
// behave like there was one at the end of the block...
if ( false === $blockEndPos ) {
$blockEndPos = strlen($css) - 1;
}
$nextBlockStartPos = strpos($css, '{', $blockStartPos + 1);
$ret .= substr($css, $substrOffset, $blockStartPos - $substrOffset);

Expand Down

0 comments on commit ae97310

Please sign in to comment.