Make WordPress Core

Changeset 3805


Ignore:
Timestamp:
05/26/2006 11:31:24 PM (20 years ago)
Author:
ryan
Message:

Update nonce action strings. Props mdawaffe.

Location:
branches/2.0/wp-admin
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-admin/admin-functions.php

    r3779 r3805  
    600600
    601601                    if ($category->cat_ID != $default_cat_id)
    602                         $edit .= "<td><a href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category &quot;%s&quot;.  All of its posts will go to the default category.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>";
     602                        $edit .= "<td><a href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category &quot;%s&quot;.  All of its posts will go to the default category.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>";
    603603                    else
    604604                        $edit .= "<td style='text-align:center'>".__("Default");
     
    644644    <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
    645645    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    646     <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-page' . $id) .  "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes(wp_specialchars(get_the_title(),'double')) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>
     646    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $id) .  "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes(wp_specialchars(get_the_title(),'double')) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>
    647647  </tr>
    648648
  • branches/2.0/wp-admin/categories.php

    r3771 r3805  
    3838case 'delete':
    3939    $cat_ID = (int) $_GET['cat_ID'];
    40     check_admin_referer('delete-category' .  $cat_ID);
     40    check_admin_referer('delete-category_' .  $cat_ID);
    4141
    4242    if ( !current_user_can('manage_categories') )
     
    9898case 'editedcat':
    9999    $cat_ID = (int) $_POST['cat_ID'];
    100     check_admin_referer('update-category' . $cat_ID);
     100    check_admin_referer('update-category_' . $cat_ID);
    101101
    102102    if ( !current_user_can('manage_categories') )
  • branches/2.0/wp-admin/edit-comments.php

    r3803 r3805  
    9999            if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    100100                echo " | <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>";
    101                 echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'delete-comment' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . __("You are about to delete this comment.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete.") . "' );\">" . __('Delete Comment') . '</a> ';
     101                echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . __("You are about to delete this comment.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete.") . "' );\">" . __('Delete Comment') . '</a> ';
    102102            } // end if any comments to show
    103103            // Get post title
  • branches/2.0/wp-admin/edit-form-advanced.php

    r3779 r3805  
    2727    $form_action = 'editpost';
    2828    $form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";
    29     wp_nonce_field('update-post' .  $post_ID);
     29    wp_nonce_field('update-post_' .  $post_ID);
    3030}
    3131
     
    267267</div>
    268268
    269 <?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post' . $post_ID ); ?>
     269<?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?>
    270270<input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), addslashes($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}\""; ?> />
    271271<?php endif; ?>
  • branches/2.0/wp-admin/edit-link-form.php

    r3771 r3805  
    55    $submit_text = __('Save Changes &raquo;');
    66    $form = '<form action="" method="post" name="editlink" id="editlink">';
    7     $nonce_action = 'update-bookmark' . $link_id;
     7    $nonce_action = 'update-bookmark_' . $link_id;
    88} else {
    99    $editing = false;
  • branches/2.0/wp-admin/edit-page-form.php

    r3771 r3805  
    1111} else {
    1212    $form_action = 'editpost';
    13     $nonce_action = 'update-post' . $post_ID;
     13    $nonce_action = 'update-post_' . $post_ID;
    1414    $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
    1515}
  • branches/2.0/wp-admin/edit-pages.php

    r3771 r3805  
    5353    <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
    5454    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=edit&amp;post=$post->ID' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    55     <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars(get_the_title('','',0), 1)) . "' );\">" . __('Delete') . "</a>"; } ?></td>
     55    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars(get_the_title('','',0), 1)) . "' );\">" . __('Delete') . "</a>"; } ?></td>
    5656  </tr>
    5757<?php
  • branches/2.0/wp-admin/edit.php

    r3803 r3805  
    211211    case 'control_delete':
    212212        ?>
    213         <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape(get_the_title())) . "' );\">" . __('Delete') . "</a>"; } ?></td>
     213        <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape(get_the_title())) . "' );\">" . __('Delete') . "</a>"; } ?></td>
    214214        <?php
    215215        break;
     
    263263            if ( current_user_can('edit_post', $post->ID) ) {
    264264                echo "[ <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" .  __('Edit') . "</a>";
    265                 echo ' - <a href="' . wp_nonce_url('post.php?action=deletecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'delete-comment' . $comment->comment_ID) . '" onclick="return confirm(\'' . __("You are about to delete this comment.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete.") . "');\">" . __('Delete') . '</a> ';
     265                echo ' - <a href="' . wp_nonce_url('post.php?action=deletecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return confirm(\'' . __("You are about to delete this comment.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete.") . "');\">" . __('Delete') . '</a> ';
    266266
    267267                if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
    268268                    if ('approved' == wp_get_comment_status($comment->comment_ID)) {
    269                         echo ' - <a href="' . wp_nonce_url('post.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'unapprove-comment' . $comment->comment_ID) . '">' . __('Unapprove') . '</a> ';
     269                        echo ' - <a href="' . wp_nonce_url('post.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '">' . __('Unapprove') . '</a> ';
    270270                    } else {
    271                         echo ' - <a href="' . wp_nonce_url('post.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment' . $comment->comment_ID) . '">' . __('Approve') . '</a> ';
     271                        echo ' - <a href="' . wp_nonce_url('post.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '">' . __('Approve') . '</a> ';
    272272                    }
    273273                }
  • branches/2.0/wp-admin/link-categories.php

    r3771 r3805  
    8484  {
    8585    $cat_id = (int) $_GET['cat_id'];
    86     check_admin_referer('delete-link-category' . $cat_id);
     86    check_admin_referer('delete-link-category_' . $cat_id);
    8787
    8888    $cat_name=get_linkcatname($cat_id);
     
    117117
    118118  <form name="editcat" method="post">
    119   <?php wp_nonce_field('update-link-category' . $row->cat_id) ?>
     119  <?php wp_nonce_field('update-link-category_' . $row->cat_id) ?>
    120120      <input type="hidden" name="action" value="editedcat" />
    121121      <input type="hidden" name="cat_id" value="<?php echo $row->cat_id ?>" />
     
    206206  {
    207207    $cat_id = (int)$_POST["cat_id"];
    208     check_admin_referer('update-link-category' . $cat_id);
     208    check_admin_referer('update-link-category_' . $cat_id);
    209209
    210210    if ( !current_user_can('manage_links') )
     
    357357                <td><?php echo $row->list_limit ?></td>
    358358                <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Edit" class="edit"><?php _e('Edit') ?></a></td>
    359                 <td><a href="<?php echo wp_nonce_url("link-categories.php?cat_id=$row->cat_id?>&amp;action=Delete", 'delete-link-category' . $row->cat_id) ?>" "onclick="return deleteSomething( 'link category', <?php echo $row->cat_id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; link category.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars($row->cat_name,1)); ?>' );" class="delete"><?php _e('Delete') ?></a></td>
     359                <td><a href="<?php echo wp_nonce_url("link-categories.php?cat_id=$row->cat_id?>&amp;action=Delete", 'delete-link-category_' . $row->cat_id) ?>" "onclick="return deleteSomething( 'link category', <?php echo $row->cat_id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; link category.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars($row->cat_name,1)); ?>' );" class="delete"><?php _e('Delete') ?></a></td>
    360360              </tr>
    361361<?php
  • branches/2.0/wp-admin/link-manager.php

    r3771 r3805  
    383383            if ($show_buttons) {
    384384        echo '<td><a href="link-manager.php?link_id=' . $link->link_id . '&amp;action=linkedit" class="edit">' . __('Edit') . '</a></td>';
    385         echo '<td><a href="' . wp_nonce_url('link-manager.php?link_id='.$link->link_id.'&amp;action=delete', 'delete-bookmark' . $link->link_id ) . '"'." class='delete' onclick=\"return deleteSomething( 'link', $link->link_id , '".sprintf(__("You are about to delete the &quot;%s&quot; bookmark to %s.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars($link->link_name, 1), wp_specialchars($link->link_url)).'\' );" class="delete">'.__('Delete').'</a></td>';
     385        echo '<td><a href="' . wp_nonce_url('link-manager.php?link_id='.$link->link_id.'&amp;action=delete', 'delete-bookmark_' . $link->link_id ) . '"'." class='delete' onclick=\"return deleteSomething( 'link', $link->link_id , '".sprintf(__("You are about to delete the &quot;%s&quot; bookmark to %s.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars($link->link_name, 1), wp_specialchars($link->link_url)).'\' );" class="delete">'.__('Delete').'</a></td>';
    386386        echo '<td><input type="checkbox" name="linkcheck[]" value="' . $link->link_id . '" /></td>';
    387387            } else {
  • branches/2.0/wp-admin/plugin-editor.php

    r3771 r3805  
    3535case 'update':
    3636
    37     check_admin_referer('edit-plugin' . $file);
     37    check_admin_referer('edit-plugin_' . $file);
    3838
    3939    if ( !current_user_can('edit_plugins') )
     
    9898    <?php   if (!$error) { ?>
    9999  <form name="template" id="template" action="plugin-editor.php" method="post">
    100   <?php wp_nonce_field('edit-plugin' . $file) ?>
     100  <?php wp_nonce_field('edit-plugin_' . $file) ?>
    101101         <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
    102102     <input type="hidden" name="action" value="update" />
  • branches/2.0/wp-admin/plugins.php

    r3771 r3805  
    44if ( isset($_GET['action']) ) {
    55    if ('activate' == $_GET['action']) {
    6         check_admin_referer('activate-plugin' . $_GET['plugin']);
     6        check_admin_referer('activate-plugin_' . $_GET['plugin']);
    77        $current = get_settings('active_plugins');
    88        if (!in_array($_GET['plugin'], $current)) {
     
    1515        header('Location: plugins.php?activate=true');
    1616    } else if ('deactivate' == $_GET['action']) {
    17         check_admin_referer('deactivate-plugin' . $_GET['plugin']);
     17        check_admin_referer('deactivate-plugin_' . $_GET['plugin']);
    1818        $current = get_settings('active_plugins');
    1919        array_splice($current, array_search( $_GET['plugin'], $current), 1 ); // Array-fu!
     
    9999
    100100        if (!empty($current_plugins) && in_array($plugin_file, $current_plugins)) {
    101             $action = "<a href='" . wp_nonce_url("plugins.php?action=deactivate&amp;plugin=$plugin_file", 'deactivate-plugin' . $plugin_file) . "' title='".__('Deactivate this plugin')."' class='delete'>".__('Deactivate')."</a>";
     101            $action = "<a href='" . wp_nonce_url("plugins.php?action=deactivate&amp;plugin=$plugin_file", 'deactivate-plugin_' . $plugin_file) . "' title='".__('Deactivate this plugin')."' class='delete'>".__('Deactivate')."</a>";
    102102            $plugin_data['Title'] = "<strong>{$plugin_data['Title']}</strong>";
    103103            $style .= $style == 'alternate' ? ' active' : 'active';
    104104        } else {
    105             $action = "<a href='" . wp_nonce_url("plugins.php?action=activate&amp;plugin=$plugin_file", 'activate-plugin' . $plugin_file) . "' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>";
     105            $action = "<a href='" . wp_nonce_url("plugins.php?action=activate&amp;plugin=$plugin_file", 'activate-plugin_' . $plugin_file) . "' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>";
    106106        }
    107107        $plugin_data['Description'] = wp_kses($plugin_data['Description'], array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()) ); ;
  • branches/2.0/wp-admin/post.php

    r3771 r3805  
    9090    $post_id = (int) $_POST['post_ID'];
    9191
    92     check_admin_referer('update-attachment' . $post_id);
     92    check_admin_referer('update-attachment_' . $post_id);
    9393
    9494    // Don't let these be changed
     
    107107case 'editpost':
    108108    $post_ID = (int) $_POST['post_ID'];
    109     check_admin_referer('update-post' . $post_ID);
     109    check_admin_referer('update-post_' . $post_ID);
    110110   
    111111    $post_ID = edit_post();
     
    133133case 'delete':
    134134    $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
    135     check_admin_referer('delete-post' . $post_id);
     135    check_admin_referer('delete-post_' . $post_id);
    136136
    137137    $post = & get_post($post_id);
     
    214214case 'deletecomment':
    215215    $comment = (int) $_GET['comment'];
    216     check_admin_referer('delete-comment' . $comment);
     216    check_admin_referer('delete-comment_' . $comment);
    217217
    218218    $p = (int) $_GET['p'];
     
    244244case 'unapprovecomment':
    245245    $comment = (int) $_GET['comment'];
    246     check_admin_referer('unapprove-comment' . $comment);
     246    check_admin_referer('unapprove-comment_' . $comment);
    247247
    248248    $p = (int) $_GET['p'];
     
    271271case 'mailapprovecomment':
    272272    $comment = (int) $_GET['comment'];
    273     check_admin_referer('approve-comment' . $comment);
     273    check_admin_referer('approve-comment_' . $comment);
    274274
    275275    if ( ! $comment = get_comment($comment) )
     
    291291case 'approvecomment':
    292292    $comment = (int) $_GET['comment'];
    293     check_admin_referer('approve-comment' . $comment);
     293    check_admin_referer('approve-comment_' . $comment);
    294294
    295295    $p = (int) $_GET['p'];
  • branches/2.0/wp-admin/profile-update.php

    r3771 r3805  
    33require_once('admin.php');
    44
    5 check_admin_referer('update-profile' . $user_ID);
     5check_admin_referer('update-profile_' . $user_ID);
    66
    77if ( !$_POST )
  • branches/2.0/wp-admin/profile.php

    r3771 r3805  
    2020<h2><?php _e('Your Profile and Personal Options'); ?></h2>
    2121<form name="profile" id="your-profile" action="profile-update.php" method="post">
    22 <?php wp_nonce_field('update-profile' . $user_ID) ?>
     22<?php wp_nonce_field('update-profile_' . $user_ID) ?>
    2323<p>
    2424<input type="hidden" name="from" value="profile" />
  • branches/2.0/wp-admin/templates.php

    r3771 r3805  
    3737case 'update':
    3838
    39     check_admin_referer('edit-file' . $file);
     39    check_admin_referer('edit-file_' . $file);
    4040
    4141    if ( ! current_user_can('edit_files') )
     
    129129<?php if (!$error) { ?>
    130130  <form name="template" id="template" action="templates.php" method="post">
    131   <?php wp_nonce_field('edit-file' . $file) ?>
     131  <?php wp_nonce_field('edit-file_' . $file) ?>
    132132     <div><textarea cols="70" rows="25" name="newcontent" id='newcontent' tabindex="1"><?php echo $content ?></textarea>
    133133     <input type="hidden" name="action" value="update" />
  • branches/2.0/wp-admin/theme-editor.php

    r3771 r3805  
    4848case 'update':
    4949
    50     check_admin_referer('edit-theme' . $file . $theme);
     50    check_admin_referer('edit-theme_' . $file . $theme);
    5151
    5252    if ( !current_user_can('edit_themes') )
     
    132132    ?>
    133133  <form name="template" id="template" action="theme-editor.php" method="post">
    134   <?php wp_nonce_field('edit-theme' . $file . $theme) ?>
     134  <?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
    135135         <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
    136136     <input type="hidden" name="action" value="update" />
  • branches/2.0/wp-admin/themes.php

    r3771 r3805  
    33
    44if ( isset($_GET['action']) ) {
    5     check_admin_referer('switch-theme' . $_GET['template']);
     5    check_admin_referer('switch-theme_' . $_GET['template']);
    66   
    77    if ('activate' == $_GET['action']) {
     
    7070    $screenshot = $themes[$theme_name]['Screenshot'];
    7171    $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
    72     $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=$template&amp;stylesheet=$stylesheet", 'switch-theme' . $template);
     72    $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=$template&amp;stylesheet=$stylesheet", 'switch-theme_' . $template);
    7373?>
    7474<div class="available-theme">
  • branches/2.0/wp-admin/user-edit.php

    r3771 r3805  
    3333case 'update':
    3434
    35 check_admin_referer('update-user' . $user_id);
     35check_admin_referer('update-user_' . $user_id);
    3636
    3737$errors = array();
     
    7474
    7575<form name="profile" id="your-profile" action="user-edit.php" method="post">
    76 <?php wp_nonce_field('update-user' . $user_ID) ?>
     76<?php wp_nonce_field('update-user_' . $user_ID) ?>
    7777<p>
    7878<input type="hidden" name="from" value="profile" />
Note: See TracChangeset for help on using the changeset viewer.