problem in parseDSN
| From: | Colin Viebrock | Date: | Mon, 16 Apr 2001 18:06:42 +0000 |
| Subject: | problem in parseDSN | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-239@lists.php.net to get a copy of this message | ||
Am I mistaken or is the bracket going the wrong way in the parseDSN regex?
Shouldn't this change be made:
--- /pear/DB.php Tue Apr 10 12:15:06 2001
+++ DB.php Mon Apr 16 14:01:33 2001
@@ -412,7 +412,7 @@
// Get phptype and dbsyntax
// $str => phptype(dbsyntax)
- if (preg_match('|^([^(]+)\(([^(]*)\)$|', $str, $arr)) {
+ if (preg_match('|^([^(]+)\(([^)]*)\)$|', $str, $arr)) {
$parsed['phptype'] = $arr[1];
$parsed['dbsyntax'] = (empty($arr[2])) ? $arr[1] : $arr[2];
} else {
Or maybe even the shorter:
+ if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) {
--
Colin Viebrock
Co-Founder, easyDNS Technologies Inc.
http://www.easyDNS.com/