WordPress.org

Ready to get started?Download WordPress

Forums

commenter's uri (5 posts)

  1. adb
    Member
    Posted 9 years ago #

    When people leave comments their uri is comprised of my blog uri and the one they enter if they don't include "http://". Is there a way to prevent this from happening?

  2. Kafkaesqui

    Posted 9 years ago #

    Simplest solution: In wp-comments-post.php, right after you see the comment variables being assigned ($comment_author, $comment_author_email, etc), insert this:
    if (!preg_match('%^http://%', $comment_author_url)) {
    $comment_author_url = 'http://' . $comment_author_url;
    }

  3. adb
    Member
    Posted 9 years ago #

    That doesn't seem to work. Maybe I should mention that I'm using 1.3 with the Manji theme?

  4. Kafkaesqui

    Posted 9 years ago #

    That should make no difference. I just now set it up on my test system, which uses the most recent nightly, and it works.
    Did you make sure to insert it after the script assigns $comment_author_url from $_POST['url']?

  5. adb
    Member
    Posted 9 years ago #

    I did. All is well. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.