Conversation
|
PHP Syntax Errors Found Scan performed on the code at commit 6a458b1 (view code). Error: syntax error, unexpected Error: syntax error, unexpected Error: syntax error, unexpected vipgoci-tests/src/Problem1Class.php Line 6 in 6a458b1 |
ariskataoka
left a comment
There was a problem hiding this comment.
phpcs scanning turned up:
🚫 16 errors
hashes-api-scanning skipped
Posting will continue in further review(s)
|
|
||
| class MyProblematicClass | ||
| { | ||
| protected string $test; |
There was a problem hiding this comment.
🚫 Error: PHP syntax error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) (Generic.PHP.Syntax.PHPSyntax).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
🚫 Error: Detected usage of a possibly undefined superglobal array index: $_POST['menu-locations']. Use isset() or empty() to check the index exists before using it (WordPress.Security.ValidatedSanitizedInput.InputNotValidated).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
| foreach ($_POST['menu-locations'] as $menu_id) { | ||
| echo 'ADD warning severity 10 - non-sanitized input variable'; | ||
| } | ||
| $functionsCookies = $_COOKIE; |
There was a problem hiding this comment.
| foreach ($_POST['menu-locations'] as $menu_id) { | ||
| echo 'ADD warning severity 10 - non-sanitized input variable'; | ||
| } | ||
| $functionsCookies = $_COOKIE; |
There was a problem hiding this comment.
🚫 Error: Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead (WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE).
| } | ||
| $functionsCookies = $_COOKIE; | ||
|
|
||
| $functionsPost = $_POST; |
There was a problem hiding this comment.
🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).
|
|
||
| $functionsPost = $_POST; | ||
|
|
||
| var_dump($functionsPost ); |
There was a problem hiding this comment.
|
|
||
| var_dump($functionsPost ); | ||
|
|
||
| session_write_close(); |
There was a problem hiding this comment.
🚫 Error: The use of PHP session function session_write_close() is prohibited (WordPressVIPMinimum.Functions.RestrictedFunctions.session_session_write_close).
|
|
||
| class MySecondProblematicClass | ||
| { | ||
| protected string $test; |
There was a problem hiding this comment.
🚫 Error: PHP syntax error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) (Generic.PHP.Syntax.PHPSyntax).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
🚫 Error: Detected usage of a possibly undefined superglobal array index: $_POST['menu-locations']. Use isset() or empty() to check the index exists before using it (WordPress.Security.ValidatedSanitizedInput.InputNotValidated).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
| foreach ($_POST['menu-locations'] as $menu_id) { | ||
| echo 'ADD warning severity 10 - non-sanitized input variable'; | ||
| } | ||
| $functionsCookies = $_COOKIE; |
There was a problem hiding this comment.
| foreach ($_POST['menu-locations'] as $menu_id) { | ||
| echo 'ADD warning severity 10 - non-sanitized input variable'; | ||
| } | ||
| $functionsCookies = $_COOKIE; |
There was a problem hiding this comment.
🚫 Error: Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead (WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE).
| } | ||
| $functionsCookies = $_COOKIE; | ||
|
|
||
| $functionsPost = $_POST; |
There was a problem hiding this comment.
🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).
|
|
||
| $functionsPost = $_POST; | ||
|
|
||
| var_dump($functionsPost ); |
There was a problem hiding this comment.
|
|
||
| var_dump($functionsPost ); | ||
|
|
||
| session_write_close(); |
There was a problem hiding this comment.
🚫 Error: The use of PHP session function session_write_close() is prohibited (WordPressVIPMinimum.Functions.RestrictedFunctions.session_session_write_close).
|
|
||
| class Problem1Class | ||
| { | ||
| protected string $test; |
There was a problem hiding this comment.
🚫 Error: PHP syntax error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) (Generic.PHP.Syntax.PHPSyntax).
|
|
||
| public function test(): string | ||
| { | ||
| $functionsCookies = $_COOKIE; |
There was a problem hiding this comment.
|
|
||
| public function test(): string | ||
| { | ||
| $functionsCookies = $_COOKIE; |
There was a problem hiding this comment.
🚫 Error: Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead (WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
🚫 Error: Detected usage of a possibly undefined superglobal array index: $_POST['menu-locations']. Use isset() or empty() to check the index exists before using it (WordPress.Security.ValidatedSanitizedInput.InputNotValidated).
|
|
||
| public function test(): string | ||
| { | ||
| foreach ($_POST['menu-locations'] as $menu_id) { |
There was a problem hiding this comment.
No description provided.