about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiImport.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-22 07:53:59 +0000
committerEric Wong <e@80x24.org>2021-03-23 00:07:12 +0000
commitd4b8980b9d2305c3004ff076a83006cc20502e56 (patch)
tree9fc5aca5d117d04a4c7b7ff2f5b9a818f3b9372c /lib/PublicInbox/LeiImport.pm
parentc61dc9e3b1d4e8fb0035461dced3f46853535e80 (diff)
downloadpublic-inbox-d4b8980b9d2305c3004ff076a83006cc20502e56.tar.gz
mbox_reader: add ->reads method to avoid nonsensical formats
Relying on UNIVERSAL::can may cause internal helper methods
to be used, which can lead to failures or nonsensical results.
Diffstat (limited to 'lib/PublicInbox/LeiImport.pm')
-rw-r--r--lib/PublicInbox/LeiImport.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm
index e769fba8..e587ada8 100644
--- a/lib/PublicInbox/LeiImport.pm
+++ b/lib/PublicInbox/LeiImport.pm
@@ -96,7 +96,7 @@ error reading $input: $!
                         my $eml = PublicInbox::Eml->new(\$buf);
                         _import_eml($eml, $lei, $kw);
                 } else { # some mbox (->can already checked in call);
-                        my $cb = PublicInbox::MboxReader->can($ifmt) //
+                        my $cb = PublicInbox::MboxReader->reads($ifmt) //
                                 die "BUG: bad fmt=$ifmt";
                         $cb->(undef, $fh, \&_import_eml, $lei, $kw);
                 }