Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.inc |
— | — | @@ -363,11 +363,13 @@ |
364 | 364 | $autocomplete_string = "[['" . implode("'], ['", $autocomplete_values) . "']]"; |
365 | 365 | // replace any newlines in the string, just to avoid breaking the Javascript |
366 | 366 | $autocomplete_string = str_replace("\n", ' ', $autocomplete_string); |
| 367 | + $autocomplete_string = str_replace("\r", ' ', $autocomplete_string); |
367 | 368 | $javascript_text .= "autocompletestrings['$options_str_key'] = $autocomplete_string;\n"; |
368 | 369 | } |
369 | 370 | if ($cur_value) { |
370 | 371 | // replace newlines with the literal '\n' to not break the Javascript |
371 | 372 | $cur_value = str_replace("\n", '\n', $cur_value); |
| 373 | + $cur_value = str_replace("\r", '\r', $cur_value); |
372 | 374 | $text .= "document.getElementById('$input_id').value = \"$cur_value\"\n"; |
373 | 375 | } |
374 | 376 | $text .= "/* ]]> */</script>\n"; |