Merge pull request #466 from itrack/master

Fix PHP 7.2 warning count
This commit is contained in:
Martin Ambrus
2018-01-07 13:03:37 +01:00
committed by GitHub
3 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -678,7 +678,7 @@ class MYSQLi_DB implements IDbConnection {
$arrayVariable[$arrayStructure] = [];
}
if (isset($arrayVariable[$arrayStructure]) && count($arrayVariable[$arrayStructure])) {
if (isset($arrayVariable[$arrayStructure]) && !empty($arrayVariable[$arrayStructure])) {
return $arrayVariable[$arrayStructure];
} else {
return null;
@@ -5461,7 +5461,7 @@ References: User ID/Message ID, Mode
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.`" . $where . "` IN(".implode(', ', $village).") and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 or " . TB_PREFIX . "movement.`" . $where . "` IN(".implode(', ', $village).") and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 4 ORDER BY endtime ASC";
break;
default:
return null;
return [];
}
$result = $this->mysqli_fetch_all(mysqli_query($this->dblink,$q));
+3 -1
View File
@@ -43,8 +43,10 @@ class multiSort {
$t = 'strnatcmp($a[' . $key . '], $b[' . $key . '])';
break;
}
usort($array, create_function('$a, $b', 'return ' . ($order ? '' : '-') . '(' . $t . ');'));
usort($array, function($a, $b) use ($order, $t) {
return ($order ? '' : '-') . ($t);
});
}
return $array;
}
+2
View File
@@ -271,6 +271,8 @@
ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
}
$datas = array();
$result = (mysqli_query($GLOBALS['link'],$q));
while($row = mysqli_fetch_assoc($result)) {
$datas[] = $row;