diff --git a/fn/auth.php b/fn/auth.php index 240f8ea..d3e1b70 100644 --- a/fn/auth.php +++ b/fn/auth.php @@ -141,10 +141,10 @@ function authDeleteUser(string $user_id): void { } function rateLimit(): void { - if (PAGE_METADATA['tokens_account_cost'] ?? 0 > 0) + if ((PAGE_METADATA['tokens_account_cost'] ?? 0) > 0) rateLimitAccount(PAGE_METADATA['tokens_account_cost']); - if (PAGE_METADATA['tokens_instance_cost'] ?? 0 > 0) + if ((PAGE_METADATA['tokens_instance_cost'] ?? 0) > 0) rateLimitInstance(PAGE_METADATA['tokens_instance_cost']); } diff --git a/jobs/check.php b/jobs/check.php index e10c7da..7e5e5c5 100644 --- a/jobs/check.php +++ b/jobs/check.php @@ -108,7 +108,7 @@ function testReg(): string { 'ns' => 'ns1.servnest.invalid.', ]); $results = kdig(name: $domain, type: 'NS', server: CONF['reg']['address']); - if ($results['authorityRRs'][0]['rdataNS'] !== 'ns1.servnest.invalid.') + if (($results['authorityRRs'][0]['rdataNS'] ?? NULL) !== 'ns1.servnest.invalid.') exit('Error: /reg/ns: NS record not set' . LF); curlTest('/reg/ns', [ @@ -189,9 +189,9 @@ function testNs(string $domain): void { 'value' => 'letsencrypt.org', ]); $results = kdig(name: $domain, type: 'CAA', server: CONF['reg']['address']); - if ($results['answerRRs'][0]['TTL'] !== 7200) + if (($results['answerRRs'][0]['TTL'] ?? NULL) !== 7200) exit('Error: /ns/caa: wrong TTL' . LF); - if ($results['answerRRs'][0]['rdataCAA'] !== '0 issue "letsencrypt.org" ') + if (($results['answerRRs'][0]['rdataCAA'] ?? NULL) !== '0 issue "letsencrypt.org" ') exit('Error: /ns/caa: CAA record not set' . LF); curlTest('/ns/edit', [ @@ -200,7 +200,7 @@ function testNs(string $domain): void { . '@ 86400 NS ' . CONF['ns']['servers'][0] . "\r\n", ]); $results = kdig(name: 'aaaa.' . $domain, type: 'AAAA', server: CONF['reg']['address']); - if ($results['answerRRs'][0]['rdataAAAA'] !== CONF['ht']['ipv6_address']) + if (($results['answerRRs'][0]['rdataAAAA'] ?? NULL) !== CONF['ht']['ipv6_address']) exit('Error: /ns/edit: AAAA record not set' . LF); } diff --git a/view.php b/view.php index 9bf6544..f955ab0 100644 --- a/view.php +++ b/view.php @@ -41,7 +41,7 @@ if (CONF['common']['services']['auth'] === 'error' OR (in_array(SERVICE, SERVICE require ROOT_PATH . '/pg-view/' . PAGE_ADDRESS . '.php'; -if ($_POST === [] AND PAGE_METADATA['require-login'] ?? true !== false AND !isset($_SESSION['id']) AND PAGE_TERMINAL) +if ($_POST === [] AND (PAGE_METADATA['require-login'] ?? true) !== false AND !isset($_SESSION['id']) AND PAGE_TERMINAL) echo '
' . sprintf(_('This form won\'t be accepted because you need to %slog in%s first.'), '', '') . '
'; displayFinalMessage($data);