|
@@ -8,7 +8,8 @@ function parseZoneFile($zone_content, $types, $filter_domain = false) {
|
|
|
$elements = preg_split('/[\t ]+/', $zone_line, 4);
|
|
|
if ($filter_domain !== false AND !str_ends_with($elements[0], $filter_domain))
|
|
|
continue; // Ignore records for other domains
|
|
|
- if (!in_array($elements[2], $types, true)) continue; // Ignore records generated by Knot
|
|
|
+ if (!in_array($elements[2], $types, true))
|
|
|
+ continue; // Ignore records generated by Knot
|
|
|
array_push($parsed_zone_content, array_map('htmlspecialchars', $elements));
|
|
|
}
|
|
|
return $parsed_zone_content;
|
|
@@ -63,7 +64,7 @@ function checkIpFormat($ip) {
|
|
|
}
|
|
|
|
|
|
function checkAbsoluteDomainFormat($domain) { // If the domain must end with a dot
|
|
|
- if (!filter_var($domain, FILTER_VALIDATE_DOMAIN) OR preg_match('/^([a-z0-9_-]{1,63}\.){2,127}$/D', $domain) !== 1)
|
|
|
+ if (!filter_var($domain, FILTER_VALIDATE_DOMAIN) OR preg_match('/^(?=^.{1,254}$)([a-z0-9_-]{1,63}\.){2,127}$/D', $domain) !== 1)
|
|
|
output(403, _('Domain malformed.'));
|
|
|
}
|
|
|
|