Changes between Version 1 and Version 2 of Ticket #56922, comment 38
- Timestamp:
- 10/10/2023 12:19:50 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #56922, comment 38
v1 v2 5 5 Please take a look at this PHP snippet: https://3v4l.org/Vp3Xb, specifically at its output at the very bottom of the page. Notice how the `$current_regular_expression` matches IDs that shouldn't be matched. Conversely, `$fixed_regular_expression` works as intended, not matching the incorrect IDs. 6 6 7 To fix the issue, `(?:\/[^\/:<>\*\?"\|]+)?` should be replaced with `\/ [^\/:<>\*\?"\|]+` in all regular expressions defining the routes in the new controllers, because the group that matches the template ID (`post_name`) part of the ID should not be optional.7 To fix the issue, `(?:\/[^\/:<>\*\?"\|]+)?` should be replaced with `\/\/?[^\/:<>\*\?"\|]+` in all regular expressions defining the routes in the new controllers, because the group that matches the template ID (`post_name`) part of the ID should not be optional. 8 8 I've added these changes as code review suggestions for your consideration.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)