diff options
Diffstat (limited to 'perl-lib/PgCommitFest/Request.pm')
-rw-r--r-- | perl-lib/PgCommitFest/Request.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-lib/PgCommitFest/Request.pm b/perl-lib/PgCommitFest/Request.pm index a12ab4a..dc75d92 100644 --- a/perl-lib/PgCommitFest/Request.pm +++ b/perl-lib/PgCommitFest/Request.pm @@ -199,6 +199,17 @@ sub render_template { # reasonable if we've already begun sending the response back to Apache. my %stash; my $content = $self->generate_headers(); + my $uri = ''; + if ($ENV{'REQUEST_METHOD'} eq 'GET') { + if ($ENV{'SCRIPT_NAME'} ne '/action/login') { + my $req = $ENV{'REQUEST_URI'}; + $req =~ s/[^A-Za-z0-9]/sprintf "%%%x", ord($&)/ge;; + $uri = '?uri=' . $req; + } + else { + $uri = '?' . $ENV{'QUERY_STRING'}; + } + } %stash = %$vars if defined $vars; $stash{'authenticate'} = $self->authenticate(); $stash{'control'} = $self->{'control'}; @@ -209,6 +220,7 @@ sub render_template { 'title' => $self->{'title'}, 'error_list' => $self->{'error_list'}, 'script_name' => $ENV{'SCRIPT_NAME'}, + 'uri' => $uri, }, \$content) || die $template->error(); $template->process($file . '.tt2', \%stash, \$content) || die $template->error(); |