WordPress.org

Ready to get started?Download WordPress

Forums

Jeff Barr spam hack modification (6 posts)

  1. brave3
    Member
    Posted 9 years ago #

    I'm trying to make Jeff Barr's spam hack case INsensitive.
    I added this line:
    $jeff = strtolower($jeff);
    above these lines in wp-comments-post.php
    $jeff = trim($_POST[’jeff’]);
    if ( ‘Jeff’ != $jeff )
    die("You forgot Jeff’s first name. If you are forgetful, hit Back and try again. “);

    but it still won't approve the comment if the user enters "JEFF" or "jeff"... What am I doing wrong? Of course I'm using a different verification question -- just keeping this example simple.

  2. I think you just have to add Jeff, jeff, and JEFF as possible answers for the field.

  3. brave3
    Member
    Posted 9 years ago #

    Duh. I guess that's another way to go about it. So line 2 should change to this?
    if ( 'Jeff' != $jeff && 'jeff' != $jeff && 'JEFF' != $jeff )

  4. brave3
    Member
    Posted 9 years ago #

    should be actual ampersands in my last post...

  5. Kitten
    Member
    Posted 9 years ago #

    the proper way:
    if ( ‘jeff’ != strtolower($jeff) )
    I added this as a comment to Jeff's original post.

  6. brave3
    Member
    Posted 9 years ago #

    Thanks Kitten. Your comment is where I got the idea for using the strtolower function. But I did not know exactly how to implement it...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.