xref: /PHP-8.2/ext/standard/tests/url/bug47174.phpt (revision afdaa911)
1--TEST--
2Bug #47174 (base64_decode() interprets pad char in mid string as terminator)
3--FILE--
4<?php
5if (base64_decode("dGVzdA==") == base64_decode("dGVzdA==CRAP")) {
6    echo "Same octet data - Signature Valid\n";
7} else {
8    echo "Invalid Signature\n";
9}
10
11$in = base64_encode("foo") . '==' . base64_encode("bar");
12var_dump($in, base64_decode($in));
13
14?>
15--EXPECT--
16Invalid Signature
17string(10) "Zm9v==YmFy"
18string(6) "foobar"
19