function InsecureUnserializeSniff::fail
Record a violation of the standard.
Parameters
\PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.:
int $position The stack position of the violation.:
Return value
void
1 call to InsecureUnserializeSniff::fail()
- InsecureUnserializeSniff::processFunctionCall in vendor/
drupal/ coder/ coder_sniffer/ DrupalPractice/ Sniffs/ FunctionCalls/ InsecureUnserializeSniff.php - Processes this function call.
File
-
vendor/
drupal/ coder/ coder_sniffer/ DrupalPractice/ Sniffs/ FunctionCalls/ InsecureUnserializeSniff.php, line 96
Class
- InsecureUnserializeSniff
- Check that unserialize() limits classes that may be unserialized.
Namespace
DrupalPractice\Sniffs\FunctionCallsCode
protected function fail(File $phpcsFile, int $position) {
$phpcsFile->addError('unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.', $position, 'InsecureUnserialize');
}