Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #6160 NonPrintableCharacterFixer - fix for when removing non-prin…
…table character break PHP syntax (kubawerlos) This PR was merged into the master branch. Discussion ---------- NonPrintableCharacterFixer - fix for when removing non-printable character break PHP syntax Apparently it is possible to use [zero-width space](https://github.com/colinodell/json5/blob/v2.2.1/src/Json5Decoder.php#L375) and [non-breaking space](https://github.com/markrogoyski/math-php/blob/v2.5.0/src/Statistics/Distance.php#L241) in such way that removing them (`NonPrintableCharacterFixer` replaces non-breaking space with normal space) breaks PHP syntax: ```php <?php /* Hello *<zero-width space here>/ World! */ $foo<non-breaking space here>bar = true; ``` Should we use ultimate solution here and check if removing non-printable character breaks PHP syntax or have fun with tokens and comment's content (if that's even possible, I've found these 2 cases, could be more)? Commits ------- 940690d NonPrintableCharacterFixer - fix for when removing non-printable character break PHP syntax
- Loading branch information