You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow RFC owner name rules in Name validator (wildcards + underscored labels) (#50)
* Follow RFC owner name rules in Name validator
Allow wildcard owner names ('*' as the entire leftmost label, RFC 4592)
and underscored labels (RFC 8552) for all record types except A/AAAA,
whose owner names must be valid host names (RFC 952, RFC 1123).
The record type constructor argument is now optional; null applies the
general domain name rules.
* (fix): update general failure reason to match inverted underscore rule
publicconststringFAILURE_REASON_INVALID_LABEL_CHARACTERS_WITH_UNDERSCORE = 'Label must contain only alpha-numeric characters, hyphens and underscores, and cannot start or end with a hyphen';
22
29
23
-
publicconststringFAILURE_REASON_GENERAL = 'Name must be between 1 and 255 characters long, and contain only alpha-numeric characters and hyphens, and cannot start or end with a hyphen, and may contain underscore if the record type allows it';
30
+
publicconststringFAILURE_REASON_INVALID_WILDCARD = 'Wildcard "*" must be the entire leftmost label';
31
+
32
+
publicconststringFAILURE_REASON_GENERAL = 'Name must be between 1 and 255 characters long, and contain only alpha-numeric characters, hyphens and (for non-address record types) underscores, and cannot start or end with a hyphen';
24
33
25
34
publicstring$reason = '';
26
35
27
-
privateint$recordType;
36
+
private?int$recordType;
28
37
29
-
publicfunction__construct(int$recordType)
38
+
/**
39
+
* @param int|null $recordType Record type code, or null to apply the general domain name rules.
40
+
*/
41
+
publicfunction__construct(?int$recordType = null)
30
42
{
31
43
$this->recordType = $recordType;
32
44
}
@@ -47,7 +59,6 @@ public function isValid(mixed $name): bool
47
59
// DNS names are made up of labels separated by dots.
0 commit comments