~legolas/ubuntu/natty/php5/5.3.5

« back to all changes in this revision

Viewing changes to ext/xml/tests/bug49687.phpt

  • Committer: Stas Verberkt
  • Date: 2011-02-01 09:27:15 UTC
  • Revision ID: legolas@legolasweb.nl-20110201092715-yq052iu2yl4i2eyg
Inserted PHP 5.3.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug #49687 Several utf8_decode deficiencies and vulnerabilities
 
3
--SKIPIF--
 
4
<?php
 
5
require_once("skipif.inc");
 
6
if (!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
);
 
16
foreach ($tests as $t) {
 
17
    echo bin2hex(utf8_decode($t)), "\n";
 
18
}
 
19
echo "Done.\n";
 
20
--EXPECT--
 
21
413f3e42
 
22
3f22
 
23
413f3f423f433f3f
 
24
Done.