Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #37093


Ignore:
Timestamp:
06/14/2016 01:43:45 AM (8 years ago)
Author:
dd32
Comment:

Just a quick formatting update to make reading the ticket easier.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37093 – Description

    initial v2  
    11under includes/comment.php, there is this piece of code in version 4.5.2:
    2 
     2{{{
    33dupe = $wpdb->prepare(
    44                "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = %s AND comment_approved != 'trash' AND ( comment_author = %s ",
     
    1717                wp_unslash( $commentdata['comment_content'] )
    1818        );
     19}}}
    1920
    20 
    21 The OR condition: ( comment_author = %s OR comment_author_email = %s) will not work if a comment is posted by an author who happens to have the same "comment_author" value as someone else who has already posted the comment and they both post exactly the same comment for some reason. See this example:
    22 
     21The OR condition: {{{( comment_author = %s OR comment_author_email = %s)}}} will not work if a comment is posted by an author who happens to have the same "comment_author" value as someone else who has already posted the comment and they both post exactly the same comment for some reason. See this example:
     22{{{
    2323Comment 1
    2424---------------
     
    3636comment_author = "Daniel"
    3737comment_author_email = "different_daniel@yahoo.com'
    38 
     38}}}
    3939In this case, comment 2 will be rejected as dupe according to the query but this is not a dupe.
    4040