mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
fix whitespace encoding in urls (#3719)
* fix broken src url encoding * remove redundant code * Revert "remove redundant code" This reverts commit4e0020114e. * Revert "fix broken src url encoding" This reverts commit3e8259da3a. * encode whitespaces in url paths
This commit is contained in:
parent
b1117e45c9
commit
6a9b1f2214
|
|
@ -244,6 +244,7 @@ class Excerpts
|
|||
$id = $element_excerpt['id'] ?? '';
|
||||
|
||||
$excerpt['element'] = $medium->parsedownElement($title, $alt, $class, $id, true);
|
||||
$excerpt['element']['attributes']['src'] = str_replace(' ', '%20', $excerpt['element']['attributes']['src']);
|
||||
} else {
|
||||
// Not a current page media file, see if it needs converting to relative.
|
||||
$excerpt['element']['attributes']['src'] = Uri::buildUrl($url_parts);
|
||||
|
|
|
|||
|
|
@ -761,7 +761,7 @@ class Uri
|
|||
$pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
|
||||
$pass = ($user || $pass) ? "{$pass}@" : '';
|
||||
$path = $parsed_url['path'] ?? '';
|
||||
$path = !empty($parsed_url['params']) ? rtrim($path, '/') . static::buildParams($parsed_url['params']) : $path;
|
||||
$path = !empty($parsed_url['params']) ? str_replace(' ', '%20', rtrim($path, '/')) . static::buildParams($parsed_url['params']) : str_replace(' ', '%20', $path);
|
||||
$query = !empty($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
|
||||
$fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user