Skip to content

Commit 0ea268b

Browse files
committedSep 9, 2023
Remove obsolete libxml2 code
LIBXML2_NEW_BUFFER is always defined since libxml2 2.9.0. That's the minimum version PHP requires, so it will always be defined.
1 parent 518233c commit 0ea268b

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed
 

‎ext/dom/documenttype.c

-4
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,7 @@ zend_result dom_documenttype_internal_subset_read(dom_object *obj, zval *retval)
175175
xmlNodeDumpOutput (buff, NULL, cur, 0, 0, NULL);
176176
xmlOutputBufferFlush(buff);
177177

178-
#ifdef LIBXML2_NEW_BUFFER
179178
smart_str_appendl(&ret_buf, (const char *) xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff));
180-
#else
181-
smart_str_appendl(&ret_buf, (char *) buff->buffer->content, buff->buffer->use);
182-
#endif
183179

184180
(void)xmlOutputBufferClose(buff);
185181
}

‎ext/dom/node.c

-8
Original file line numberDiff line numberDiff line change
@@ -1891,17 +1891,9 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
18911891
RETVAL_FALSE;
18921892
} else {
18931893
if (mode == 0) {
1894-
#ifdef LIBXML2_NEW_BUFFER
18951894
ret = xmlOutputBufferGetSize(buf);
1896-
#else
1897-
ret = buf->buffer->use;
1898-
#endif
18991895
if (ret > 0) {
1900-
#ifdef LIBXML2_NEW_BUFFER
19011896
RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret);
1902-
#else
1903-
RETVAL_STRINGL((char *) buf->buffer->content, ret);
1904-
#endif
19051897
} else {
19061898
RETVAL_EMPTY_STRING();
19071899
}

‎ext/simplexml/simplexml.c

-5
Original file line numberDiff line numberDiff line change
@@ -1432,13 +1432,8 @@ PHP_METHOD(SimpleXMLElement, asXML)
14321432

14331433
xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, (const char *) ((xmlDocPtr) sxe->document->ptr)->encoding);
14341434
xmlOutputBufferFlush(outbuf);
1435-
#ifdef LIBXML2_NEW_BUFFER
14361435
return_content = (char *)xmlOutputBufferGetContent(outbuf);
14371436
return_len = xmlOutputBufferGetSize(outbuf);
1438-
#else
1439-
return_content = (char *)outbuf->buffer->content;
1440-
return_len = outbuf->buffer->use;
1441-
#endif
14421437
if (!return_content) {
14431438
RETVAL_FALSE;
14441439
} else {

0 commit comments

Comments
 (0)