8000 merged branch stealth35/fix_2599 (PR #2601) · proofek/symfony@632a99f · GitHub
[go: up one dir, main page]

Skip to content

Commit 632a99f

Browse files
committed
merged branch stealth35/fix_2599 (PR symfony#2601)
Commits ------- a245e15 [DomCrawler] trim URI in getURI Discussion ---------- [DomCrawler] trim URI in getURI Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: symfony#2599
2 parents f8164ec + a245e15 commit 632a99f

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