@@ -257,12 +257,12 @@ static int php_new_dom_write_smart_str(void *context, const char *buffer, int le
257
257
return len ;
258
258
}
259
259
260
- static zend_string * php_new_dom_dump_node_to_str ( xmlDocPtr doc , xmlNodePtr node , bool format , const char * encoding )
260
+ static zend_string * php_new_dom_dump_node_to_str_ex ( xmlNodePtr node , int options , bool format , const char * encoding )
261
261
{
262
262
smart_str str = {0 };
263
263
264
264
int status = -1 ;
265
- xmlSaveCtxtPtr ctxt = xmlSaveToIO (php_new_dom_write_smart_str , NULL , & str , encoding , XML_SAVE_AS_XML );
265
+ xmlSaveCtxtPtr ctxt = xmlSaveToIO (php_new_dom_write_smart_str , NULL , & str , encoding , XML_SAVE_AS_XML | options );
266
266
if (EXPECTED (ctxt != NULL )) {
267
267
xmlCharEncodingHandlerPtr handler = xmlFindCharEncodingHandler (encoding );
268
268
xmlOutputBufferPtr out = xmlOutputBufferCreateIO (php_new_dom_write_smart_str , NULL , & str , handler );
@@ -284,9 +284,14 @@ static zend_string *php_new_dom_dump_node_to_str(xmlDocPtr doc, xmlNodePtr node,
284
284
return smart_str_extract (& str );
285
285
}
286
286
287
+ static zend_string * php_new_dom_dump_node_to_str (xmlDocPtr doc , xmlNodePtr node , bool format , const char * encoding )
288
+ {
289
+ return php_new_dom_dump_node_to_str_ex (node , 0 , format , encoding );
290
+ }
291
+
287
292
static zend_string * php_new_dom_dump_doc_to_str (xmlDocPtr doc , int options , const char * encoding )
288
293
{
289
- return php_new_dom_dump_node_to_str ( doc , (xmlNodePtr ) doc , options & XML_SAVE_FORMAT , encoding );
294
+ return php_new_dom_dump_node_to_str_ex ( (xmlNodePtr ) doc , options , options & XML_SAVE_FORMAT , encoding );
290
295
}
291
296
292
297
zend_long php_new_dom_dump_node_to_file (const char * filename , xmlDocPtr doc , xmlNodePtr node , bool format , const char * encoding )
0 commit comments