8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symfony version(s) affected: 4.1.0
Description I'm having problem with router after 4.1 update on one of my routes I'm getting: Uncaught PHP Exception ErrorException: "Warning: preg_match(): Compilation failed: unmatched parentheses at offset 595" at /var/www/symfony/var/cache/dev/srcDevDebugProjectContainerUrlMatcher.php line 415 This looks like there is something wrong with generated regex.
Uncaught PHP Exception ErrorException: "Warning: preg_match(): Compilation failed: unmatched parentheses at offset 595" at /var/www/symfony/var/cache/dev/srcDevDebugProjectContainerUrlMatcher.php line 415
Additional context
Here is generated regex https://pastebin.com/egUBavqi
Routes in switch that matches url
849 => array(array('_route' => 'nsp_admin_package_createaction__invoke', '_format' => 'json', '_controller' => 'NSP\\Controller\\Admin\\Package\\CreateAction'), array('_format'), array('POST' => 0), null), 978 => array(array('_route' => 'nsp_admin_package_listaction__invoke', '_format' => 'json', '_controller' => 'NSP\\Controller\\Admin\\Package\\ListAction'), array('_format'), array('GET' => 0), null),
I'm calling: GET /admin/api/package.json
GET /admin/api/package.json
The text was updated successfully, but these errors were encountered:
Can you provide a small reproducer? E.g. a small set of routes that reproduce this?
Sorry, something went wrong.
The regexps you linked on pastbin are valid, they do not generate this error.
Status: waiting feedback
I spend some time with this, removing vendor and do clean install helps :/ probably something wrong with update, sorry to bother.
Sorry again, I just try run project in CI in clean environment and error still persists. I'm not able to create minimal example. But figure out that it should be possible to run whole srcDevDebugProjectContainerUrlMatcher.php class alone. So i created reproducer her: https://github.com/zajca/sf41-bug-routing-27504 There is whole auto-generated class with test.php which will trigger error.
test.php
I'm sorry but I cannot use your reproducer as the compiled container is just unreadable. Anyway, can you check if #27511 fixes the issue? If not, please provide a reproducer that starts from regular route configuration, so that I can compile on my own. Thanks in advance.
I've checked #27511 but srcDevDebugProjectContainerUrlMatcher is just same. I also tried to make reproducer by route configuration but routes are just fine, there is nothing special. Also all regex in srcDevDebugProjectContainerUrlMatcher are fine but still trigger error.
OK, i did reproduce this with 4 routes: https://github.com/zajca/sf41-bug-routing-27504 Also try to apply patch from #27511 to routing component and result is same.
Will be fixed by #27511
bug #27511 [Routing] fix matching host patterns, utf8 prefixes and no…
836f121
…n-capturing groups (nicolas-grekas) This PR was merged into the 4.1 branch. Discussion ---------- [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27448, #27461, #27504, #27512 | License | MIT | Doc PR | - Commits ------- 465b15c [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups
No branches or pull requests