cvs: /php3 ChangeLog /php3/functions base64.c

From: Date: Thu, 10 Feb 2000 09:41:52 +0000
Subject: cvs: /php3 ChangeLog /php3/functions base64.c
Groups: php.dev 
Request: Send a blank email to php-dev+get-15347@lists.php.net to get a copy of this message
thies Thu Feb 10 01:41:52 2000 EDT Modified files: /php3 ChangeLog /php3/functions base64.c Log: fix for #3446. base64_decode now works on POST data. Index: php3/ChangeLog diff -u php3/ChangeLog:1.820 php3/ChangeLog:1.821 --- php3/ChangeLog:1.820 Mon Feb 7 15:48:09 2000 +++ php3/ChangeLog Thu Feb 10 01:41:51 2000 @@ -2,6 +2,8 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ???, Version 3.0.15 +- base64_decode() will decode POST data correct. (Thies) + Patch submitted by: Turadg Aleahmad <turadg@wise.berkeley.edu> - Fixed a bug in the XML module that could cause crashes (Zeev) - Fixed a long historical bug in the API function call_user_function(), that could cause crashes in functions that made use of it (e.g., Index: php3/functions/base64.c diff -u php3/functions/base64.c:1.33 php3/functions/base64.c:1.34 --- php3/functions/base64.c:1.33 Sun Feb 6 07:16:18 2000 +++ php3/functions/base64.c Thu Feb 10 01:41:52 2000 @@ -26,7 +26,7 @@ | Author: Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id: base64.c,v 1.33 2000/02/06 15:16:18 thies Exp $ */ +/* $Id: base64.c,v 1.34 2000/02/10 09:41:52 thies Exp $ */ #include <string.h> @@ -94,6 +94,16 @@ /* run through the whole string, converting as we go */ while ((ch = *current++) != '\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 = '+'; + chp = strchr(base64_table, ch); if (chp == NULL) continue; ch = chp - base64_table;

« previous php.dev (#15347) next »