htmlcompressor
htmlcompressor copied to clipboard
php files without ending php tag
If you compress a php file that doesn't close the <?php tag, the compresor will
mess the php code between the last <?php and the end of the file.
I expect that the compresor know that every thing between <?php and the end of
the file is php code
I'll try to use an user pattern but It still fails
<\?php[^(\?>)]*$
I know the files I attach don't have html so it's useless to compress them, I I
choose this ones because this ones are smaller and show the problem.
Original issue reported on code.google.com by [email protected] on 16 Dec 2011 at 12:53
Attachments:
Any other ideas how to rectify this problem?
I purposely leave out the ending PHP tag ?> in purely PHP files in order to
save space (granted it's not much but it's a habit now). --preserve-php is
ignored in this scenario.
PHP comments are also not removed and there seems to be no option to remove
them, only HTML ones
Thanks
Original comment by u01jmg3 on 19 Apr 2013 at 1:32
Try this regexp:
(?si)<\?php.+?\?>
(?si)<\?php.*\Z
Original comment by [email protected] on 28 Jun 2013 at 12:41