Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#12428 closed defect (bug) (fixed)

Renaming the active theme results in massive failures

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

Part of this was handled in [13469], but I'm finding that a theme name with an apostrophe produces additional failures relating to storing and retrieving theme data.

I'm ticketing this so I don't forget to follow up on it.

Attachments (1)

12428.diff (528 bytes) - added by nacin 15 years ago.
Clears cached name of the current theme if there is no corresponding theme.

Download all attachments as: .zip

Change History (4)

#1 @nacin
15 years ago

  • Owner set to nacin
  • Status changed from new to accepted

The remaining issue is actually renaming an active theme. We should add a sanity check to current_theme_info() that if $theme[$current_theme] isn't set, when we clear the 'current_theme' option and attempt to get_current_theme() again.

@nacin
15 years ago

Clears cached name of the current theme if there is no corresponding theme.

#2 @nacin
15 years ago

  • Keywords has-patch added
  • Summary changed from Apostrophes in theme names result in massive failures to Renaming the active theme results in massive failures

get_current_theme() returns the current_theme option if it exists, otherwise it calculates it from the stylesheet and template paths. Patch attached removes the current_theme option and calls get_current_theme() again, if the theme isn't found in the result returned by get_themes().

To reproduce: Activate a theme, then rename it. A few different admin pages, including wp-admin/themes.php, should flip out a bit.

To test: Apply patch, activate a theme, then rename it.

#3 @nacin
15 years ago

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

(In [13762]) Clear cache of current theme name, if the theme name no longer exists. Fixes failures when an an active theme is renamed in its stylesheet. fixes #12428

Note: See TracTickets for help on using tickets.