summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-02-08 18:59:38 +0000
committerSascha Schumann <sas@php.net>2003-02-08 18:59:38 +0000
commitafaecf4140e1265d85b1355b9580e235cdf9faa2 (patch)
tree71a52ddec24684173b65cd25a99ac254b03bd636
parent16add2cb7a81ffd97708b95bc3182a45e7423228 (diff)
downloadphp-git-afaecf4140e1265d85b1355b9580e235cdf9faa2.tar.gz
MFH
-rw-r--r--ext/gettext/gettext.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index d384e22667..4b41a57d4b 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -178,7 +178,12 @@ PHP_FUNCTION(bindtextdomain)
convert_to_string_ex(domain_name);
convert_to_string_ex(dir);
- if (strcmp(Z_STRVAL_PP(dir), "") && strcmp(Z_STRVAL_PP(dir), "0")) {
+ if (Z_STRVAL_PP(domain_name)[0] == '\0') {
+ php_error(E_WARNING, "The first parameter of bindtextdomain must not be empty");
+ RETURN_FALSE;
+ }
+
+ if (Z_STRVAL_PP(dir)[0] != '\0' && strcmp(Z_STRVAL_PP(dir), "0")) {
VCWD_REALPATH(Z_STRVAL_PP(dir), dir_name);
} else {
VCWD_GETCWD(dir_name, MAXPATHLEN);