Issue Details (XML | Word | Printable)

Key: LUTECE-78
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: ELY
Reporter: ELY
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lutèce

lutece-core - HTML entities not escaped

Created: 13/Mar/07 11:33 AM   Updated: 21/Jan/10 07:05 PM
Component/s: core
Affects Version/s: 2.1.0-b1
Fix Version/s: 2.4.0

Time Tracking:
Not Specified


 Description  « Hide

Try to save an user value (for example, in workgroup creation form) with html entities ("<", ">", ...) into a text input. You'll see that these characters are not escaped during display.



ELY added a comment - 15/Mar/07 04:33 PM

To resolve HTML entities problems, add <#escape> freemarker tag into templates.
An example is available on plugin-document :

  • create_document.html
  • modify_document.html

When you surround a part of the template with an escape directive, interpolations (${...}) that occur inside the block are combined with the escaping expression automatically.

<#escape x as x?html>
...
</#escape>

Sometimes there is a need to temporarily turn off escaping for one or two interpolations in an escape block. You can achieve this by closing and later reopening the escape block, but then you have to write the escaping expression twice. You can instead use the noescape directive:
<#noescape>
...
</#noescape>