mirror of
https://github.com/getgrav/grav.git
synced 2026-02-09 08:07:49 +01:00
Allows '+' in the URLs, such as http://localhost/grav/blog/tag:c++
This commit is contained in:
@@ -492,7 +492,7 @@ class Grav extends Container
|
||||
if ($page) {
|
||||
$media = $page->media()->all();
|
||||
|
||||
$parsed_url = parse_url(urldecode($uri->basename()));
|
||||
$parsed_url = parse_url(rawurldecode($uri->basename()));
|
||||
|
||||
$media_file = $parsed_url['path'];
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ class Uri
|
||||
if (strpos($bit, $delimiter) !== false) {
|
||||
$param = explode($delimiter, $bit);
|
||||
if (count($param) == 2) {
|
||||
$plain_var = filter_var(urldecode($param[1]), FILTER_SANITIZE_STRING);
|
||||
$plain_var = filter_var(rawurldecode($param[1]), FILTER_SANITIZE_STRING);
|
||||
$this->params[$param[0]] = $plain_var;
|
||||
}
|
||||
} else {
|
||||
@@ -206,7 +206,7 @@ class Uri
|
||||
*/
|
||||
public function route($absolute = false, $domain = false)
|
||||
{
|
||||
return urldecode(($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths));
|
||||
return rawurldecode(($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,7 +268,7 @@ class Uri
|
||||
public function param($id)
|
||||
{
|
||||
if (isset($this->params[$id])) {
|
||||
return urldecode($this->params[$id]);
|
||||
return rawurldecode($this->params[$id]);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -545,8 +545,8 @@ class Uri
|
||||
|
||||
if (file_exists($full_path)) {
|
||||
// do nothing
|
||||
} elseif (file_exists(urldecode($full_path))) {
|
||||
$full_path = urldecode($full_path);
|
||||
} elseif (file_exists(rawurldecode($full_path))) {
|
||||
$full_path = rawurldecode($full_path);
|
||||
} else {
|
||||
return $normalized_url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user