From 3b09aa8578702a403e06e6359a19013b573443bc Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Wed, 4 Jul 2012 10:13:00 +0000 Subject: [PATCH] Correct Postgresql connection with space in password. Work around php bug --- lib/db.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/db.php b/lib/db.php index ffa0d37307..2a06d72ea3 100644 --- a/lib/db.php +++ b/lib/db.php @@ -128,6 +128,14 @@ class OC_DB { }else{ $dsn='pgsql:dbname='.$name.';host='.$host; } + /** + * Ugly fix for pg connections pbm when password use spaces + */ + $e_user = addslashes($user); + $e_password = addslashes($pass); + $pass = $user = null; + $dsn .= ";user='$e_user';password='$e_password'"; + /** END OF FIX***/ break; } try{