peteboere / css-crush

CSS preprocessor.
http://the-echoplex.net/csscrush
MIT License
537 stars 51 forks source link

Custom formatter func may cause fatal error #81

Closed biziclop closed 9 years ago

biziclop commented 9 years ago

In css-crush/lib/CssCrush/Rule.php line 59 this way of calling the formatter is unfortunately not exactly equivalent to call_user_func, causing fatal error in PHP5.3 (but in PHP5.6 too) when the function is given in the form array('SomeClass'', 'formatter') or 'SomeClass::formatter':

        $formatter = $process->ruleFormatter;
        return "$stub{$formatter($this)}";

Suggested fix:

        return "$stub" . call_user_func( $process->ruleFormatter, $this );