version 1.1.1.3, 2013/07/22 01:31:40
|
version 1.1.1.4, 2014/06/15 20:03:42
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2013 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 188 int dom_documenttype_internal_subset_read(dom_object *
|
Line 188 int dom_documenttype_internal_subset_read(dom_object *
|
{ |
{ |
|
|
xmlDtdPtr dtdptr; |
xmlDtdPtr dtdptr; |
xmlDtd *intsubset; | xmlDtdPtr intsubset; |
xmlOutputBuffer *buff = NULL; | |
|
|
dtdptr = (xmlDtdPtr) dom_object_get_node(obj); |
dtdptr = (xmlDtdPtr) dom_object_get_node(obj); |
|
|
Line 200 int dom_documenttype_internal_subset_read(dom_object *
|
Line 199 int dom_documenttype_internal_subset_read(dom_object *
|
|
|
ALLOC_ZVAL(*retval); |
ALLOC_ZVAL(*retval); |
|
|
if (dtdptr->doc != NULL && ((intsubset = dtdptr->doc->intSubset) != NULL)) { | if (dtdptr->doc != NULL && ((intsubset = xmlGetIntSubset(dtdptr->doc)) != NULL) && intsubset->children != NULL) { |
buff = xmlAllocOutputBuffer(NULL); | smart_str ret_buf = {0}; |
if (buff != NULL) { | xmlNodePtr cur = intsubset->children; |
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); | |
xmlOutputBufferFlush(buff); | while (cur != NULL) { |
| xmlOutputBuffer *buff = xmlAllocOutputBuffer(NULL); |
| |
| if (buff != NULL) { |
| xmlNodeDumpOutput (buff, NULL, cur, 0, 0, NULL); |
| xmlOutputBufferFlush(buff); |
| |
#ifdef LIBXML2_NEW_BUFFER |
#ifdef LIBXML2_NEW_BUFFER |
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1); | smart_str_appendl(&ret_buf, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff)); |
#else |
#else |
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1); | smart_str_appendl(&ret_buf, buff->buffer->content, buff->buffer->use); |
#endif |
#endif |
(void)xmlOutputBufferClose(buff); | |
| (void)xmlOutputBufferClose(buff); |
| } |
| |
| cur = cur->next; |
| } |
| |
| if (ret_buf.len) { |
| ZVAL_STRINGL(*retval, ret_buf.c, ret_buf.len, 1); |
| smart_str_free(&ret_buf); |
return SUCCESS; |
return SUCCESS; |
} |
} |
} |
} |
|
|
ZVAL_EMPTY_STRING(*retval); | ZVAL_NULL(*retval); |
|
|
return SUCCESS; |
return SUCCESS; |
|
|