[Rt-commit] rt branch 5.0/use-base64-for-big-content created. rt-5.0.5-74-g349a92218d

BPS Git Server git at git.bestpractical.com
Thu Dec 7 21:34:42 UTC 2023


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, 5.0/use-base64-for-big-content has been created
        at  349a92218dc70dd22fc140825fca3af1fd7e1880 (commit)

- Log -----------------------------------------------------------------
commit 349a92218dc70dd22fc140825fca3af1fd7e1880
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 7 16:28:01 2023 -0500

    Use base64 encoding for content larger than 100KB
    
    QuotedPrintable is quite slow in some cases especially when content size
    is big.

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 3a87daf590..4f5f2ac2b7 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -743,7 +743,7 @@ sub _EncodeLOB {
     #if the current attachment contains nulls and the
     #database doesn't support embedded nulls
 
-    if ( ( !$RT::Handle->BinarySafeBLOBs ) && ( $Body =~ /\x00/ ) ) {
+    if ( ( !$RT::Handle->BinarySafeBLOBs ) && ( $Body =~ /\x00/ || length $Body > 100_000 ) ) {
 
         # set a flag telling us to mimencode the attachment
         $ContentEncoding = 'base64';

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list