Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NonPrintableCharacterFixer - fix for when removing non-printable character break PHP syntax #6160

Merged
merged 1 commit into from Dec 13, 2021
Merged

NonPrintableCharacterFixer - fix for when removing non-printable character break PHP syntax #6160

merged 1 commit into from Dec 13, 2021

Conversation

kubawerlos
Copy link
Contributor

@kubawerlos kubawerlos commented Dec 10, 2021

Apparently it is possible to use zero-width space and non-breaking space in such way that removing them (NonPrintableCharacterFixer replaces non-breaking space with normal space) breaks PHP syntax:

<?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)?

@kubawerlos kubawerlos changed the title NonPrintableCharacterFixer - fix for when removing non-printable character close the multi-line comment NonPrintableCharacterFixer - fix for when removing non-printable character break PHP syntax Dec 10, 2021
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Dec 11, 2021

Coverage Status

Coverage increased (+0.002%) to 93.033% when pulling 940690d on werlos:fix_NonPrintableCharacterFixer into 56d8399 on FriendsOfPHP:master.

@kubawerlos kubawerlos marked this pull request as ready for review December 11, 2021 21:21
@SpacePossum
Copy link
Contributor

Thank you @kubawerlos.

@SpacePossum SpacePossum merged commit f2808cf into PHP-CS-Fixer:master Dec 13, 2021
@kubawerlos kubawerlos deleted the fix_NonPrintableCharacterFixer branch December 13, 2021 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants