1
0
mirror of https://github.com/php/php-src.git synced 2026-04-05 15:12:39 +02:00

Fixed bug #34214 (base64_decode() does not properly ignore whitespace)

This commit is contained in:
Ilia Alshanetsky
2005-08-26 03:32:31 +00:00
parent 293beeb74a
commit 980b9be4b4

View File

@@ -153,15 +153,6 @@ PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, in
while ((ch = *current++) != '\0' && length-- > 0) {
if (ch == base64_pad) break;
/* When Base64 gets POSTed, all pluses are interpreted as spaces.
This line changes them back. It's not exactly the Base64 spec,
but it is completely compatible with it (the spec says that
spaces are invalid). This will also save many people considerable
headache. - Turadg Aleahmad <turadg@wise.berkeley.edu>
*/
if (ch == ' ') ch = '+';
ch = base64_reverse_table[ch];
if (ch < 0) continue;