From 11eec3365d537b20ade6923eaa5fdd18206d4342 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 5 Jan 2020 23:23:31 +0000 Subject: hval: export prurl and add prototype This allows to do some compile-time checking and fills in a missing "use" in PublicInbox::NewsWWW, allowing it to be used standalone and independently of PublicInbox::WWW --- lib/PublicInbox/Hval.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Hval.pm') diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm index cd3a4df3..7e007027 100644 --- a/lib/PublicInbox/Hval.pm +++ b/lib/PublicInbox/Hval.pm @@ -10,7 +10,7 @@ use Encode qw(find_encoding); use PublicInbox::MID qw/mid_clean mid_escape/; use base qw/Exporter/; our @EXPORT_OK = qw/ascii_html obfuscate_addrs to_filename src_escape - to_attr from_attr/; + to_attr from_attr prurl/; my $enc_ascii = find_encoding('us-ascii'); # safe-ish acceptable filename pattern for portability @@ -84,7 +84,8 @@ sub raw { } } -sub prurl { +# returns a protocol-relative URL string +sub prurl ($$) { my ($env, $u) = @_; if (ref($u) eq 'ARRAY') { my $h = $env->{HTTP_HOST} // $env->{SERVER_NAME}; -- cgit v1.2.3-24-ge0c7