#35649 [Opn->Bgs]: base64_decode bug
| From: | tony2001@php.net | Date: | Mon, 12 Dec 2005 19:51:08 +0000 |
| Subject: | #35649 [Opn->Bgs]: base64_decode bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90303@lists.php.net to get a copy of this message | ||
ID: 35649
Updated by: tony2001@php.net
Reported By: salmon318 at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Windows
PHP Version: 5.1.1
New Comment:
With "a bc" you'll get the same result as with "abc" because that's
the
way it should work according to the RFC:
"All line breaks or other characters not found in Table 1 must be
ignored by decoding software."
http://www.faqs.org/rfcs/rfc2045.html
Previous Comments:
------------------------------------------------------------------------
[2005-12-12 20:39:27] salmon318 at hotmail dot com
Description:
------------
Upgraded to 5.1.1 from 5.0.5 and our application was totally broken. We
found that base64_decode in 5.1.1 behaves differently than 5.0.5.
Basically, if there is a SPACE in the string to be decoded, problem
comes up.
There are similar article on version 4.0.x but nothing on 5.1.1 so I
think it is not fixed in 5.1.x yet.
Reproduce code:
---------------
Try the following code on both PHP 5.0.5 vs 5.1.1:
<?
$str = "a bc";
echo base64_decode($str);
?>
You will get different result. This only happens if there is a space.
Maybe base64_encode has the similar problem too.
Expected result:
----------------
Php 5.0.5 and below has this result:
kæÜ
Php 5.1.1 got this result:
i·
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35649&edit=1