You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on improving code coverage for the Generic.Files.LowercasedFilename sniff (#681), I noticed that it fails to properly handle file names that contain uppercase non-ANSII characters as it uses [strtolower()](https://www.php.net/manual/en/function.strtolower.php) to check if the filename is all lowercase. strtolower() ignores non-ANSII characters.
Describe the bug
While working on improving code coverage for the
Generic.Files.LowercasedFilename
sniff (#681), I noticed that it fails to properly handle file names that contain uppercase non-ANSII characters as it uses[strtolower()](https://www.php.net/manual/en/function.strtolower.php)
to check if the filename is all lowercase.strtolower()
ignores non-ANSII characters.PHP_CodeSniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php
Line 51 in 26ddb35
Code sample
<?php
To reproduce
Steps to reproduce the behavior:
tÉst.php
with the code sample above.phpcs tÉst.php --standard=Generic --sniffs=Generic.Files.LowercasedFilename
Expected behavior
PHPCS should display the following error message:
Versions (please complete the following information)
Please confirm
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: