protected function checkOnlyDatabase()
{
if (is_string($GLOBALS['cfg']['Server']['only_db']) && strlen($GLOBALS['cfg']['Server']['only_db']) > 0) {
$GLOBALS['cfg']['Server']['only_db'] = array($GLOBALS['cfg']['Server']['only_db']);
}
if (!is_array($GLOBALS['cfg']['Server']['only_db'])) {
return false;
}
$items = array();
foreach ($GLOBALS['cfg']['Server']['only_db'] as $each_only_db) {
// check if the db name contains wildcard,
// thus containing not escaped _ or %
if (!preg_match('/(^|[^\\\\])(_|%)/', $each_only_db)) {
// ... not contains wildcard
$items[] = Util::unescapeMysqlWildcards($each_only_db);
continue;
}
$items = array_merge($items, $this->retrieve($each_only_db));
}
$this->exchangeArray($items);
return true;
}