#13184 closed defect (bug) (fixed)
admin.php can re-include itself in certain environments
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | high |
Severity: | blocker | Version: | |
Component: | Administration | Keywords: | dev-feedback has-patch |
Focuses: | Cc: |
Description
admin.php?import=XX doesn't work on my environment. It includes admin-header.php, which then does a check:
if ( if (!isset($_GET["page"])) require_once('./admin.php');
This then requires admin.php, and it fails on redefinition of functions.
On my environment -- PHP 5.3.0, Apache 2.2.11, Mac (those bundled with 10.6) -- I can reproduce this on trunk, 2.9, and 2.8. The code itself has been around for years. I'm not really sure why this is cropping up now.
This originated on the wp-testers list, on someone running a similar setup (though PHP 5.3.1). westi tested (I think he uses MAMP) and it worked on 5.3.1, 5.3.6, and I think a 5.2 branch.
Suggested fix:
if ( if (!defined('WP_ADMIN')) require_once('./admin.php');
That said, there may be a reason for the code as it is.
Note: See
TracTickets for help on using
tickets.
(In [14334]) Fix admin.php?import=x pages, which can re-include itself in certain environments. fixes #13184 for trunk.