diff options
author | Friendika <info@friendika.com> | 2010-12-07 19:40:12 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-12-07 19:40:12 -0800 |
commit | e241c401cf21108f39f67e54f64f50ad139af221 (patch) | |
tree | 287e6568475d0a5b168b1ac8ee9c1883838a915a /include/dba.php | |
parent | 5763d31b4f213fbb2eea4d366a9c7ad534a7f1ec (diff) | |
download | volse-hubzilla-e241c401cf21108f39f67e54f64f50ad139af221.tar.gz volse-hubzilla-e241c401cf21108f39f67e54f64f50ad139af221.tar.bz2 volse-hubzilla-e241c401cf21108f39f67e54f64f50ad139af221.zip |
significantly enhanced profile security
Diffstat (limited to 'include/dba.php')
-rw-r--r-- | include/dba.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/include/dba.php b/include/dba.php index 4e3f11f7b..fd403b560 100644 --- a/include/dba.php +++ b/include/dba.php @@ -1,12 +1,15 @@ <?php -// MySQL database class -// -// For debugging, insert 'dbg(x);' anywhere in the program flow. -// x = 1: display db success/failure following content -// x = 2: display full queries following content -// x = 3: display full queries using echo; which will mess up display -// really bad but will return output in stubborn cases. +/** + * + * MySQL database class + * + * For debugging, insert 'dbg(1);' anywhere in the program flow. + * dbg(0); will turn it off. Logging is performed at LOGGER_DATA level. + * When logging, all binary info is converted to text and html entities are escaped so that + * the debugging stream is safe to view within both terminals and web pages. + * + */ if(! class_exists('dba')) { class dba { @@ -51,6 +54,13 @@ class dba { logger('dba: ' . $str ); } else { + + /* + * If dbfail.out exists, we will write any failed calls directly to it, + * regardless of any logging that may or may nor be in effect. + * These usually indicate SQL syntax errors that need to be resolved. + */ + if($result === false) { logger('dba: ' . printable($sql) . ' returned false.'); if(file_exists('dbfail.out')) |