diff options
author | Eric Wong <e@80x24.org> | 2014-04-15 07:06:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-04-15 07:07:12 +0000 |
commit | d95eccbe97f1a48b76c8a80fc81d88a291676cdc (patch) | |
tree | aed9704c5fe023feb52b44af06f51f991b6d7c79 /public-inbox.cgi | |
parent | 7aab828b54dd4bf9adc455940599a9a0ae6fafb6 (diff) | |
download | public-inbox-d95eccbe97f1a48b76c8a80fc81d88a291676cdc.tar.gz |
Lightly tested, but this seems to work OK.
Diffstat (limited to 'public-inbox.cgi')
-rwxr-xr-x | public-inbox.cgi | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/public-inbox.cgi b/public-inbox.cgi index 374b03d4..1fb96e75 100755 --- a/public-inbox.cgi +++ b/public-inbox.cgi @@ -15,7 +15,7 @@ use warnings; use CGI qw(:cgi :escapeHTML -nosticky); # PSGI/FastCGI/mod_perl compat use Encode qw(decode_utf8); use PublicInbox::Config; -use URI::Escape qw(uri_unescape); +use URI::Escape qw(uri_escape uri_unescape); use Digest::SHA qw(sha1_hex); our $LISTNAME_RE = qr!\A(?:/.*?)?/([\w\.\-]+)!; our $pi_config; @@ -172,9 +172,7 @@ sub get_mid_html { my $x = mid2blob($ctx); return r404() unless $x; - my $pfx = $cgi->self_url; - $pfx =~ s!/m/.+\z!/!; # FIXME: this is not robust - + my $pfx = "../f/" . uri_escape($ctx->{mid}) . ".html"; require PublicInbox::View; require Email::MIME; [ "200 OK", {'Content-Type' => 'text/html'}, |