Ticket #349 (closed defect: fixed)
Prompt text in search commands can't include line breaks.
| Reported by: | mbeckman | Owned by: | jng |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | AJAX Viewer | Version: | |
| Severity: | minor | Keywords: | |
| Cc: | External ID: |
Description
If the user inserts a line break in the prompt text in a search command a java script error will prevent the ajaxviewer from loading.
Example:
This text will work:
"Search for places beginning with: Example 'holly' will return 'hollywood'"
This text will not work:
"Search for places beginning with:
Example 'holly' will return 'hollywood'"
This could be fixed by replacing the new line characters with a html new line tag, so the this text would work:
"Search for places beginning with:<br>Example 'holly' will return 'hollywood'"
To make sure there are no line breaks in the prompt text a quick solution for the phpviewer would be to change line 229 from
StrEscape?($cmd->GetPrompt?()),
to
str_replace("\n", "<br>", StrEscape?($cmd->GetPrompt?())),
Note: This also happens for the DWF viewer, but it is fixed with the same code.
