Permalink
Browse files

Merge pull request #34 from rusjoan/normalize_int-patch

Update CSSmin.php to satisfy PHP 7.1 requirements
  • Loading branch information...
2 parents 20f7388 + f4d3160 commit 32421d3939e0b86fad687895fca9fbded9bf97cc @tubalmartin committed on GitHub Feb 27, 2017
Showing with 4 additions and 3 deletions.
  1. +4 −3 cssmin.php
View
@@ -765,13 +765,14 @@ private function str_slice($str, $start = 0, $end = FALSE)
private function normalize_int($size)
{
if (is_string($size)) {
- switch (substr($size, -1)) {
+ $letter = substr($size, -1);
+ $size = intval($size);
+ switch ($letter) {
case 'M': case 'm': return $size * 1048576;
case 'K': case 'k': return $size * 1024;
case 'G': case 'g': return $size * 1073741824;
}
}
-
return (int) $size;
}
-}
+}

1 comment on commit 32421d3

futtta commented on 32421d3 Feb 27, 2017

welcome back @tubalmartin :-)

Please sign in to comment.