Make WordPress Core


Ignore:
Timestamp:
08/28/2015 03:30:55 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Avoid PHP notices in redirect_canonical() and _wp_menu_item_classes_by_context() if $_SERVER['HTTP_HOST'] is not set.

fixes #32229.

File:
1 edited

Legend:

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

    r33585 r33775  
    554554
    555555        // if the menu item corresponds to the currently-requested URL
    556         } elseif ( 'custom' == $menu_item->object ) {
     556        } elseif ( 'custom' == $menu_item->object && isset( $_SERVER['HTTP_HOST'] ) ) {
    557557            $_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] );
    558558            $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current );
Note: See TracChangeset for help on using the changeset viewer.