From eddf474351c12b1000a9e9928cf156d6fe4f0e0a Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 1 Sep 2006 14:49:13 +0000 Subject: [PATCH] Remove call to PHP 5 only function. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@355 48356398-32a2-884e-a903-53898d9a118a --- tests/HTMLPurifier/EntityParserTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/HTMLPurifier/EntityParserTest.php b/tests/HTMLPurifier/EntityParserTest.php index 47da1068..11a5ce2a 100644 --- a/tests/HTMLPurifier/EntityParserTest.php +++ b/tests/HTMLPurifier/EntityParserTest.php @@ -54,7 +54,12 @@ class HTMLPurifier_EntityParserTest extends UnitTestCase '&#x' . dechex($arg[0]) . ';'; // hex $expect = ''; if ($arg[1] !== false) { - $chars = str_split($arg[1], 2); + // this is only for PHP 5, the below is PHP 5 and PHP 4 + //$chars = str_split($arg[1], 2); + $chars = array(); + for ($i = 0; isset($arg[1][$i]); $i += 2) { + $chars[] = $arg[1][$i] . $arg[1][$i+1]; + } foreach ($chars as $char) { $expect .= chr(hexdec($char)); }