@@ -297,7 +297,7 @@ readonly=no
297297int dom_document_format_output_read (dom_object * obj , zval * retval )
298298{
299299 if (obj -> document ) {
300- dom_doc_propsptr doc_prop = dom_get_doc_props (obj -> document );
300+ libxml_doc_props const * doc_prop = dom_get_doc_props_read_only (obj -> document );
301301 ZVAL_BOOL (retval , doc_prop -> formatoutput );
302302 } else {
303303 ZVAL_FALSE (retval );
@@ -322,7 +322,7 @@ readonly=no
322322int dom_document_validate_on_parse_read (dom_object * obj , zval * retval )
323323{
324324 if (obj -> document ) {
325- dom_doc_propsptr doc_prop = dom_get_doc_props (obj -> document );
325+ libxml_doc_props const * doc_prop = dom_get_doc_props_read_only (obj -> document );
326326 ZVAL_BOOL (retval , doc_prop -> validateonparse );
327327 } else {
328328 ZVAL_FALSE (retval );
@@ -347,7 +347,7 @@ readonly=no
347347int dom_document_resolve_externals_read (dom_object * obj , zval * retval )
348348{
349349 if (obj -> document ) {
350- dom_doc_propsptr doc_prop = dom_get_doc_props (obj -> document );
350+ libxml_doc_props const * doc_prop = dom_get_doc_props_read_only (obj -> document );
351351 ZVAL_BOOL (retval , doc_prop -> resolveexternals );
352352 } else {
353353 ZVAL_FALSE (retval );
@@ -372,7 +372,7 @@ readonly=no
372372int dom_document_preserve_whitespace_read (dom_object * obj , zval * retval )
373373{
374374 if (obj -> document ) {
375- dom_doc_propsptr doc_prop = dom_get_doc_props (obj -> document );
375+ libxml_doc_props const * doc_prop = dom_get_doc_props_read_only (obj -> document );
376376 ZVAL_BOOL (retval , doc_prop -> preservewhitespace );
377377 } else {
378378 ZVAL_FALSE (retval );
@@ -397,7 +397,7 @@ readonly=no
397397int dom_document_recover_read (dom_object * obj , zval * retval )
398398{
399399 if (obj -> document ) {
400- dom_doc_propsptr doc_prop = dom_get_doc_props (obj -> document );
400+ libxml_doc_props const * doc_prop = dom_get_doc_props_read_only (obj -> document );
401401 ZVAL_BOOL (retval , doc_prop -> recover );
402402 } else {
403403 ZVAL_FALSE (retval );
@@ -422,7 +422,7 @@ readonly=no
422422int dom_document_substitue_entities_read (dom_object * obj , zval * retval )
423423{
424424 if (obj -> document ) {
425- dom_doc_propsptr doc_prop = dom_get_doc_props (obj -> document );
425+ libxml_doc_props const * doc_prop = dom_get_doc_props_read_only (obj -> document );
426426 ZVAL_BOOL (retval , doc_prop -> substituteentities );
427427 } else {
428428 ZVAL_FALSE (retval );
@@ -1176,7 +1176,6 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
11761176{
11771177 xmlDocPtr ret ;
11781178 xmlParserCtxtPtr ctxt = NULL ;
1179- dom_doc_propsptr doc_props ;
11801179 dom_object * intern ;
11811180 php_libxml_ref_obj * document = NULL ;
11821181 int validate , recover , resolve_externals , keep_blanks , substitute_ent ;
@@ -1189,17 +1188,13 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
11891188 document = intern -> document ;
11901189 }
11911190
1192- doc_props = dom_get_doc_props (document );
1191+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (document );
11931192 validate = doc_props -> validateonparse ;
11941193 resolve_externals = doc_props -> resolveexternals ;
11951194 keep_blanks = doc_props -> preservewhitespace ;
11961195 substitute_ent = doc_props -> substituteentities ;
11971196 recover = doc_props -> recover ;
11981197
1199- if (document == NULL ) {
1200- efree (doc_props );
1201- }
1202-
12031198 xmlInitParser ();
12041199
12051200 if (mode == DOM_LOAD_FILE ) {
@@ -1387,7 +1382,6 @@ PHP_METHOD(DOMDocument, save)
13871382 size_t file_len = 0 ;
13881383 int bytes , format , saveempty = 0 ;
13891384 dom_object * intern ;
1390- dom_doc_propsptr doc_props ;
13911385 char * file ;
13921386 zend_long options = 0 ;
13931387
@@ -1405,7 +1399,7 @@ PHP_METHOD(DOMDocument, save)
14051399
14061400 /* encoding handled by property on doc */
14071401
1408- doc_props = dom_get_doc_props (intern -> document );
1402+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (intern -> document );
14091403 format = doc_props -> formatoutput ;
14101404 if (options & LIBXML_SAVE_NOEMPTYTAG ) {
14111405 saveempty = xmlSaveNoEmptyTags ;
@@ -1433,7 +1427,6 @@ PHP_METHOD(DOMDocument, saveXML)
14331427 xmlBufferPtr buf ;
14341428 xmlChar * mem ;
14351429 dom_object * intern , * nodeobj ;
1436- dom_doc_propsptr doc_props ;
14371430 int size , format , saveempty = 0 ;
14381431 zend_long options = 0 ;
14391432
@@ -1444,7 +1437,7 @@ PHP_METHOD(DOMDocument, saveXML)
14441437
14451438 DOM_GET_OBJ (docp , id , xmlDocPtr , intern );
14461439
1447- doc_props = dom_get_doc_props (intern -> document );
1440+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (intern -> document );
14481441 format = doc_props -> formatoutput ;
14491442
14501443 if (nodep != NULL ) {
@@ -1928,7 +1921,6 @@ PHP_METHOD(DOMDocument, saveHTMLFile)
19281921 size_t file_len ;
19291922 int bytes , format ;
19301923 dom_object * intern ;
1931- dom_doc_propsptr doc_props ;
19321924 char * file ;
19331925 const char * encoding ;
19341926
@@ -1947,7 +1939,7 @@ PHP_METHOD(DOMDocument, saveHTMLFile)
19471939
19481940 encoding = (const char * ) htmlGetMetaEncoding (docp );
19491941
1950- doc_props = dom_get_doc_props (intern -> document );
1942+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (intern -> document );
19511943 format = doc_props -> formatoutput ;
19521944 bytes = htmlSaveFileFormat (file , docp , encoding , format );
19531945
@@ -1969,7 +1961,6 @@ PHP_METHOD(DOMDocument, saveHTML)
19691961 dom_object * intern , * nodeobj ;
19701962 xmlChar * mem = NULL ;
19711963 int format ;
1972- dom_doc_propsptr doc_props ;
19731964
19741965 id = ZEND_THIS ;
19751966 if (zend_parse_parameters (ZEND_NUM_ARGS (),
@@ -1980,7 +1971,7 @@ PHP_METHOD(DOMDocument, saveHTML)
19801971
19811972 DOM_GET_OBJ (docp , id , xmlDocPtr , intern );
19821973
1983- doc_props = dom_get_doc_props (intern -> document );
1974+ libxml_doc_props const * doc_props = dom_get_doc_props (intern -> document );
19841975 format = doc_props -> formatoutput ;
19851976
19861977 if (nodep != NULL ) {
0 commit comments