removing possible CR/LF from content for ajax search result javascript, as it breaks the options

This commit is contained in:
Klaus Leithoff 2010-03-15 15:33:12 +00:00
parent 0b3377534f
commit 96827af747

View File

@ -639,6 +639,7 @@ class link_widget
foreach($found as $id => $option)
{
if (!is_array($option)) $option = array('label' => $option);
$option['label'] = str_replace(array("\r","\n"),array(" "," "),$option['label']);
$script .= "opt = select.options[select.options.length] = new Option('".addslashes($option['label'])."','".addslashes($id)."');\n";
if (count($option) > 1)
{