Log in with username/password: lyceum/lyceum

Ticket #729: post.diff

File post.diff, 1.8 kB (added by bthale, 1 year ago)

Patch to prevent token deletion prior to returning links to the user that reference the token.

  • post.php

    old new  
    6666   break; 
    6767 
    6868case 'edit': 
    69    validateToken($_REQUEST['token'], 'post.php', 'edit', (int)$_REQUEST['post']); 
     69   validateToken($_REQUEST['token'], 'post.php', 'edit', (int)$_REQUEST['post'], true); 
    7070   $title = __('Edit'); 
    7171 
    7272   require_once('admin-header.php'); 
     
    9292   break; 
    9393 
    9494case 'editattachment': 
    95    validateToken($_REQUEST['token'], 'post.php', 'editattachment', (int)$_REQUEST['post_ID']); 
     95   validateToken($_REQUEST['token'], 'post.php', 'editattachment', (int)$_REQUEST['post_ID'],true); 
    9696 
    9797   $post_id = (int) $_POST['post_ID']; 
    9898 
     
    112112      add_post_meta($post_id, '_wp_attachment_metadata', $newmeta); 
    113113 
    114114case 'editpost': 
    115    validateToken($_REQUEST['token'], 'post.php', 'editpost', (int)$_REQUEST['post_ID']); 
     115   validateToken($_REQUEST['token'], 'post.php', 'editpost', (int)$_REQUEST['post_ID'],true); 
    116116   $post_ID = (int) $_POST['post_ID']; 
    117117   check_admin_referer('update-post_' . $post_ID); 
    118118    
     
    190190 
    191191   $comment = (int) $_GET['comment']; 
    192192 
    193    validateToken($_REQUEST['token'], 'post.php', 'editcomment', $comment); 
     193   validateToken($_REQUEST['token'], 'post.php', 'editcomment', $comment, true); 
    194194   if ( ! $comment = get_comment($comment) ) 
    195195      die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)')); 
    196196 
     
    210210   $comment = (int) $_GET['comment']; 
    211211   $p = (int) $_GET['p']; 
    212212 
    213    validateToken($_REQUEST['token'], 'post.php', 'confirmdeletecomment', $comment); 
     213   validateToken($_REQUEST['token'], 'post.php', 'confirmdeletecomment', $comment,true); 
    214214   if ( ! $comment = get_comment($comment) ) 
    215215      die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
    216216 
Log in with username/password: lyceum/lyceum