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

Undefined index warnings in ValidatedSanitizedInputSniff #107

Closed
westonruter opened this issue Oct 24, 2013 · 4 comments
Closed

Undefined index warnings in ValidatedSanitizedInputSniff #107

westonruter opened this issue Oct 24, 2013 · 4 comments
Assignees

Comments

@westonruter
Copy link
Member

Through PhpStorm I'm getting some notices reported, in relation to #72:

10:26:05 PM PHP Code Sniffer
            phpcs: PHP Notice:  Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
            PHP Notice:  Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
            PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
            PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
@ghost ghost assigned shadyvb Oct 24, 2013
@shadyvb
Copy link
Contributor

shadyvb commented Oct 27, 2013

@westonruter Can you share the problematic piece of code that phpcs is trying to check ?

@westonruter
Copy link
Member Author

@shadyvb Here, run this:

curl -G -L https://raw.github.com/x-team/wp-widget-customizer/3348b8e279ba3cc6a2ff4396c79f24177b33dac9/widget-customizer.php | phpcs --standard=WordPress

Output:

PHP Notice:  Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_opener in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71

Notice: Undefined index: parenthesis_closer in .../vvv/www/phpcs/CodeSniffer/Standards/WordPress/Sniffs/VIP/ValidatedSanitizedInputSniff.php on line 71
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671
PHP Notice:  Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

Notice: Undefined index:  in .../vvv/www/phpcs/CodeSniffer/File.php on line 2671

FILE: ...-develop/src/wp-content/plugins/widget-customizer/widget-customizer.php
--------------------------------------------------------------------------------
FOUND 12 ERROR(S) AND 12 WARNING(S) AFFECTING 8 LINE(S)
--------------------------------------------------------------------------------
 124 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 125 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 125 | ERROR   | Detected usage of a non-validated input variable: $_POST
 125 | ERROR   | Detected usage of a non-sanitized input variable: $_POST
 633 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 637 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 637 | ERROR   | Detected usage of a non-validated input variable: $_POST
 637 | ERROR   | Detected usage of a non-sanitized input variable: $_POST
 637 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 637 | ERROR   | Detected usage of a non-validated input variable: $_POST
 637 | ERROR   | Detected usage of a non-sanitized input variable: $_POST
 649 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 649 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 649 | ERROR   | Detected usage of a non-validated input variable: $_POST
 649 | ERROR   | Detected usage of a non-sanitized input variable: $_POST
 649 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 649 | ERROR   | Detected usage of a non-validated input variable: $_POST
 649 | ERROR   | Detected usage of a non-sanitized input variable: $_POST
 656 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 678 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 678 | WARNING | Detected access of super global var $_POST without targeting a
     |         | member variable.
 679 | WARNING | Detected access of super global var $_POST, probably need
     |         | manual inspection.
 679 | ERROR   | Detected usage of a non-validated input variable: $_POST
 679 | ERROR   | Detected usage of a non-sanitized input variable: $_POST
--------------------------------------------------------------------------------

Time: 248 ms, Memory: 10.25Mb


shadyvb added a commit that referenced this issue Oct 29, 2013
@ghost ghost assigned westonruter Oct 29, 2013
@shadyvb
Copy link
Contributor

shadyvb commented Oct 29, 2013

@westonruter Fixed, i've also enabled development parameters in my CLI php.ini to catch similar errors in the future.

@westonruter
Copy link
Member Author

👍

Merged branch issue/107 in f8a0f36.

jrfnl pushed a commit to jrfnl/WordPress-Coding-Standards that referenced this issue Jan 30, 2017
NoFaviconSniff: Add missing delimiter to `preg_quote()` call.
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

2 participants