- tie %PLP::Script::get, 'PLP::Tie::Delay', 'PLP::Script::get', sub {
- my %get;
- my $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] =~ /^\@/;
- push @{ $get{'@' . $keyval[0]} }, $keyval[1];
- }
- }
- return \%get;
- };
-
- tie %PLP::Script::post, 'PLP::Tie::Delay', 'PLP::Script::post', sub {
- my %post;
- my $post;
- if ($ENV{MOD_PERL}) {
- $post = Apache->request->content;
- } else {
- read(*STDIN, $post, $ENV{CONTENT_LENGTH});
- }
- if (defined $post
- and $post ne ''
- and $ENV{CONTENT_TYPE} =~ m!^(?:application/x-www-form-urlencoded|$)!
- ){
- for (split /&/, $post) {
- my @keyval = split /=/, $_, 2;
- PLP::Functions::DecodeURI(@keyval);
- $post{$keyval[0]} = $keyval[1] unless $keyval[0] =~ /^\@/;
- push @{ $post{'@' . $keyval[0]} }, $keyval[1];
- }
- }
- return \%post;
- };
-
- tie %PLP::Script::fields, 'PLP::Tie::Delay', 'PLP::Script::fields', sub {
-# $PLP::Script::get{PLPdummy}, $PLP::Script::post{PLPdummy}; # Trigger creation
-# No longer necessary, as PLP::Tie::Delay has been fixed since 3.00
-# And fixed even more in 3.13
- return { %PLP::Script::get, %PLP::Script::post };
- };
-
- tie %PLP::Script::header, 'PLP::Tie::Headers';
-
- if (defined($ENV{HTTP_COOKIE}) && $ENV{HTTP_COOKIE} ne ''){
- for (split /; ?/, $ENV{HTTP_COOKIE}) {
- my @keyval = split /=/, $_, 2;
- $PLP::Script::cookie{$keyval[0]} ||= $keyval[1];
+
+ # %get
+
+ my $get = \%PLP::Script::get;
+ if (length $ENV{QUERY_STRING}){
+ for (split /[&;]/, $ENV{QUERY_STRING}) {
+ my @keyval = split /=/, $_, 2;
+ PLP::Functions::DecodeURI(@keyval);
+ $get->{$keyval[0]} = $keyval[1] unless $keyval[0] =~ /^\@/;
+ push @{ $get->{ '@' . $keyval[0] } }, $keyval[1];
+ }