[DomCrawler] trim URI in getURI
This commit is contained in:
parent
3c584f5683
commit
a245e15434
@ -77,7 +77,7 @@ class Link
|
||||
*/
|
||||
public function getUri()
|
||||
{
|
||||
$uri = $this->getRawUri();
|
||||
$uri = trim($this->getRawUri());
|
||||
|
||||
// absolute URL?
|
||||
if ('http' === substr($uri, 0, 4)) {
|
||||
|
@ -79,6 +79,10 @@ class LinkTest extends \PHPUnit_Framework_TestCase
|
||||
return array(
|
||||
array('/foo', 'http://localhost/bar/foo/', 'http://localhost/foo'),
|
||||
array('/foo', 'http://localhost/bar/foo', 'http://localhost/foo'),
|
||||
array('
|
||||
/foo', 'http://localhost/bar/foo/', 'http://localhost/foo'),
|
||||
array('/foo
|
||||
', 'http://localhost/bar/foo', 'http://localhost/foo'),
|
||||
|
||||
array('foo', 'http://localhost/bar/foo/', 'http://localhost/bar/foo/foo'),
|
||||
array('foo', 'http://localhost/bar/foo', 'http://localhost/bar/foo'),
|
||||
|
Reference in New Issue
Block a user