Skip to content

Commit

Permalink
Fix IRI "normalization"
Browse files Browse the repository at this point in the history
  • Loading branch information
ozh committed Oct 29, 2014
1 parent b398534 commit d93df96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/Requests/IRI.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,9 @@ class Requests_IRI
),
'http' => array(
'port' => 80,
'ipath' => '/'
),
'https' => array(
'port' => 443,
'ipath' => '/'
),
);

Expand Down Expand Up @@ -743,6 +741,10 @@ protected function scheme_normalization()
{
$this->ipath = '';
}
if (isset($this->ihost) && empty($this->ipath))
{
$this->ipath = '/';
}
if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery'])
{
$this->iquery = null;
Expand Down Expand Up @@ -1060,7 +1062,6 @@ protected function set_path($ipath)
$cache[$ipath] = array($valid, $removed);
$this->ipath = ($this->scheme !== null) ? $removed : $valid;
}

$this->scheme_normalization();
return true;
}
Expand Down

0 comments on commit d93df96

Please sign in to comment.