summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/config.lib.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-05-30 07:44:44 -0300
committerRenato Botelho <renato@netgate.com>2017-05-30 07:44:44 -0300
commit63cbb6551bf3ec7c72a49e148f68fa6ac0ae85b5 (patch)
tree59980852b7dcc7e06c060eadcf96c48b0baac8f7 /src/etc/inc/config.lib.inc
parent7c2ca1543c5e0776711ae53e9c3e83224ac592ad (diff)
downloadpfsense-63cbb6551bf3ec7c72a49e148f68fa6ac0ae85b5.zip
pfsense-63cbb6551bf3ec7c72a49e148f68fa6ac0ae85b5.tar.gz
Fix preg_match call without delimiter and also use preg_quote() to variable used in pattern
Diffstat (limited to 'src/etc/inc/config.lib.inc')
-rw-r--r--src/etc/inc/config.lib.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc
index b1174fa..c700052 100644
--- a/src/etc/inc/config.lib.inc
+++ b/src/etc/inc/config.lib.inc
@@ -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);
OpenPOWER on IntegriCloud