From: Denis Ovsienko Date: Sat, 2 Aug 2008 22:50:55 +0000 (+0000) Subject: r2102 + showError(): don't reveal the full path to the file X-Git-Tag: RackTables-0.16.2~56 X-Git-Url: https://code.racktables.org/racktables/commitdiff_plain/04f110a0a4c1ee93e4da5a994341ff0ab5fdf340 r2102 + showError(): don't reveal the full path to the file --- diff --git a/inc/interface.php b/inc/interface.php index bdf263e2..798eec63 100644 --- a/inc/interface.php +++ b/inc/interface.php @@ -171,10 +171,14 @@ function renderRow ($row_id = 0) echo ""; } -function showError ($info = '', $funcname = 'N/A') +function showError ($info = '', $location = 'N/A') { global $root; - echo "
An error has occured in [${funcname}]. "; + if (preg_match ('/\.php$/', $location)) + $location = basename ($location); + elseif ($location != 'N/A') + $location = $location . '()'; + echo "
An error has occured in [${location}]. "; if (empty ($info)) echo 'No additional information is available.'; else