Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions ext/dom/document.c
Original file line number Diff line number Diff line change
Expand Up @@ -2040,8 +2040,6 @@ PHP_METHOD(DOMDocument, relaxNGValidateSource)

#endif

#ifdef LIBXML_HTML_ENABLED

static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
{
char *source;
Expand Down Expand Up @@ -2234,8 +2232,6 @@ PHP_METHOD(DOMDocument, saveHTML)
}
/* }}} end dom_document_save_html */

#endif /* defined(LIBXML_HTML_ENABLED) */

/* {{{ Register extended class used to create base node type */
static void dom_document_register_node_class(INTERNAL_FUNCTION_PARAMETERS, bool modern)
{
Expand Down
12 changes: 0 additions & 12 deletions ext/dom/php_dom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,9 +1369,7 @@ PHP_MINFO_FUNCTION(dom)
php_info_print_table_row(2, "DOM/XML", "enabled");
php_info_print_table_row(2, "DOM/XML API Version", DOM_API_VERSION);
php_info_print_table_row(2, "libxml Version", LIBXML_DOTTED_VERSION);
#ifdef LIBXML_HTML_ENABLED
php_info_print_table_row(2, "HTML Support", "enabled");
#endif
#ifdef LIBXML_XPATH_ENABLED
php_info_print_table_row(2, "XPath Support", "enabled");
#endif
Expand Down Expand Up @@ -2709,20 +2707,10 @@ xmlChar *php_dom_libxml_fix_file_path(xmlChar *path)

xmlDocPtr php_dom_create_html_doc(void)
{
#ifdef LIBXML_HTML_ENABLED
xmlDocPtr lxml_doc = htmlNewDocNoDtD(NULL, NULL);
if (EXPECTED(lxml_doc)) {
lxml_doc->dict = xmlDictCreate();
}
#else
/* If HTML support is not enabled, then htmlNewDocNoDtD() is not available.
* This code mimics the behaviour. */
xmlDocPtr lxml_doc = xmlNewDoc((const xmlChar *) "1.0");
if (EXPECTED(lxml_doc)) {
lxml_doc->type = XML_HTML_DOCUMENT_NODE;
lxml_doc->dict = xmlDictCreate();
}
#endif
return lxml_doc;
}

Expand Down
2 changes: 0 additions & 2 deletions ext/dom/php_dom.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ extern zend_module_entry dom_module_entry;
#include <libxml/xinclude.h>
#include <libxml/hash.h>
#include <libxml/c14n.h>
#ifdef LIBXML_HTML_ENABLED
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#endif
#ifdef LIBXML_XPATH_ENABLED
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
Expand Down
2 changes: 0 additions & 2 deletions ext/dom/php_dom.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,6 @@ public function registerNodeClass(string $baseClass, ?string $extendedClass): tr
/** @tentative-return-type */
public function save(string $filename, int $options = 0): int|false {}

#ifdef LIBXML_HTML_ENABLED
/** @tentative-return-type */
public function loadHTML(string $source, int $options = 0): bool {}

Expand All @@ -1025,7 +1024,6 @@ public function saveHTML(?DOMNode $node = null): string|false {}

/** @tentative-return-type */
public function saveHTMLFile(string $filename): int|false {}
#endif

/** @tentative-return-type */
public function saveXML(?DOMNode $node = null, int $options = 0): string|false {}
Expand Down
18 changes: 3 additions & 15 deletions ext/dom/php_dom_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading