From 21e17e3738a3c026dd8efb6558ae5124cbaf3c61 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 16 Oct 2009 11:19:52 -0700 Subject: [PATCH] Fix a logic error in php-gettext's setlocale() check; if setlocale() failed to return, we fall back to checking LANG environment variable. Now actually works when doing a setlocale *check* instead of a *set*. Submitting fix upstream, but as the package is currently unmaintained it may not make it in. --- extlib/php-gettext/gettext.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extlib/php-gettext/gettext.inc b/extlib/php-gettext/gettext.inc index fcaafe7c9e..7c95e40ec2 100644 --- a/extlib/php-gettext/gettext.inc +++ b/extlib/php-gettext/gettext.inc @@ -129,7 +129,7 @@ function _setlocale($category, $locale) { $ret = 0; if (function_exists('setlocale')) // I don't know if this ever happens ;) $ret = setlocale($category, $locale); - if (($ret and $locale == '') or ($ret == $locale)) { + if ($ret and ($locale == '' or $ret == $locale)) { $EMULATEGETTEXT = 0; $CURRENTLOCALE = $ret; } else {