Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ext/tidy/tidy.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,7 @@ static zend_result tidy_node_cast_handler(zend_object *in, zval *out, int type)
case IS_STRING:
obj = php_tidy_fetch_object(in);
tidyBufInit(&buf);
if (obj->ptdoc) {
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
if (obj->ptdoc && tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf)) {
ZVAL_STRINGL(out, (char *) buf.bp, buf.size-1);
} else {
ZVAL_EMPTY_STRING(out);
Expand Down Expand Up @@ -611,7 +610,7 @@ static void tidy_add_node_default_properties(PHPTidyObj *obj)
char *name;

tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
(void) tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would ZEND_ASSERT(true) fits ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, the check is implicitly done below by checking the buffer size.


zend_update_property_stringl(
tidy_ce_node,
Expand Down
Loading