fixed a problem when using post/php-nuke and phpgroupware on one server

*nuke is setting a cookie $lang, which is a string

the translation functions are using $lang as GLOBAL too, but as array
which creates funny results :)
This commit is contained in:
Lars Kneschke 2001-10-01 02:52:53 +00:00
parent 0382b72183
commit bb0cfbf43e

View File

@ -30,8 +30,13 @@
{
if ( ! $vars ) $vars = array();
$ret = $key;
if (!isset($GLOBALS['lang']) || !$GLOBALS['lang'])
// check also if $GLOBALS['lang'] is a array
// php-nuke and postnuke are using $GLOBALS['lang'] too
// as string
// this makes many problems
if (!isset($GLOBALS['lang']) || !$GLOBALS['lang'] || !is_array($GLOBALS['lang']))
{
$GLOBALS['lang'] = array();
if (isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
{
@ -81,6 +86,14 @@
function add_app($app)
{
// post-nuke and php-nuke are using $GLOBALS['lang'] too
// but not as array!
// this produces very strange results
if (!is_array($GLOBALS['lang']))
{
$GLOBALS['lang'] = array();
}
if ($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
{
$userlang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];