Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[bml] r118: LJSUP-5467: Inbox: multi-message delete ...

Committer: gariev
LJSUP-5467: Inbox: multi-message delete is not working
U   trunk/lib/Apache/BML.pm
Modified: trunk/lib/Apache/BML.pm
===================================================================
--- trunk/lib/Apache/BML.pm	2010-02-02 05:07:29 UTC (rev 117)
+++ trunk/lib/Apache/BML.pm	2010-02-05 08:00:32 UTC (rev 118)
@@ -225,26 +225,24 @@
     # tied interface to BML::ml();
     *BMLCodeBlock::ML = *BML::ML;
 
-    my %gets  = LJ::Request->get_params;
-    my %posts = LJ::Request->post_params;
+    my @gets  = LJ::Request->get_params;
+    my @posts = LJ::Request->post_params;
 
     # let BML code blocks see input
     %BMLCodeBlock::GET  = ();
     %BMLCodeBlock::POST = ();
     %BMLCodeBlock::FORM = ();  # whatever request method is
-    my %input_target = ( GET  => [ \%BMLCodeBlock::GET  ],
-                         POST => [ \%BMLCodeBlock::POST ], );
-    push @{$input_target{LJ::Request->method}}, \%BMLCodeBlock::FORM;
-    foreach my $id ([ [ %gets  ] => $input_target{'GET'}  ],
-                    [ [ %posts ] => $input_target{'POST'} ])
+    foreach my $id ([ \@gets  => \%BMLCodeBlock::GET  ],
+                    [ \@posts => \%BMLCodeBlock::POST ])
     {
-        while (my ($k, $v) = splice @{$id->[0]}, 0, 2) {
-            foreach my $dest (@{$id->[1]}) {
-                $dest->{$k} .= "\0" if exists $dest->{$k};
-                $dest->{$k} .= $v;
-            }
+        my ($params, $dest) = @$id;
+        while (my ($k, $v) = splice(@$params, 0, 2)) {
+            $dest->{$k} .= "\0" if exists $dest->{$k};
+            $dest->{$k} .= $v;
         }
     }
+    %BMLCodeBlock::FORM = (LJ::Request->method eq 'GET') ? 
+        %BMLCodeBlock::GET : %BMLCodeBlock::POST;
 
      %BMLCodeBlock::GET_POTENTIAL_XSS = ();
      if ($env->{MildXSSProtection}) {

Tags: bml, gariev, pm
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