[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[14858] branches/SM-1_4-STABLE/squirrelmail/ functions/mime.php
From:       pdontthink--- via squirrelmail-cvs <squirrelmail-cvs () lists ! sourceforge ! net>
Date:       2020-05-23 18:44:23
Message-ID: 1590259463.969945.2725 () sfp-scm-1 ! v30 ! lw ! sourceforge ! com
[Download RAW message or body]

Revision: 14858
          http://sourceforge.net/p/squirrelmail/code/14858
Author:   pdontthink
Date:     2020-05-23 18:44:23 +0000 (Sat, 23 May 2020)
Log Message:
-----------
Show better filesize approximations for base64-encoded attachments

Modified Paths:
--------------
    branches/SM-1_4-STABLE/squirrelmail/functions/mime.php

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/mime.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/mime.php	2020-05-23 18:43:27 UTC \
                (rev 14857)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/mime.php	2020-05-23 18:44:23 UTC \
(rev 14858) @@ -545,9 +545,15 @@
         $links = $hookresults[1];
         $defaultlink = $hookresults[6];
 
+        // base64 encoded file sizes are misleading, so approximate real size
+        if (!empty($header->encoding) && $header->encoding == 'base64')
+            $size = $header->size / 4 * 3;
+        else
+            $size = $header->size;
+
         $attachments .= '<tr><td>' .
             '<a href="'.$defaultlink.'">'.decodeHeader($display_filename).'</a>&nbsp;</td>' \
                .
-            '<td><small><b>' . show_readable_size($header->size) .
+            '<td><small><b>' . show_readable_size($size) .
             '</b>&nbsp;&nbsp;</small></td>' .
             '<td><small>[ \
'.sm_encode_html_special_chars($type0).'/'.sm_encode_html_special_chars($type1).' \
]&nbsp;</small></td>' .  '<td><small>';

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.



-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic