mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-13 09:54:55 +02:00
charactersearch widget: fix Invalid argument
PHP Warning: Invalid argument supplied for foreach() in layout/widgets/charactersearch.php on line 22 This happens when the database has no players, during fresh install.
This commit is contained in:
@@ -19,9 +19,9 @@
|
||||
if ($cache->hasExpired()) {
|
||||
$names_sql = mysql_select_multi('SELECT `name` FROM `players` ORDER BY `name` ASC;');
|
||||
$names = array();
|
||||
foreach ($names_sql as $name) {
|
||||
if ($names_sql !== false): foreach ($names_sql as $name) {
|
||||
$names[] = $name['name'];
|
||||
}
|
||||
} endif;
|
||||
$cache->setContent($names);
|
||||
$cache->save();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user