WordPress.org

Make WordPress Core

Ticket #23587: miqro-23587.patch

File miqro-23587.patch, 780 bytes (added by miqrogroove, 4 years ago)

This would allow any chars in the pattern.

  • src/wp-includes/rewrite.php

     
    362362                if ( !empty($url) && ($url != $request) && (strpos($match, $url) === 0) )
    363363                        $request_match = $url . '/' . $request;
    364364
    365                 if ( preg_match("!^$match!", $request_match, $matches) ) {
     365                $pattern = '@^' . str_replace('@', '\@', $match) . '@';
    366366
     367                if ( preg_match($pattern, $request_match, $matches) ) {
     368
    367369                        if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) {
    368370                                // this is a verbose page match, lets check to be sure about it
    369371                                if ( ! get_page_by_path( $matches[ $varmatch[1] ] ) )