#39412 [Opn->Csd]: base64_decode does not return FALSE on failure
| From: | bjori@php.net | Date: | Tue, 07 Nov 2006 14:20:22 +0000 |
| Subject: | #39412 [Opn->Csd]: base64_decode does not return FALSE on failure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-104508@lists.php.net to get a copy of this message | ||
ID: 39412
Updated by: bjori@php.net
Reported By: phpbugs at staznosti dot sk
-Status: Open
+Status: Closed
Bug Type: *URL Functions
Operating System: Linux
PHP Version: 4.4.4
New Comment:
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
Will not get fixed in 4.4, but already fixed in 5.2.
php -r 'var_dump(base64_decode("This is short string!",
true));'
bool(false)
Previous Comments:
------------------------------------------------------------------------
[2006-11-07 10:01:35] phpbugs at staznosti dot sk
Description:
------------
base64_decode does not return FALSE on failure, return garbled (binary)
text instead
Reproduce code:
---------------
$string="This is short string!";
$test=base64_decode($string);
if ($test===FALSE) echo 'text is not base64 encoded';
else echo $test;
Expected result:
----------------
FALSE should be returned
Actual result:
--------------
garbled text / binary string
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39412&edit=1