summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>1999-12-07 21:30:38 +0000
committerAndrei Zmievski <andrei@php.net>1999-12-07 21:30:38 +0000
commit9c89f731e8802fcb3b42a87dfb214ac42f654bae (patch)
tree68614eb94093a1797d9f9bb1819022df07cfbe55
parentb9f27a4743e153edbcb18afcc23a944a70950d81 (diff)
downloadphp-git-9c89f731e8802fcb3b42a87dfb214ac42f654bae.tar.gz
(DB::parseDSN) Remove extraneous / at the end of the spec if no database
is specified.
-rw-r--r--pear/DB.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/pear/DB.php b/pear/DB.php
index 9585be30ed..52c50c7919 100644
--- a/pear/DB.php
+++ b/pear/DB.php
@@ -225,6 +225,9 @@ class DB {
$dsn = $arr[2];
}
+ if (!$parsed['database'])
+ $dsn = preg_replace('|/+$|', '', $dsn);
+
$parsed['hostspec'] = $dsn;
if (!$parsed['dbsyntax']) {