Browse Source

* fix handling of broken DSNs like Colin suggested

PHP-4.0.6
Stig Bakken 26 years ago
parent
commit
b16f38e2e7
  1. 2
      pear/DB.php

2
pear/DB.php

@ -425,7 +425,7 @@ class DB
// Get phptype and dbsyntax // Get phptype and dbsyntax
// $str => phptype(dbsyntax) // $str => phptype(dbsyntax)
if (preg_match('|^([^(]+)\(([^(]*)\)$|', $str, $arr)) {
if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) {
$parsed['phptype'] = $arr[1]; $parsed['phptype'] = $arr[1];
$parsed['dbsyntax'] = (empty($arr[2])) ? $arr[1] : $arr[2]; $parsed['dbsyntax'] = (empty($arr[2])) ? $arr[1] : $arr[2];
} else { } else {

Loading…
Cancel
Save