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

exclude comments from theme file scan #114

Open
stklcode opened this issue May 28, 2021 · 0 comments
Open

exclude comments from theme file scan #114

stklcode opened this issue May 28, 2021 · 0 comments

Comments

@stklcode
Copy link
Contributor

Originally suggested in WP support forums: https://wordpress.org/support/topic/should-not-alert-in-php-comments/

The theme file scan detects malicious patterns in comments as well, because the current implementation does not distinguish between comment lines and code lines or even mixed content.

To achieve this, the feeding routine has to be extended to detect comments correctly in a safe way, as there are many false-positive candidates that break the change (whether intentionally or by mistake)

Some primitive examples that must not be detected incorrectly:

// Single line comment containing /* multiline comment sequence
...
$url = 'https://www.example.com';
...
//* Single line, not multi */ ... still comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant