diff options
author | Eric Wong <e@yhbt.net> | 2020-01-05 23:23:31 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-01-06 10:20:37 +0000 |
commit | 11eec3365d537b20ade6923eaa5fdd18206d4342 (patch) | |
tree | 90e37108bb9b800555f08b32ac248eeabe140373 /lib/PublicInbox/Hval.pm | |
parent | ac47f1bc4692ec11760017fff706e06a5fa8ebc7 (diff) | |
download | public-inbox-11eec3365d537b20ade6923eaa5fdd18206d4342.tar.gz |
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
Diffstat (limited to 'lib/PublicInbox/Hval.pm')
-rw-r--r-- | lib/PublicInbox/Hval.pm | 5 |
1 files changed, 3 insertions, 2 deletions
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}; |