[PHP-DEV] base64_decode improvement From: Turadg Aleahmad (turadg <email protected>)
Date: 02/06/00

I want to contribute this patch to the base64_decode function, but I
don't want to set up CVS if I don't have to. If someone can put this in
the tree for me, please do so and let me know. Thanks.

base64_decode is part of URL functions set, but it doesn't handle base64
that's been POSTed. After POSTing, all the pluses turn to spaces. This
code makes the base64_decode smart enough to deal with that. It's not
entirely necessary, but it will save people time and there are no cons.

[turadg <email protected> ~]$ diff base64.c
/usr/local/src/php-3.0.14/functions/base64.c
96,102d95
< /* 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 <email protected>>
< */
< if (ch == ' ') ch = '+';

-Turadg

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>