From b7890a9ba46bfe0d38ceae47daed396ce6f90a32 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 14 Apr 2004 09:28:18 +0000 Subject: [PATCH] fix for ADOdb's missing BlobEncode function for mysql, that caused a lot SQL-errors in email --- phpgwapi/inc/class.db.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpgwapi/inc/class.db.inc.php b/phpgwapi/inc/class.db.inc.php index 599565209a..c39bcc56c9 100644 --- a/phpgwapi/inc/class.db.inc.php +++ b/phpgwapi/inc/class.db.inc.php @@ -275,6 +275,7 @@ { return False; } +if (is_array($str)) $this->halt('db::db_addslashes('.print_r($str,True).",'$type') 1. arguments is an array!!!"); // the substring is needed as the string is already in quotes return substr($this->Link_ID->quote($str),1,-1); } @@ -849,6 +850,8 @@ */ function quote($value,$type=False) { + if ($this->Debug) echo "

db::quote('$value','$type')

\n"; + switch($type) { case 'int': @@ -868,6 +871,10 @@ switch($type) { case 'blob': + if ($this->Type == 'mysql') + { + break; // ADOdb has no BlobEncode for mysql and returns an unquoted string !!! + } return "'" . $this->Link_ID->BlobEncode($value) . "'"; } return $this->Link_ID->quote($value); @@ -896,6 +903,8 @@ { $column_definitions = $this->column_definitions; } + if ($this->Debug) echo "

db::column_data_implode('$glue',".print_r($array,True).",'$use_key',".print_r($only,True).",

".print_r($column_definitions,True)."
\n"; + $keys = $values = array(); foreach($array as $key => $data) {