@@ -297,7 +297,7 @@ readonly=no
297
297
int dom_document_format_output_read (dom_object * obj , zval * retval )
298
298
{
299
299
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 );
301
301
ZVAL_BOOL (retval , doc_prop -> formatoutput );
302
302
} else {
303
303
ZVAL_FALSE (retval );
@@ -322,7 +322,7 @@ readonly=no
322
322
int dom_document_validate_on_parse_read (dom_object * obj , zval * retval )
323
323
{
324
324
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 );
326
326
ZVAL_BOOL (retval , doc_prop -> validateonparse );
327
327
} else {
328
328
ZVAL_FALSE (retval );
@@ -347,7 +347,7 @@ readonly=no
347
347
int dom_document_resolve_externals_read (dom_object * obj , zval * retval )
348
348
{
349
349
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 );
351
351
ZVAL_BOOL (retval , doc_prop -> resolveexternals );
352
352
} else {
353
353
ZVAL_FALSE (retval );
@@ -372,7 +372,7 @@ readonly=no
372
372
int dom_document_preserve_whitespace_read (dom_object * obj , zval * retval )
373
373
{
374
374
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 );
376
376
ZVAL_BOOL (retval , doc_prop -> preservewhitespace );
377
377
} else {
378
378
ZVAL_FALSE (retval );
@@ -397,7 +397,7 @@ readonly=no
397
397
int dom_document_recover_read (dom_object * obj , zval * retval )
398
398
{
399
399
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 );
401
401
ZVAL_BOOL (retval , doc_prop -> recover );
402
402
} else {
403
403
ZVAL_FALSE (retval );
@@ -422,7 +422,7 @@ readonly=no
422
422
int dom_document_substitue_entities_read (dom_object * obj , zval * retval )
423
423
{
424
424
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 );
426
426
ZVAL_BOOL (retval , doc_prop -> substituteentities );
427
427
} else {
428
428
ZVAL_FALSE (retval );
@@ -1176,7 +1176,6 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
1176
1176
{
1177
1177
xmlDocPtr ret ;
1178
1178
xmlParserCtxtPtr ctxt = NULL ;
1179
- dom_doc_propsptr doc_props ;
1180
1179
dom_object * intern ;
1181
1180
php_libxml_ref_obj * document = NULL ;
1182
1181
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
1189
1188
document = intern -> document ;
1190
1189
}
1191
1190
1192
- doc_props = dom_get_doc_props (document );
1191
+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (document );
1193
1192
validate = doc_props -> validateonparse ;
1194
1193
resolve_externals = doc_props -> resolveexternals ;
1195
1194
keep_blanks = doc_props -> preservewhitespace ;
1196
1195
substitute_ent = doc_props -> substituteentities ;
1197
1196
recover = doc_props -> recover ;
1198
1197
1199
- if (document == NULL ) {
1200
- efree (doc_props );
1201
- }
1202
-
1203
1198
xmlInitParser ();
1204
1199
1205
1200
if (mode == DOM_LOAD_FILE ) {
@@ -1387,7 +1382,6 @@ PHP_METHOD(DOMDocument, save)
1387
1382
size_t file_len = 0 ;
1388
1383
int bytes , format , saveempty = 0 ;
1389
1384
dom_object * intern ;
1390
- dom_doc_propsptr doc_props ;
1391
1385
char * file ;
1392
1386
zend_long options = 0 ;
1393
1387
@@ -1405,7 +1399,7 @@ PHP_METHOD(DOMDocument, save)
1405
1399
1406
1400
/* encoding handled by property on doc */
1407
1401
1408
- doc_props = dom_get_doc_props (intern -> document );
1402
+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (intern -> document );
1409
1403
format = doc_props -> formatoutput ;
1410
1404
if (options & LIBXML_SAVE_NOEMPTYTAG ) {
1411
1405
saveempty = xmlSaveNoEmptyTags ;
@@ -1433,7 +1427,6 @@ PHP_METHOD(DOMDocument, saveXML)
1433
1427
xmlBufferPtr buf ;
1434
1428
xmlChar * mem ;
1435
1429
dom_object * intern , * nodeobj ;
1436
- dom_doc_propsptr doc_props ;
1437
1430
int size , format , saveempty = 0 ;
1438
1431
zend_long options = 0 ;
1439
1432
@@ -1444,7 +1437,7 @@ PHP_METHOD(DOMDocument, saveXML)
1444
1437
1445
1438
DOM_GET_OBJ (docp , id , xmlDocPtr , intern );
1446
1439
1447
- doc_props = dom_get_doc_props (intern -> document );
1440
+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (intern -> document );
1448
1441
format = doc_props -> formatoutput ;
1449
1442
1450
1443
if (nodep != NULL ) {
@@ -1928,7 +1921,6 @@ PHP_METHOD(DOMDocument, saveHTMLFile)
1928
1921
size_t file_len ;
1929
1922
int bytes , format ;
1930
1923
dom_object * intern ;
1931
- dom_doc_propsptr doc_props ;
1932
1924
char * file ;
1933
1925
const char * encoding ;
1934
1926
@@ -1947,7 +1939,7 @@ PHP_METHOD(DOMDocument, saveHTMLFile)
1947
1939
1948
1940
encoding = (const char * ) htmlGetMetaEncoding (docp );
1949
1941
1950
- doc_props = dom_get_doc_props (intern -> document );
1942
+ libxml_doc_props const * doc_props = dom_get_doc_props_read_only (intern -> document );
1951
1943
format = doc_props -> formatoutput ;
1952
1944
bytes = htmlSaveFileFormat (file , docp , encoding , format );
1953
1945
@@ -1969,7 +1961,6 @@ PHP_METHOD(DOMDocument, saveHTML)
1969
1961
dom_object * intern , * nodeobj ;
1970
1962
xmlChar * mem = NULL ;
1971
1963
int format ;
1972
- dom_doc_propsptr doc_props ;
1973
1964
1974
1965
id = ZEND_THIS ;
1975
1966
if (zend_parse_parameters (ZEND_NUM_ARGS (),
@@ -1980,7 +1971,7 @@ PHP_METHOD(DOMDocument, saveHTML)
1980
1971
1981
1972
DOM_GET_OBJ (docp , id , xmlDocPtr , intern );
1982
1973
1983
- doc_props = dom_get_doc_props (intern -> document );
1974
+ libxml_doc_props const * doc_props = dom_get_doc_props (intern -> document );
1984
1975
format = doc_props -> formatoutput ;
1985
1976
1986
1977
if (nodep != NULL ) {
0 commit comments