diff --git a/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php b/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php index 9ebaf5b..bb951f7 100644 --- a/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php +++ b/Security/Sniffs/BadFunctions/SystemExecFunctionsSniff.php @@ -30,6 +30,9 @@ public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); if (in_array($tokens[$stackPtr]['content'], $utils::getSystemexecFunctions())) { + if ($tokens[$stackPtr - 1]['code'] == T_OBJECT_OPERATOR) { + return; + } $opener = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr, null, false, null, true); $closer = $tokens[$opener]['parenthesis_closer']; $s = $stackPtr + 1;