alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[livejournal] r19310: LJSUP-9016: LJ-like - add donate button

Committer: afedorov
LJSUP-9016: LJ-like - add donate button

U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2011-06-17 02:13:16 UTC (rev 19309)
+++ trunk/cgi-bin/weblib.pl	2011-06-17 02:46:33 UTC (rev 19310)
@@ -619,7 +619,14 @@
 #          or the user has changed session (logged out and in again, or something).
 # </LJFUNC>
 sub check_form_auth {
-    my $formauth = shift || $BMLCodeBlock::POST{'lj_form_auth'};
+    my $opts = shift;
+    my $formauth = $BMLCodeBlock::POST{'lj_form_auth'};
+    if (ref $opts eq 'HASH') {
+        $formauth = $opts->{'lj_form_auth'} if defined $opts->{'lj_form_auth'};
+    } else {
+        $formauth = $opts if defined $opts;
+        $opts = {};
+    }
     return 0 unless $formauth;
 
     my $remote = LJ::get_remote();
@@ -634,9 +641,9 @@
     return 0 unless $sess eq $chal_sess;
 
     # check the signature is good and not expired
-    my $opts = { dont_check_count => 1 };  # in/out
-    LJ::challenge_check($formauth, $opts);
-    return $opts->{valid} && ! $opts->{expired};
+    my $opts = { dont_check_count => !$opts->{enable_check_count} };  # in/out
+    my $result = LJ::challenge_check($formauth, $opts);
+    return $result;
 }
 
 # <LJFUNC>

Tags: livejournal, pl, red_alf
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 

  • 0 comments