ID: 37244
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-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] [EMAIL PROTECTED]
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