Don't pollute the DSN with non-connection related data.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 3 Nov 2010 04:07:47 +0000 (00:07 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 3 Nov 2010 04:07:47 +0000 (00:07 -0400)
Not sure if there's a better place to do this or not...if so, happy to
move it.

Bug: 9355

framework/Core/lib/Horde/Core/Factory/Db.php

index 7c5c17e..6fab127 100644 (file)
@@ -85,6 +85,19 @@ class Horde_Core_Factory_Db
             return $this->_instances[$sig];
         }
 
+        // Prevent DSN from getting polluted
+        if ($type == 'auth' && $conf['driver'] == 'custom') {
+            unset($conf['query_auth'],
+                  $conf['query_add'],
+                  $conf['query_getpw'],
+                  $conf['query_update'],
+                  $conf['query_resetpassword'],
+                  $conf['query_remove'],
+                  $conf['query_list'],
+                  $conf['query_exists'],
+                  $conf['encryption'],
+                  $conf['show_encryption']);
+        }
         try {
             $this->_instances[$sig] = $this->_createDb($config);
         } catch (Horde_Exception $e) {