Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-label domain is stripped from URL #22

Closed
jameshfisher opened this issue May 7, 2014 · 18 comments
Closed

Single-label domain is stripped from URL #22

jameshfisher opened this issue May 7, 2014 · 18 comments

Comments

@jameshfisher
Copy link

Test case:

<?php

require_once __DIR__ . "/vendor/autoload.php";

use Aura\Uri\Url\Factory as UrlFactory;
use Aura\Uri\PublicSuffixList;

$psl = new PublicSuffixList(require_once __DIR__ . '/vendor/aura/uri/data/public-suffix-list.php');
$url_factory = new UrlFactory($_SERVER, $psl);
$url = $url_factory->newInstance('http://localhost/');
echo $url->__toString() . "\n";

Expected output:

http://localhost/

Actual output:

http://

Version 1.1.1 of Aura.Uri.

@jameshfisher
Copy link
Author

@jameshfisher
Copy link
Author

The error appears be a mistaken assumption in the library, rather than an accidental bug: https://github.com/auraphp/Aura.Uri/blob/develop/src/Aura/Uri/Host.php

@harikt
Copy link
Member

harikt commented May 7, 2014

if you have a fix for it. pull request welcome :) .

Hari K T

You can ring me : +91 9388 75 8821

http://harikt.com , https://github.com/auraphp ,
http://www.linkedin.com/in/harikt , http://www.xing.com/profile/Hari_KT

Skype : kthari85
Twitter : harikt

On Wed, May 7, 2014 at 6:08 PM, James Harrison Fisher <
notifications@github.com> wrote:

The error appears be a mistaken assumption in the library, rather than an
accidental bug:
https://github.com/auraphp/Aura.Uri/blob/develop/src/Aura/Uri/Host.php


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-42421304
.

@jeremykendall
Copy link
Contributor

@harikt @jameshfisher This is related to php-domain-parser. I'll take a look and see what I can't work out. Thanks for the report, @jameshfisher.

@harikt
Copy link
Member

harikt commented May 14, 2014

Thank you @jeremykendall for the heads up.

@jeremykendall
Copy link
Contributor

This is fixed in php-domain-parser. I owe you guys an integration ASAP. I'll submit a PR as soon as I can.

@harikt
Copy link
Member

harikt commented May 15, 2014

@jeremykendall are you working on this ?

@jeremykendall
Copy link
Contributor

@harikt Yes, I am.

@harikt
Copy link
Member

harikt commented May 15, 2014

@jeremykendall I am wondering what timezone are you. Is it morning or you didn't slept ?

@jeremykendall
Copy link
Contributor

@harikt I'm GMT -5:00. I'm not sleeping well lately :-/

@harikt
Copy link
Member

harikt commented May 15, 2014

ok, not too late I assume ;) .

Around 10:30 PM.

@jeremykendall
Copy link
Contributor

@harikt No, you did the math wrong. We were chatting around 04:30 Central Daylight Time. I'm pretty pooped.

@jeremykendall
Copy link
Contributor

@harikt && @pmjones: Would you guys be willing to look over this php-domain-parser pull request: jeremykendall/php-domain-parser#23? It's a good idea of the changes I'll have to make here in order to resolve this issue.

I'm also planning to add support for ftp protocol (see jeremykendall/php-domain-parser@6a8765f) and "schemeless" URLs (see: https://github.com/jeremykendall/php-domain-parser/blob/ec7866a625cacae846e60e905adfb9f0f3b6b9ef/library/Pdp/Uri/Url.php#L108).

If any of the changes mentioned are cause for concern or you don't want them, speak now (soon-ish) or forever hold your peace and merge my PRs 😄

@harikt
Copy link
Member

harikt commented May 15, 2014

@jeremykendall I am not the authority. You should ping @pmjones .

@harikt
Copy link
Member

harikt commented May 15, 2014

and I am not against adding a support 👍 . And by the way you are a member of aura. Why is it not showing on your profile ?

@pmjones
Copy link
Member

pmjones commented May 15, 2014

@jeremykendall I see nothing obviously problematic with jeremykendall/php-domain-parser#23 . The main issue is, will it be a BC break?

@jeremykendall
Copy link
Contributor

@pmjones No, no BC break. I had to touch the interface for Pdp\Uri\Url\Host::__construct, but I won't have to do that in Aura\Uri\Host. I didn't have to change the interface anywhere in Aura.Uri, as a matter of fact. Pretty sweet, IMHO.

@pmjones
Copy link
Member

pmjones commented May 15, 2014

Ehhxcellent. Make the PR at your convenience, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants