File tree Expand file tree Collapse file tree 3 files changed +202
-3
lines changed Expand file tree Collapse file tree 3 files changed +202
-3
lines changed Original file line number Diff line number Diff line change @@ -282,13 +282,13 @@ class Pdp\Uri\Url\Host#7 (3) {
282282
283283### Validation of Public Suffixes
284284
285- Public Suffix validation is available by calling ` Parser::isValidSuffix () ` :
285+ Public Suffix validation is available by calling ` Parser::isSuffixValid () ` :
286286
287287```
288- var_dump($parser->isValidSuffix ('www.example.faketld');
288+ var_dump($parser->isSuffixValid ('www.example.faketld');
289289// false
290290
291- var_dump($parser->isValidSuffix ('www.example.com.au');
291+ var_dump($parser->isSuffixValid ('www.example.com.au');
292292// true
293293```
294294
Original file line number Diff line number Diff line change 2323 $ manager = new \Pdp \PublicSuffixListManager ();
2424 $ parser = new Pdp \Parser ($ manager ->getList ());
2525 $ url = $ parser ->parseUrl ($ domain );
26+ $ suffixValid = ($ parser ->isSuffixValid ((string ) $ url ->host )) ? 'IS ' : 'IS NOT ' ;
27+
2628 print_r ($ url ->toArray ());
2729 echo sprintf ('Host: %s ' , $ url ) . PHP_EOL ;
30+ echo sprintf (
31+ "'%s' %s a valid public suffix. " ,
32+ $ url ->host ->publicSuffix ,
33+ $ suffixValid
34+ ) . PHP_EOL ;
2835} catch (\Exception $ e ) {
2936 die ($ e ->getMessage () . PHP_EOL );
3037}
You can’t perform that action at this time.
0 commit comments