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
- the submitted domain name using `Pdp\Domain::getDomain`
172
-
- the public suffix part normalized according to the domain using `Pdp\Domain::getPublicSuffix`
173
-
- the registrable domain part using `Pdp\Domain::getRegistrableDomain`
174
-
- the subdomain part using `Pdp\Domain::getSubDomain`.
175
+
- All `Pdp\Domain` getter methods returns normalized and lowercased domain labels or `null` if no value was found for a particular domain part.
175
176
176
-
If the domain name or some of its part are seriously malformed or unrecognized, the getter methods will return `null`.
177
-
178
-
**The Domain name status depends on the PSL section used to resolve it:**
177
+
**The domain public suffix status depends on the PSL section used to resolve it:**
179
178
180
179
-`Pdp\Domain::isKnown` returns `true` if the public suffix is found in the selected PSL;
181
180
-`Pdp\Domain::isICANN` returns `true` if the public suffix is found using a PSL which includes the ICANN DOMAINS section;
@@ -186,26 +185,22 @@ The `Rules::getPublicSuffix` method expects the same arguments as `Rules::resolv
186
185
~~~php
187
186
<?php
188
187
189
-
final class PublicSuffix implements Countable, JsonSerializable
188
+
final class PublicSuffix implements DomainInterface, JsonSerializable
190
189
{
191
-
public function getContent(): ?string
192
190
public function isKnown(): bool;
193
191
public function isICANN(): bool;
194
192
public function isPrivate(): bool;
195
-
public function toUnicode(): self;
196
-
public function toAscii(): self;
197
193
}
198
194
~~~
199
195
200
196
While `Rules::resolve` will only throws an exception if the section value is invalid, the `Rules::getPublicSuffix` is more restrictive and will additionnally throw if:
201
197
202
198
- The domain name is invalid or seriously malformed
203
-
- The public suffix can not be normalized and converted using the domain encoding.
199
+
- No public suffix can be match against the submitted domain.
200
+
- The public suffix can not be normalized using the domain encoding.
204
201
205
202
**WARNING:**
206
203
207
-
**The `Pdp\Rules::resolve` does not validate the submitted host. You are require to use a host validator prior to using this library.**
208
-
209
204
**You should never use the library this way in production, without, at least, a caching mechanism to reduce PSL downloads.**
210
205
211
206
**Using the PSL to determine what is a valid domain name and what isn't is dangerous, particularly in these days where new gTLDs are arriving at a rapid pace. The DNS is the proper source for this information. If you must use this library for this purpose, please consider integrating a PSL update mechanism into your software.**
@@ -375,7 +370,7 @@ For example, below I'm using the `Manager` with
375
370
376
371
Of course you can add more setups depending on your usage.
377
372
378
-
<pclass="message-notice">Be sure to adapt the following code to your own framework/situation. The following code is given as an example without warranty of it working out of the box.</p>
373
+
**Be sure to adapt the following code to your own framework/situation. The following code is given as an example without warranty of it working out of the box.**
0 commit comments