File tree 2 files changed +6
-13
lines changed 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -194,10 +194,8 @@ zend_result dom_document_version_write(dom_object *obj, zval *newval)
194
194
{
195
195
DOM_PROP_NODE (xmlDocPtr , docp , obj );
196
196
197
- zend_string * str = zval_try_get_string (newval );
198
- if (UNEXPECTED (!str )) {
199
- return FAILURE ;
200
- }
197
+ /* Cannot fail because the type is either null or a string. */
198
+ zend_string * str = zval_get_string (newval );
201
199
202
200
if (php_dom_follow_spec_intern (obj )) {
203
201
if (!zend_string_equals_literal (str , "1.0" ) && !zend_string_equals_literal (str , "1.1" )) {
@@ -396,10 +394,8 @@ zend_result dom_document_document_uri_write(dom_object *obj, zval *newval)
396
394
{
397
395
DOM_PROP_NODE (xmlDocPtr , docp , obj );
398
396
399
- zend_string * str = zval_try_get_string (newval );
400
- if (UNEXPECTED (!str )) {
401
- return FAILURE ;
402
- }
397
+ /* Cannot fail because the type is either null or a string. */
398
+ zend_string * str = zval_get_string (newval );
403
399
404
400
if (docp -> URL != NULL ) {
405
401
xmlFree (BAD_CAST docp -> URL );
@@ -1780,7 +1776,6 @@ PHP_METHOD(DOMDocument, xinclude)
1780
1776
} else {
1781
1777
RETVAL_FALSE ;
1782
1778
}
1783
-
1784
1779
}
1785
1780
/* }}} */
1786
1781
Original file line number Diff line number Diff line change @@ -179,10 +179,8 @@ zend_result dom_node_node_value_write(dom_object *obj, zval *newval)
179
179
{
180
180
DOM_PROP_NODE (xmlNodePtr , nodep , obj );
181
181
182
- zend_string * str = zval_try_get_string (newval );
183
- if (UNEXPECTED (!str )) {
184
- return FAILURE ;
185
- }
182
+ /* Cannot fail because the type is either null or a string. */
183
+ zend_string * str = zval_get_string (newval );
186
184
187
185
/* Access to Element node is implemented as a convenience method */
188
186
switch (nodep -> type ) {
You can’t perform that action at this time.
0 commit comments