#7337 closed defect (bug) (fixed)
Consistently use $wp_rewrite->index instead of hardcoding "index.php"
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | 3.6 |
| Component: | Permalinks | Version: | 2.6 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | mikeschinkel@… |
Description
A few place in our URL generation and canonicalization code use hardcoded "index.php" instead of using $wp_rewrite->index
This prevents people from using custom PATHINFO permalinks.
Attachments (2)
Change History (17)
- Keywords needs-patch added; permalinks, pathinfo removed
- Component changed from General to Permalinks
- Owner changed from anonymous to ryan
comment:5
follow-up:
↓ 7
solarissmoke — 2 years ago
- Keywords close added
comment:6
mikeschinkel — 2 years ago
- Cc mikeschinkel@… added
comment:7
in reply to:
↑ 5
SergeyBiryukov — 22 months ago
- Keywords close removed
Replying to solarissmoke:
Is this still an issue?
Yep, in some files:
- canonical.php
- link-template.php
- nav-menu-template.php (maybe unrelated though)
- rewrite.php
wonderboymusic — 7 months ago
comment:9
wonderboymusic — 5 months ago
- Milestone changed from Future Release to 3.6
Moving to 3.6 for review
comment:10
markjaquith — 4 months ago
- Resolution set to fixed
- Status changed from new to closed
In 23305:
comment:11
andrewryno — 4 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
This breaks _wp_menu_item_classes_by_context() in nav-menu-template.php.
Notice: Undefined variable: wp_rewrite in wp-includes/nav-menu-template.php on line 370
Notice: Trying to get property of non-object in wp-includes/nav-menu-template.php on line 370
Need $wp_rewrite to be global for it to work.
Not sure if it breaks other places, but this is the only one I've seen.
andrewryno — 4 months ago
comment:12
wonderboymusic — 4 months ago
I wrote the patch a while ago, thanks for catching that :)
comment:13
ryan — 4 months ago
- Resolution set to fixed
- Status changed from reopened to closed
In 23309:
comment:14
Viper007Bond — 4 months ago
Why not have a helper function that returns this value so that the $wp_rewrite global isn't needed? Much less prone to issues and doesn't require using global.
comment:15
andrewryno — 4 months ago
That would probably be better. Mine was a rather quick patch and I believe it's a global in other instances (and a global was already being defined for $wp_query) so it just made it seem more consistent.

Is this still an issue?