diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-05-08 16:36:29 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-05-08 16:36:29 -0400 |
commit | b7062f4b21f09ed5921af66449f05d48ece59727 (patch) | |
tree | e78626e46a6275002e4f6a457a7b12dc75615a2e /includes | |
parent | 98256f2df186f4b7a969862709646308b0784a10 (diff) | |
download | brdo-b7062f4b21f09ed5921af66449f05d48ece59727.tar.gz brdo-b7062f4b21f09ed5921af66449f05d48ece59727.tar.bz2 |
- Patch #958850 by bellHead: Postgres password containing backslashes don't work.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/database/pgsql/database.inc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc index f01f7b50b..98b954ffd 100644 --- a/includes/database/pgsql/database.inc +++ b/includes/database/pgsql/database.inc @@ -34,6 +34,15 @@ class DatabaseConnection_pgsql extends DatabaseConnection { if (empty($connection_options['password'])) { $connection_options['password'] = NULL; } + // If the password contains a backslash it is treated as an escape character + // http://bugs.php.net/bug.php?id=53217 + // so backslashes in the password need to be doubled up. + // The bug was reported against pdo_pgsql 1.0.2, backslashes in passwords + // will break on this doubling up when the bug is fixed, so check the version + //elseif (phpversion('pdo_pgsql') < 'version_this_was_fixed_in') { + else { + $connection_options['password'] = str_replace('\\', '\\\\', $connection_options['password']); + } $this->connectionOptions = $connection_options; |