diff options
Diffstat (limited to 'phpBB/includes/db/postgres.php')
-rw-r--r-- | phpBB/includes/db/postgres.php | 19 |
1 files changed, 18 insertions, 1 deletions
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; } /** @@ -379,6 +388,14 @@ class dbal_postgres extends dbal } /** + * Escape string used in sql query + */ + function sql_escape_binary($msg) + { + return "'" . @pg_escape_bytea($msg) . "'"; + } + + /** * return sql error array * @access: private */ |