【发布时间】:2017-01-25 20:05:39
【问题描述】:
寻找通过 PHP 打包以外的环境使用 libxml 的人,以确认 HTML_PARSE_NOWARNING 标志被忽略。 仍然会生成警告。
来自 PHP 的源代码,用 C 实现 libxml:
//one of these options is 64 or HTML_PARSE_NOWARNING
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;
}
htmlParseDocument(ctxt); //this still produces warnings
【问题讨论】: