[Rt-commit] rt branch 4.4/prevent-warning-attachment-image-rewrite created. rt-4.4.5-32-gabdc57cac8

BPS Git Server git at git.bestpractical.com
Tue Mar 15 21:17:36 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 4.4/prevent-warning-attachment-image-rewrite has been created
        at  abdc57cac8da9cea189b154413a022a3652f2ef7 (commit)

- Log -----------------------------------------------------------------
commit abdc57cac8da9cea189b154413a022a3652f2ef7
Author: Brian Conry <bconry at bestpractical.com>
Date:   Tue Mar 15 16:14:09 2022 -0500

    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.

diff --git a/share/html/Ticket/Attachment/dhandler b/share/html/Ticket/Attachment/dhandler
index 44ada1e211..7ae440c02f 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");
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list