Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r18746 r19658  
    363363            $_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] );
    364364            $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_root_relative_current;
    365             $item_url = untrailingslashit( strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url );
     365            $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
     366            $item_url = untrailingslashit( $raw_item_url );
    366367            $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) );
    367368
    368             if ( in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) {
     369            if ( $raw_item_url && in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) {
    369370                $classes[] = 'current-menu-item';
    370371                $menu_items[$key]->current = true;
Note: See TracChangeset for help on using the changeset viewer.