diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 8 | ||||
-rw-r--r-- | includes/database.pgsql.inc | 5 |
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\\"); } /** |