• Hello,

    I found a problem as I saved the theme settings. The problem is that a string is multiplied by a number.Below is the piece of code that happens to.

    class-CSSmin.php Line: 764

    private function normalize_int($size)
        {
            if (is_string($size)) {
                switch (substr($size, -1)) {
                    case 'M': case 'm': return $size * 1048576;
                    case 'K': case 'k': return $size * 1024;
                    case 'G': case 'g': return $size * 1073741824;
                }
            }
            
            return (int) $size;
        }

    I corrected it with the following code:

    private function normalize_int($size)
        {
            if (is_string($size)) {
                switch (substr($size, -1)) {
                    case 'M': case 'm': return (int) $size * 1048576;
                    case 'K': case 'k': return (int) $size * 1024;
                    case 'G': case 'g': return (int) $size * 1073741824;
                }
            }
            
            return (int) $size;
        }

    Keep up the good work!

    • This topic was modified 6 years, 10 months ago by egritosgroup.

The topic ‘Found Bug in class-CSSmin.php’ is closed to new replies.