]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/comment.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-admin / includes / comment.php
index 06447d41d05465efe8785fbe78cf44362df9f5b9..36954b231c6e70c4b096882395ef4555981f95cc 100644 (file)
 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' );