Skip to content

Commit 644dba8

Browse files
committed
Fix spelling and omitted return
1 parent 0f7c6c6 commit 644dba8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

ext/simplexml/simplexml.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value,
436436
}
437437

438438
if (!Z_STRLEN_P(member)) {
439-
zend_value_error("Cannot create %s with an empty name", attribs ? "attributes" : "elements");
439+
zend_value_error("Cannot create %s with an empty name", attribs ? "attribute" : "element");
440440
if (member == &tmp_zv) {
441441
zval_ptr_dtor_str(&tmp_zv);
442442
}
@@ -490,6 +490,7 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value,
490490
zval zval_copy;
491491
if (sxe_object_cast_ex(Z_OBJ_P(value), &zval_copy, IS_STRING) == FAILURE) {
492492
zend_throw_error(NULL, "Unable to cast node to string");
493+
return &EG(error_zval);
493494
}
494495

495496
value_str = Z_STR(zval_copy);

ext/simplexml/tests/012.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ __HALT_COMPILER();
3838
?>
3939
===DONE===
4040
--EXPECT--
41-
Cannot create attributes with an empty name
41+
Cannot create attribute with an empty name
4242
<?xml version="1.0" encoding="ISO-8859-1"?>
4343
<foo attr="value"/>
4444
<?xml version="1.0" encoding="ISO-8859-1"?>

ext/simplexml/tests/bug37076_1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ try {
1616
print $xml->asXML();
1717
?>
1818
--EXPECT--
19-
Cannot create elements with an empty name
19+
Cannot create element with an empty name
2020
<?xml version="1.0"?>
2121
<root><foo/></root>

0 commit comments

Comments
 (0)