aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/postgres.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-08-06 05:52:41 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-08-06 05:52:41 +0000
commit2f901a520326b4d6941ef18fcfce0a9d5ef9cea5 (patch)
tree7ef08c7f0bedfed5f6a65278c8dc53194ac16d20 /phpBB/includes/db/postgres.php
parentb4b901b82552e639cae00c4dc38542cf6fe2d873 (diff)
downloadforums-2f901a520326b4d6941ef18fcfce0a9d5ef9cea5.tar
forums-2f901a520326b4d6941ef18fcfce0a9d5ef9cea5.tar.gz
forums-2f901a520326b4d6941ef18fcfce0a9d5ef9cea5.tar.bz2
forums-2f901a520326b4d6941ef18fcfce0a9d5ef9cea5.tar.xz
forums-2f901a520326b4d6941ef18fcfce0a9d5ef9cea5.zip
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
Diffstat (limited to 'phpBB/includes/db/postgres.php')
-rw-r--r--phpBB/includes/db/postgres.php19
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
*/