Match only valid locales for localized routes.

This commit is contained in:
Jan Böhmer 2019-09-12 18:30:12 +02:00
parent 0bfcec77fb
commit 6e74eb8276

View file

@ -3,3 +3,6 @@ controllers:
type: annotation type: annotation
prefix: '{_locale}' prefix: '{_locale}'
requirements:
# Match only locales like de_DE or de
_locale: "^[a-z]{2}(_[A-Z]{2})?$"