PHP Warning: Undefined array key "ref"

This commit is contained in:
Ivor Barhansky 2023-08-29 12:15:09 +03:00
parent 6f006ed790
commit 5f48c6f67d

View File

@ -13,8 +13,8 @@ if (!defined('GAME_VERSION')) {
use Core\{Config, Database, Db};
use User\Confirmation;
use User\UserIp;
use User\Register;
use User\UserIp;
Config::init();
Database::init();
@ -24,8 +24,9 @@ if (empty($_SESSION['step'])) {
$_SESSION['step'] = 1;
}
$_SESSION['ref'] = Db::getValue('select count(*) from users where id = ?', [$_REQUEST['ref']]) ?? 0;
if (!empty($_REQUEST['ref'])) {
$_SESSION['ref'] = Db::getValue('select count(*) from users where id = ?', [$_REQUEST['ref']]) ?? 0;
}
if (