From aa4750009f7954c69bb01305446d9bc2667e8416 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 4 Mar 2020 21:19:33 +0100 Subject: [PATCH] Revert "fix some errors in new phpUnit tests: define lang() only if not already done" This reverts commit ab289eb5c120da114795b6e7c3d102df84b50f54. --- setup/inc/functions.inc.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index 819e7df8ae..e24cbd8a9f 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -56,17 +56,14 @@ require_once(EGW_INCLUDE_ROOT . '/api/src/loader/common.php'); * function to handle multilanguage support * */ -if (!function_exists('lang')) +function lang($key,$vars=null) { - function lang($key, $vars = null) + if(!is_array($vars)) { - if (!is_array($vars)) - { - $vars = func_get_args(); - array_shift($vars); // remove $key - } - return $GLOBALS['egw_setup']->translation->translate("$key", $vars); + $vars = func_get_args(); + array_shift($vars); // remove $key } + return $GLOBALS['egw_setup']->translation->translate("$key", $vars); } if(file_exists(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'))