merged branch stealth35/fix_2599 (PR #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: #2599
This commit is contained in:
Fabien Potencier 2011-11-11 08:09:10 +01:00
commit 632a99fd7c
2 changed files with 5 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class Link
*/
public function getUri()
{
$uri = $this->getRawUri();
$uri = trim($this->getRawUri());
// absolute URL?
if ('http' === substr($uri, 0, 4)) {

View File

@ -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'),