1
0
Fork 0

Some code reformatting

This commit is contained in:
Michael Vogel 2016-10-23 23:14:35 +00:00
parent b99f5b576e
commit 1ade94fd8a

View file

@ -221,13 +221,14 @@ class dba {
if ($result === false) { if ($result === false) {
logger('dba: ' . printable($sql) . ' returned false.' . "\n" . $this->error); logger('dba: ' . printable($sql) . ' returned false.' . "\n" . $this->error);
if (file_exists('dbfail.out')) if (file_exists('dbfail.out')) {
file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND); file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND);
}
} }
if (($result === true) || ($result === false)) if (($result === true) || ($result === false)) {
return $result; return $result;
}
if ($onlyquery) { if ($onlyquery) {
$this->result = $result; $this->result = $result;
return true; return true;
@ -250,8 +251,9 @@ class dba {
//$a->save_timestamp($stamp1, "database"); //$a->save_timestamp($stamp1, "database");
if ($this->debug) if ($this->debug) {
logger('dba: ' . printable(print_r($r, true))); logger('dba: ' . printable(print_r($r, true)));
}
return($r); return($r);
} }
@ -318,8 +320,9 @@ if (! function_exists('printable')) {
function printable($s) { function printable($s) {
$s = preg_replace("~([\x01-\x08\x0E-\x0F\x10-\x1F\x7F-\xFF])~",".", $s); $s = preg_replace("~([\x01-\x08\x0E-\x0F\x10-\x1F\x7F-\xFF])~",".", $s);
$s = str_replace("\x00",'.',$s); $s = str_replace("\x00",'.',$s);
if (x($_SERVER,'SERVER_NAME')) if (x($_SERVER,'SERVER_NAME')) {
$s = escape_tags($s); $s = escape_tags($s);
}
return $s; return $s;
}} }}
@ -327,8 +330,9 @@ function printable($s) {
if (! function_exists('dbg')) { if (! function_exists('dbg')) {
function dbg($state) { function dbg($state) {
global $db; global $db;
if ($db) if ($db) {
$db->dbg($state); $db->dbg($state);
}
}} }}
if (! function_exists('dbesc')) { if (! function_exists('dbesc')) {