diff options
author | stilez <stilez@users.noreply.github.com> | 2017-05-27 14:14:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-27 14:14:46 +0100 |
commit | ff4e29fb9d048162f0d4d28b0c3e818ed2c1fd8e (patch) | |
tree | 128242bba60382e7fc0494a50cca89183c3285dd /src/etc/inc/config.lib.inc | |
parent | 1155cd631886c4814be6a1e42b0a441c80cf40e7 (diff) | |
download | pfsense-ff4e29fb9d048162f0d4d28b0c3e818ed2c1fd8e.zip pfsense-ff4e29fb9d048162f0d4d28b0c3e818ed2c1fd8e.tar.gz |
Don't create system notices for errors in user-entered ad-hoc PHP (diag_command.php)
Diffstat (limited to 'src/etc/inc/config.lib.inc')
-rw-r--r-- | src/etc/inc/config.lib.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc index 40c3150..b1174fa 100644 --- a/src/etc/inc/config.lib.inc +++ b/src/etc/inc/config.lib.inc @@ -908,7 +908,8 @@ function pfSense_clear_globals() { $error = error_get_last(); - if ($error !== NULL) { + // 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 (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); |