8000 [DomCrawler] trim URI in getURI · proofek/symfony@a245e15 · GitHub
[go: up one dir, main page]

Sk 65F7 ip to content

Commit a245e15

Browse files
committed
[DomCrawler] trim URI in getURI
1 parent 3c584f5 commit a245e15

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/DomCrawler/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getMethod()
7777
*/
7878
public function getUri()
7979
{
80-
$uri = $this->getRawUri();
80+
$uri = trim($this->getRawUri());
8181

8282
// absolute URL?
8383
if ('http' === substr($uri, 0, 4)) {

tests/Symfony/Tests/Component/DomCrawler/LinkTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ public function getGetUriTests()
7979
return array(
8080
array('/foo', 'http://localhost/bar/foo/', 'http://localhost/foo'),
8181
array('/foo', 'http://localhost/bar/foo', 'http://localhost/foo'),
82+
array('
83+
/foo', 'http://localhost/bar/foo/', 'http://localhost/foo'),
84+
array('/foo
85+
', 'http://localhost/bar/foo', 'http://localhost/foo'),
8286

8387
array('foo', 'http://localhost/bar/foo/', 'http://localhost/bar/foo/foo'),
8488
array('foo', 'http://localhost/bar/foo', 'http://localhost/bar/foo'),

0 commit comments

Comments
 (0)
0