fix: fix even more PHP errors and warnings
This commit is contained in:
parent
077f97d5fc
commit
7debdba37c
28 changed files with 80 additions and 72 deletions
|
@ -21,28 +21,28 @@ class ajax {
|
|||
|
||||
// Get AJAX functions from handler
|
||||
$a1 = is_array($handler->ajax) ? $handler->ajax : array();
|
||||
if (is_array($a1['func'])) {
|
||||
if (isset($a1['func'])) {
|
||||
ajax::$fHandler = $a1['func'];
|
||||
$ml = is_array($a1['method']) ? $a1['method'] : array();
|
||||
$ml = is_array($a1['method'] ?? null) ? $a1['method'] : array();
|
||||
foreach ($a1['func'] as $f) {
|
||||
$m = ($ml[$f] == "") ? ($handler->ajaxPOST ? "POST" : "GET") : $ml[$f];
|
||||
$m = ($ml[$f] ?? "" == "") ? ($handler->ajaxPOST ?? false ? "POST" : "GET") : $ml[$f];
|
||||
ajax::$method[$f] = $m;
|
||||
}
|
||||
}
|
||||
|
||||
// Get theme-specific AJAX functions
|
||||
$a2 = ajax::getTheme();
|
||||
if (is_array($a2['func'])) {
|
||||
if (isset($a2['func'])) {
|
||||
ajax::$fTheme = $a2['func'];
|
||||
$ml = is_array($a2['method']) ? $a2['method'] : array();
|
||||
$ml = is_array($a2['method'] ?? null) ? $a2['method'] : array();
|
||||
foreach ($a2['func'] as $f) {
|
||||
$m = ($ml[$f] == "") ? ($handler->ajaxPOST ? "POST" : "GET") : $ml[$f];
|
||||
$m = ($ml[$f] ?? "" == "") ? ($handler->ajaxPOST ?? false ? "POST" : "GET") : $ml[$f];
|
||||
ajax::$method[$f] = $m;
|
||||
}
|
||||
}
|
||||
|
||||
// Create init string
|
||||
ajax::$init = $a2['init'] . $a1['init'];
|
||||
ajax::$init = ($a2['init'] ?? '') . ($a1['init'] ?? '');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ class db {
|
|||
}
|
||||
|
||||
public function getGameAccess($prefix) {
|
||||
if (is_null($this->accessors[$prefix])) {
|
||||
if (!isset($this->accessors[$prefix])) {
|
||||
$this->accessors[$prefix] = new db_accessor($this, $prefix);
|
||||
}
|
||||
return $this->accessors[$prefix];
|
||||
|
|
|
@ -316,7 +316,7 @@ class display_engine {
|
|||
return;
|
||||
}
|
||||
|
||||
if (tracking::$data['bat']) {
|
||||
if (tracking::$data['bat'] ?? false) {
|
||||
// User tried to log in after being kicked
|
||||
session::kill();
|
||||
$this->displayKicked();
|
||||
|
|
|
@ -54,7 +54,7 @@ class display_engine {
|
|||
return;
|
||||
}
|
||||
|
||||
if (tracking::$data['bat']) {
|
||||
if (isset(tracking::$data['bat'])) {
|
||||
// User tried to log in after being kicked
|
||||
session::kill();
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ class game {
|
|||
private $__status = null;
|
||||
private $__firstTick = null;
|
||||
private $__lastTick = null;
|
||||
public $db = null;
|
||||
|
||||
function __construct($version, $name, $namespace, $public, $canJoin, $text) {
|
||||
$this->version = $version;
|
||||
|
@ -48,7 +49,7 @@ class game {
|
|||
|
||||
|
||||
private function __loadActionObject() {
|
||||
if ($this->actionObj) {
|
||||
if (isset($this->actionObj)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class handler {
|
|||
*/
|
||||
|
||||
// Get the list of supported engines
|
||||
if (is_array($handler->engines)) {
|
||||
if (isset($handler->engines) && is_array($handler->engines)) {
|
||||
$engines = $handler->engines;
|
||||
} else {
|
||||
$engines = array('page', 'css', 'js', 'rpc');
|
||||
|
|
|
@ -111,7 +111,7 @@ function handleInput() {
|
|||
engine::$e->initSession();
|
||||
engine::$e->checkAuth();
|
||||
|
||||
if (is_array($_SESSION) && is_array(config::$main['trace'])
|
||||
if (isset($_SESSION) && is_array(config::$main['trace'])
|
||||
&& in_array($_SESSION['userid'], config::$main['trace'])) {
|
||||
|
||||
$path = input::$path;
|
||||
|
|
|
@ -15,7 +15,7 @@ class prefs {
|
|||
while ($r = dbFetchHash($qr)) {
|
||||
$v = $r['version'];
|
||||
$i = $r['id'];
|
||||
if (!is_array(prefs::$prefs[$v])) {
|
||||
if (!isset(prefs::$prefs[$v])) {
|
||||
prefs::$prefs[$v] = array();
|
||||
}
|
||||
prefs::$prefs[$v][$i] = $r['value'];
|
||||
|
@ -96,7 +96,7 @@ class prefs {
|
|||
}
|
||||
|
||||
list($version, $name) = explode('/', $path);
|
||||
if (is_array(prefs::$prefs[$version])) {
|
||||
if (isset(prefs::$prefs[$version])) {
|
||||
$v = prefs::$prefs[$version][$name];
|
||||
} else {
|
||||
$v = null;
|
||||
|
|
|
@ -19,11 +19,11 @@ class tick_definition {
|
|||
}
|
||||
|
||||
function getName($lang) {
|
||||
return ($this->text[$lang] ? $this->text[$lang][0] : "");
|
||||
return isset($this->text[$lang]) ? $this->text[$lang][0] : "";
|
||||
}
|
||||
|
||||
function getDescription($lang) {
|
||||
return ($this->text[$lang] ? $this->text[$lang][1] : "");
|
||||
return isset($this->text[$lang]) ? $this->text[$lang][1] : "";
|
||||
}
|
||||
|
||||
function getPath() {
|
||||
|
|
|
@ -34,6 +34,7 @@ class tick_manager {
|
|||
}
|
||||
}
|
||||
|
||||
l::debug("cache dir : " . config::$main['cachedir']);
|
||||
if (file_exists(config::$main['cachedir'] . "/stop_ticks")) {
|
||||
unlink(config::$main['cachedir'] . "/stop_ticks");
|
||||
$this->ticksStopped = true;
|
||||
|
|
|
@ -121,7 +121,7 @@ class tracking {
|
|||
tracking::$cName = config::getParam('trackname');
|
||||
|
||||
list($trackId,$trackNew) = tracking::readId();
|
||||
if (handler::$h->noTracking && (is_null($trackId) || $trackNew)) {
|
||||
if (handler::$h->noTracking ?? false && (is_null($trackId) || $trackNew)) {
|
||||
tracking::$disabled = true;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue