vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r16320: LJSUP-5445: update handling post data.

Committer: vsukhanov
LJSUP-5445: update handling post data.
U   trunk/cgi-bin/LJ/Request/Apache.pm
Modified: trunk/cgi-bin/LJ/Request/Apache.pm
===================================================================
--- trunk/cgi-bin/LJ/Request/Apache.pm	2010-03-04 07:07:39 UTC (rev 16319)
+++ trunk/cgi-bin/LJ/Request/Apache.pm	2010-03-04 07:24:03 UTC (rev 16320)
@@ -46,8 +46,9 @@
     my $r     = shift;
 
     $instance = bless {}, $class;
-    $instance->{apr} = Apache::Request->new($r);
+    $instance->{apr} = Apache::Request->instance($r);
     $instance->{r} = $r;
+    $instance->{apr}->parse;
     return $instance;
 }
 
@@ -182,7 +183,7 @@
 sub LJ::Request::push_handlers {
     my $class = shift;
     _die_if_no_request();
-    return $instance->{r}->push_handlers(@_);
+    return Apache->request->push_handlers(@_);
 }
 
 sub LJ::Request::set_handlers {
@@ -364,10 +365,15 @@
     ## but only if the request content type is application/x-www-form-urlencoded.
     ## ...
     ## NOTE: you can only ask for this once, as the entire body is read from the client.
-    return () if $instance->{r}->headers_in()->get("Content-Type") =~ m!^multipart/form-data!;
+    #return () if $instance->{r}->headers_in()->get("Content-Type") =~ m!^multipart/form-data!;
 
-    return @{ $instance->{params} } if $instance->{params};
-    my @params = $instance->{r}->content;
+    return @{ $instance->{params} } if $instance->{params};  
+    my @params = ();
+    foreach my $name ($instance->{apr}->param){
+        foreach my $val ($instance->{apr}->param($name)){
+            push @params => ($name, $val);
+        }
+    }
     $instance->{params} = \@params;
     return @params;
 }

Tags: livejournal, pm, vadvs
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