#37244 [Opn->Asn]: base64_decode violates RFC 3548
| From: | iliaa@php.net | Date: | Tue, 02 May 2006 15:16:06 +0000 |
| Subject: | #37244 [Opn->Asn]: base64_decode violates RFC 3548 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96482@lists.php.net to get a copy of this message | ||
ID: 37244
Updated by: iliaa@php.net
Reported By: nohn@php.net
-Status: Open
+Status: Assigned
Bug Type: URL related
Operating System: Irrelevant
PHP Version: 5CVS-2006-04-29 (CVS)
-Assigned To:
+Assigned To: iliaa
Previous Comments:
------------------------------------------------------------------------
[2006-04-29 13:58:29] nohn@php.net
Description:
------------
base64_decode violates RFC 3548:
"Implementations MUST reject the encoding if it contains characters
outside the base alphabet when interpreting base encoded data, unless
the specification referring to this document explicitly states
otherwise."
Reproduce code:
---------------
<?php
$strings = array(
'SW1wbGVtZW50YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
'SW1wbGVtZW$0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
'SW1wbGVtZW0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu'
);
foreach($strings as $string) {
var_dump(base64_decode($string));
}
?>
Expected result:
----------------
string(93) "Implementations MUST reject the encoding if it contains
characters outside the base alphabet."
bool(false)
string(92) "Implemem][ÛÈUTZXH[ÛÙ[ÈYÛÛZ[ÈÚ\XÝ\ÈÝ]ÚYHH\ÙH[X]"
Actual result:
--------------
string(93) "Implementations MUST reject the encoding if it contains
characters outside the base alphabet."
string(92) "Implemem][ÛÈUTZXH[ÛÙ[ÈYÛÛZ[ÈÚ\XÝ\ÈÝ]ÚYHH\ÙH[X]"
string(92) "Implemem][ÛÈUTZXH[ÛÙ[ÈYÛÛZ[ÈÚ\XÝ\ÈÝ]ÚYHH\ÙH[X]"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37244&edit=1