backport fix for new libxml
This commit is contained in:
		
							parent
							
								
									b641517c1b
								
							
						
					
					
						commit
						8a7f0643a6
					
				
							
								
								
									
										68
									
								
								php-5.4.6-libxml.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								php-5.4.6-libxml.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,68 @@ | |||||||
|  | From c4b26cc1b0b0521c75e653fffec2a9e3b4bf8cbb Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Daniel Veillard <veillard@redhat.com> | ||||||
|  | Date: Thu, 9 Aug 2012 14:02:33 -0400 | ||||||
|  | Subject: [PATCH] Update to work with libxml 2.9.0 | ||||||
|  | 
 | ||||||
|  | ---
 | ||||||
|  |  ext/dom/documenttype.c    |    4 ++++ | ||||||
|  |  ext/dom/node.c            |    8 ++++++++ | ||||||
|  |  ext/simplexml/simplexml.c |    4 ++++ | ||||||
|  |  3 files changed, 16 insertions(+), 0 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
 | ||||||
|  | index d61ba79..eee3b5f 100644
 | ||||||
|  | --- a/ext/dom/documenttype.c
 | ||||||
|  | +++ b/ext/dom/documenttype.c
 | ||||||
|  | @@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
 | ||||||
|  |  		if (buff != NULL) { | ||||||
|  |  			xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); | ||||||
|  |  			xmlOutputBufferFlush(buff); | ||||||
|  | +#ifdef LIBXML2_NEW_BUFFER
 | ||||||
|  | +			ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
 | ||||||
|  | +#else
 | ||||||
|  |  			ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1); | ||||||
|  | +#endif
 | ||||||
|  |  			(void)xmlOutputBufferClose(buff); | ||||||
|  |  			return SUCCESS; | ||||||
|  |  		} | ||||||
|  | diff --git a/ext/dom/node.c b/ext/dom/node.c
 | ||||||
|  | index 5bcb234..727d1bc 100644
 | ||||||
|  | --- a/ext/dom/node.c
 | ||||||
|  | +++ b/ext/dom/node.c
 | ||||||
|  | @@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
 | ||||||
|  |          RETVAL_FALSE; | ||||||
|  |      } else { | ||||||
|  |  		if (mode == 0) { | ||||||
|  | +#ifdef LIBXML2_NEW_BUFFER
 | ||||||
|  | +			ret = xmlOutputBufferGetSize(buf);
 | ||||||
|  | +#else
 | ||||||
|  |  			ret = buf->buffer->use; | ||||||
|  | +#endif
 | ||||||
|  |  			if (ret > 0) { | ||||||
|  | +#ifdef LIBXML2_NEW_BUFFER
 | ||||||
|  | +				RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);
 | ||||||
|  | +#else
 | ||||||
|  |  				RETVAL_STRINGL((char *) buf->buffer->content, ret, 1); | ||||||
|  | +#endif
 | ||||||
|  |  			} else { | ||||||
|  |  				RETVAL_EMPTY_STRING(); | ||||||
|  |  			} | ||||||
|  | diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
 | ||||||
|  | index a379111..2368596 100644
 | ||||||
|  | --- a/ext/simplexml/simplexml.c
 | ||||||
|  | +++ b/ext/simplexml/simplexml.c
 | ||||||
|  | @@ -1417,7 +1417,11 @@ SXE_METHOD(asXML)
 | ||||||
|  |   | ||||||
|  |  			xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding); | ||||||
|  |  			xmlOutputBufferFlush(outbuf); | ||||||
|  | +#ifdef LIBXML2_NEW_BUFFER
 | ||||||
|  | +			RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1);
 | ||||||
|  | +#else
 | ||||||
|  |  			RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1); | ||||||
|  | +#endif
 | ||||||
|  |  			xmlOutputBufferClose(outbuf); | ||||||
|  |  		} | ||||||
|  |  	} else { | ||||||
|  | -- 
 | ||||||
|  | 1.7.8 | ||||||
|  | 
 | ||||||
							
								
								
									
										5
									
								
								php.spec
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								php.spec
									
									
									
									
									
								
							| @ -87,6 +87,9 @@ Patch42: php-5.3.1-systzdata-v9.patch | |||||||
| Patch43: php-5.4.0-phpize.patch | Patch43: php-5.4.0-phpize.patch | ||||||
| # Use system libzip instead of bundled one | # Use system libzip instead of bundled one | ||||||
| Patch44: php-5.4.5-system-libzip.patch | Patch44: php-5.4.5-system-libzip.patch | ||||||
|  | # Fix for libxml 2.9.0 | ||||||
|  | # http://git.php.net/?p=php-src.git;a=commitdiff;h=c4b26cc1b0b0521c75e653fffec2a9e3b4bf8cbb | ||||||
|  | Patch45: php-5.4.6-libxml.patch | ||||||
| 
 | 
 | ||||||
| # Fixes for tests | # Fixes for tests | ||||||
| 
 | 
 | ||||||
| @ -587,6 +590,7 @@ support for using the enchant library to PHP. | |||||||
| %if %{with_libzip} | %if %{with_libzip} | ||||||
| %patch44 -p1 -b .systzip | %patch44 -p1 -b .systzip | ||||||
| %endif | %endif | ||||||
|  | %patch45 -p1 -b .libxml290 | ||||||
| 
 | 
 | ||||||
| # Prevent %%doc confusion over LICENSE files | # Prevent %%doc confusion over LICENSE files | ||||||
| cp Zend/LICENSE Zend/ZEND_LICENSE | cp Zend/LICENSE Zend/ZEND_LICENSE | ||||||
| @ -1286,6 +1290,7 @@ fi | |||||||
| * Fri Aug 17 2012 Remi Collet <remi@fedoraproject.org> 5.4.6-1 | * Fri Aug 17 2012 Remi Collet <remi@fedoraproject.org> 5.4.6-1 | ||||||
| - update to 5.4.6 | - update to 5.4.6 | ||||||
| - update to v9 of systzdata patch | - update to v9 of systzdata patch | ||||||
|  | - backport fix for new libxml | ||||||
| 
 | 
 | ||||||
| * Fri Jul 20 2012 Remi Collet <remi@fedoraproject.org> 5.4.5-1 | * Fri Jul 20 2012 Remi Collet <remi@fedoraproject.org> 5.4.5-1 | ||||||
| - update to 5.4.5 | - update to 5.4.5 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user