xref: /PHP-5.5/ext/standard/tests/url/bug47174.phpt (revision a772d7c3)
1--TEST--
2Bug #47174 (base64_decode() interprets pad char in mid string as terminator)
3--FILE--
4<?php
5if (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");
12var_dump($in, base64_decode($in));
13
14?>
15--EXPECT--
16Invalid Signature
17string(10) "Zm9v==YmFy"
18string(6) "foobar"
19