my ($p) = @_;
my @p;
foreach my $k (keys %$p) {
+ next if $k eq '';
foreach my $v (@{ $p->{$k} }) {
push @p, $k, $v;
}
# Calls $bodyfn->($c,$r) which returns @formbits
my $c = $r->{Cgi};
my @form;
+ my $pathinfo = '';
+ $pathinfo .= $params->{''}[0] if $params->{''};
push @form, ('<form method="POST" action="'.
- escapeHTML($r->_ch('get_url')).'">');
+ escapeHTML($r->_ch('get_url').$pathinfo).'">');
push @form, $bodyfn->($c,$r);
foreach my $n (keys %$params) {
+ next if $n eq '';
foreach my $val (@{ $params->{$n} }) {
push @form, ('<input type="hidden"'.
' name="'.escapeHTML($n).'"'.
promise_check_mutate => 0,
get_param => sub { $_[0]->param($_[2]) },
get_params => sub { $_[1]->get_params() },
+ get_path_info => sub { $_[0]->path_info() },
get_cookie => sub { $_[0]->cookie($_[1]->{S}{cookie_name}) },
get_method => sub { $_[0]->request_method() },
get_url => sub { $_[0]->url(); },
foreach my $name (grep /^$dummy_prefix/, keys %p) {
delete $p{$name};
}
+ die if exists $p{''};
+ $p{''} = [ $r->_ch('get_path_info') ];
return \%p;
}
my ($r, $params) = @_;
print STDERR "PARAMS ",Dumper($params);
my $uri = URI->new($r->_ch('get_url'));
+ $uri->path($uri->path() . $params->{''}[0]) if $params->{''};
$uri->query_form(flatten_params($params));
return $uri->as_string();
}
my $params = $divert->{Params};
my $cookie = $r->construct_cookie($cookiesecret);
- if (defined $cookiesecret) {
- $params->{$r->{S}{assoc_param_name}} = [ $r->hash($cookiesecret) ];
- }
-
if ($kind =~ m/^REDIRECT-/) {
# for redirects, we honour stored NextParams and SetCookie,
# as we would for non-divert
return 0;
}
+ if (defined $cookiesecret) {
+ $params->{$r->{S}{assoc_param_name}} = [ $r->hash($cookiesecret) ];
+ }
+
my ($title, @body);
if ($kind =~ m/^LOGIN-/) {
$title = $r->_gt('Login');