Skip to content

Commit 2b87729

Browse files
committed
params as PATHs
1 parent 78bfee1 commit 2b87729

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

ext/gettext/gettext.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,13 @@ PHP_FUNCTION(bindtextdomain)
183183
char *retval, dir_name[MAXPATHLEN], *btd_result;
184184

185185
ZEND_PARSE_PARAMETERS_START(1, 2)
186-
Z_PARAM_STR(domain)
186+
Z_PARAM_PATH_STR(domain)
187187
Z_PARAM_OPTIONAL
188-
Z_PARAM_STR_OR_NULL(dir)
188+
Z_PARAM_PATH_STR_OR_NULL(dir)
189189
ZEND_PARSE_PARAMETERS_END();
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-
198193
if (dir == NULL) {
199194
btd_result = bindtextdomain(ZSTR_VAL(domain), NULL);
200195
if (btd_result == NULL) {

ext/gettext/tests/gh17400.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ try {
1616
}
1717
?>
1818
--EXPECT--
19-
bindtextdomain(): Argument #1 ($domain) cannot be empty
19+
bindtextdomain(): Argument #1 ($domain) must not contain any null bytes

0 commit comments

Comments
 (0)