mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix preg_match call without delimiter and also use preg_quote() to variable used in pattern
This commit is contained in:
parent
7c2ca1543c
commit
63cbb6551b
@ -909,7 +909,7 @@ function pfSense_clear_globals() {
|
||||
$error = error_get_last();
|
||||
|
||||
// Errors generated by user code (diag_commands.php) are identified by path and not added to notices
|
||||
if ($error !== NULL && !preg_match('^' . $g['tmp_path_user_code'] . '/[^/]{1,16}$', $error['file'])) {
|
||||
if ($error !== NULL && !preg_match('|^' . preg_quote($g['tmp_path_user_code']) . '/[^/]{1,16}$|', $error['file'])) {
|
||||
if (in_array($error['type'], array(E_ERROR, E_COMPILE_ERROR, E_CORE_ERROR, E_RECOVERABLE_ERROR))) {
|
||||
$errorstr = "PHP ERROR: Type: {$error['type']}, File: {$error['file']}, Line: {$error['line']}, Message: {$error['message']}";
|
||||
print($errorstr);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user