diff --git wp-includes/nav-menu-template.php wp-includes/nav-menu-template.php
index 21898ab..ea795eb 100644
|
|
function _wp_menu_item_classes_by_context( &$menu_items ) { |
360 | 360 | |
361 | 361 | // if the menu item corresponds to the currently-requested URL |
362 | 362 | } elseif ( 'custom' == $menu_item->object ) { |
363 | | $current_url = untrailingslashit( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); |
364 | 363 | $item_url = untrailingslashit( strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url ); |
| 364 | if ( 0 === strpos( $item_url, '/' ) ) |
| 365 | $item_url = untrailingslashit( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] ) . $item_url; |
| 366 | |
| 367 | $current_url = untrailingslashit( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); |
365 | 368 | $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) ); |
366 | 369 | |
367 | 370 | if ( in_array( $item_url, array( $current_url, $_indexless_current ) ) ) { |