mirror of
https://github.com/getgrav/grav.git
synced 2026-03-04 11:31:43 +01:00
Fix for custom_base_url not routing properly
This commit is contained in:
@@ -133,7 +133,12 @@ class Uri
|
||||
$custom_parts = parse_url($custom_base);
|
||||
$orig_root_path = $this->root_path;
|
||||
$this->root_path = isset($custom_parts['path']) ? rtrim($custom_parts['path'], '/') : '';
|
||||
$this->root = isset($custom_parts['scheme']) ? $custom_base : $this->base . $this->root_path;
|
||||
if (isset($custom_parts['scheme'])) {
|
||||
$this->base = $custom_parts['scheme'] . '://' . $custom_parts['host'];
|
||||
$this->root = $custom_base;
|
||||
} else {
|
||||
$this->root = $this->base . $this->root_path;
|
||||
}
|
||||
$this->uri = Utils::replaceFirstOccurrence($orig_root_path, $this->root_path, $this->uri);
|
||||
} else {
|
||||
$this->root = $this->base . $this->root_path;
|
||||
@@ -143,6 +148,7 @@ class Uri
|
||||
|
||||
$uri = str_replace(static::filterPath($this->root), '', $this->url);
|
||||
|
||||
|
||||
// remove the setup.php based base if set:
|
||||
$setup_base = $grav['pages']->base();
|
||||
if ($setup_base) {
|
||||
@@ -1185,7 +1191,6 @@ class Uri
|
||||
if ($this->host) {
|
||||
$this->host = $this->validateHostname($this->host) ? $this->host : 'unknown';
|
||||
}
|
||||
|
||||
// Filter userinfo, path, query string and fragment.
|
||||
$this->user = $this->user !== null ? static::filterUserInfo($this->user) : null;
|
||||
$this->password = $this->password !== null ? static::filterUserInfo($this->password) : null;
|
||||
|
||||
Reference in New Issue
Block a user