From 0c27df9b59417fcef923f18f6c33d6190dd94fa9 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 14 May 2007 11:55:32 +0000 Subject: [PATCH] =?utf8?q?build=5Fstd=5Furl()=20etwas=20aufgebohrt,=20soda?= =?utf8?q?ss=20das=20auszuf=C3=BChrende=20Script=20ver=C3=A4ndert=20werden?= =?utf8?q?=20kann.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/common.pl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index b661c34dc..7f557fb43 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -45,20 +45,27 @@ sub restore_form { sub build_std_url { $lxdebug->enter_sub(); - my $url = "$form->{script}?"; - my $first = 1; + my $script = $form->{script}; + + my @parts; + foreach my $key ((qw(login password), @_)) { next unless ($key); - $url .= "&" unless ($first); - $first = 0; - if ($key =~ /=/) { - $url .= $key; + if ($key =~ /(.*?)=(.*)/) { + if ($1 eq 'script') { + $script = $2; + } else { + push @parts, $key; + } + } else { - $url .= "${key}=" . E($form->{$key}); + push @parts, "${key}=" . E($form->{$key}); } } + my $url = "${script}?" . join('&', @parts); + $lxdebug->leave_sub(); return $url; -- 2.20.1