|
|
@ -1184,7 +1184,6 @@ class rcube_db
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Find protocol and hostspec
|
|
|
|
// Find protocol and hostspec
|
|
|
|
|
|
|
|
|
|
|
|
// $dsn => proto(proto_opts)/database
|
|
|
|
// $dsn => proto(proto_opts)/database
|
|
|
|
if (preg_match('|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) {
|
|
|
|
if (preg_match('|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) {
|
|
|
|
$proto = $match[1];
|
|
|
|
$proto = $match[1];
|
|
|
@ -1200,7 +1199,7 @@ class rcube_db
|
|
|
|
&& strpos($dsn, '/', 2) !== false
|
|
|
|
&& strpos($dsn, '/', 2) !== false
|
|
|
|
&& $parsed['phptype'] == 'oci8'
|
|
|
|
&& $parsed['phptype'] == 'oci8'
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
//oracle's "Easy Connect" syntax:
|
|
|
|
// Oracle's "Easy Connect" syntax:
|
|
|
|
// "username/password@[//]host[:port][/service_name]"
|
|
|
|
// "username/password@[//]host[:port][/service_name]"
|
|
|
|
// e.g. "scott/tiger@//mymachine:1521/oracle"
|
|
|
|
// e.g. "scott/tiger@//mymachine:1521/oracle"
|
|
|
|
$proto_opts = $dsn;
|
|
|
|
$proto_opts = $dsn;
|
|
|
@ -1230,17 +1229,18 @@ class rcube_db
|
|
|
|
$parsed['socket'] = $proto_opts;
|
|
|
|
$parsed['socket'] = $proto_opts;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get dabase if any
|
|
|
|
// Get database if any
|
|
|
|
// $dsn => database
|
|
|
|
// $dsn => database
|
|
|
|
if ($dsn) {
|
|
|
|
if ($dsn) {
|
|
|
|
// /database
|
|
|
|
// /database
|
|
|
|
if (($pos = strpos($dsn, '?')) === false) {
|
|
|
|
if (($pos = strpos($dsn, '?')) === false) {
|
|
|
|
$parsed['database'] = rawurldecode($dsn);
|
|
|
|
$parsed['database'] = rawurldecode($dsn);
|
|
|
|
// /database?param1=value1¶m2=value2
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
// /database?param1=value1¶m2=value2
|
|
|
|
$parsed['database'] = rawurldecode(substr($dsn, 0, $pos));
|
|
|
|
$parsed['database'] = rawurldecode(substr($dsn, 0, $pos));
|
|
|
|
$dsn = substr($dsn, $pos + 1);
|
|
|
|
$dsn = substr($dsn, $pos + 1);
|
|
|
|
|
|
|
|
|
|
|
|
if (strpos($dsn, '&') !== false) {
|
|
|
|
if (strpos($dsn, '&') !== false) {
|
|
|
|
$opts = explode('&', $dsn);
|
|
|
|
$opts = explode('&', $dsn);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1255,6 +1255,9 @@ class rcube_db
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// remove problematic suffix (#7034)
|
|
|
|
|
|
|
|
$parsed['database'] = preg_replace('/;.*$/', '', $parsed['database']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $parsed;
|
|
|
|
return $parsed;
|
|
|
|