]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/themes.php
Wordpress 2.0.11-scripts
[autoinstalls/wordpress.git] / wp-admin / themes.php
index a17ea3cdc9d0a8683deaafc82c2988a23ec1032c..87678ff3046b9081b715a786e050ca26a05c9932 100644 (file)
@@ -2,7 +2,7 @@
 require_once('admin.php');
 
 if ( isset($_GET['action']) ) {
 require_once('admin.php');
 
 if ( isset($_GET['action']) ) {
-       check_admin_referer();
+       check_admin_referer('switch-theme_' . $_GET['template']);
        
        if ('activate' == $_GET['action']) {
                if ( isset($_GET['template']) )
        
        if ('activate' == $_GET['action']) {
                if ( isset($_GET['template']) )
@@ -13,7 +13,7 @@ if ( isset($_GET['action']) ) {
                
                do_action('switch_theme', get_current_theme());
                
                
                do_action('switch_theme', get_current_theme());
                
-               header('Location: themes.php?activated=true');
+               wp_redirect('themes.php?activated=true');
                exit;
        }
 }
                exit;
        }
 }
@@ -69,7 +69,7 @@ foreach ($theme_names as $theme_name) {
        $author = $themes[$theme_name]['Author'];
        $screenshot = $themes[$theme_name]['Screenshot'];
        $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
        $author = $themes[$theme_name]['Author'];
        $screenshot = $themes[$theme_name]['Screenshot'];
        $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
-       $activate_link = "themes.php?action=activate&template=$template&stylesheet=$stylesheet";
+       $activate_link = wp_nonce_url("themes.php?action=activate&template=$template&stylesheet=$stylesheet", 'switch-theme_' . $template);
 ?>
 <div class="available-theme">
 <h3><a href="<?php echo $activate_link; ?>"><?php echo "$title $version"; ?></a></h3>
 ?>
 <div class="available-theme">
 <h3><a href="<?php echo $activate_link; ?>"><?php echo "$title $version"; ?></a></h3>