From 68a6c53a57156a5efb2073b1eb3f2d79a46c9dc2 Mon Sep 17 00:00:00 2001 From: jmarcil Date: Mon, 5 Aug 2019 12:34:55 -0700 Subject: [PATCH] solves #40 --- Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php b/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php index bb951f7..842779b 100644 --- a/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php +++ b/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php @@ -34,6 +34,9 @@ public function process(File $phpcsFile, $stackPtr) { return; } $opener = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr, null, false, null, true); + if (!$opener) { + return; + } $closer = $tokens[$opener]['parenthesis_closer']; $s = $stackPtr + 1; $s = $phpcsFile->findNext(array_merge(\PHP_CodeSniffer\Util\Tokens::$emptyTokens, \PHP_CodeSniffer\Util\Tokens::$bracketTokens, \PHPCS_SecurityAudit\Sniffs\Utils::$staticTokens, array(T_STRING_CONCAT)), $s, $closer, true);