xref: /PHP-5.5/ext/xml/tests/bug49687.phpt (revision db75ce41)
1--TEST--
2Bug #49687 Several utf8_decode deficiencies and vulnerabilities
3--SKIPIF--
4<?php
5require_once("skipif.inc");
6if (!extension_loaded('xml')) die ("skip xml extension not available");
7?>
8--FILE--
9<?php
10
11$tests = array(
12    "\x41\xC2\x3E\x42",
13    "\xE3\x80\x22",
14    "\x41\x98\xBA\x42\xE2\x98\x43\xE2\x98\xBA\xE2\x98",
15);
16foreach ($tests as $t) {
17    echo bin2hex(utf8_decode($t)), "\n";
18}
19echo "Done.\n";
20--EXPECT--
21413f3e42
223f22
23413f3f423f433f3f
24Done.
25