In csstidy, IMPORTANT_COMMENT ($this->_tidy->css['!'] in ExtractStyleBlocks) are declaired as string. But, when it goes trough ExtractStyleBlocks, it is transformed in an empty array while it should stay a string.
ExtractStyleBlocks.php line 317-319 where IMPORTANT_COMMENT is transform
The reason why it is reuse by csstidy where it expected to be a string and it cause an error because it is now an array.
class.csstidy_print.php line 352-355 where IMPORTANT_COMMENT is reuse in csstidy
if (isset($this->css['!'])) {
$this->parser->_add_token(IMPORTANT_COMMENT, rtrim($this->css['!']), true);
unset($this->css['!']);
}
Ex:
<style>
/*! important comment */
h1 {
color: white;
text-align: center;
}
/*! another important comment */
p {
font-family: verdana;
font-size: 20px;
}
</style>
After being parse by csstidy (ExtractStyleBlocks.php line 141), IMPORTANT_COMMENT looks like this: $this->_tidy->css['!'] = 'important comment\nanother important comment'
After being transform by ExtractStyleBlocks, IMPORTANT_COMMENT looks like this: $this->_tidy->css['!'] = []
It than cause an argument error rtrim(): Argument #1 ($string) must be of type string, array given when it is reuse by csstidy.
In csstidy, IMPORTANT_COMMENT ($this->_tidy->css['!'] in ExtractStyleBlocks) are declaired as string. But, when it goes trough ExtractStyleBlocks, it is transformed in an empty array while it should stay a string.
The reason why it is reuse by csstidy where it expected to be a string and it cause an error because it is now an array.
Ex:
After being parse by csstidy (ExtractStyleBlocks.php line 141), IMPORTANT_COMMENT looks like this:
$this->_tidy->css['!'] = 'important comment\nanother important comment'
After being transform by ExtractStyleBlocks, IMPORTANT_COMMENT looks like this:
$this->_tidy->css['!'] = []
It than cause an argument error
rtrim(): Argument #1 ($string) must be of type string, array given
when it is reuse by csstidy.