X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f5fcdc7994bb67cce809bc4777944ae8b7fad4a4..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-admin/includes/comment.php diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index 06447d41..36954b23 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -20,11 +20,11 @@ function comment_exists($comment_author, $comment_date) { global $wpdb; - $comment_author = stripslashes($comment_author); - $comment_date = stripslashes($comment_date); - return $wpdb->get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments - WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) ); + WHERE comment_author = %s AND comment_date = %s", + stripslashes( $comment_author ), + stripslashes( $comment_date ) + ) ); } /** @@ -33,7 +33,6 @@ function comment_exists($comment_author, $comment_date) { * @since 2.0.0 */ function edit_comment() { - if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) wp_die ( __( 'You are not allowed to edit comments on this post.' ) ); @@ -80,7 +79,7 @@ function edit_comment() { * @since 2.0.0 * * @param int $id ID of comment to retrieve. - * @return bool|object Comment if found. False on failure. + * @return object|false Comment if found. False on failure. */ function get_comment_to_edit( $id ) { if ( !$comment = get_comment($id) ) @@ -156,7 +155,8 @@ function get_pending_comments_num( $post_id ) { * Add avatars to relevant places in admin, or try to. * * @since 2.5.0 - * @uses $comment + * + * @global object $comment * * @param string $name User name. * @return string Avatar with Admin name. @@ -167,6 +167,9 @@ function floated_admin_avatar( $name ) { return "$avatar $name"; } +/** + * @since 2.7.0 + */ function enqueue_comment_hotkeys_js() { if ( 'true' == get_user_option( 'comment_shortcuts' ) ) wp_enqueue_script( 'jquery-table-hotkeys' );