WordPress.org

Make WordPress Core

Ticket #23587: 23587_regex_delimiters.patch

File 23587_regex_delimiters.patch, 966 bytes (added by stevenkword, 5 years ago)
  • wp-includes/rewrite.php

     
    341341                if ( !empty($url) && ($url != $request) && (strpos($match, $url) === 0) ) 
    342342                        $request_match = $url . '/' . $request; 
    343343 
    344                 if ( preg_match("!^$match!", $request_match, $matches) ) { 
     344                if ( preg_match("#^$match#", $request_match, $matches) ) { 
    345345 
    346346                        if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) { 
    347347                                // this is a verbose page match, lets check to be sure about it 
     
    351351 
    352352                        // Got a match. 
    353353                        // Trim the query of everything up to the '?'. 
    354                         $query = preg_replace("!^.+\?!", '', $query); 
     354                        $query = preg_replace("#^.+\?#", '', $query); 
    355355 
    356356                        // Substitute the substring matches into the query. 
    357357                        $query = addslashes(WP_MatchesMapRegex::apply($query, $matches));