Skip to content

Commit

Permalink
Revert "fix whitespace encoding in urls" (#3764)
Browse files Browse the repository at this point in the history
* Revert "fix whitespace encoding in urls (#3719)"

This reverts commit 6a9b1f2.

* Revert change
  • Loading branch information
w00fz authored Oct 28, 2023
1 parent 0b53609 commit 0c9333e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Fixed a math rounding issue with number validation when using floating point steps [#3761](https://github.com/getgrav/grav/issues/3761)
* Fixed an issue with `Inflector::ordinalize()` not working as expected [#3759](https://github.com/getgrav/grav/pull/3759)
* Fix for invalid input to foreach in `UserGroupObject` [#3724](https://github.com/getgrav/grav/pull/3724)
* Fix whitespace encoding in URLs (#3661)[https://github.com/getgrav/grav/pull/3719]
* Fixed exception: `Property 'jsmodule_pipeline_include_externals' does not exist in object` (#3661)[https://github.com/getgrav/grav/pull/3661]
* Fixed `too few arguments exception` in FlexObjects [#3658](https://github.com/getgrav/grav/pull/3658)

Expand Down
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 0c9333e

Please sign in to comment.