WordPress.org

Make WordPress Core

Ticket #18144: 18144.patch

File 18144.patch, 979 bytes (added by SergeyBiryukov, 3 years ago)
  • wp-includes/nav-menu-template.php

     
    363363                        $current_url = untrailingslashit( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 
    364364                        $item_url = untrailingslashit( strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url ); 
    365365                        $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) ); 
     366                        $relative_url = untrailingslashit( $_SERVER['REQUEST_URI'] ); 
    366367 
    367                         if ( in_array( $item_url, array( $current_url, $_indexless_current ) ) ) { 
     368                        if ( in_array( $item_url, array( $current_url, $_indexless_current, $relative_url ) ) ) { 
    368369                                $classes[] = 'current-menu-item'; 
    369370                                $menu_items[$key]->current = true; 
    370371                                $_anc_id = (int) $menu_item->db_id;