Annotation of embedaddon/php/ext/standard/tests/url/bug47174.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #47174 (base64_decode() interprets pad char in mid string as terminator)
! 3: --FILE--
! 4: <?php
! 5: if (base64_decode(b"dGVzdA==") == base64_decode(b"dGVzdA==CRAP")) {
! 6: echo "Same octect data - Signature Valid\n";
! 7: } else {
! 8: echo "Invalid Signature\n";
! 9: }
! 10:
! 11: $in = base64_encode(b"foo") . b'==' . base64_encode(b"bar");
! 12: var_dump($in, base64_decode($in));
! 13:
! 14: ?>
! 15: --EXPECT--
! 16: Invalid Signature
! 17: string(10) "Zm9v==YmFy"
! 18: string(6) "foobar"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>