mirror of
https://github.com/getgrav/grav.git
synced 2026-07-20 04:30:42 +02:00
Regression: base_url_absolute always has the port number (#1690)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
## mm/dd/2017
|
||||
|
||||
1. [](#bugfix)
|
||||
|
||||
* Regression: `base_url_absolute` always has the port number (#1690)
|
||||
|
||||
# v1.3.6
|
||||
## 10/12/2017
|
||||
|
||||
@@ -79,6 +79,9 @@ class Uri
|
||||
|
||||
// Build port.
|
||||
$this->port = isset($env['SERVER_PORT']) ? (int)$env['SERVER_PORT'] : null;
|
||||
if ($this->hasStandardPort()) {
|
||||
$this->port = null;
|
||||
}
|
||||
|
||||
// Build path.
|
||||
$request_uri = isset($env['REQUEST_URI']) ? $env['REQUEST_URI'] : '';
|
||||
@@ -107,6 +110,16 @@ class Uri
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this Uri use a standard port?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasStandardPort()
|
||||
{
|
||||
return ($this->scheme === 'http' && $this->port === 80) || ($this->scheme === 'https' && $this->port === 443);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user