summaryrefslogtreecommitdiff
path: root/pear/DB.php
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>1999-12-07 21:38:51 +0000
committerAndrei Zmievski <andrei@php.net>1999-12-07 21:38:51 +0000
commit44f6f66bd28289b00e9f08234b92ceaa2a467416 (patch)
tree6f284da879c70589f572b4957fe6391957a1c5c0 /pear/DB.php
parent9c89f731e8802fcb3b42a87dfb214ac42f654bae (diff)
downloadphp-git-44f6f66bd28289b00e9f08234b92ceaa2a467416.tar.gz
(DB::parseDSN) check for an extra / at the end purely to guard against
user error
Diffstat (limited to 'pear/DB.php')
-rw-r--r--pear/DB.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/pear/DB.php b/pear/DB.php
index 52c50c7919..5559767345 100644
--- a/pear/DB.php
+++ b/pear/DB.php
@@ -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;