From 2f905e8290cfd842bd9eb0761a9e443f394df990 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 8 Jan 2014 09:47:37 +0000 Subject: [PATCH] return $arr argument itself, but no reference to it, in all error cases --- etemplate/inc/class.boetemplate.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index 8acaefa3c4..40ac5f009d 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -689,12 +689,12 @@ class boetemplate extends soetemplate */ static function &get_array(&$arr,$idx,$reference_into=False,$skip_empty=False) { - if (!is_array($arr)) + // return content of $arr itself (but no reference!) in all error-cases: $arr no array or $idx an object + if (is_object($idx) || !is_array($arr)) { - throw new egw_exception_assertion_failed(__METHOD__."(\$arr,'$idx',$reference_into,$skip_empty) \$arr is no array!"); + $ret = $arr; + return $ret; } - if (is_object($idx)) return false; // given an error in php5.2 - if ((string)$idx === '') { $idxs = array();