]> granicus.if.org Git - php/commitdiff
(DB::parseDSN) Remove extraneous / at the end of the spec if no database
authorAndrei Zmievski <andrei@php.net>
Tue, 7 Dec 1999 21:30:38 +0000 (21:30 +0000)
committerAndrei Zmievski <andrei@php.net>
Tue, 7 Dec 1999 21:30:38 +0000 (21:30 +0000)
               is specified.

pear/DB.php

index 9585be30edd9b4eda280dfee532d3c7f238fcadb..52c50c791962b95f9a9ef9d18b8fd14e81cc0757 100644 (file)
@@ -225,6 +225,9 @@ class DB {
                        $dsn = $arr[2];
                }
 
+               if (!$parsed['database'])
+                       $dsn = preg_replace('|/+$|', '', $dsn);
+
                $parsed['hostspec'] = $dsn;
 
                if (!$parsed['dbsyntax']) {