Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#13184 closed defect (bug) (fixed)

admin.php can re-include itself in certain environments

Reported by: nacin's profile 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.

Change History (4)

#1 @aaroncampbell
14 years ago

  • Cc aaron@… added

#2 @nacin
14 years ago

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

(In [14334]) Fix admin.php?import=x pages, which can re-include itself in certain environments. fixes #13184 for trunk.

#3 @nacin
14 years ago

(In [14335]) Fix admin.php?import=x pages, which can re-include itself in certain environments. fixes #13184 for 2.9.

#4 @nacin
14 years ago

(In [14336]) Fix admin.php?import=x pages, which can re-include itself in certain environments. fixes #13184 for 2.8.

Note: See TracTickets for help on using tickets.