Ticket #9244: theme-preview-bug.diff
File theme-preview-bug.diff, 927 bytes (added by , 16 years ago) |
---|
-
wp-includes/theme.php
849 849 if ( !current_user_can( 'switch_themes' ) ) 850 850 return; 851 851 852 $_GET['template'] = preg_replace('|[^a-z0-9_. -/]|i', '', $_GET['template']);852 $_GET['template'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['template']); 853 853 854 854 if ( validate_file($_GET['template']) ) 855 855 return; … … 857 857 add_filter('template', create_function('', "return '{$_GET['template']}';") ); 858 858 859 859 if ( isset($_GET['stylesheet']) ) { 860 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_. -/]|i', '', $_GET['stylesheet']);860 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['stylesheet']); 861 861 if ( validate_file($_GET['stylesheet']) ) 862 862 return; 863 863 add_filter('stylesheet', create_function('', "return '{$_GET['stylesheet']}';") );