Skip to content

Commit

Permalink
Revert "fix whitespace encoding in urls (#3719)"
Browse files Browse the repository at this point in the history
This reverts commit 6a9b1f2.
  • Loading branch information
w00fz authored Oct 28, 2023
1 parent 0b53609 commit 5602658
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion system/src/Grav/Common/Page/Markdown/Excerpts.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ public function processImageExcerpt(array $excerpt): array
$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);
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ public static function buildUrl($parsed_url)
$pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
$pass = ($user || $pass) ? "{$pass}@" : '';
$path = $parsed_url['path'] ?? '';
$path = !empty($parsed_url['params']) ? str_replace(' ', '%20', rtrim($path, '/')) . static::buildParams($parsed_url['params']) : str_replace(' ', '%20', $path);
$path = !empty($parsed_url['params']) ? rtrim($path, '/') . static::buildParams($parsed_url['params']) : $path;
$query = !empty($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
$fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';

Expand Down

0 comments on commit 5602658

Please sign in to comment.