Make WordPress Core


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

Backport nonces and pluggable cookies.

File:
1 edited

Legend:

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

    r3737 r3771  
    3131switch($action) {
    3232case 'post':
    33         check_admin_referer();
     33        check_admin_referer('add-post');
    3434       
    3535        $post_ID = write_post();
     
    8888
    8989case 'editattachment':
    90         check_admin_referer();
    91 
    9290        $post_id = (int) $_POST['post_ID'];
     91
     92        check_admin_referer('update-attachment' . $post_id);
    9393
    9494        // Don't let these be changed
     
    106106
    107107case 'editpost':
    108         check_admin_referer();
     108        $post_ID = (int) $_POST['post_ID'];
     109        check_admin_referer('update-post' . $post_ID);
    109110       
    110111        $post_ID = edit_post();
     
    131132
    132133case 'delete':
    133         check_admin_referer();
    134 
    135134        $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
     135        check_admin_referer('delete-post' . $post_id);
    136136
    137137        $post = & get_post($post_id);
     
    213213
    214214case 'deletecomment':
    215 
    216         check_admin_referer();
    217 
    218         $comment = (int) $_GET['comment'];
     215        $comment = (int) $_GET['comment'];
     216        check_admin_referer('delete-comment' . $comment);
     217
    219218        $p = (int) $_GET['p'];
    220219        if (isset($_GET['noredir'])) {
     
    244243
    245244case 'unapprovecomment':
    246 
    247         check_admin_referer();
    248 
    249         $comment = (int) $_GET['comment'];
     245        $comment = (int) $_GET['comment'];
     246        check_admin_referer('unapprove-comment' . $comment);
     247
    250248        $p = (int) $_GET['p'];
    251249        if (isset($_GET['noredir'])) {
     
    272270
    273271case 'mailapprovecomment':
    274 
    275         $comment = (int) $_GET['comment'];
     272        $comment = (int) $_GET['comment'];
     273        check_admin_referer('approve-comment' . $comment);
    276274
    277275        if ( ! $comment = get_comment($comment) )
     
    292290
    293291case 'approvecomment':
    294 
    295         check_admin_referer();
    296 
    297         $comment = (int) $_GET['comment'];
     292        $comment = (int) $_GET['comment'];
     293        check_admin_referer('approve-comment' . $comment);
     294
    298295        $p = (int) $_GET['p'];
    299296        if (isset($_GET['noredir'])) {
     
    325322case 'editedcomment':
    326323
    327         check_admin_referer();
     324        check_admin_referer('update-comment');
    328325
    329326        edit_comment();
Note: See TracChangeset for help on using the changeset viewer.