Make WordPress Core

Ticket #2734: 2734b.diff

File 2734b.diff, 32.0 KB (added by mdawaffe, 20 years ago)

verbs and nouns and names, oh my!

  • wp-includes/pluggable-functions.php

     
    236236                !(-1 == $action && strstr($referer, $adminurl)) ) {
    237237                if ( $referer )
    238238                        $adminurl = $referer;
     239                if ( $action !== -1 && preg_match('/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches) ) {
     240                        $verbs = array(
     241                                        'add' => __('add'),
     242                                        'delete' => __('delete'),
     243                                        'update' => __('update'),
     244                                        'edit' => __('edit'),
     245                                        'approve' => __('approve'),
     246                                        'unapprove' => __('unapprove'),
     247                                        'moderate' => __('moderate'),
     248                                        'activate' => __('activate'),
     249                                        'deactivate' => __('deactivate'),
     250                                        'import' => __('import'),
     251                                        'switch' => __('switch to')
     252                                );
     253                        if ( isset($verbs[$matches[1]]) )
     254                                $verb = $verbs[$matches[1]];
     255                        $nouns = array(
     256                                        'category' => array(__('this category'), 'get_catname'),
     257                                        'comment' => array(__('this comment'), false),
     258                                        'comments' => array(__('these comments'), false),
     259                                        'bookmark' => array(__('this bookmark'), false),
     260                                        'bookmarks' => array(__('these bookmarks'), false),
     261                                        'permalink' => array(__('the permalink structure'), false),
     262                                        'options' => array(__('these options'), false),
     263                                        'post' => array(__('this post'), 'get_the_title'),
     264                                        'page' => array(__('this page'), 'get_the_title'),
     265                                        'attachment' => array(__('the attachments on'), 'get_the_title'),
     266                                        'plugin' => array(__('this plugin'), false),
     267                                        'profile' => array(__('this user'), 'get_author_name'),
     268                                        'user' => array(__('this user'), 'get_author_name'),
     269                                        'users' => array(__('these users'), false),
     270                                        'file' => array(__('this file'), false),
     271                                        'theme' => array(__('this theme'), false)
     272                                );
     273                        if ( isset($nouns[$matches[2]]) ) {
     274                                $noun = $nouns[$matches[2]][0];
     275                                $name = ( isset($matches[4]) && function_exists($nouns[$matches[2]][1]) ) ? call_user_func($nouns[$matches[2]][1], $matches[4]) : false;
     276                        }
     277                }
     278                if ( $name && $noun && $verb )
     279                        $ays = sprintf(__('Are you sure you want to %s %s: "%s"?'), $verb, $noun, $name);
     280                elseif ( $noun && $verb )
     281                        $ays = sprintf(__('Are you sure you want to %s %s?'), $verb, $noun);
     282                else
     283                        $ays = __('Are you sure you want to do this');
    239284                $title = __('WordPress Confirmation');
    240285                require_once(ABSPATH . '/wp-admin/admin-header.php');
    241286                if ( $_POST ) {
     
    248293                                $html .= "\t\t<input type='hidden' name='" . wp_specialchars( urldecode($k), 1 ) . "' value='" . wp_specialchars( urldecode($v), 1 ) . "' />\n";
    249294                        }
    250295                        $html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n";
    251                         $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . __('Are you sure you want to do this?') . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n";
     296                        $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>$ays</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n";
    252297                } else {
    253                         $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . __('Are you sure you want to do this?') . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] ) . "'>" . __('Yes') . "</a></p>\n\t</div>\n";
     298                        $html .= "\t<div id='message' class='confirm fade'>\n\t<p>$ays</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] ) . "'>" . __('Yes') . "</a></p>\n\t</div>\n";
    254299                }
    255300                $html .= "</body>\n</html>";
    256301                echo $html;
  • wp-admin/edit-comments.php

     
    119119<?php
    120120if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    121121        echo " <a href='comment.php?action=editcomment&amp;comment=".$comment->comment_ID."\'>" .  __('Edit') . '</a>';
    122         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 . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "' );\">" . __('Delete') . '</a> ';
     122        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 . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "' );\">" . __('Delete') . '</a> ';
    123123        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
    124                 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'unapprove-comment' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
    125                 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
     124                echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
     125                echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
    126126        }
    127         echo " | <a href=\"comment.php?action=deletecomment&amp;delete_type=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "' );\">" . __('Spam') . "</a> ";
     127        echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;delete_type=spam&amp;p=" . $comment->comment_post_ID . "&amp;comment=" . $comment->comment_ID", 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "' );\">" . __('Spam') . "</a> ";
    128128}
    129129$post = get_post($comment->comment_post_ID);
    130130$post_title = wp_specialchars( $post->post_title, 'double' );
  • wp-admin/profile-update.php

     
    44$submenu_file = 'profile.php';
    55require_once('admin.php');
    66
    7 check_admin_referer('update-profile' . $user_ID);
     7check_admin_referer('update-profile_' . $user_ID);
    88
    99if ( !$_POST )
    1010        die( __('No post?') );
  • wp-admin/post.php

     
    8282case 'editattachment':
    8383        $post_id = (int) $_POST['post_ID'];
    8484
    85         check_admin_referer('update-attachment' . $post_id);
     85        check_admin_referer('update-attachment_' . $post_id);
    8686
    8787        // Don't let these be changed
    8888        unset($_POST['guid']);
     
    9999
    100100case 'editpost':
    101101        $post_ID = (int) $_POST['post_ID'];
    102         check_admin_referer('update-post' . $post_ID);
     102        check_admin_referer('update-post_' . $post_ID);
    103103       
    104104        $post_ID = edit_post();
    105105
     
    125125
    126126case 'delete':
    127127        $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
    128         check_admin_referer('delete-post' . $post_id);
     128        check_admin_referer('delete-post_' . $post_id);
    129129
    130130        $post = & get_post($post_id);
    131131
  • wp-admin/theme-editor.php

     
    4747
    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') )
    5353        die('<p>'.__('You have do not have sufficient permissions to edit templates for this blog.').'</p>');
     
    131131        if (!$error) {
    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" />
    137137     <input type="hidden" name="file" value="<?php echo $file ?>" />
  • wp-admin/templates.php

     
    3636
    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') )
    4242                die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
     
    128128</div>
    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" />
    134134     <input type="hidden" name="file" value="<?php echo $file ?>" />
  • wp-admin/admin-functions.php

     
    656656                                        $default_link_cat_id = get_option('default_link_category');
    657657
    658658                                        if ( ($category->cat_ID != $default_cat_id) && ($category->cat_ID != $default_link_cat_id) )
    659                                                 $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;.\\nAll of its posts will go into the default category of &quot;%s&quot;\\nAll of its bookmarks will go into the default category of &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes($category->cat_name), js_escape(get_catname($default_cat_id)), js_escape(get_catname($default_link_cat_id))) . "' );\" class='delete'>".__('Delete')."</a>";
     659                                                $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;.\\nAll of its posts will go into the default category of &quot;%s&quot;\\nAll of its bookmarks will go into the default category of &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes($category->cat_name), js_escape(get_catname($default_cat_id)), js_escape(get_catname($default_link_cat_id))) . "' );\" class='delete'>".__('Delete')."</a>";
    660660                                        else
    661661                                                $edit .= "<td style='text-align:center'>".__("Default");
    662662                                }
     
    709709    <td><?php echo mysql2date('Y-m-d g:i a', $post->post_modified); ?></td>
    710710        <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
    711711    <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    712     <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='" . wp_nonce_url("page.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>
     712    <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='" . wp_nonce_url("page.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>
    713713  </tr>
    714714
    715715<?php
  • wp-admin/edit-page-form.php

     
    1010        $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
    1111} else {
    1212        $form_action = 'editpost';
    13         $nonce_action = 'update-page' . $post_ID;
     13        $nonce_action = 'update-page_' . $post_ID;
    1414        $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
    1515}
    1616
  • wp-admin/comment.php

     
    5151        $comment = (int) $_GET['comment'];
    5252        $p = (int) $_GET['p'];
    5353        $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment';
    54         $nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment' : 'approve-comment';
     54        $nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment_' : 'approve-comment_';
    5555        $nonce_action .= $comment;
    5656
    5757        if ( ! $comment = get_comment($comment) )
     
    9393
    9494case 'deletecomment':
    9595        $comment = (int) $_REQUEST['comment'];
    96         check_admin_referer('delete-comment' . $comment);
     96        check_admin_referer('delete-comment_' . $comment);
    9797
    9898        $p = (int) $_REQUEST['p'];
    9999        if ( isset($_REQUEST['noredir']) ) {
     
    126126
    127127case 'unapprovecomment':
    128128        $comment = (int) $_GET['comment'];
    129         check_admin_referer('unapprove-comment' . $comment);
     129        check_admin_referer('unapprove-comment_' . $comment);
    130130       
    131131        $p = (int) $_GET['p'];
    132132        if (isset($_GET['noredir'])) {
     
    153153
    154154case 'approvecomment':
    155155        $comment = (int) $_GET['comment'];
    156         check_admin_referer('approve-comment' . $comment);
     156        check_admin_referer('approve-comment_' . $comment);
    157157
    158158        $p = (int) $_GET['p'];
    159159        if (isset($_GET['noredir'])) {
  • wp-admin/edit-link-form.php

     
    33        $heading = __('Edit Bookmark');
    44        $submit_text = __('Save Changes &raquo;');
    55        $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
    6         $nonce_action = 'update-bookmark' . $link_id;
     6        $nonce_action = 'update-bookmark_' . $link_id;
    77} else {
    88        $heading = __('Create Bookmark');
    99        $submit_text = __('Add Bookmark &raquo;');
  • wp-admin/edit-form-advanced.php

     
    2626} else {
    2727        $form_action = 'editpost';
    2828        $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
    29         wp_nonce_field('update-post' .  $post_ID);
     29        wp_nonce_field('update-post_' .  $post_ID);
    3030}
    3131
    3232$form_pingback = '<input type="hidden" name="post_pingback" value="' . get_option('default_pingback_flag') . '" id="post_pingback" />';
     
    220220
    221221</div>
    222222
    223 <?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post' . $post_ID ); ?>
     223<?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?>
    224224<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;}\""; ?> />
    225225<?php endif; ?>
    226226
  • wp-admin/plugins.php

     
    33
    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)) {
    99                        $current[] = trim( $_GET['plugin'] );
     
    1414                }
    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!
    2020                update_option('active_plugins', $current);
     
    100100                $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate';
    101101
    102102                if (!empty($current_plugins) && in_array($plugin_file, $current_plugins)) {
    103                         $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>";
     103                        $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>";
    104104                        $plugin_data['Title'] = "<strong>{$plugin_data['Title']}</strong>";
    105105                        $style .= $style == 'alternate' ? ' active' : 'active';
    106106                } else {
    107                         $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>";
     107                        $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>";
    108108                }
    109109                $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()) ); ;
    110110                if ($style != '') $style = 'class="' . $style . '"';
  • wp-admin/edit.php

     
    211211
    212212        case 'control_delete':
    213213                ?>
    214                 <td><?php if ( current_user_can('delete_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>
     214                <td><?php if ( current_user_can('delete_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>
    215215                <?php
    216216                break;
    217217
     
    273273<?php
    274274if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    275275        echo " <a href='comment.php?action=editcomment&amp;comment=".$comment->comment_ID."\'>" .  __('Edit') . '</a>';
    276         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 . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "' );\">" . __('Delete') . '</a> ';
     276        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 . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "' );\">" . __('Delete') . '</a> ';
    277277        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
    278                 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'unapprove-comment' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
    279                 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
     278                echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
     279                echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
    280280        }
    281         echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;delete_type=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-comment' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "' );\">" . __('Spam') . "</a> ]";
     281        echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;delete_type=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "' );\">" . __('Spam') . "</a> ]";
    282282} // end if any comments to show
    283283?>
    284284</p>
  • wp-admin/link.php

     
    8181
    8282        case 'save' :
    8383                $link_id = (int) $_POST['link_id'];
    84                 check_admin_referer('update-bookmark' . $link_id);
     84                check_admin_referer('update-bookmark_' . $link_id);
    8585
    8686                edit_link($link_id);
    8787
     
    9191
    9292        case 'delete' :
    9393                $link_id = (int) $_GET['link_id'];
    94                 check_admin_referer('delete-bookmark' . $link_id);
     94                check_admin_referer('delete-bookmark_' . $link_id);
    9595
    9696                if (!current_user_can('manage_links'))
    9797                        die(__("Cheatin' uh ?"));
  • wp-admin/profile.php

     
    1919<div class="wrap">
    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" />
    2525<input type="hidden" name="checkuser_id" value="<?php echo $user_ID ?>" />
  • wp-admin/user-edit.php

     
    3232
    3333case 'update':
    3434
    35 check_admin_referer('update-user' . $user_id);
     35check_admin_referer('update-user_' . $user_id);
    3636
    3737if (!current_user_can('edit_users'))
    3838        $errors = new WP_Error('head', __('You do not have permission to edit this user.'));
     
    7474<h2><?php _e('Edit User'); ?></h2>
    7575
    7676<form name="profile" id="your-profile" action="user-edit.php" method="post">
    77 <?php wp_nonce_field('update-user' . $user_ID) ?>
     77<?php wp_nonce_field('update-user_' . $user_ID) ?>
    7878<p>
    7979<input type="hidden" name="from" value="profile" />
    8080<input type="hidden" name="checkuser_id" value="<?php echo $user_ID ?>" />
  • wp-admin/edit-category-form.php

     
    44        $submit_text = __('Edit Category &raquo;');
    55        $form = '<form name="editcat" id="editcat" method="post" action="categories.php">';
    66        $action = 'editedcat';
    7         $nonce_action = 'update-category' . $cat_ID;
     7        $nonce_action = 'update-category_' . $cat_ID;
    88} else {
    99        $heading = __('Add Category');
    1010        $submit_text = __('Add Category &raquo;');
     
    4545<p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p>
    4646<div id="ajax-response"></div>
    4747</form>
    48 </div>
    49  No newline at end of file
     48</div>
  • wp-admin/link-manager.php

     
    176176<?php
    177177
    178178                echo '<td><a href="link.php?link_id='.$link->link_id.'&amp;action=edit" class="edit">'.__('Edit').'</a></td>';
    179                 echo '<td><a href="' . wp_nonce_url('link.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>';
     179                echo '<td><a href="' . wp_nonce_url('link.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>';
    180180                echo '<td align="center"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></td>';
    181181                echo "\n    </tr>\n";
    182182        }
  • wp-admin/page.php

     
    7676
    7777case 'editattachment':
    7878        $page_id = $post_ID = (int) $_POST['post_ID'];
    79         check_admin_referer('update-attachment' . $page_id);
     79        check_admin_referer('update-attachment_' . $page_id);
    8080
    8181        // Don't let these be changed
    8282        unset($_POST['guid']);
     
    9393
    9494case 'editpost':
    9595        $page_ID = (int) $_POST['post_ID'];
    96         check_admin_referer('update-page' . $page_ID);
     96        check_admin_referer('update-page_' . $page_ID);
    9797
    9898        $page_ID = edit_post();
    9999
     
    119119
    120120case 'delete':
    121121        $page_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
    122         check_admin_referer('delete-page' .  $page_id);
     122        check_admin_referer('delete-page_' .  $page_id);
    123123
    124124        $page = & get_post($page_id);
    125125
  • wp-admin/plugin-editor.php

     
    3434
    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') )
    4040        die('<p>'.__('You have do not have sufficient permissions to edit templates for this blog.').'</p>');
     
    9797</div>
    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" />
    103103     <input type="hidden" name="file" value="<?php echo $file ?>" />
  • wp-admin/themes.php

     
    22require_once('admin.php');
    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']) {
    88                if ( isset($_GET['template']) )
     
    6969        $author = $themes[$theme_name]['Author'];
    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">
    7575<h3><a href="<?php echo $activate_link; ?>"><?php echo "$title $version"; ?></a></h3>
  • wp-admin/categories.php

     
    3636
    3737case 'delete':
    3838        $cat_ID = (int) $_GET['cat_ID'];
    39         check_admin_referer('delete-category' .  $cat_ID);
     39        check_admin_referer('delete-category_' .  $cat_ID);
    4040
    4141        if ( !current_user_can('manage_categories') )
    4242                die (__('Cheatin&#8217; uh?'));
     
    6767
    6868case 'editedcat':
    6969        $cat_ID = (int) $_POST['cat_ID'];
    70         check_admin_referer('update-category' . $cat_ID);
     70        check_admin_referer('update-category_' . $cat_ID);
    7171
    7272        if ( !current_user_can('manage_categories') )
    7373                die (__('Cheatin&#8217; uh?'));