浏览代码

minor fixes

Miraty 1 年之前
父节点
当前提交
2ebf1eee2a
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 1 2
      init.php
  2. 1 1
      pg-act/ns/zone-add.php

+ 1 - 2
init.php

@@ -1,5 +1,6 @@
 <?php declare(strict_types=1);
 umask(0077);
+const LF = "\n";
 
 set_error_handler(function ($level, $message, $file = '', $line = 0) {
 	throw new ErrorException($message, 0, $level, $file, $line);
@@ -36,8 +37,6 @@ header('Content-Language: ' . LOCALE);
 
 const SERVICES_USER = ['reg', 'ns', 'ht'];
 
-const LF = "\n";
-
 const PLACEHOLDER_DOMAIN = 'example'; // From RFC2606: Reserved Top Level DNS Names > 2. TLDs for Testing, & Documentation Examples
 const PLACEHOLDER_IPV6 = '2001:db8::3'; // From RFC3849: IPv6 Address Prefix Reserved for Documentation
 const PLACEHOLDER_IPV4 = '203.0.113.42'; // From RFC5737: IPv4 Address Blocks Reserved for Documentation

+ 1 - 1
pg-act/ns/zone-add.php

@@ -11,7 +11,7 @@ if ($parent_authoritatives === [])
 foreach ($parent_authoritatives as $parent_authoritative)
 	checkAbsoluteDomainFormat($parent_authoritative);
 
-$ns_records = array_column(kdig(name: $_POST['domain'], type: 'NS', server: (CONF['ns']['local_only_check'] ? CONF['reg']['address'] : $parentAuthoritatives[0]))['authorityRRs'], 'rdataNS');
+$ns_records = array_column(kdig(name: $_POST['domain'], type: 'NS', server: (CONF['ns']['local_only_check'] ? CONF['reg']['address'] : $parent_authoritative[0]))['authorityRRs'], 'rdataNS');
 if (preg_match('/^(?<salt>[0-9a-f]{8})-(?<hash>[0-9a-f]{32})\._domain-verification\.' . preg_quote(SERVER_NAME, '/') . '\.$/Dm', implode(LF, $ns_records), $matches) !== 1)
 	output(403, _('NS authentication record not found.'));