]> granicus.if.org Git - php/commitdiff
MFH
authorSascha Schumann <sas@php.net>
Sat, 8 Feb 2003 18:59:38 +0000 (18:59 +0000)
committerSascha Schumann <sas@php.net>
Sat, 8 Feb 2003 18:59:38 +0000 (18:59 +0000)
ext/gettext/gettext.c

index d384e22667d96765f7f1af9a13a61a6312785846..4b41a57d4b9b4fb6f3b4222476b6bef4e0b6d4e3 100644 (file)
@@ -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);