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
I can see there are some test files with extra . in (and not just underscores), but I was wondering if an incorrect file name like class.my-class.php might be detected, as the checking for hyphenation only replaces underscores.
I also see substr( $file_name, 0, -4 ), which is assuming that a PHP-rendered file will always have a three letter file extension, but I wonder if someone could break that assumption with --extensions=php3,myphp or similar.
I can see there are some test files with extra . in (and not just underscores), but I was wondering if an incorrect file name like class.my-class.php might be detected, as the checking for hyphenation only replaces underscores.
I don't think it is, but did you test it ? If a test would proof it not to be handled, it might be good to open an issue about that.
I also see substr( $file_name, 0, -4 ), which is assuming that a PHP-rendered file will always have a three letter file extension, but I wonder if someone could break that assumption with --extensions=php3,myphp or similar.
They most definitely could, but is that likely for a WP file or plugin ? I mean, for that to work on a server, either additional .htaccess rules or nginx rules (or similar) would need to be set up to support that.
All the same, I agree it may be good to clarify the file name rule in the handbook to be explicit about file extensions. Once that is done, this sniff would need to be updated.
The text was updated successfully, but these errors were encountered:
The most pertinent points from this issue have now been addressed in PR #2285.
The only thing left is whether or not to enforce that files use a .php file extension. As this is not a (handbook) rule, this would need a post on Make to decide whether that rule should be added or not.
@GaryJones Do you want to leave this issue open for that ? Or shall we close this issue as fixed and open a separate issue for the file extension check ?
Originally posted by @GaryJones in #2154 (comment):
Response by @jrfnl :
The text was updated successfully, but these errors were encountered: