Skip to content

Commit

Permalink
Merge pull request #69 from maximehuran/feature/correct-prepare-slug
Browse files Browse the repository at this point in the history
Remove correctly the locale at the beginning of the route
  • Loading branch information
maximehuran committed Jun 24, 2024
2 parents 2802ac4 + 2c31e41 commit f1a5036
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Routing/RequestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ private function prepareSlug(string $slug): string
return $slug;
}

return ltrim($slug, sprintf('%s/', $localeCode));
// Remove the locale code which is at the beginning of the slug
return (string) preg_replace(sprintf('/^%s\//', $localeCode), '', $slug);
}

/**
Expand Down

0 comments on commit f1a5036

Please sign in to comment.