From: tokul Date: Sat, 29 Apr 2006 17:22:00 +0000 (+0000) Subject: adding hack to fix setlocale behavior on OpenBSD 3.8+ (#1427512). I don't think X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=06783280842a90181b2e984bd8ea13e3b7466edb;p=squirrelmail.git adding hack to fix setlocale behavior on OpenBSD 3.8+ (#1427512). I don't think that e-a-department (obsd) cares about it. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11097 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index 30557ce2..5ff9693b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,7 @@ Version 1.5.2 - CVS - Fixed automatic mailbox creation in left_main.php. 1.5.1 mailbox caching broke detection of unsubscribed special folders. - Undo extra sanitizing in decodeHeader() function (#1460638). + - Added workaround for broken OpenBSD 3.8+ setlocale() function (#1427512). Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/include/languages.php b/include/languages.php index 342b9336..97eeb095 100644 --- a/include/languages.php +++ b/include/languages.php @@ -72,11 +72,11 @@ function sq_textdomain($domain) { * @see http://www.php.net/setlocale */ function sq_setlocale($category,$locale) { - // string with only one locale - if (is_string($locale)) - return setlocale($category,$locale); - - if (! check_php_version(4,3)) { + if (is_string($locale)) { + // string with only one locale + $ret = setlocale($category,$locale); + } elseif (! check_php_version(4,3)) { + // older php version (second setlocale argument must be string) $ret=false; $index=0; while ( ! $ret && $index