From abdc57cac8da9cea189b154413a022a3652f2ef7 Mon Sep 17 00:00:00 2001 From: Brian Conry Date: Tue, 15 Mar 2022 16:14:09 -0500 Subject: [PATCH] Prevent warnings with some HTML attachments. HTML attachments may be rewritten on download to adjust links to images that are stored in RT as separate attachments. The function that does the rewrite may return undef if there is nothing to rewrite, causing a 'Use of uninitialized value' warning. --- share/html/Ticket/Attachment/dhandler | 1 + 1 file changed, 1 insertion(+) diff --git a/share/html/Ticket/Attachment/dhandler b/share/html/Ticket/Attachment/dhandler index 44ada1e211a..7ae440c02f3 100644 --- a/share/html/Ticket/Attachment/dhandler +++ b/share/html/Ticket/Attachment/dhandler @@ -83,6 +83,7 @@ elsif (lc $content_type eq 'text/html') { Content => \$content, Attachment => $AttachmentObj, ); + $count //= 0; # RewriteInlineImages can return undef when nothing needs to be rewritten RT->Logger->debug("Rewrote $count CID images when displaying original HTML attachment #$attach"); }