From 5df1f310983f647c4652c2878662331149f192bc Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 2 Jul 2004 08:56:50 +0000 Subject: [PATCH] fix for select-box values containing commas, which are not ment as multiple comma-separated id's --- phpgwapi/inc/class.html.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 21aaa9240a..bf302284d4 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -160,7 +160,8 @@ class html if (!is_array($key)) { - $key = explode(',',$key); + // explode on ',' only if multiple values expected and the key contains just numbers and commas + $key = $multiple && ('/^[,0-9]+$/',$key) ? explode(',',$key) : array($key); } foreach($arr as $k => $text) { @@ -549,6 +550,7 @@ htmlareaConfig.editorURL = '."'$this->phpgwapi_js_url/htmlarea/';"; $vars = $url; $url = '/index.php'; } + //echo "

html::a_href('".htmlspecialchars($content)."','$url',".print_r($vars,True).") = ".$this->link($url,$vars)."

"; return ''.$content.''; }