@@ -167,11 +167,6 @@ static xmlAttrPtr dom_element_reflected_attribute_write(dom_object *obj, zval *n
167
167
return NULL ;
168
168
}
169
169
170
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
171
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (obj -> document ));
172
- return NULL ;
173
- }
174
-
175
170
/* Typed property, so it is a string already */
176
171
ZEND_ASSERT (Z_TYPE_P (newval ) == IS_STRING );
177
172
return xmlSetNsProp (nodep , NULL , (const xmlChar * ) name , (const xmlChar * ) Z_STRVAL_P (newval ));
@@ -395,11 +390,6 @@ PHP_METHOD(DOMElement, setAttribute)
395
390
396
391
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
397
392
398
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
399
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
400
- RETURN_FALSE ;
401
- }
402
-
403
393
attr = dom_get_dom1_attribute (nodep , (xmlChar * )name );
404
394
if (attr != NULL ) {
405
395
switch (attr -> type ) {
@@ -466,11 +456,6 @@ PHP_METHOD(DOMElement, removeAttribute)
466
456
467
457
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
468
458
469
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
470
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
471
- RETURN_FALSE ;
472
- }
473
-
474
459
attrp = dom_get_dom1_attribute (nodep , (xmlChar * )name );
475
460
if (attrp == NULL ) {
476
461
RETURN_FALSE ;
@@ -533,11 +518,6 @@ PHP_METHOD(DOMElement, setAttributeNode)
533
518
534
519
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
535
520
536
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
537
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
538
- RETURN_FALSE ;
539
- }
540
-
541
521
DOM_GET_OBJ (attrp , node , xmlAttrPtr , attrobj );
542
522
543
523
if (attrp -> type != XML_ATTRIBUTE_NODE ) {
@@ -599,11 +579,6 @@ PHP_METHOD(DOMElement, removeAttributeNode)
599
579
600
580
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
601
581
602
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
603
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
604
- RETURN_FALSE ;
605
- }
606
-
607
582
DOM_GET_OBJ (attrp , node , xmlAttrPtr , attrobj );
608
583
609
584
if (attrp -> type != XML_ATTRIBUTE_NODE || attrp -> parent != nodep ) {
@@ -748,11 +723,6 @@ PHP_METHOD(DOMElement, setAttributeNS)
748
723
749
724
stricterror = dom_get_strict_error (intern -> document );
750
725
751
- if (dom_node_is_read_only (elemp ) == SUCCESS ) {
752
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , stricterror );
753
- RETURN_NULL ();
754
- }
755
-
756
726
errorcode = dom_check_qname (name , & localname , & prefix , uri_len , name_len );
757
727
758
728
if (errorcode == 0 ) {
@@ -867,11 +837,6 @@ PHP_METHOD(DOMElement, removeAttributeNS)
867
837
868
838
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
869
839
870
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
871
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
872
- RETURN_NULL ();
873
- }
874
-
875
840
attrp = xmlHasNsProp (nodep , (xmlChar * )name , (xmlChar * )uri );
876
841
877
842
nsptr = dom_get_nsdecl (nodep , (xmlChar * )name );
@@ -965,12 +930,6 @@ PHP_METHOD(DOMElement, setAttributeNodeNS)
965
930
}
966
931
967
932
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
968
-
969
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
970
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
971
- RETURN_FALSE ;
972
- }
973
-
974
933
DOM_GET_OBJ (attrp , node , xmlAttrPtr , attrobj );
975
934
976
935
/* ZPP Guarantees that a DOMAttr class is given, as it is converted to a xmlAttr
@@ -1145,11 +1104,6 @@ PHP_METHOD(DOMElement, setIdAttribute)
1145
1104
1146
1105
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
1147
1106
1148
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
1149
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
1150
- RETURN_NULL ();
1151
- }
1152
-
1153
1107
attrp = xmlHasNsProp (nodep , (xmlChar * )name , NULL );
1154
1108
if (attrp == NULL || attrp -> type == XML_ATTRIBUTE_DECL ) {
1155
1109
php_dom_throw_error (NOT_FOUND_ERR , dom_get_strict_error (intern -> document ));
@@ -1181,11 +1135,6 @@ PHP_METHOD(DOMElement, setIdAttributeNS)
1181
1135
1182
1136
DOM_GET_OBJ (elemp , id , xmlNodePtr , intern );
1183
1137
1184
- if (dom_node_is_read_only (elemp ) == SUCCESS ) {
1185
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
1186
- RETURN_NULL ();
1187
- }
1188
-
1189
1138
attrp = xmlHasNsProp (elemp , (xmlChar * )name , (xmlChar * )uri );
1190
1139
if (attrp == NULL || attrp -> type == XML_ATTRIBUTE_DECL ) {
1191
1140
php_dom_throw_error (NOT_FOUND_ERR , dom_get_strict_error (intern -> document ));
@@ -1214,12 +1163,6 @@ PHP_METHOD(DOMElement, setIdAttributeNode)
1214
1163
}
1215
1164
1216
1165
DOM_GET_OBJ (nodep , id , xmlNodePtr , intern );
1217
-
1218
- if (dom_node_is_read_only (nodep ) == SUCCESS ) {
1219
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error (intern -> document ));
1220
- RETURN_NULL ();
1221
- }
1222
-
1223
1166
DOM_GET_OBJ (attrp , node , xmlAttrPtr , attrobj );
1224
1167
1225
1168
if (attrp -> parent != nodep ) {
0 commit comments