Correct Postgresql connection with space in password. Work around php bug

This commit is contained in:
Brice Maron 2012-07-04 10:13:00 +00:00
parent 799e34acd4
commit 3b09aa8578
1 changed files with 8 additions and 0 deletions

View File

@ -128,6 +128,14 @@ class OC_DB {
}else{ }else{
$dsn='pgsql:dbname='.$name.';host='.$host; $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; break;
} }
try{ try{