Re: problem in parseDSN

From: Date: Mon, 16 Apr 2001 22:29:34 +0000
Subject: Re: problem in parseDSN
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-241@lists.php.net to get a copy of this message
["Colin Viebrock" <colin@easyDNS.com>] > 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, Could you supply a DSN that breaks? - Stig -- Stig Sæther Bakken <ssb@fast.no> Fast Search & Transfer ASA, Trondheim, Norway

« previous php.pear.dev (#241) next »