From 2f901a520326b4d6941ef18fcfce0a9d5ef9cea5 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 6 Aug 2006 05:52:41 +0000 Subject: This should end some issues we have been having regarding the proper binary encoding of stuff. :D Acyd Burn: quit breaking the schema :P git-svn-id: file:///svn/phpbb/trunk@6238 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/postgres.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/db/postgres.php') diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index c928a936d9..03fd5c17ce 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -258,7 +258,16 @@ class dbal_postgres extends dbal return $cache->sql_fetchrow($query_id); } - return ($query_id) ? @pg_fetch_assoc($query_id, NULL) : false; + $row = @pg_fetch_assoc($query_id, null); + if ($row) + { + foreach ($row as $key => $value) + { + $row[$key] = (strpos($key, 'bitfield') === false) ? $value : pg_unescape_bytea($value); + } + } + + return ($query_id) ? $row : false; } /** @@ -378,6 +387,14 @@ class dbal_postgres extends dbal return @pg_escape_string($msg); } + /** + * Escape string used in sql query + */ + function sql_escape_binary($msg) + { + return "'" . @pg_escape_bytea($msg) . "'"; + } + /** * return sql error array * @access: private -- cgit v1.2.1