summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-09-20 17:58:14 +0000
committerDries Buytaert <dries@buytaert.net>2004-09-20 17:58:14 +0000
commit228b3c7cc84717e5deae769d7aa3a3e29fdae6a1 (patch)
tree2e307dc713e8c14acf6ed4e699989fc742bdf017 /includes
parent4fe5b52a219c7b2d7183003fe3b2a0bea5fa13bd (diff)
downloadbrdo-228b3c7cc84717e5deae769d7aa3a3e29fdae6a1.tar.gz
brdo-228b3c7cc84717e5deae769d7aa3a3e29fdae6a1.tar.bz2
- Patch #10945 by Adrian: more PostgreSQL fixes/updates.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc8
-rw-r--r--includes/database.pgsql.inc5
2 files changed, 9 insertions, 4 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 7a0a37ac4..174ca6243 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -118,7 +118,11 @@ function variable_del($name) {
*/
function cache_get($key) {
$cache = db_fetch_object(db_query("SELECT data, created, headers FROM {cache} WHERE cid = '%s'", $key));
- return isset($cache->data) ? $cache : 0;
+ if (isset($cache->data)) {
+ $cache->data = db_decode_blob($cache->data);
+ return $cache;
+ }
+ return 0;
}
/**
@@ -271,7 +275,7 @@ function drupal_page_header() {
header($header);
}
- print db_decode_blob($cache->data);
+ print $cache->data;
// Call all init() and exit() hooks without including all modules.
// Only use those hooks for critical operations.
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index 95a36d3fa..3829b0920 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -23,7 +23,8 @@
function db_connect($url) {
$url = parse_url($url);
- $conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) .' password='. $url['pass'];
+ $conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) .' password='. $url['pass'] . ' host=' . $url['host'];
+ $conn_string .= ($url['port']) ? ' port=' . $url['port'] : '';
$connection = pg_connect($conn_string) or die(pg_last_error());
return $connection;
@@ -263,7 +264,7 @@ function db_query_range($query) {
* Encoded data.
*/
function db_encode_blob($data) {
- return pg_escape_bytea($data);
+ return addcslashes($data, "\0..\37\\");
}
/**