Skip to content

Commit b098ae9

Browse files
authored
Merge pull request #33 from abderrahmaneib/abderrahmaneib-patch-1
Fix Issue #19 - Correct output for CallbackFunction and SQLFunction Sniffs
2 parents ea4120b + 5b7358e commit b098ae9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Security/Sniffs/BadFunctions/CallbackFunctionsSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function process(File $phpcsFile, $stackPtr) {
4545
$msg = 'Function ' . $tokens[$stackPtr]['content'] . '() that supports callback detected';
4646
if ($s) {
4747
if ($utils::is_token_user_input($tokens[$s])) {
48-
$phpcsFile->addError($msg . ' with parameter directly from user input', $stackPtr, 'ErrFringestuff');
48+
$phpcsFile->addError($msg . ' with parameter directly from user input', $stackPtr, 'ErrCallbackFunctions');
4949
} else {
50-
$phpcsFile->addWarning($msg, $stackPtr, 'WarnFringestuff');
50+
$phpcsFile->addWarning($msg, $stackPtr, 'WarnCallbackFunctions');
5151
}
5252
}
5353
}

Security/Sniffs/BadFunctions/SQLFunctionsSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public function process(File $phpcsFile, $stackPtr) {
3838
if ($s) {
3939
$msg = 'SQL function ' . $tokens[$stackPtr]['content'] . '() detected with dynamic parameter ';
4040
if ($utils::is_token_user_input($tokens[$s])) {
41-
$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrFilesystem');
41+
$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrSQLFunction');
4242
} else {
43-
$phpcsFile->addWarning($msg, $stackPtr, 'WarnFilesystem');
43+
$phpcsFile->addWarning($msg, $stackPtr, 'WarnSQLFunction');
4444
}
4545
}
4646
}

0 commit comments

Comments
 (0)