Topic:
WordPress is upgraded once again. Version 2.7.1 is now available on WordPress’ official site.
Problem:
Some bugs are fixed, but unfortunately we find a new bug in this release. If your theme folder name contains character “-”, you’ll have a blank preview window from the admin control panel. However this doesn’t matter much, you can still activate your theme and use it without any trouble.
Reason:
wp-includes/theme.php is changed a little in order to support subdirectories of themes.
Details here: http://core.trac.wordpress.org/attachment/ticket/8548/themefix.diff
The newer regular expression supports “/” which refers to subdirectories. But the meaning of “-” is misunderstood, this caused preview error when theme folder name contains “-”.
Solution:
Simply change the string sequence:
Ver 2.7.1 original (which supports subdirectories, but doesn’t support “-” in directory name)
line 852 $_GET['template'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['template']);
line 860 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['stylesheet']);
Ver 2.7.1, bug fixed
line 852 $_GET['template'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['template']);
line 860 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['stylesheet']);








