mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-30 19:29:22 +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:
parent
855c889568
commit
91816bbe2b
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user