WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#4006 closed defect (bug) (fixed)

wp_die stylesheet path needs to be absolute

Reported by: filosofo Owned by:
Milestone: 2.3 Priority: low
Severity: normal Version: 2.2
Component: Administration Keywords: wp_die stylesheet is_wp_error has-patch
Focuses: Cc:

Description

I have a plugin that calls wp_die, but not in the WP top-level directory, so the relative links to the error message stylesheet don't work.

The attached patch makes the path to the stylesheet absolute.

Attachments (3)

trunk.diff (580 bytes) - added by filosofo 8 years ago.
trunk.2.diff (1018 bytes) - added by filosofo 8 years ago.
4006.diff (656 bytes) - added by Nazgul 7 years ago.

Download all attachments as: .zip

Change History (10)

@filosofo8 years ago

comment:1 @foolswisdom8 years ago

  • Milestone changed from 2.3 to 2.2
  • Version set to 2.2

comment:2 follow-up: @Sewar8 years ago

This way wp_die won't work if WP didn't installed yet, see #3138.

But if #4003 committed, this will be usable.

comment:3 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

@filosofo8 years ago

comment:4 in reply to: ↑ 2 @filosofo8 years ago

  • Keywords is_wp_error added

Replying to Sewar:

This way wp_die won't work if WP didn't installed yet, see #3138.

Oops. I wondered why that existing code was there.

The second patch works even without wp installed, in the top-level directory and in wp-admin.

I also added a fix you can see in the upper half of the patch for a problematic call to is_wp_error if you try to run /wp-admin/install.php

comment:5 @Sewar8 years ago

Great, if this code moved to get_bloginfo('wpurl') it will be possible for other parts of WP to use it also.

Thanks a lot for fixing these bugs.

@Nazgul7 years ago

comment:6 @Nazgul7 years ago

New patch which tries multiple ways of determining the admin_dir if the previous one fails.

comment:7 @markjaquith7 years ago

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

(In [6057]) Try more ways of getting wp-admin URL in wp_die(). props Nazgul. fixes #4006

Note: See TracTickets for help on using tickets.