From 141c4c1eddb3718d62e2870a13fc07a17412f402 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 25 Oct 2011 07:51:04 +0000 Subject: [PATCH] casting boolean explicitly to string, as ADODB_postgres64::qstr() has an unwanted special handling for boolean types, causing eg. query in CalDAV for resources throw an invalid SQL exception under PostgreSQL --- phpgwapi/inc/class.egw_db.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index 96542e3817..de7bdb0de3 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -1473,6 +1473,10 @@ class egw_db { $value = substr($value,0,$length); } + // casting boolean explicitly to string, as ADODB_postgres64::qstr() has an unwanted special handling + // for boolean types, causing it to return "true" or "false" and not a quoted string like "'1'"! + if (is_bool($value)) $value = (string)$value; + return $this->Link_ID->qstr($value); }