From 3b4bbf3a6a10df98a00e77ed162b4cca0d0b5333 Mon Sep 17 00:00:00 2001 From: Ivor Barhansky Date: Thu, 31 Aug 2023 16:59:41 +0300 Subject: [PATCH] Remove globals --- _incl_data/class/User.php | 8 ++++++-- _incl_data/class/User/Stats.php | 2 +- main.php | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index ec8afd12..1058e8f7 100644 --- a/_incl_data/class/User.php +++ b/_incl_data/class/User.php @@ -583,6 +583,10 @@ class User private function __construct() { + if (empty($_SESSION['uid']) && empty($_COOKIE['login'])) { + return; + } + $user = !empty($_SESSION['uid']) ? $_SESSION['uid'] : $_COOKIE['login']; $this->info = self::getInfo($user); unset($user); @@ -2000,7 +2004,7 @@ class User [$id] ); } - $r = ''; + if ( isset($inf['id']) && ( @@ -5544,7 +5548,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (!isset($po['nodelete'])) { $is1 .= ' '; + ) . ' . Config::img() . ' / i / clear . gif">'; } } } diff --git a/_incl_data/class/User/Stats.php b/_incl_data/class/User/Stats.php index f54e234f..6888be00 100644 --- a/_incl_data/class/User/Stats.php +++ b/_incl_data/class/User/Stats.php @@ -953,7 +953,7 @@ from items_users left join items_main on items_main.id = item_id where inOdet != //Бонусы комплектов $i = 0; - if (is_array($coms['new'])) { + if (!empty($coms['new']) && is_array($coms['new'])) { while ($i <= count($coms['new'])) { if (isset($coms['new'][$i])) { //$coms[$i]['id'] - id комплекта, $j - кол-во предметов данного комплекта diff --git a/main.php b/main.php index 7f9c2a3b..7a0b6a44 100644 --- a/main.php +++ b/main.php @@ -429,7 +429,6 @@ elem.parentNode.removeChild(elem); "; if ($u->info['dnow'] > 0) { $d = new Dungeon; - $d->start(); } require_once('modules_data/_dialog.php'); } elseif (isset($_GET['inv']) && !isset($u->tfer['id']) && $trololo == 1) {