From 0cbb4fdb71f88a5ac4ec3c38736734afe2a285bf Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 18 Sep 2004 14:59:54 +0000 Subject: [PATCH] fixed encoding of blob columns for all DB's --- phpgwapi/inc/class.db.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.db.inc.php b/phpgwapi/inc/class.db.inc.php index e073b514c2..788763e887 100644 --- a/phpgwapi/inc/class.db.inc.php +++ b/phpgwapi/inc/class.db.inc.php @@ -280,7 +280,6 @@ { return False; } - // the substring is needed as the string is already in quotes return $this->Link_ID->addq($str); } @@ -959,11 +958,15 @@ switch($type) { case 'blob': - if ($this->Type == 'mysql') + switch ($this->Link_ID->blobEncodeType) { - break; // ADOdb has no BlobEncode for mysql and returns an unquoted string !!! + case 'C': // eg. postgres + return "'" . $this->Link_ID->BlobEncode($value) . "'"; + case 'I': + return $this->Link_ID->BlobEncode($value); + default: + break; // handled like strings } - return "'" . $this->Link_ID->BlobEncode($value) . "'"; case 'date': return $this->Link_ID->DBDate($value); case 'timestamp':