]> source.dussan.org Git - nextcloud-server.git/commitdiff
Correct Postgresql connection with space in password. Work around php bug
authorBrice Maron <brice@bmaron.net>
Wed, 4 Jul 2012 10:13:00 +0000 (10:13 +0000)
committerBrice Maron <brice@bmaron.net>
Wed, 4 Jul 2012 10:13:00 +0000 (10:13 +0000)
lib/db.php

index ffa0d37307a51c3d39e6eff6babf492bf48a8c16..2a06d72ea323db8e4e0e53f168fe982335814523 100644 (file)
@@ -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{