From a603c8bb2ef991cf351c04ef6507e5f95dbe43ef Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 24 Sep 2008 11:16:26 +0000 Subject: [PATCH] "correctly quoting the id's in ajax_search, as single quotes otherwise mess up the javascript in the ajax response (eg. caused by single quotes in Wiki Page Names)" --- etemplate/inc/class.link_widget.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.link_widget.inc.php b/etemplate/inc/class.link_widget.inc.php index 7da2741d38..3400f5079e 100644 --- a/etemplate/inc/class.link_widget.inc.php +++ b/etemplate/inc/class.link_widget.inc.php @@ -575,7 +575,7 @@ class link_widget /** * Ajax callback to search in $app for $pattern, result is displayed in $id - * + * * Called via onClick from etemplate.link_widget.(to|entry)'s search button * * @param string $app app-name to search @@ -605,7 +605,7 @@ class link_widget foreach($found as $id => $option) { if (!is_array($option)) $option = array('label' => $option); - $script .= "opt = select.options[select.options.length] = new Option('".addslashes($option['label'])."','$id');\n"; + $script .= "opt = select.options[select.options.length] = new Option('".addslashes($option['label'])."','".addslashes($id)."');\n"; if (count($option) > 1) { foreach($option as $name => $value)