André Cruz (edevil) wrote in lj_dev,
André Cruz
edevil
lj_dev

talklib.pl and Captcha on comments

Hello all.

I'm a software developer from Portugal and I've just started to work on a project using LiveJournal.

I came across some Captcha related code in talklib.pl which I think does not quite work. Here is a diff.


--- /home/lj/cvs/livejournal/cgi-bin/talklib.pl 2005-12-05 10:57:00.000000000 +0000
+++ talklib.pl  2005-12-05 11:13:52.000000000 +0000
@@ -2854,7 +2854,7 @@
             };

             $$need_captcha =
-                ($LJ::HUMAN_CHECK{anonpost} || $LJ::HUMAN_CHECK{authpost}) &&
+                ($LJ::HUMAN_CHECK{'comment_html_anon'} || $LJ::HUMAN_CHECK{'comment_html_auth'}) &&
                 ! LJ::Talk::Post::check_rate($comment->{'u'}, $journalu);

             if ($show_captcha->()) {
@@ -2874,7 +2874,7 @@
             }

             # if the user is anonymous and the IP is marked, ignore rates and always human test.
-            $$need_captcha = 1 if $LJ::HUMAN_CHECK{anonpost} &&
+            $$need_captcha = 1 if $LJ::HUMAN_CHECK{'comment_html_anon'} &&
                 ! $comment->{'u'} &&
                 LJ::sysban_check('talk_ip_test', LJ::get_remote_ip());



I don't know if this is the correct place to submit code but this way more people can look at the code and tell me if I'm wrong. :)

Thanks and good bye.
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments