Make WordPress Core

Changeset 15584


Ignore:
Timestamp:
09/07/2010 04:17:37 AM (14 years ago)
Author:
markjaquith
Message:

When doing current page highlighting logic, apply untrailingslashit() to everything so that slash additions or omissions still match. fixes #14208. props filosofo

File:
1 edited

Legend:

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

    r15545 r15584  
    360360        // if the menu item corresponds to the currently-requested URL
    361361        } elseif ( 'custom' == $menu_item->object ) {
    362             $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    363             $item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
    364             $_indexless_current = preg_replace( '/index.php$/', '', $current_url );
     362            $current_url = untrailingslashit( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     363            $item_url = untrailingslashit( strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url );
     364            $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) );
    365365           
    366366            if ( in_array( $item_url, array( $current_url, $_indexless_current ) ) ) {
Note: See TracChangeset for help on using the changeset viewer.