mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 06:45:44 +01:00
- Parce PSL ICANN section into structured sections (rules, wildcards, exceptions) according to the format. - Updates PublicSuffix semantics for complete application of the rules. - Includes private domain suffixes now. - Refreshes the existing data. - Fixes the update-regionals.yml workflow, set it to run twice a week. References: https://github.com/publicsuffix/list/wiki/Format#format
2.1 KiB
2.1 KiB
PublicDomainSuffix
PublicDomainSuffix()
Validates whether the input is a public domain suffix from the Public Suffix List, including wildcard, exception, ICANN and private section rules.
v::publicDomainSuffix()->assert('co.uk');
// Validation passes successfully
v::publicDomainSuffix()->assert('co.ck');
// Validation passes successfully
v::publicDomainSuffix()->assert('www.ck');
// → "www.ck" must be a public domain suffix
v::publicDomainSuffix()->assert('myname.nom.br');
// Validation passes successfully
v::publicDomainSuffix()->assert('invalid.com');
// → "invalid.com" must be a public domain suffix
v::publicDomainSuffix()->assert('blogspot.com');
// Validation passes successfully
This validator will not match top level domains such as tk.
If you want to match either, use a combination with Tld:
v::oneOf(v::tld(), v::publicDomainSuffix())->assert('tk');
// Validation passes successfully
Templates
PublicDomainSuffix::TEMPLATE_STANDARD
| Mode | Template |
|---|---|
default |
{{subject}} must be a public domain suffix |
inverted |
{{subject}} must not be a public domain suffix |
Template placeholders
| Placeholder | Description |
|---|---|
subject |
The validated input or the custom validator name (if specified). |
Categorization
- Internet
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Templates changed |
| 2.3.0 | Created |