diff options
author | Andrei Zmievski <andrei@php.net> | 1999-12-07 21:38:51 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 1999-12-07 21:38:51 +0000 |
commit | 44f6f66bd28289b00e9f08234b92ceaa2a467416 (patch) | |
tree | 6f284da879c70589f572b4957fe6391957a1c5c0 /pear/DB.php | |
parent | 9c89f731e8802fcb3b42a87dfb214ac42f654bae (diff) | |
download | php-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.php | 4 |
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; |