Fixed on the fly decoding of base64 attachment. We need to do on the fly
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 2 May 2004 13:49:14 +0000 (13:49 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 2 May 2004 13:49:14 +0000 (13:49 +0000)
commit7c0ec1d81108c90f37fdab4b85520a05107fc58d
treef3dd4b08cf279ab97e68a2fc4ce8d1dcb3c1dfb2
parentc17df1156beb2355b0a20cd28deb7a115dde41a7
Fixed on the fly decoding of base64 attachment. We need to do on the fly
decoding because otherwise we have to buffer entire attachments in memory
which will cause out of memory errors with large attachments.

The fix has to do with the grouping of bytes in pairs of 4 which represents
24 bits of data. If such group is splitted over 2 lines then on the fly
decoding went wrong. Now we count the pure base64 data (without \r\n, \r \n
and spaces), divide it by 4 and return incomplete pairs which get processed
the in the next loop.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7343 7612ce4b-ef26-0410-bec9-ea0150e637f0
functions/imap_general.php
functions/mime.php