Skip to content

Commit 0ede7ce

Browse files
committed
... or we re-establish empty domain check.
1 parent ef4647a commit 0ede7ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ext/gettext/gettext.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ PHP_FUNCTION(bindtextdomain)
190190

191191
PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, ZSTR_LEN(domain))
192192

193+
if (ZSTR_VAL(domain)[0] == '\0') {
194+
zend_argument_value_error(1, "cannot be empty");
195+
RETURN_THROWS();
196+
}
197+
193198
if (dir == NULL) {
194199
btd_result = bindtextdomain(ZSTR_VAL(domain), NULL);
195200
if (btd_result == NULL) {
@@ -212,9 +217,6 @@ PHP_FUNCTION(bindtextdomain)
212217
}
213218

214219
retval = bindtextdomain(ZSTR_VAL(domain), dir_name);
215-
if (retval == NULL) {
216-
RETURN_FALSE;
217-
}
218220

219221
RETURN_STRING(retval);
220222
}

0 commit comments

Comments
 (0)