MFH: test for bug #37244

This commit is contained in:
Hannes Magnusson 2006-06-26 22:20:27 +00:00
parent 3d63ca3edc
commit c9c2c0e1f8

View File

@ -0,0 +1,18 @@
--TEST--
Bug #37244 (base64_decode violates RFC 3548)
--FILE--
<?php
$strings = array(
'SW1wbGVtZW50YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
'SW1wbGVtZW$0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
'SW1wbGVtZW0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu'
);
foreach($strings as $string) {
var_dump(base64_decode($string, true));
}
?>
--EXPECT--
string(93) "Implementations MUST reject the encoding if it contains characters outside the base alphabet."
bool(false)
string(92) "Implemem][ÛœÈUTÕ™Z™XÝH[˜ÛÙ[™ÈYˆ]ÛÛ<C39B>Z[œÈÚ\˜\œÈÝ]ÚYHH˜\ÙH[X™] "