From: Dominik Csapak Date: Wed, 4 Mar 2020 08:42:34 +0000 (+0100) Subject: check if img tag has actually a 'src' attribute X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=841e05f544b4014f8b548f5b7a9cdc7774b51b2a;p=pmg-api.git check if img tag has actually a 'src' attribute otherwise the journal gets flooded with Use of uninitialized value in pattern match (m//) [...] when the user opens a preview which contains img tags without src attribute Signed-off-by: Dominik Csapak --- diff --git a/src/PMG/HTMLMail.pm b/src/PMG/HTMLMail.pm index 668be48..b69a596 100644 --- a/src/PMG/HTMLMail.pm +++ b/src/PMG/HTMLMail.pm @@ -32,7 +32,7 @@ sub dump_html { $node->{target} = '_blank' if $tag eq 'a'; if ($tag eq 'img') { - if ($node->{src} =~ m/^cid:(\S+)$/) { + if ($node->{src} && $node->{src} =~ m/^cid:(\S+)$/) { if (my $datauri = $cid_hash->{$1}) { $node->{src} = $datauri; }