From 0df7e5eefa245559d3a1e1c0318fba0011513a9c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 19 Sep 2011 17:07:06 +0200 Subject: [PATCH] [ticket/10370] Ease up code checking for arguments of include etc. PHPBB3-10370 --- phpBB/includes/functions.php | 21 +++++++-------------- 1 file 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'))) + // 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'))) { - unset($trace['args']); - } - else - { - // 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'];