Skip to content

Commit f1a5036

Browse files
authored
Merge pull request #69 from maximehuran/feature/correct-prepare-slug
Remove correctly the locale at the beginning of the route
2 parents 2802ac4 + 2c31e41 commit f1a5036

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Routing/RequestContext.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ private function prepareSlug(string $slug): string
8181
return $slug;
8282
}
8383

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

8788
/**

0 commit comments

Comments
 (0)