mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Get rid of remaining usages of zval_try_get_string() (#14041)
This isn't necessary because the cases where we use it will always succeed because the properties always have the type string|null.
This commit is contained in:
@@ -194,10 +194,8 @@ zend_result dom_document_version_write(dom_object *obj, zval *newval)
|
||||
{
|
||||
DOM_PROP_NODE(xmlDocPtr, docp, obj);
|
||||
|
||||
zend_string *str = zval_try_get_string(newval);
|
||||
if (UNEXPECTED(!str)) {
|
||||
return FAILURE;
|
||||
}
|
||||
/* Cannot fail because the type is either null or a string. */
|
||||
zend_string *str = zval_get_string(newval);
|
||||
|
||||
if (php_dom_follow_spec_intern(obj)) {
|
||||
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)
|
||||
{
|
||||
DOM_PROP_NODE(xmlDocPtr, docp, obj);
|
||||
|
||||
zend_string *str = zval_try_get_string(newval);
|
||||
if (UNEXPECTED(!str)) {
|
||||
return FAILURE;
|
||||
}
|
||||
/* Cannot fail because the type is either null or a string. */
|
||||
zend_string *str = zval_get_string(newval);
|
||||
|
||||
if (docp->URL != NULL) {
|
||||
xmlFree(BAD_CAST docp->URL);
|
||||
@@ -1780,7 +1776,6 @@ PHP_METHOD(DOMDocument, xinclude)
|
||||
} else {
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -179,10 +179,8 @@ zend_result dom_node_node_value_write(dom_object *obj, zval *newval)
|
||||
{
|
||||
DOM_PROP_NODE(xmlNodePtr, nodep, obj);
|
||||
|
||||
zend_string *str = zval_try_get_string(newval);
|
||||
if (UNEXPECTED(!str)) {
|
||||
return FAILURE;
|
||||
}
|
||||
/* Cannot fail because the type is either null or a string. */
|
||||
zend_string *str = zval_get_string(newval);
|
||||
|
||||
/* Access to Element node is implemented as a convenience method */
|
||||
switch (nodep->type) {
|
||||
|
||||
Reference in New Issue
Block a user