diff --git a/admin/pages/login.php b/admin/pages/login.php index ebf86d5b..76d25d49 100644 --- a/admin/pages/login.php +++ b/admin/pages/login.php @@ -14,5 +14,5 @@ $twig->display('admin.login.html.twig', [ 'logout' => (ACTION == 'logout' ? 'You have been logged out!' : ''), 'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number', 'account_login_by' => getAccountLoginByLabel(), - 'errors' => isset($errors)? $errors : '' + 'errors' => $errors ?? '' ]); diff --git a/admin/pages/news.php b/admin/pages/news.php index 65a26132..66398b09 100644 --- a/admin/pages/news.php +++ b/admin/pages/news.php @@ -116,20 +116,20 @@ if($action == 'edit' || $action == 'new') { 'action' => $action, 'news_link' => getLink(PAGE), 'news_link_form' => '?p=news&action=' . ($action == 'edit' ? 'edit' : 'new'), - 'news_id' => isset($id) ? $id : null, - 'title' => isset($p_title) ? $p_title : '', + 'news_id' => $id ?? null, + 'title' => $p_title ?? '', 'body' => isset($body) ? escapeHtml($body) : '', - 'type' => isset($type) ? $type : null, + 'type' => $type ?? null, 'player' => isset($player) && $player->isLoaded() ? $player : null, - 'player_id' => isset($player_id) ? $player_id : null, + 'player_id' => $player_id ?? null, 'account_players' => $account_players, - 'category' => isset($category) ? $category : 0, + 'category' => $category ?? 0, 'categories' => $categories, 'forum_boards' => getForumBoards(), - 'forum_section' => isset($forum_section) ? $forum_section : null, - 'comments' => isset($comments) ? $comments : null, - 'article_text' => isset($article_text) ? $article_text : null, - 'article_image' => isset($article_image) ? $article_image : null + 'forum_section' => $forum_section ?? null, + 'comments' => $comments ?? null, + 'article_text' => $article_text ?? null, + 'article_image' => $article_image ?? null )); } diff --git a/system/login.php b/system/login.php index ebe608ab..d794970e 100644 --- a/system/login.php +++ b/system/login.php @@ -56,7 +56,7 @@ if(!$logged && isset($_POST['account_login'], $_POST['password_login'])) $tmp = array(); $ip = $_SERVER['REMOTE_ADDR']; - $t = isset($tmp[$ip]) ? $tmp[$ip] : NULL; + $t = $tmp[$ip] ?? null; } if(config('recaptcha_enabled') && !config('account_create_auto_login')) diff --git a/system/pages/account/base.php b/system/pages/account/base.php index 4a3a7542..bb0c6c5f 100644 --- a/system/pages/account/base.php +++ b/system/pages/account/base.php @@ -16,10 +16,10 @@ if(!$logged) $twig->display('error_box.html.twig', array('errors' => $errors)); $twig->display('account.login.html.twig', array( - 'redirect' => isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : null, + 'redirect' => $_REQUEST['redirect'] ?? null, 'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number', 'account_login_by' => getAccountLoginByLabel(), - 'error' => isset($errors[0]) ? $errors[0] : null + 'error' => $errors[0] ?? null )); return; diff --git a/system/pages/account/change_info.php b/system/pages/account/change_info.php index e3a8174a..753f4ce5 100644 --- a/system/pages/account/change_info.php +++ b/system/pages/account/change_info.php @@ -63,10 +63,10 @@ if($show_form) { } $twig->display('account.change_info.html.twig', array( - 'countries' => isset($countries) ? $countries : [], + 'countries' => $countries ?? [], 'account_rlname' => $account_rlname, 'account_location' => $account_location, - 'account_country' => isset($account_country) ? $account_country : '' + 'account_country' => $account_country ?? '' )); } ?> diff --git a/system/pages/account/change_password.php b/system/pages/account/change_password.php index d4ec8647..a32531f6 100644 --- a/system/pages/account/change_password.php +++ b/system/pages/account/change_password.php @@ -17,9 +17,9 @@ if(!$logged) { return; } -$new_password = isset($_POST['newpassword']) ? $_POST['newpassword'] : NULL; -$new_password2 = isset($_POST['newpassword2']) ? $_POST['newpassword2'] : NULL; -$old_password = isset($_POST['oldpassword']) ? $_POST['oldpassword'] : NULL; +$new_password = $_POST['newpassword'] ?? NULL; +$new_password2 = $_POST['newpassword2'] ?? NULL; +$old_password = $_POST['oldpassword'] ?? NULL; if(empty($new_password) && empty($new_password2) && empty($old_password)) { $twig->display('account.change_password.html.twig'); } diff --git a/system/pages/account/confirm_email.php b/system/pages/account/confirm_email.php index b542b838..233c5533 100644 --- a/system/pages/account/confirm_email.php +++ b/system/pages/account/confirm_email.php @@ -11,7 +11,7 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Confirm Email'; -$hash = isset($_GET['hash']) ? $_GET['hash'] : ''; +$hash = $_GET['hash'] ?? ''; if(empty($hash)) { warning('Please enter email hash code.
If you copied the link, please try again with full link.'); return;