aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-07 19:40:12 -0800
committerFriendika <info@friendika.com>2010-12-07 19:40:12 -0800
commite241c401cf21108f39f67e54f64f50ad139af221 (patch)
tree287e6568475d0a5b168b1ac8ee9c1883838a915a /include/dba.php
parent5763d31b4f213fbb2eea4d366a9c7ad534a7f1ec (diff)
downloadvolse-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.php24
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'))