(Ilia)
- Added stream_resolve_include_path(). (Mikko)
+- Fixed bug #50661 (DOMDocument::loadXML does not allow UTF-16). (Rob)
- Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds
but returns false). (Ilia)
- Fixed bug #50636 (MySQLi_Result sets values before calling constructor).
}
/* }}} */
-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;
}
} else {
- ctxt = xmlCreateDocParserCtxt(source);
+ ctxt = xmlCreateMemoryParserCtxt(source, source_len);
}
if (ctxt == NULL) {
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;
--- /dev/null
+--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/>