mirror of
https://github.com/getgrav/grav.git
synced 2026-02-04 22:00:13 +01:00
@@ -484,7 +484,7 @@ class Grav extends Container
|
||||
if ($page) {
|
||||
$media = $page->media()->all();
|
||||
|
||||
$parsed_url = parse_url(rawurldecode($uri->basename()));
|
||||
$parsed_url = parse_url(urldecode($uri->basename()));
|
||||
|
||||
$media_file = $parsed_url['path'];
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ trait ParsedownGravTrait
|
||||
|
||||
// get the local path to page media if possible
|
||||
if ($path_parts['dirname'] == $this->page->url(false, false, false)) {
|
||||
$url['path'] = rawurldecode($path_parts['basename']);
|
||||
$url['path'] = urldecode($path_parts['basename']);
|
||||
// get the media objects for this page
|
||||
$media = $this->page->media();
|
||||
} else {
|
||||
@@ -204,7 +204,7 @@ trait ParsedownGravTrait
|
||||
$ext_page = $this->pages->dispatch($page_route, true);
|
||||
if ($ext_page) {
|
||||
$media = $ext_page->media();
|
||||
$url['path'] = rawurldecode($path_parts['basename']);
|
||||
$url['path'] = urldecode($path_parts['basename']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ trait ParsedownGravTrait
|
||||
|
||||
// loop through actions for the image and call them
|
||||
foreach ($actions as $action) {
|
||||
$medium = call_user_func_array(array($medium, $action['method']), explode(',', rawurldecode($action['params'])));
|
||||
$medium = call_user_func_array(array($medium, $action['method']), explode(',', urldecode($action['params'])));
|
||||
}
|
||||
|
||||
if (isset($url['fragment'])) {
|
||||
|
||||
@@ -449,7 +449,7 @@ class Medium extends Data implements RenderableInterface
|
||||
{
|
||||
$qs = $method;
|
||||
if (count($args) > 1 || (count($args) == 1 && !empty($args[0]))) {
|
||||
$qs .= '=' . implode(',', array_map(function ($a) { return rawurlencode($a); }, $args));
|
||||
$qs .= '=' . implode(',', array_map(function ($a) { return urlencode($a); }, $args));
|
||||
}
|
||||
|
||||
if (!empty($qs)) {
|
||||
|
||||
@@ -170,7 +170,7 @@ class Uri
|
||||
if (strpos($bit, $delimiter) !== false) {
|
||||
$param = explode($delimiter, $bit);
|
||||
if (count($param) == 2) {
|
||||
$plain_var = filter_var(rawurldecode($param[1]), FILTER_SANITIZE_STRING);
|
||||
$plain_var = filter_var(urldecode($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 rawurldecode(($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths));
|
||||
return urldecode(($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,7 +268,7 @@ class Uri
|
||||
public function param($id)
|
||||
{
|
||||
if (isset($this->params[$id])) {
|
||||
return rawurldecode($this->params[$id]);
|
||||
return urldecode($this->params[$id]);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -545,8 +545,8 @@ class Uri
|
||||
|
||||
if (file_exists($full_path)) {
|
||||
// do nothing
|
||||
} elseif (file_exists(rawurldecode($full_path))) {
|
||||
$full_path = rawurldecode($full_path);
|
||||
} elseif (file_exists(urldecode($full_path))) {
|
||||
$full_path = urldecode($full_path);
|
||||
} else {
|
||||
return $normalized_url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user