diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-09-19 17:07:06 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-09-19 17:37:10 +0200 |
commit | 0df7e5eefa245559d3a1e1c0318fba0011513a9c (patch) | |
tree | 8b70fe59049ee219055506c41a8a24d0b08d80ed | |
parent | 12530a763b436c3d01d2668999dc343a95926389 (diff) | |
download | forums-0df7e5eefa245559d3a1e1c0318fba0011513a9c.tar forums-0df7e5eefa245559d3a1e1c0318fba0011513a9c.tar.gz forums-0df7e5eefa245559d3a1e1c0318fba0011513a9c.tar.bz2 forums-0df7e5eefa245559d3a1e1c0318fba0011513a9c.tar.xz forums-0df7e5eefa245559d3a1e1c0318fba0011513a9c.zip |
[ticket/10370] Ease up code checking for arguments of include etc.
PHPBB3-10370
-rw-r--r-- | phpBB/includes/functions.php | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b203dcbea3..5f90093bd0 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3401,22 +3401,15 @@ function get_backtrace() { // Strip the current directory from path $trace['file'] = (empty($trace['file'])) ? '' : phpbb_filter_root_path($trace['file']); - $args = array(); - // If include/require/include_once is not called, do not show arguments - they may contain sensible information - if (!in_array($trace['function'], array('include', 'require', 'include_once'))) - { - unset($trace['args']); - } - else + // Only show function arguments for include etc. + // Other parameters may contain sensible information + $args = array(); + if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once'))) { - // Path... - if (!empty($trace['args'][0])) - { - $argument = htmlspecialchars($trace['args'][0]); - $argument = phpbb_filter_root_path($argument); - $args[] = "'{$argument}'"; - } + $argument = htmlspecialchars($trace['args'][0]); + $argument = phpbb_filter_root_path($argument); + $args[] = "'{$argument}'"; } $trace['class'] = (!isset($trace['class'])) ? '' : $trace['class']; |