make autocompletion more fault tolerant

This commit is contained in:
Roland Gruber 2013-05-21 15:50:06 +00:00
parent 0d0b980650
commit 92127c7c0c
1 changed files with 1 additions and 1 deletions

View File

@ -640,7 +640,7 @@ class htmlInputField extends htmlElement {
*/
public function enableAutocompletion($values, $minLength = 1, $multiValue = false, $multiSeparatorExp = ',\s*', $multiSeparator = ', ') {
for ($i = 0; $i < sizeof($values); $i++) {
$values[$i] = '"' . htmlspecialchars($values[$i]) . '"';
$values[$i] = '"' . htmlspecialchars(str_replace(array('"', "\r", "\n"), array('', '', ''), $values[$i])) . '"';
}
$this->autocomplete = true;
$this->autocompleteValues = $values;