diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 172ae76d3876..c992dfc40e69 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -98,6 +98,11 @@ PHP_FUNCTION(textdomain) retval = textdomain(domain_name); + if (UNEXPECTED(retval == NULL)) { + zend_throw_error(NULL, "Could not set text domain"); + RETURN_THROWS(); + } + RETURN_STRING(retval); } /* }}} */ @@ -211,6 +216,11 @@ PHP_FUNCTION(bindtextdomain) retval = bindtextdomain(ZSTR_VAL(domain), dir_name); + if (UNEXPECTED(retval == NULL)) { + zend_throw_error(NULL, "Could not bind text domain"); + RETURN_THROWS(); + } + RETURN_STRING(retval); } /* }}} */