mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Do not use exit in Testcase environment (#28301)
# Fix: Do not use exit in Testcase environment Let tests continue in test case environment and allow identifying the cause for what would be an exit in a production setup.
This commit is contained in:
parent
f0ffe83fe6
commit
b3702b2467
|
|
@ -257,6 +257,11 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type, $stopcode = 1)
|
|||
// Note: No addition into security audit table is done because we don't want to execute code in such a case.
|
||||
// Detection of too many such requests can be done with a fail2ban rule on 403 error code or into the PHP server error log.
|
||||
|
||||
|
||||
if (class_exists('PHPUnit\Framework\TestSuite')) {
|
||||
$message = $errormessage.' '.substr($errormessage2, 2000);
|
||||
throw new Exception("Security injection exception: $message");
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user