Ticket #9152: 9152.3.patch
File 9152.3.patch, 1.0 KB (added by , 15 years ago) |
---|
-
wp-includes/theme.php
854 854 if ( validate_file($_GET['template']) ) 855 855 return; 856 856 857 add_filter( 'template', create_function('', "return '{$_GET['template']}';") );857 add_filter( 'template', create_function('', "return '{$_GET['template']}';") ); 858 858 859 859 if ( isset($_GET['stylesheet']) ) { 860 860 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['stylesheet']); 861 861 if ( validate_file($_GET['stylesheet']) ) 862 862 return; 863 add_filter( 'stylesheet', create_function('', "return '{$_GET['stylesheet']}';") );863 add_filter( 'stylesheet', create_function('', "return '{$_GET['stylesheet']}';") ); 864 864 } 865 865 866 // Prevent theme mods to current theme being used on theme being previewed 867 add_filter( 'pre_option_mods_' . get_current_theme(), create_function( '', "return array();" ) ); 868 866 869 ob_start( 'preview_theme_ob_filter' ); 867 870 } 868 871 add_action('setup_theme', 'preview_theme');