Skip to content

Commit c546045

Browse files
committed
PHPC-756: Do not eval bson_error_t.message as boolean
1 parent 6bfddea commit c546045

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ PHP_FUNCTION(fromJSON)
16791679
PHONGO_RETVAL_STRINGL((const char *) bson_get_data(&b), b.len);
16801680
bson_destroy(&b);
16811681
} else {
1682-
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE TSRMLS_CC, "%s", error.message ? error.message : "Error parsing JSON");
1682+
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE TSRMLS_CC, "%s", error.domain == BSON_ERROR_JSON ? error.message : "Error parsing JSON");
16831683
}
16841684
}
16851685
/* }}} */

0 commit comments

Comments
 (0)