Revision 0c27df9b
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
bin/mozilla/common.pl | ||
---|---|---|
45 | 45 |
sub build_std_url { |
46 | 46 |
$lxdebug->enter_sub(); |
47 | 47 |
|
48 |
my $url = "$form->{script}?"; |
|
49 |
my $first = 1; |
|
48 |
my $script = $form->{script}; |
|
49 |
|
|
50 |
my @parts; |
|
51 |
|
|
50 | 52 |
foreach my $key ((qw(login password), @_)) { |
51 | 53 |
next unless ($key); |
52 |
$url .= "&" unless ($first); |
|
53 |
$first = 0; |
|
54 | 54 |
|
55 |
if ($key =~ /=/) { |
|
56 |
$url .= $key; |
|
55 |
if ($key =~ /(.*?)=(.*)/) { |
|
56 |
if ($1 eq 'script') { |
|
57 |
$script = $2; |
|
58 |
} else { |
|
59 |
push @parts, $key; |
|
60 |
} |
|
61 |
|
|
57 | 62 |
} else { |
58 |
$url .= "${key}=" . E($form->{$key});
|
|
63 |
push @parts, "${key}=" . E($form->{$key});
|
|
59 | 64 |
} |
60 | 65 |
} |
61 | 66 |
|
67 |
my $url = "${script}?" . join('&', @parts); |
|
68 |
|
|
62 | 69 |
$lxdebug->leave_sub(); |
63 | 70 |
|
64 | 71 |
return $url; |
Auch abrufbar als: Unified diff
build_std_url() etwas aufgebohrt, sodass das auszuführende Script verändert werden kann.