mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
PHP bug #74004
Fix for DOMDocument loadHTML and loadHTMLFile ignore LIBXML_NOWARNING and LIBXML_NOERROR flags.
This commit is contained in:
parent
cf60f26da6
commit
fab5ce347c
4
NEWS
4
NEWS
@ -2,7 +2,9 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2017 PHP 7.0.18
|
||||
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #74004 (LIBXML_NOWARNING flag ingnored on loadHTML*).
|
||||
(somedaysummer)
|
||||
|
||||
16 Mar 2017 PHP 7.0.17
|
||||
|
||||
|
@ -2038,16 +2038,16 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (options) {
|
||||
htmlCtxtUseOptions(ctxt, (int)options);
|
||||
}
|
||||
|
||||
|
||||
ctxt->vctxt.error = php_libxml_ctx_error;
|
||||
ctxt->vctxt.warning = php_libxml_ctx_warning;
|
||||
if (ctxt->sax != NULL) {
|
||||
ctxt->sax->error = php_libxml_ctx_error;
|
||||
ctxt->sax->warning = php_libxml_ctx_warning;
|
||||
}
|
||||
if (options) {
|
||||
htmlCtxtUseOptions(ctxt, (int)options);
|
||||
}
|
||||
htmlParseDocument(ctxt);
|
||||
newdoc = ctxt->myDoc;
|
||||
htmlFreeParserCtxt(ctxt);
|
||||
|
14
ext/dom/tests/bug74004.phpt
Normal file
14
ext/dom/tests/bug74004.phpt
Normal file
@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #74004 (DOMDocument->loadHTML and ->loadHTMLFile do not heed LIBXML_NOWARNING and LIBXML_NOERROR options)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$doc=new DOMDocument();
|
||||
$doc->loadHTML("<tag-throw></tag-throw>",LIBXML_NOERROR);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user