журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[livejournal] r22871: LJSUP-13578: XML RPC paid repost are not...

Committer: nnikulochkina
LJSUP-13578: XML RPC paid repost are not accessible
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-09-12 07:22:54 UTC (rev 22870)
+++ trunk/cgi-bin/ljprotocol.pl	2012-09-12 07:49:43 UTC (rev 22871)
@@ -268,18 +268,15 @@
         $req->{'ver'} = 0 unless defined $req->{'ver'};
 
         # check specified language
-        if (defined $req->{'lang'} && $req->{'lang'}) {
-            if ($req->{'lang'} eq 'en') {
-                $req->{'lang'} = "en_LJ";
-            } elsif (not grep /^$req->{'lang'}$/, @LJ::LANGS) {
-                return fail($err, 221, $req->{'lang'} );
-            }
+        if ($req->{'lang'} && not grep /^$req->{'lang'}$/, @LJ::LANGS) {
+            return fail($err, 221, $req->{'lang'} );
         }
     }
     
     # set specified or default language
     my $current_lang = LJ::Lang::current_language();
     my $lang = $req->{'lang'} || $current_lang || $LJ::DEFAULT_LANG;
+    $lang = 'en_LJ' if $lang eq 'en';
     LJ::Lang::current_language($lang) unless $lang eq $current_lang;
 
     $flags ||= {};
@@ -329,6 +326,7 @@
     }
 
     LJ::Request->notes("codepath" => "") if LJ::Request->is_inited;
+
     return fail($err, 201);
 }
 

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