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

Breaks on malformed double http links #213

Closed
salamanders opened this issue Jul 10, 2012 · 4 comments
Closed

Breaks on malformed double http links #213

salamanders opened this issue Jul 10, 2012 · 4 comments

Comments

@salamanders
Copy link

public static function absolutize_url($relative, $base)
will not return an object if the link is one of the messed up "http://http://whatever.com" bad encoding variety, which will kill the RSS read.

It also seems to die if the "$relative" section has a double forward slash.

@salamanders
Copy link
Author

Also breaks if both parameters are empty.

@spideron
Copy link

Got the same problem.
Changed the function to:
public static function absolutize_url($relative, $base)
{
$iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
if($iri === false){
return false;
}
return $iri->get_uri();
}

@salamanders
Copy link
Author

Nice fix, didn't know I could return false. Thanks! back up and running for now.

@spideron
Copy link

Cool, glad I could help out :-)

@skyzyx skyzyx closed this as completed Jun 26, 2017
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

3 participants