-
Notifications
You must be signed in to change notification settings - Fork 42
Downgrade Files.IncludingNonPHPFile.IncludingSVGCSSFile to a warning with a more descriptive message #597
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
Comments
@rebeccahum Just checking - why was this issue closed ? And why is it (still) in the
The first part - "we don't want arbitrary code evaluated" - I can understand. The second part - "it's faster" -, however, is unlikely.
PHPCS 4.x will no longer have tokenizer support for CSS files. This means that you will no longer be able to pass a This sniff, however, does not target CSS files, but PHP files (containing code which includes css files). So for this sniff, nothing will change with PHPCS 4.x. It will continue to function for both CSS as well as SVG files (and all other types) as before. It would be different if we were trying to analyse a CSS file doing something like: @import url("../parenttheme/style.css"); |
@jrfnl Ah, I should have been more transparent as to why I closed this. After an audit, we've decided that we're going to keep this at the error level since we typically do not review SVG/CSS/other non-PHP files. So, it would be good to flag that they are properly being included (and not being executed). |
Since SVG files are submitted for review and VIPCS runs on them, I think we can downgrade
Files.IncludingNonPHPFile.IncludingSVGCSSFile
to a warning level rather than an error. The main reasoning why we recommendfile_get_contents()
overinclude()
is because we don't want arbitrary code evaluated and it's faster — we should indicate the "why" in the messaging.The text was updated successfully, but these errors were encountered: