X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2FPublicInbox%2FWwwListing.pm;h=365743cfdf90d13bc4b56b95297dc1d04e93f716;hb=6c853f5256f3a324c018a37a9e8a6b9fc8fdc063;hp=780c97e913b22a9d2427aa4d7cd5a3c80f4a65ea;hpb=967f6d1b1626392ee4340ea356a00651462377b3;p=public-inbox.git diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index 780c97e9..365743cf 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -6,11 +6,10 @@ package PublicInbox::WwwListing; use strict; use warnings; -use PublicInbox::Hval qw(ascii_html prurl); +use PublicInbox::Hval qw(ascii_html prurl fmt_ts); use PublicInbox::Linkify; use PublicInbox::View; use PublicInbox::Inbox; -use PublicInbox::NoopFilter; use PublicInbox::GzipFilter qw(gzf_maybe); use bytes (); # bytes::length use HTTP::Date qw(time2str); @@ -41,7 +40,7 @@ sub list_all ($$$) { sub list_match_domain_i { my ($ibx, $arg) = @_; my ($list, $hide_key, $re) = @$arg; - if (!$ibx->{-hide}->{$hide_key} && grep($re, @{$ibx->{url}})) { + if (!$ibx->{-hide}->{$hide_key} && grep(/$re/, @{$ibx->{url}})) { push @$list, $ibx; } } @@ -92,7 +91,7 @@ sub new { sub ibx_entry { my ($mtime, $ibx, $env) = @_; - my $ts = PublicInbox::View::fmt_ts($mtime); + my $ts = fmt_ts($mtime); my $url = prurl($env, $ibx->{url}); my $tmp = <<""; * $ts - $url @@ -108,8 +107,8 @@ sub html ($$) { my ($env, $list) = @_; my $h = [ 'Content-Type', 'text/html; charset=UTF-8', 'Content-Length', undef ]; - my $gzf = gzf_maybe($h, $env) || PublicInbox::NoopFilter::new(); - my $out = $gzf->zmore('' . + my $gzf = gzf_maybe($h, $env); + $gzf->zmore('<html><head><title>' . 'public-inbox listing' . '
');
 	my $code = 404;
@@ -122,11 +121,11 @@ sub html ($$) {
 
 		my $tmp = join("\n", map { ibx_entry(@$_, $env) } @$list);
 		my $l = PublicInbox::Linkify->new;
-		$out .= $gzf->zmore($l->to_html($tmp));
+		$gzf->zmore($l->to_html($tmp));
 	} else {
-		$out .= $gzf->zmore('no inboxes, yet');
+		$gzf->zmore('no inboxes, yet');
 	}
-	$out .= $gzf->zflush('

'.
+	my $out = $gzf->zflush('

'.
 				PublicInbox::WwwStream::code_footer($env) .
 				'
'); $h->[3] = bytes::length($out);