Are you sure this is not a problem with your configuration? (ask on the
Google Group)
Minify commit/version: 2.1.5
PHP version: 5.2
What steps will reproduce the problem?
1. Try to minify XHTML already containing scripts with CDATA:
<script><![CDATA[ alert("&"); ]]> </script>
Expected output:
<script>/*<![CDATA[*/ alert("&"); /*]]>/* </script>
Actual output:
CDATA is attached twice.
My fix to the problem:
minify-2.1.5\min\lib\Minify\HTML.php, line 244.
Replace line:
return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
With:
return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str) &&
!preg_match('#\<\!\[CDATA#ui', $str));
Original issue reported on code.google.com by moroz1...@gmail.com on 11 Oct 2012 at 11:03
Original issue reported on code.google.com by
moroz1...@gmail.com
on 11 Oct 2012 at 11:03