static String |
forJs(String input)
Escape characters for Javascript, i.e. escape single and double quotes, and newlines
The following characters are replaced:
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EscapeTool
public EscapeTool(AppModel appModel)
toXMLText
public String toXMLText(String input)
- Deprecated. Use forXML()
forHtml
public static String forHtml(String input)
- Escape characters for Javascript, i.e. escape single and double quotes.
The following characters are replaced:
| Character | Encoding |
| " | " |
| ' | ' |
forJs
public static String forJs(String input)
- Escape characters for Javascript, i.e. escape single and double quotes, and newlines
The following characters are replaced:
| Character | Encoding |
| " | \" |
| ' | \' |
| \n | |
forXml
public static String forXml(String input)
- Escape characters for text appearing as XML data, between tags.
The following characters are replaced with corresponding character entities :
| Character | Encoding |
| < | < |
| > | > |
| & | & |
| " | " |
| ' | ' |
forHtmlSafety
public static String forHtmlSafety(String input)
- Escape characters for text appearing in HTML markup.
This method exists as a defence against Cross Site Scripting (XSS) hacks.
This method escapes all characters recommended by the Open Web App
Security Project -
link.
The following characters are replaced with corresponding HTML
character entities :
| Character | Encoding |
| < | < |
| > | > |
| & | & |
| " | " |
| ' | ' |
| ( | ( |
| ) | ) |
| # | # |
| % | % |
| ; | ; |
| + | + |
| - | - |
toDisableTags
public static String toDisableTags(String input)
- Return aText with all '<' and '>' characters
replaced by their escaped equivalents.
toLatex
public String toLatex(String input)
- Deprecated. Use forLatex()
forLatex
public String forLatex(String input)
main
public static void main(String[] args)
|