]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Form.pm
Scriptparameter sowohl via %ENV als auch von @ARGV und STDIN auswerten
[kivitendo-erp.git] / SL / Form.pm
index cfffd78e2935d2f7e1076a5b7bea30a5f37771c7..bf9deb4ba685714fcd9639cd0a9760b220ee7669 100644 (file)
@@ -243,20 +243,17 @@ sub new {
     tie %{ $self }, 'SL::Watchdog';
   }
 
-  read(STDIN, $_, $ENV{CONTENT_LENGTH});
+  bless $self, $type;
 
-  if ($ENV{QUERY_STRING}) {
-    $_ = $ENV{QUERY_STRING};
-  }
+  $self->_input_to_hash($ENV{QUERY_STRING}) if $ENV{QUERY_STRING};
+  $self->_input_to_hash($ARGV[0])           if @ARGV && $ARGV[0];
 
-  if ($ARGV[0]) {
-    $_ = $ARGV[0];
+  if ($ENV{CONTENT_LENGTH}) {
+    my $content;
+    read STDIN, $content, $ENV{CONTENT_LENGTH};
+    $self->_request_to_hash($content);
   }
 
-  bless $self, $type;
-
-  $self->_request_to_hash($_);
-
   my $db_charset   = $main::dbcharset;
   $db_charset    ||= Common::DEFAULT_CHARSET;