From 713c82dfd2e6d2cbb672008b0a16910186617e4e Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 29 Jul 2008 17:03:00 +0000 Subject: [PATCH] Allow dots in theme dirs when previewing. fixes #7482 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@8485 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 6376075f1..2ed733582 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -486,12 +486,17 @@ 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; 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]';") ); }