"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)"

This commit is contained in:
Ralf Becker 2008-09-24 11:16:26 +00:00
parent 9e81d70cb7
commit a603c8bb2e

View File

@ -605,7 +605,7 @@ class link_widget
foreach($found as $id => $option) foreach($found as $id => $option)
{ {
if (!is_array($option)) $option = array('label' => $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) if (count($option) > 1)
{ {
foreach($option as $name => $value) foreach($option as $name => $value)