Make WordPress Core


Ignore:
Timestamp:
01/18/2013 01:44:22 PM (12 years ago)
Author:
markjaquith
Message:

Consistently use $wp_rewrite->index instead of hardcoding "index.php".

props wonderboymusic. fixes #7337

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/nav-menu-template.php

    r22302 r23305  
    368368            $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
    369369            $item_url = untrailingslashit( $raw_item_url );
    370             $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) );
     370            $_indexless_current = untrailingslashit( preg_replace( '/' . preg_quote( $wp_rewrite->index, '/' ) . '$/', '', $current_url ) );
    371371
    372372            if ( $raw_item_url && in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) {
Note: See TracChangeset for help on using the changeset viewer.