Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#13977 closed defect (bug) (fixed)

home link current_page nav menu defect on IIS

Reported by: andddd's profile andddd Owned by: filosofo's profile 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 15 years ago.

Download all attachments as: .zip

Change History (10)

#2 @filosofo
15 years ago

  • Keywords has-patch added

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

#3 @andddd
15 years ago

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

Yes, now it works, thank you!

#4 @andddd
15 years ago

  • Cc and@… added

#5 @filosofo
15 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

#6 @andddd
15 years ago

I thought I should change status to fixed, sorry.

#7 @filosofo
15 years ago

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

#8 @ryan
15 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

#9 @ryan
15 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.