|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesMembership (last revision 2012-09-27 01:25 UTC by ekutkut2002 at hotmail dot com)Pull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2006-05-06 22:47 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
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]"