|
From: Benjamin C. <bc...@us...> - 2004-05-03 13:06:59
|
Update of /cvsroot/phpbt/phpbt/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18535/inc Modified Files: Tag: htmltemplates functions.php Log Message: Added function for taint checking. Cleaned up database error reporting. Index: functions.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v retrieving revision 1.44.2.2 retrieving revision 1.44.2.3 diff -u -r1.44.2.2 -r1.44.2.3 --- functions.php 16 Sep 2003 11:39:34 -0000 1.44.2.2 +++ functions.php 3 May 2004 13:06:44 -0000 1.44.2.3 @@ -496,7 +496,13 @@ // Handle a database error function handle_db_error(&$obj) { - die($obj->message.'<br>'.$obj->userinfo); + define(RAWERROR, false); + if (!RAWERROR) { + show_text('A database error has occurred'); + } else { + show_text(htmlentities($obj->message).'<br>'.htmlentities($obj->userinfo)); + } + exit; } // Date() wrapper for smarty @@ -618,4 +624,13 @@ } } +// Check to make sure a bug is numeric +function check_id($id) { + if (!is_numeric($id) or !$id) { + show_text("Invalid ID"); + exit; + } + return $id; +} + ?> |