Permalink
Browse files

fixed a bug when the dsn is passed as an array to singleton and it do…

…es not contain all possible entries

git-svn-id: http://svn.php.net/repository/pear/packages/MDB/trunk@148070 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 2188c03 commit e797eef2a7a61b7e5dc2077fa4d02e992deed533 Lukas Smith committed Jan 7, 2004
Showing with 1 addition and 1 deletion.
  1. +1 −1 MDB.php
View
@@ -340,7 +340,7 @@ function &singleton($dsn = null, $options = false)
$keys = array_keys($GLOBALS['_MDB_databases']);
for ($i=0, $j=count($keys); $i<$j; ++$i) {
$tmp_dsn = $GLOBALS['_MDB_databases'][$keys[$i]]->getDSN('array');
- if (count(array_diff($dsninfo, $tmp_dsn)) == 0) {
+ if (count(array_diff($tmp_dsn, $dsninfo)) == 0) {
MDB::setOptions($GLOBALS['_MDB_databases'][$keys[$i]], $options);
return $GLOBALS['_MDB_databases'][$keys[$i]];
}

0 comments on commit e797eef

Please sign in to comment.