Closed
Description
Symfony version(s) affected: 4.1.0
Description
My current application is running on 3.4.11, today I tried to upgrade it to the latest 4.1.0 but when I boot it up I get the following:
preg_match(): Compilation failed: invalid UTF-8 string at offset 993
With a stack trace ending at the PhpMatcherDumper trying to match the following expression
{^(?|/en/(?|classifieds/(?|([^/]+)\-(\d+)\.html(*:1281)|([^/]+)\-(\d+)/print(*:1310)|([^/]+)\-(\d+)/share(*:1339)|([^/]+)\-(\d+)/gallery(*:1370)|([^/]+)\-(\d+)/report\-problem(*:1409)|([^/]+)\-(\d+)/promote(*:1440)|logout/(\d+)(*:1461)|update/(\d+)(*:1482)|delete/(\d+)(*:1503))|обяви/(?|([^/]+)\-(\d+)/отпечатай(*:1560)|([^/]+)\-(\d+)/успешно\-докладван\-проблем(*:1634)|([^/]+)\-(\d+)/оферта(*:1670)|(\d+)/обявата\-изтрита\-успешно(*:1731))|listings/new\-password/(\d+)/([^/]++)(*:1778))|/обяви/(?|([^/]+)\-(\d+)\.html(*:1823)|([^/]+)\-(\d+)/принтирай(*:1865)|([^/]+)\-(\d+)/отпечатай(*:1907)|([^/]+)\-(\d+)/изпрати\-на\-приятел(*:1967)|([^/]+)\-(\d+)/снимки(*:2003)|([^/]+)\-(\d+)/докладвай\-проблем(*:2061)|([^/]+)\-(\d+)/успешно\-докладван\-проблем(*:2135)|([^/]+)\-(\d+)/промотирай(*:2179)|([^/]+)\-(\d+)/оферта(*:2215)|из�(?|�од/(\d+)(*:2243)|�рий\-обява/(\d+)(*:2277))|редактиране\-на\-обява/(\d+)(*:2333)|(\d+)/обявата\-изтрита\-успешно(*:2394))|/listings/new\-password/(\d+)/([^/]++)(*:2442))$}sDu
It breaks on some UTF-8 characters, trying to match two routes - /изход and /изтрий-обява which have the same first two letters.
How to reproduce
The two routes are defined as:
listing_logout:
path: /обяви/изход/{id}
defaults:
_controller: AppBundle:Listing/Login:listingLogout
requirements:
id: \d+
options:
utf8: true
and
listing_delete:
path: /обяви/изтрий-обява/{id}
defaults:
_controller: AppBundle:Listing/Listing:delete
requirements:
id: \d+
options:
utf8: true
Possible Solution
Additional context