Opened 5 years ago

Closed 4 years ago

#6478 closed defect (bug) (fixed)

index.php file in the plugins folder makes the Dashboard fail

Reported by: networker Owned by: anonymous
Priority: normal Milestone: 2.8
Component: General Version: 2.7
Severity: normal Keywords: has-patch commit
Cc:

Description

The "Dashboard" tab in WordPress 2.5 at the far upper left contains the following URL:
http://www.example.com/wp-admin/admin.php?page=index.php

When this tab is clicked it, all the Dashboard widgets disappear in Firefox (2.0.0.12). I'm left with a plain screen of links.

When the page is pulled up with the following URL: it works fine with all the Dashboard widget functionality.
http://www.example.com/wp-admin/

Attachments (1)

9478-real-fix.diff (2.0 KB) - added by Denis-de-Bernardy 4 years ago.
actually fix this and optimize

Download all attachments as: .zip

Change History (18)

My dashboard link using r7579 points to /wp-admin/index.php.

When I try going to the link you gave, I get "Cannot load index.php." in Opera 9.26, Firefox 2.0.0.13 and 2.0.0.12. IE7 gives me its generic "Cannot be displyed" error page

  • Milestone set to 2.5.1
  • Version set to 2.5

Works for me on FF & IE 7 using r7583

Works for me as well.

Disable all plugins and try again.

I'm still getting the issue with today's 2.5 branch. no plugins, default theme.

comment:6   ryan5 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

  • Milestone 2.9 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Re-open if still current in 2.7 and not a local config issue.

  • Summary changed from Dashboard widgets disappear after clicking "Dashboard" link to index.php file in the plugins folder makes the Dashboard fail

I nailed this down since. It was due to the presence of an index.php file in the plugins folder, and the bug is, I suspect, the same as this one:

http://trac.wordpress.org/ticket/6422

  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Version changed from 2.5 to 2.7

still current in wp 2.7 with an index.php file in the plugins folder

  • Keywords dev-feedback added
  • Milestone set to 2.9

Its quite easy to "fix" this, Simply removing all references to file_exists() in wp-admin/menu-header.php will work.

However, Doing so, Will remove the ability for plugins to have menu items which are linked to files which are dumped into the wp-admin folder (There are a number of cobbled together items where people have been directed to put files in wp-content AND wp-admin), It'll also remove the ability for overriding admin pages via a .php file, It'd still be possible to hook via a action tho.
It might also remove the menu for any old plugins which add their menu item manually via array-fu

The menu code seems to need a clean up to me, I'd love to be able to specify the exact URL for a menu item when adding (ie. wp-admin/posts.php/test/example or post.php?example=url), as well as a few other items.. But staying backwards compatible is hard.

Setting to 2.9 due to no patch. Can be pulled into 2.8 if/when theres a patch, Unless its decided to leave it as-is to retain functionality. dev-feedback to see if menu should be changed, or existing functionality retained.

  • Milestone changed from 2.9 to 2.7.1
  • Resolution set to fixed
  • Status changed from reopened to closed

(In [10510]) Ignore index.php in plugins dir when creating menus. fixes #6478

(In [10511]) Ignore index.php in plugins dir when creating menus. fixes #6478 for 2.7

(In [10516]) Ignore index.php in plugins dir when creating menus. fixes #6478

(In [10517]) Ignore index.php in plugins dir when creating menus. fixes #6478 for 2.7

actually fix this and optimize

  • Keywords has-patch commit added; dev-feedback removed
  • Milestone changed from 2.7.1 to 2.8
  • Resolution fixed deleted
  • Status changed from closed to reopened

applied patches don't work. attached patch fixes the issue, and places the check before the calls to file_exists to avoid uneeded filesystem calls.

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

(In [10890]) Ignore index.php in plugins dir when creating menus. Props Denis-de-Bernardy. fixes #6478

Note: See TracTickets for help on using tickets.