X-Git-Url: http://git.shiar.net/gitweb.cgi/perl/plp/.git/blobdiff_plain/4cbac41f4d1bef193cf955c6c854c8a9ed258119..55b5d8b2c5b2d13e40ed37f37ef54f0e1f37af4b:/PLP/Fields.pm diff --git a/PLP/Fields.pm b/PLP/Fields.pm index a14f038..7b563cb 100644 --- a/PLP/Fields.pm +++ b/PLP/Fields.pm @@ -10,13 +10,21 @@ PLP::Script. Also generates %cookie immediately. PLP::Fields::doit(); +This module is part of the PLP internals. Don't use it yourself. + =cut sub doit { tie %PLP::Script::get, 'PLP::Tie::Delay', 'PLP::Script::get', sub { my %get; - if ($ENV{QUERY_STRING} ne ''){ - for (split /[&;]/, $ENV{QUERY_STRING}) { + my $get; + if ($ENV{MOD_PERL}) { + $get = Apache->request->args; + } else { + $get = $ENV{QUERY_STRING} + } + if ($get ne ''){ + for (split /[&;]/, $get) { my @keyval = split /=/, $_, 2; PLP::Functions::DecodeURI(@keyval); $get{$keyval[0]} = $keyval[1] unless $keyval[0] =~ /^\@/; @@ -28,7 +36,12 @@ sub doit { tie %PLP::Script::post, 'PLP::Tie::Delay', 'PLP::Script::post', sub { my %post; - our $post = ; + my $post; + if ($ENV{MOD_PERL}) { + $post = Apache->request->content; + } else { + read(*STDIN, $post, $ENV{CONTENT_LENGTH}); + } if (defined($post) && $post ne '' && ($ENV{CONTENT_TYPE} eq '' || $ENV{CONTENT_TYPE} eq 'application/x-www-form-urlencoded')){ for (split /&/, $post) {