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

$utils::is_token_false_positive is fiddly and unstable #68

Open
jrfnl opened this issue Mar 12, 2020 · 1 comment
Open

$utils::is_token_false_positive is fiddly and unstable #68

jrfnl opened this issue Mar 12, 2020 · 1 comment

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Mar 12, 2020

The Utils::is_token_false_positive() method required sniffs to pass two tokens. The second token is calculated, not retrieved via token walking and may therefore be incorrect.

The method basically expects code to be written like so:

$_SERVER['key'];

... but all of the below are valid PHP and would fail the check because of the token calculation:

$_SERVER ['key'];
$_SERVER[ 'key' ];
$_SERVER[/*comment*/ 'key' ];
... etc...
@jrfnl
Copy link
Contributor Author

jrfnl commented Mar 12, 2020

I have a fix ready for this, but would like to pull it accompanied by unit tests - see #57.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant