[wp-trac] [WordPress Trac] #23587: url_to_postid() needs to use # or @ for preg_match start/end character

WordPress Trac noreply at wordpress.org
Fri Feb 22 19:10:22 UTC 2013


#23587: url_to_postid() needs to use # or @ for preg_match start/end character
-----------------------------+---------------------------
 Reporter:  coreygilmore     |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Rewrite Rules
  Version:  3.5.1            |   Severity:  normal
 Keywords:  needs-patch      |
-----------------------------+---------------------------
 [source:/tags/3.5.1/wp-includes/rewrite.php at 23479#L344 url_to_postid()]
 uses ! for the start/end characters of regular expressions, which doesn't
 allow you to use expressions containing `!`, like `(?!negativelookahead)`.

 The solution is to use `preg_match("#^$match#", $request_match, $matches)`
 or `preg_match("@^$match@", $request_match, $matches)`


 See also: #7486 and [source:/tags/3.5.1/wp-includes/class-wp.php#L204
 WP::parse_request()]

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23587>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list