Theme Previews borking in WPMu 2.7.1

The last few days I have been doing the arduous work of making sure the BuddyPress admin bar and D’Arcy’s Akismet Credit Inserter plugin work cleanly with all the themes on UMW Blogs. It’s painstaking work, but pretty important if BuddyPress is going to go live this fall. So, anyway, as I was going through our over 120 themes (the edited versions of which i will make available when finished) I found that almost 50 of the theme previews were just showing a white screen. Odd, so while I still haven’t updated UMW Blogs from 2.7.1 to 2.8.1 (still making sure the userthemes plugin is rock solid), I tested the same theme previews on the bava, which is running 2.8.1, and they worked. Long story short, this bug is fixed in 2.8.1, but if for some reason you can’t upgrade from 2.7.1 just yet, here is the fix which refers to the themes.php files within the wp-includes directory (wp-includes/theme.php):

Around line 852 replace

$_GET['template'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['template']);

with

$_GET['template'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['template']);

and around line 861 replace

$_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['stylesheet']);

with

$_GET['stylesheet'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['stylesheet']);

And if you are upgrading—which you should—then this is one more thing to cross off your list, cause 2.8.1 makes this bug go away.

This entry was posted in , themes, wpmu, wpmu development, wpmued. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *