Make WordPress Core

Ticket #26970: 26970.2.diff

File 26970.2.diff, 634 bytes (added by Denis-de-Bernardy, 11 years ago)

fix the actually problematic regex

  • wp-includes/rewrite.php

    diff --git wp-includes/rewrite.php wp-includes/rewrite.php
    index 2b48cdf..5bbaa9c 100644
    function url_to_postid($url) { 
    354354                if ( !empty($url) && ($url != $request) && (strpos($match, $url) === 0) )
    355355                        $request_match = $url . '/' . $request;
    356356
    357                 if ( preg_match("!^$match!", $request_match, $matches) ) {
     357                if ( preg_match("#^$match#", $request_match, $matches) ) {
    358358
    359359                        if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) {
    360360                                // this is a verbose page match, lets check to be sure about it