@@ -671,16 +671,16 @@ void dom_parent_node_before(dom_object *context, zval *nodes, uint32_t nodesc)
671
671
php_dom_pre_insert (context -> document , fragment , parentNode , viable_previous_sibling );
672
672
}
673
673
674
- static zend_result dom_child_removal_preconditions (const xmlNode * child , int stricterror )
674
+ static zend_result dom_child_removal_preconditions (const xmlNode * child , const dom_object * context )
675
675
{
676
676
if (dom_node_is_read_only (child ) == SUCCESS ||
677
677
(child -> parent != NULL && dom_node_is_read_only (child -> parent ) == SUCCESS )) {
678
- php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , stricterror );
678
+ php_dom_throw_error (NO_MODIFICATION_ALLOWED_ERR , dom_get_strict_error ( context -> document ) );
679
679
return FAILURE ;
680
680
}
681
681
682
682
if (!child -> parent ) {
683
- php_dom_throw_error (NOT_FOUND_ERR , stricterror );
683
+ php_dom_throw_error (NOT_FOUND_ERR , dom_get_strict_error ( context -> document ) );
684
684
return FAILURE ;
685
685
}
686
686
@@ -690,9 +690,8 @@ static zend_result dom_child_removal_preconditions(const xmlNode *child, int str
690
690
void dom_child_node_remove (dom_object * context )
691
691
{
692
692
xmlNode * child = dom_object_get_node (context );
693
- bool stricterror = dom_get_strict_error (context -> document );
694
693
695
- if (UNEXPECTED (dom_child_removal_preconditions (child , stricterror ) != SUCCESS )) {
694
+ if (UNEXPECTED (dom_child_removal_preconditions (child , context ) != SUCCESS )) {
696
695
return ;
697
696
}
698
697
@@ -724,8 +723,7 @@ void dom_child_replace_with(dom_object *context, zval *nodes, uint32_t nodesc)
724
723
viable_next_sibling = viable_next_sibling -> next ;
725
724
}
726
725
727
- bool stricterror = dom_get_strict_error (context -> document );
728
- if (UNEXPECTED (dom_child_removal_preconditions (child , stricterror ) != SUCCESS )) {
726
+ if (UNEXPECTED (dom_child_removal_preconditions (child , context ) != SUCCESS )) {
729
727
return ;
730
728
}
731
729
0 commit comments