Comments (12)
Please make sure you’re using the most recent version the the public suffix list. Can’t look now but update instructions should be in README.
from purl.
Thanks. Would you be willing to provide a failing test and a fix?
from purl.
Here you go: https://github.com/jwage/purl/blob/master/README.markdown#staying-up-to-date
from purl.
@jwage @jeremykendall It seems like the suffixes with key *
on their array are failing
'bd' =>
array (
'*' =>
array (
),
)
or
'nz' =>
array (
'*' =>
array (
),
'co' =>
array (
'blogspot' =>
array (
),
),
),
There are few other like bd, pg etc.
This is fixed if you replace the content of the file
vendor/jwage/purl/data/public-suffix-list.php
with
vendor/jeremykendall/php-domain-parser/data/public-suffix-list.php
And also this code in vendor/jeremykendall/php-domain-parser/library/Pdp/Parser.php
if (array_key_exists('*', $publicSuffixList)) {
array_unshift($publicSuffix, $part);
$publicSuffixList = $publicSuffixList['*'];
continue;
}
adds all the parts in the domains to public suffix if there exist a key *
for a given suffix.
So I guess the issue is as @jeremykendall pointed out, the list is not updated and also I am not sure that the fix to this would be, updating the public prefix list or not letting everything with *
key into the suffix list. And since the codes are in two different repos I am a bit confused.
Please let me know if I can be of help further.
from purl.
Updating the file using the CLI tool did not resolve your issue?
from purl.
No it did not.
from purl.
@nyamsprod Any chance you can take a look?
from purl.
Seems that Purl uses v3 and not v5 of the domain parser package. I'll look if v5 has the same issue
from purl.
That’s due to some php extension requirements in newer versions of php-domain-parser that are not required by purl. If @jwage is OK with that I think it’s safe to upgrade.
from purl.
Beside the intl extension I don't believe there are any other dependencies that I'm aware of
from purl.
Using v5 it does work ...
use Pdp\Cache;
use Pdp\CurlHttpClient;
use Pdp\Manager;
require 'vendor/autoload.php';
$manager = new Manager(new Cache(), new CurlHttpClient());
$rules = $manager->getRules();
$domain = $rules->resolve('naren.nz');
echo '<pre>', json_encode($domain, JSON_PRETTY_PRINT);
And the result is
{
"domain": "naren.nz",
"registrableDomain": "naren.nz",
"subDomain": null,
"publicSuffix": "nz",
"isKnown": true,
"isICANN": true,
"isPrivate": false
}
from purl.
We can upgrade 👍
from purl.
Related Issues (20)
- Feature request: resolving urls HOT 1
- How to remove a part of the url ? HOT 1
- how to set IP address as host in a url ? HOT 1
- Using parse() inside loop eats up all memory HOT 4
- Incorrect handling of long generic domain extensions
- Consider adding PHPUnit to composer package list HOT 2
- Joining with a protocol-relative url HOT 3
- Php 7.2.2 Calling parse_str() without the result argument is deprecated HOT 1
- Incompatible with modern software HOT 4
- Require PHP 7.1
- Add phpstan and Doctrine coding standards
- Purl can fail to parse the fragment HOT 3
- PHP7.2 parse_str param 2 not null HOT 3
- Why does remove() return "void" HOT 2
- require old jeremykendall/php-domain-parser version HOT 4
- Request: new patch version
- subdomain and registerableDomain no longer work HOT 2
- PHP8: Compile Error Purl\AbstractPart::__set(): Return type must be void when declared
- Support PHP8 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purl.