forked from extern/egroupware
"additionally using the port for the pdo connection and remove password from stacktrace of failed connection"
This commit is contained in:
parent
b86449d359
commit
48734de102
@ -1270,15 +1270,25 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
|||||||
switch($egw_db->Type)
|
switch($egw_db->Type)
|
||||||
{
|
{
|
||||||
case 'mysqlt':
|
case 'mysqlt':
|
||||||
$dsn = 'mysql:host='.$egw_db->Host.';dbname='.$egw_db->Database;
|
$type = 'mysql';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$dsn = $egw_db->Type.':host='.$egw_db->Host.';dbname='.$egw_db->Database;
|
$type = $egw_db->Type;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
self::$pdo = new PDO($dsn,$egw_db->User,$egw_db->Password);
|
switch($type)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
$dsn = $egw_db->Type.':host='.$egw_db->Host.';port='.$egw_db->Port.';dbname='.$egw_db->Database;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$egw_db->Password .= 'x';
|
||||||
|
try {
|
||||||
|
self::$pdo = new PDO($dsn,$egw_db->User,$egw_db->Password);
|
||||||
|
} catch(Exception $e) {
|
||||||
|
// Exception reveals password, so we ignore the exception and connect again without pw, to get the right exception without pw
|
||||||
|
self::$pdo = new PDO($dsn,$egw_db->User,'$egw_db->Password');
|
||||||
|
}
|
||||||
// set client charset of the connection
|
// set client charset of the connection
|
||||||
$charset = $GLOBALS['egw']->translation->charset();
|
$charset = $GLOBALS['egw']->translation->charset();
|
||||||
switch($server['db_type'])
|
switch($server['db_type'])
|
||||||
|
Loading…
Reference in New Issue
Block a user