mirror of
https://github.com/php/php-src.git
synced 2024-10-03 07:46:12 +00:00
e69b1ff2c4
of reported malformed sequences). (Gustavo) #Made a public interface for get_next_char/utf-8 in trunk to use in utf8_decode. #In PHP 5.3, trunk's get_next_char was copied to xml.c because 5.3's #get_next_char is different and is not prepared to recover appropriately from #errors.
25 lines
484 B
PHP
25 lines
484 B
PHP
--TEST--
|
|
Bug #49687 Several utf8_decode deficiencies and vulnerabilities
|
|
--SKIPIF--
|
|
<?php
|
|
require_once("skipif.inc");
|
|
if (!extension_loaded('xml')) die ("skip xml extension not available");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$tests = array(
|
|
"\x41\xC2\x3E\x42",
|
|
"\xE3\x80\x22",
|
|
"\x41\x98\xBA\x42\xE2\x98\x43\xE2\x98\xBA\xE2\x98",
|
|
);
|
|
foreach ($tests as $t) {
|
|
echo bin2hex(utf8_decode($t)), "\n";
|
|
}
|
|
echo "Done.\n";
|
|
--EXPECT--
|
|
413f3e42
|
|
3f22
|
|
413f3f423f433f3f
|
|
Done.
|