base64_decode improvement

From: Date: Sun, 06 Feb 2000 19:37:48 +0000
Subject: base64_decode improvement
Groups: php.dev 
Request: Send a blank email to php-dev+get-15260@lists.php.net to get a copy of this message
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@wise ~]$ 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@wise.berkeley.edu> < */ < if (ch == ' ') ch = '+'; -Turadg

« previous php.dev (#15260) next »