On Mon, 27 Dec 2004 22:48:31 +0100 I wrote:

I have been using Squirrelmail 1.4.2 on OpenBSD 3.5 (PHP 4.3.8) since May of 2004. Recently I got a report from a user saying that the language selection function no longer worked, except for the "Help" link. Unfortunately I didn't get this report until 2 or 3 weeks after the problem started occurring so I don't know what I might have done to cause it.

The change I had made was putting on safe_mode. I was then advised that somehow the setlocale call must be failing. Indeed, PHP's setlocale function does not seem to work on OpenBSD:


<?php
/* Set locale to Catalan */
setlocale(LC_ALL, 'ca_ES');
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
?>

Produces:
Friday 22 December 1978

However, Horde/Imp's language function *did* work. So I looked in Lang.php and saw the following:

putenv('LANG=' . $lang);
putenv('LANGUAGE=' . $lang);
setlocale(LC_ALL, $lang);

But SM's i18n.php won't do the putenv call if safe_mode is on:

        if ( !ini_get('safe_mode') &&
             getenv( 'LC_ALL' ) != $longlocale ) {
            putenv( "LC_ALL=$longlocale" );
            putenv( "LANG=$longlocale" );
            putenv( "LANGUAGE=$longlocale" );
        }

        setlocale(LC_ALL, $longlocale);

So I simply killed the conditional and included LANG and LANGUAGE in my php.ini file's safe_mode_allowed_env_vars. My thanks to Tomas Kuliavas for his helpful comments.

--
All the best (Ad�u-siau),
Lou Hevly
[EMAIL PROTECTED]
http://visca.com



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
--
squirrelmail-users mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [email protected]
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to