Edit report at https://bugs.php.net/bug.php?id=80870&edit=1
ID: 80870
Comment by: rtrtrtrtrt at dfdfdfdf dot dfd
Reported by: bugs at jth dot net
Summary: base64_decode: Concatenated base64 blocks are
corrupted
Status: Not a bug
Type: Bug
Package: Strings related
Operating System: Linux
PHP Version: 7.4.16
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
argue whatever you want: "Concatenated base64 blocks" are idiotic
Previous Comments:
------------------------------------------------------------------------
[2021-03-17 20:32:13] bugs at jth dot net
The base64_decode is handling the padding character '=' incorrectly.
It can decode concatenated blocks if the statement
i = 0;
is inserted into the code in a proper place.
However, adding a few more lines will handle it properly and I am currently testing this.
------------------------------------------------------------------------
[2021-03-17 16:27:17] cmb@php.net
base64_encode() is supposed to decode a base64 encoded string. Two
concatenated base64 encoded strings are not a base64 encoded
string.
------------------------------------------------------------------------
[2021-03-16 20:13:29] iguv dot jdzx at ghjj dot sddr
again: read the source of roundcubemail which is written in php and solved your issues
------------------------------------------------------------------------
[2021-03-16 19:33:01] bugs at jth dot net
Please, forget the source, and relate to the problem.
Linux base64 is handling decoding correctly.
base64_decode is not handling it correctly, but corrupting data.
------------------------------------------------------------------------
[2021-03-16 19:05:30] bugs at jth dot net
> Please, understand, that we are handling emails > sent to a server from the outside world composed > by a variety of email clients out of our control
please understand that everybody dealing with email has that issue and solving that properly is far
outside of a naive usage of base64 / string functions
it's far outside of the scope of a programming language
you are wrong here - look how mail-clients linke rouncube written in php deal with emails! again:
you are wrong here, base64_decode alone can't handle emails, period
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80870
--
Edit this bug report at https://bugs.php.net/bug.php?id=80870&edit=1