From 49d30a54c661e11f54b5f3331a91b894eac13004 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 1 Mar 2009 19:59:41 +0000 Subject: [PATCH] Escape hyphen in regex. Props chrisbliss18. fixes #8548 #9244 for 2.7 git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10677 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 4634075a83..22e46bc876 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -849,7 +849,7 @@ function preview_theme() { if ( !current_user_can( 'switch_themes' ) ) return; - $_GET['template'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['template']); + $_GET['template'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['template']); if ( validate_file($_GET['template']) ) return; @@ -857,7 +857,7 @@ function preview_theme() { add_filter('template', create_function('', "return '{$_GET['template']}';") ); if ( isset($_GET['stylesheet']) ) { - $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['stylesheet']); + $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['stylesheet']); if ( validate_file($_GET['stylesheet']) ) return; add_filter('stylesheet', create_function('', "return '{$_GET['stylesheet']}';") );