generalize reading post input
[perl/plp/.git] / PLP / Fields.pm
index 2a4190c062dd845c4e9c1f341a157799ffa3c0c9..7f07c4e914225e8f006e86a02db99b7391ee7471 100644 (file)
@@ -27,11 +27,7 @@ sub doit {
                return \%post if $ENV{CONTENT_TYPE} !~
                        m!^(?:application/x-www-form-urlencoded|$)!;
                
-               if ($ENV{MOD_PERL}) {
-                       $post = Apache->request->content;
-               } else {
-                       read *STDIN, $post, $ENV{CONTENT_LENGTH};
-               }
+               $post = $PLP::read->($ENV{CONTENT_LENGTH}) if $ENV{CONTENT_LENGTH};
                
                return \%post unless defined $post and length $post;