Patch Test_if_NULL_or_empty for Gettext related Bug #53251
Patch version 2010-11-24 22:38 UTC
Return to Bug #53251 |
Download this patch
Patch Revisions:
Developer: pajoye@php.net
Index: branches/PHP_5_3/ext/gettext/gettext.c
===================================================================
--- branches/PHP_5_3/ext/gettext/gettext.c (revision 305505)
+++ branches/PHP_5_3/ext/gettext/gettext.c (working copy)
@@ -259,15 +259,17 @@
php_error(E_WARNING, "The first parameter of bindtextdomain must not be empty");
RETURN_FALSE;
}
-
- if (dir[0] != '\0' && strcmp(dir, "0")) {
- if (!VCWD_REALPATH(dir, dir_name)) {
+ if (dir_len == 0) {
+ retval = bindtextdomain(domain, dir_name);
+ } else {
+ if (dir[0] != '\0' && strcmp(dir, "0")) {
+ if (!VCWD_REALPATH(dir, dir_name)) {
+ RETURN_FALSE;
+ }
+ } else if (!VCWD_GETCWD(dir_name, MAXPATHLEN)) {
RETURN_FALSE;
}
- } else if (!VCWD_GETCWD(dir_name, MAXPATHLEN)) {
- RETURN_FALSE;
}
-
retval = bindtextdomain(domain, dir_name);
RETURN_STRING(retval, 1);
|