mirror of
https://github.com/friendica/friendica
synced 2024-11-17 22:23:41 +00:00
make debugging safe
This commit is contained in:
parent
1f2f483531
commit
8d0ba93436
1 changed files with 8 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue