Skip to content

Commit

Permalink
Merge pull request #33 from abderrahmaneib/abderrahmaneib-patch-1
Browse files Browse the repository at this point in the history
Fix Issue #19 - Correct output for CallbackFunction and SQLFunction Sniffs
  • Loading branch information
jmarcil authored Aug 4, 2019
2 parents ea4120b + 5b7358e commit b098ae9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Security/Sniffs/BadFunctions/CallbackFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function process(File $phpcsFile, $stackPtr) {
$msg = 'Function ' . $tokens[$stackPtr]['content'] . '() that supports callback detected';
if ($s) {
if ($utils::is_token_user_input($tokens[$s])) {
$phpcsFile->addError($msg . ' with parameter directly from user input', $stackPtr, 'ErrFringestuff');
$phpcsFile->addError($msg . ' with parameter directly from user input', $stackPtr, 'ErrCallbackFunctions');
} else {
$phpcsFile->addWarning($msg, $stackPtr, 'WarnFringestuff');
$phpcsFile->addWarning($msg, $stackPtr, 'WarnCallbackFunctions');
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Security/Sniffs/BadFunctions/SQLFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public function process(File $phpcsFile, $stackPtr) {
if ($s) {
$msg = 'SQL function ' . $tokens[$stackPtr]['content'] . '() detected with dynamic parameter ';
if ($utils::is_token_user_input($tokens[$s])) {
$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrFilesystem');
$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrSQLFunction');
} else {
$phpcsFile->addWarning($msg, $stackPtr, 'WarnFilesystem');
$phpcsFile->addWarning($msg, $stackPtr, 'WarnSQLFunction');
}
}
}
Expand Down

0 comments on commit b098ae9

Please sign in to comment.