pajoye Wed, 03 Feb 2010 18:41:27 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=294436
Log: fix bug #50661 (DOMDocument::loadXML does not allow UTF-16) Bug: http://bugs.php.net/50661 (Closed) DOMDocument::loadXML does not allow UTF-16 Changed paths: _U php/php-src/branches/PHP_5_3_2/ U php/php-src/branches/PHP_5_3_2/ext/dom/document.c A + php/php-src/branches/PHP_5_3_2/ext/dom/tests/bug50661.phpt (from php/php-src/branches/PHP_5_3/ext/dom/tests/bug50661.phpt:r293176) _U php/php-src/branches/PHP_5_3_2/ext/tidy/tests/ _U php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt Property changes on: php/php-src/branches/PHP_5_3_2 ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293268,293341,293400,293502,293538,293558,293974 /php/php-src/trunk:284726 + /php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293268,293341,293400,293502,293538,293558,293974 /php/php-src/trunk:284726 Modified: php/php-src/branches/PHP_5_3_2/ext/dom/document.c =================================================================== --- php/php-src/branches/PHP_5_3_2/ext/dom/document.c 2010-02-03 18:38:11 UTC (rev 294435) +++ php/php-src/branches/PHP_5_3_2/ext/dom/document.c 2010-02-03 18:41:27 UTC (rev 294436) @@ -1542,7 +1542,7 @@ } /* }}} */ -static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int options TSRMLS_DC) /* {{{ */ +static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int source_len, int options TSRMLS_DC) /* {{{ */ { xmlDocPtr ret; xmlParserCtxtPtr ctxt = NULL; @@ -1579,7 +1579,7 @@ } } else { - ctxt = xmlCreateDocParserCtxt(source); + ctxt = xmlCreateMemoryParserCtxt(source, source_len); } if (ctxt == NULL) { @@ -1682,7 +1682,7 @@ RETURN_FALSE; } - newdoc = dom_document_parser(id, mode, source, options TSRMLS_CC); + newdoc = dom_document_parser(id, mode, source, source_len, options TSRMLS_CC); if (!newdoc) RETURN_FALSE; Copied: php/php-src/branches/PHP_5_3_2/ext/dom/tests/bug50661.phpt (from rev 293176, php/php-src/branches/PHP_5_3/ext/dom/tests/bug50661.phpt) =================================================================== --- php/php-src/branches/PHP_5_3_2/ext/dom/tests/bug50661.phpt (rev 0) +++ php/php-src/branches/PHP_5_3_2/ext/dom/tests/bug50661.phpt 2010-02-03 18:41:27 UTC (rev 294436) @@ -0,0 +1,16 @@ +--TEST-- +Bug #50661 (DOMDocument::loadXML does not allow UTF-16). +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$data = "\xFE\xFF\x00\x3C\x00\x66\x00\x6F\x00\x6F\x00\x2F\x00\x3E"; + +$dom = new DOMDocument(); +$dom->loadXML($data); +echo $dom->saveXML(); + +?> +--EXPECT-- +<?xml version="1.0"?> +<foo/> Property changes on: php/php-src/branches/PHP_5_3_2/ext/tidy/tests ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292719,292765,293146,293152,293400,293502,293538,293558 /php/php-src/trunk/ext/tidy/tests:284726,287798-287941 + /php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292719,292765,293146,293152,293176,293400,293502,293538,293558 /php/php-src/trunk/ext/tidy/tests:284726,287798-287941 Property changes on: php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,293146,293152,293400,293502,293538,293558 /php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951 + /php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,293146,293152,293176,293400,293502,293538,293558 /php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
