components/php-5_3/php-sapi/patches/134_php_libxml_2_9_0.patch
changeset 1402 f225f89a0538
parent 1401 367855861774
child 1403 568fa31151bb
equal deleted inserted replaced
1401:367855861774 1402:f225f89a0538
     1 Update to work with libxml 2.9.0 
       
     2 
       
     3 https://github.com/php/php-src/commit/c4b26cc1b0b0521c75e653fffec2a9e3b4bf8cbb
       
     4 
       
     5 diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
       
     6 index d61ba79..eee3b5f 100644
       
     7 --- a/ext/dom/documenttype.c
       
     8 +++ b/ext/dom/documenttype.c
       
     9 @@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
       
    10  		if (buff != NULL) {
       
    11  			xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
       
    12  			xmlOutputBufferFlush(buff);
       
    13 +#ifdef LIBXML2_NEW_BUFFER
       
    14 +			ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
       
    15 +#else
       
    16  			ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
       
    17 +#endif
       
    18  			(void)xmlOutputBufferClose(buff);
       
    19  			return SUCCESS;
       
    20  		}
       
    21 diff --git a/ext/dom/node.c b/ext/dom/node.c
       
    22 index 5bcb234..727d1bc 100644
       
    23 --- a/ext/dom/node.c
       
    24 +++ b/ext/dom/node.c
       
    25 @@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
       
    26          RETVAL_FALSE;
       
    27      } else {
       
    28  		if (mode == 0) {
       
    29 +#ifdef LIBXML2_NEW_BUFFER
       
    30 +			ret = xmlOutputBufferGetSize(buf);
       
    31 +#else
       
    32  			ret = buf->buffer->use;
       
    33 +#endif
       
    34  			if (ret > 0) {
       
    35 +#ifdef LIBXML2_NEW_BUFFER
       
    36 +				RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);
       
    37 +#else
       
    38  				RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);
       
    39 +#endif
       
    40  			} else {
       
    41  				RETVAL_EMPTY_STRING();
       
    42  			}
       
    43 diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
       
    44 index a379111..2368596 100644
       
    45 --- a/ext/simplexml/simplexml.c
       
    46 +++ b/ext/simplexml/simplexml.c
       
    47 @@ -1387,7 +1387,11 @@ static int sxe_objects_compare(zval *object1, zval *object2 TSRMLS_DC) /* {{{ */
       
    48  
       
    49  			xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
       
    50  			xmlOutputBufferFlush(outbuf);
       
    51 +#ifdef LIBXML2_NEW_BUFFER
       
    52 +			RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1);
       
    53 +#else
       
    54  			RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1);
       
    55 +#endif
       
    56  			xmlOutputBufferClose(outbuf);
       
    57  		}
       
    58  	} else {