tedious / JShrink

Javascript Minifier built in PHP
http://www.tedivm.com
BSD 3-Clause "New" or "Revised" License
751 stars 152 forks source link

Fix where "return/RegEX/" breaks minify #104

Closed viable-hartman closed 1 year ago

viable-hartman commented 3 years ago

tinymce.min.js contains the following Javascript:

return/^[^:]+:\/\/\/?[^\/]+\//.test(t)

JSShrink does not call the saveRegex method for this Javascript string as it is not a recognized RegEx starting point.

By adding "n" to the strpos test before the saveRegex call, the return/RegEx/ situation is properly handled. In the above case.

When it is not properly handled, the \//.test(t) part of the RegEx is treated as a comment and is improperly truncated for tineymce.min.js.

tedivm commented 1 year ago

This project has recently upgraded its test suite to work with Github Actions and PHPUnit 10. If you are still interested in this PR please rebase and open a new PR. Thanks!