Commit 14a30015 authored by Barnaby Walters's avatar Barnaby Walters

Merge branch 'gRegorLove-issue84'

parents 184823a4 f33a3c4a
...@@ -78,6 +78,9 @@ function fetch($url, $convertClassic = true, &$curlInfo=null) { ...@@ -78,6 +78,9 @@ function fetch($url, $convertClassic = true, &$curlInfo=null) {
return null; return null;
} }
# ensure the final URL is used to resolve relative URLs
$url = $info['url'];
return parse($html, $url, $convertClassic); return parse($html, $url, $convertClassic);
} }
......
...@@ -325,4 +325,13 @@ EOT; ...@@ -325,4 +325,13 @@ EOT;
$result = Mf2\applySrcsetUrlTransformation($srcset, $transformation); $result = Mf2\applySrcsetUrlTransformation($srcset, $transformation);
$this->assertEquals('https://example.com/banner-HD.jpeg 2x, https://example.com/banner-phone.jpeg 100w, https://example.com/banner-phone-HD.jpeg 100w 2x', $result); $this->assertEquals('https://example.com/banner-HD.jpeg 2x, https://example.com/banner-phone.jpeg 100w, https://example.com/banner-phone-HD.jpeg 100w 2x', $result);
} }
/**
* @see https://github.com/indieweb/php-mf2/issues/84
*/
public function testRelativeURLResolvedWithFinalURL() {
$mf = Mf2\fetch('http://aaron.pk/4Zn5');
$this->assertEquals('https://aaronparecki.com/2014/12/23/5/photo.jpeg', $mf['items'][0]['properties']['photo'][0]);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment