Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #56922, comment 38


Ignore:
Timestamp:
10/10/2023 12:25:21 PM (8 months ago)
Author:
antonvlasenko
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #56922, comment 38

    v2 v3  
    33Thank you for the detailed reply, @spacedmonkey . I've read your response attentively and I agree with your explanation of how things are meant to work. However, that's not exatly the point I'm trying to make.
    44
    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.
     5Please take a look at this PHP snippet: https://3v4l.org/aARJS, 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.
    66
    77To 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.