{
zval *argv[3]; /* Arguments to the scheme getall function */
zval *retval; /* Return value from the scheme getall function */
+ int result;
php_xslt *handle = (php_xslt *) user_data; /* A PHP-XSLT processor */
TSRMLS_FETCH();
/* return failure */
return 1;
}
-
- /* Save the return value in the buffer (copying it) */
- *buffer = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
- *byte_count = Z_STRLEN_P(retval);
+
+ if ((Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) || (Z_TYPE_P(retval) == IS_NULL)) {
+ result = 1;
+ } else {
+ /* Convert the return value to string if needed */
+ if (Z_TYPE_P(retval) != IS_STRING)
+ convert_to_string_ex(&retval);
+
+ /* Save the return value in the buffer (copying it) */
+ *buffer = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ *byte_count = Z_STRLEN_P(retval);
+ result = 0;
+ }
/* Free return value */
zval_ptr_dtor(&retval);
- /* return success */
- return 0;
+ return result;
}
/* }}} */