php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54037
Patch patch-for-new-loadhtml-options-documentation revision 2011-08-12 21:06 UTC by fxmulder at gmail dot com
Patch patch-for-adding-loadhtml-options.patch revision 2011-03-03 07:12 UTC by chregu@php.net
Patch libxml-html-constants.patch revision 2011-02-17 23:19 UTC by fxmulder at gmail dot com
revision 2011-02-17 23:00 UTC by fxmulder at gmail dot com
Patch domdocument-loadhtml-options.patch revision 2011-02-17 18:31 UTC by fxmulder at gmail dot com
revision 2011-02-17 17:59 UTC by fxmulder at gmail dot com

Patch domdocument-loadhtml-options.patch for DOM XML related Bug #54037

Patch version 2011-02-17 18:31 UTC

Return to Bug #54037 | Download this patch
This patch is obsolete

Obsoleted by patches:

This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: fxmulder@gmail.com

diff -ru PHP_TRUNK.ORIG/ext/dom/document.c PHP_TRUNK/ext/dom/document.c
--- PHP_TRUNK.ORIG/ext/dom/document.c	2011-02-17 08:22:53.000000000 -0700
+++ PHP_TRUNK/ext/dom/document.c	2011-02-17 08:30:56.000000000 -0700
@@ -149,10 +149,12 @@
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtml, 0, 0, 1)
 	ZEND_ARG_INFO(0, source)
+	ZEND_ARG_INFO(0, options)
 ZEND_END_ARG_INFO();
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtmlfile, 0, 0, 1)
 	ZEND_ARG_INFO(0, source)
+	ZEND_ARG_INFO(0, options)
 ZEND_END_ARG_INFO();
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savehtml, 0, 0, 0)
@@ -2155,12 +2157,12 @@
 	dom_object *intern;
 	dom_doc_propsptr doc_prop;
 	char *source;
-	int source_len, refcount, ret;
+	int source_len, refcount, ret, options = 0;
 	htmlParserCtxtPtr ctxt;
 	
 	id = getThis();
 
-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) {
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
 		return;
 	}
 
@@ -2180,6 +2182,10 @@
 		RETURN_FALSE;
 	}
 
+	if (options) {
+		htmlCtxtUseOptions(ctxt, options);
+	}
+
 	ctxt->vctxt.error = php_libxml_ctx_error;
 	ctxt->vctxt.warning = php_libxml_ctx_warning;
 	if (ctxt->sax != NULL) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 04:01:30 2024 UTC