shorten some expressions with ??

This commit is contained in:
slawkens
2023-02-06 20:05:01 +01:00
parent 56bd2c86b7
commit 4eb9bbbbcf
7 changed files with 19 additions and 19 deletions

View File

@@ -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;

View File

@@ -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 ?? ''
));
}
?>

View File

@@ -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');
}

View File

@@ -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.<br/>If you copied the link, please try again with full link.');
return;