From 6e74eb82765f3f3115ecadc0696fd646d7ca7801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Thu, 12 Sep 2019 18:30:12 +0200 Subject: [PATCH] Match only valid locales for localized routes. --- config/routes/annotations.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/routes/annotations.yaml b/config/routes/annotations.yaml index 836fcabc..bb85917e 100644 --- a/config/routes/annotations.yaml +++ b/config/routes/annotations.yaml @@ -3,3 +3,6 @@ controllers: type: annotation prefix: '{_locale}' + requirements: + # Match only locales like de_DE or de + _locale: "^[a-z]{2}(_[A-Z]{2})?$"