aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-11 22:24:08 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-11 22:24:08 -0700
commit8d0ba934364fbb65e66edf1b2cda24ebd8afb96b (patch)
tree44c027f7515d004fc917c0c6bf73b72eb68b4401 /include
parent1f2f483531c8ca59d429aa0c3fe6124fd09c2a00 (diff)
downloadvolse-hubzilla-8d0ba934364fbb65e66edf1b2cda24ebd8afb96b.tar.gz
volse-hubzilla-8d0ba934364fbb65e66edf1b2cda24ebd8afb96b.tar.bz2
volse-hubzilla-8d0ba934364fbb65e66edf1b2cda24ebd8afb96b.zip
make debugging safe
Diffstat (limited to 'include')
-rw-r--r--include/dba.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/dba.php b/include/dba.php
index 09d07322c..48dcc12a9 100644
--- a/include/dba.php
+++ b/include/dba.php
@@ -65,11 +65,9 @@ class dba {
}
if($this->debug == 2)
- $debug_text .= print_r($r, true). EOL;
-// $debug_text .= quoted_printable_encode(print_r($r, true). EOL);
+ $debug_text .= printable(print_r($r, true). EOL);
elseif($this->debug == 3)
- echo print_r($r, true) . EOL ;
-// echo quoted_printable_encode(print_r($r, true) . EOL) ;
+ echo printable(print_r($r, true) . EOL) ;
return($r);
}
@@ -87,6 +85,12 @@ class dba {
}
}}
+if(! function_exists('printable')) {
+function printable($s) {
+ $s = preg_replace("~([\x01-\x08\x0E-\x0F\x10-\x1F\x7F-\xFF])~",".", $s);
+ return(escape_tags(str_replace("\x00",'.',$s)));
+}}
+
// Procedural functions
if(! function_exists('dbg')) {
function dbg($state) {