From: Brion Vibber Date: Fri, 16 Oct 2009 18:19:52 +0000 (-0700) Subject: Fix a logic error in php-gettext's setlocale() check; if setlocale() failed to return... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=21e17e3738a3c026dd8efb6558ae5124cbaf3c61;p=quix0rs-gnu-social.git 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. --- 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 {