WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13977 closed defect (bug) (fixed)

home link current_page nav menu defect on IIS

Reported by: andddd Owned by: filosofo
Milestone: 3.0.1 Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: menu highlight current_page_item has-patch
Focuses: Cc:

Description

I'm using IIS and fresh WordPress 3.0 without any URL Rewrite software and I found a defect in wp-includes/nav-menu-template.php (line 365) which prevents home link highlight.

$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
			

...


if ( untrailingslashit($current_url) == home_url() ) {
   $classes[] = 'menu-item-home';

...

$current_url is always http(s)://mysite.com/index.php on the front page and my home_url() is always http(s)://mysite.com so both variables never be equal.

Attachments (1)

recognize-home-link-with-index.13977.diff (1.2 KB) - added by filosofo 4 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 ocean904 years ago

Related #13994

comment:2 filosofo4 years ago

  • Keywords has-patch added

Does recognize-home-link-with-index.13977.diff fix it for you?

comment:3 andddd4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Yes, now it works, thank you!

comment:4 andddd4 years ago

  • Cc and@… added

comment:5 filosofo4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

It's not "fixed" until the patch gets committed to WordPress trunk.

comment:6 andddd4 years ago

I thought I should change status to fixed, sorry.

comment:7 filosofo4 years ago

  • Owner set to filosofo
  • Status changed from reopened to accepted

comment:8 ryan4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [15320]) Fix current page detection for home when index.php is in the requested URL. Props filosofo. fixes #13977 for 3.1

comment:9 ryan4 years ago

(In [15321]) Fix current page detection for home when index.php is in the requested URL. Props filosofo. fixes #13977 for 3.0.1

Note: See TracTickets for help on using tickets.