Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions modules/oe_multilingual_url_suffix/src/UrlSuffixTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public function getUrlSuffixes(string $path = ''): array {
* The suffix.
*/
public function getSuffixFromPath(string $path): string {
$parsed = UrlHelper::parse($path);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewer: why calling UrlHelper:parse if the content of $path is already expected to be a path, without query string and fragment?
Where this function is called, it is the result of $request->getPathInfo(), which already return only the path part of the URL. This can be seen in the documentation of the function:
image

$path = urldecode(trim($parsed['path'], '/'));
$path = urldecode(trim($path, '/'));
$parts = explode(LanguageNegotiationUrlSuffix::SUFFIX_DELIMITER, $path);
return $parts ? array_pop($parts) : '';
}
Expand Down