From f8529382599e678ff266bd26ab82782e3d7b2686 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 19 Oct 2009 15:10:19 +0200 Subject: [PATCH] Vars in is::invoice_links besser sichern. --- bin/mozilla/is.pl | 45 +++++++-------------------------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index b037ca2c7..3aa93b622 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -147,52 +147,21 @@ sub invoice_links { } } - my $payment_id; - if ($form->{payment_id}) { - $payment_id = $form->{payment_id}; - } - my $language_id; - if ($form->{language_id}) { - $language_id = $form->{language_id}; - } - my $taxzone_id; - if ($form->{taxzone_id}) { - $taxzone_id = $form->{taxzone_id}; - } - my $id; - if ($form->{id}) { - $id = $form->{id}; - } - my $shipto_id; - if ($form->{shipto_id}) { - $shipto_id = $form->{shipto_id}; - } + $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes id shipto_id)); - my $cp_id = $form->{cp_id}; IS->get_customer(\%myconfig, \%$form); #quote all_customer Bug 133 foreach my $ref (@{ $form->{all_customer} }) { $ref->{name} = $form->quote($ref->{name}); } - if ($id) { - $form->{id} = $id; - } - IS->retrieve_invoice(\%myconfig, \%$form); - $form->{cp_id} = $cp_id; - if ($payment_id) { - $form->{payment_id} = $payment_id; - } - if ($language_id) { - $form->{language_id} = $language_id; - } - if ($taxzone_id) { - $form->{taxzone_id} = $taxzone_id; - } - if ($shipto_id) { - $form->{shipto_id} = $shipto_id; - } + $form->restore_vars(qw(id)); + + IS->retrieve_invoice(\%myconfig, \%$form); + $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id)); + $form->restore_vars(qw(taxincluded)) if $form->{id}; + $form->restore_vars(qw(salesman_id)) if $main::editing; # build vendor/customer drop down comatibility... don't ask if (@{ $form->{"all_customer"} }) { -- 2.20.1