Make WordPress Core


Ignore:
Timestamp:
04/14/2008 04:13:25 PM (19 years ago)
Author:
ryan
Message:

Prepare DB queries in more places. Props filosofo. see #6644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r7424 r7645  
    1313        foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
    1414                $comment = (int) $comment;
    15                 $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
    16                 // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
     15                $post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) );
    1716                if ( !current_user_can('edit_post', $post_id) )
    1817                        continue;
Note: See TracChangeset for help on using the changeset viewer.