]> granicus.if.org Git - php/commitdiff
(DB::parseDSN) check for an extra / at the end purely to guard against
authorAndrei Zmievski <andrei@php.net>
Tue, 7 Dec 1999 21:38:51 +0000 (21:38 +0000)
committerAndrei Zmievski <andrei@php.net>
Tue, 7 Dec 1999 21:38:51 +0000 (21:38 +0000)
               user error

pear/DB.php

index 52c50c791962b95f9a9ef9d18b8fd14e81cc0757..55597673453b756f4677b93dacf6006c4cea14df 100644 (file)
@@ -206,7 +206,7 @@ class DB {
                        return $parsed; // XXX ADDREF
                }
 
-               if (preg_match('|^(.*)/([^/]+)$|', $dsn, &$arr)) {
+               if (preg_match('|^(.*)/([^/]+)/?$|', $dsn, &$arr)) {
                        $parsed['database'] = $arr[2];
                        $dsn = $arr[1];
                }
@@ -226,7 +226,7 @@ class DB {
                }
 
                if (!$parsed['database'])
-                       $dsn = preg_replace('|/+$|', '', $dsn);
+                       $dsn = preg_replace('|/+$|', '', &$dsn);
 
                $parsed['hostspec'] = $dsn;