WP 2.7.1 bug report (1 post)

  1. myst_dg
    Posted 7 years ago #

    I'm not sure whether this post should be here or not.

    I upgraded to WordPress 2.7.1 just a few hours ago. Then I found that all my themes are not displayed in preview window from admin control panel.

    After checking the list of fixed tickets, I found this:
    This fixed ticket of wp-includes/theme.php brings another problem: theme folder containers the character "-" will not show in preview window! Because the regular expression string is misunderstood.

    Version 2.7
    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 (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 (my fixed file)
    line 852
    $_GET['template'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['template']);

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

    I'm a freshman in coding, so if anything's not clear or still has problem, please tell me.

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.