Skip to content

Commit 1c39a78

Browse files
authored
Merge pull request #240 from rmccue/double-slash-path
Allow paths starting with a double-slash
2 parents f7cb82b + 73a75ac commit 1c39a78

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

library/Requests/IRI.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,7 @@ public function is_valid() {
688688
$isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null;
689689
if ($this->ipath !== '' &&
690690
(
691-
$isauthority && (
692-
$this->ipath[0] !== '/' ||
693-
substr($this->ipath, 0, 2) === '//'
694-
) ||
691+
$isauthority && $this->ipath[0] !== '/' ||
695692
(
696693
$this->scheme === null &&
697694
!$isauthority &&

tests/IRI.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,6 @@ public function testInvalidAbsolutizeBase()
333333
$this->assertFalse(Requests_IRI::absolutize('://not a URL', '../'));
334334
}
335335

336-
public function testInvalidAbsolutizeRelative()
337-
{
338-
$this->assertFalse(Requests_IRI::absolutize('http://example.com/', 'http://example.com//not a URL'));
339-
}
340-
341336
public function testFullGamut()
342337
{
343338
$iri = new Requests_IRI();

0 commit comments

Comments
 (0)