From bb0cfbf43ec29686f3a278f13c02d1b9dd9104a6 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Mon, 1 Oct 2001 02:52:53 +0000 Subject: [PATCH] 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 :) --- phpgwapi/inc/class.translation_sql.inc.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.translation_sql.inc.php b/phpgwapi/inc/class.translation_sql.inc.php index 80e19a4f53..3e54194a7f 100644 --- a/phpgwapi/inc/class.translation_sql.inc.php +++ b/phpgwapi/inc/class.translation_sql.inc.php @@ -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'];