File tree 9 files changed +37
-17
lines changed
9 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 80
80
<artifactId >unicodetools-testutils</artifactId >
81
81
<scope >test</scope >
82
82
</dependency >
83
- </dependencies >
83
+
84
+ <dependency >
85
+ <groupId >org.owasp.encoder</groupId >
86
+ <artifactId >encoder</artifactId >
87
+ <version >1.2.3</version >
88
+ </dependency >
89
+
90
+ <dependency >
91
+ <groupId >org.owasp.encoder</groupId >
92
+ <artifactId >encoder-jsp</artifactId >
93
+ <version >1.2.3</version >
94
+ </dependency >
95
+ </dependencies >
84
96
<build >
85
97
<finalName >${project.artifactId} </finalName >
86
98
<plugins >
Original file line number Diff line number Diff line change
1
+ <%@ page import =" org.owasp.encoder.Encode" %>
1
2
<html >
2
3
3
4
<head >
@@ -258,7 +259,7 @@ function setUbaInput(str) {
258
259
</tr >
259
260
<tr >
260
261
<td >
261
- <textarea id =" idInputCharSeq" name =" s" rows =" 2" cols =" 100" maxlength =" 200" oninput =" setUbaInputFromEdit(event)" ><%= valInputCharSeq % > </textarea >
262
+ <textarea id =" idInputCharSeq" name =" s" rows =" 2" cols =" 100" maxlength =" 200" oninput =" setUbaInputFromEdit(event)" ><%= Encode . forHtmlContent( valInputCharSeq) % > </textarea >
262
263
</td >
263
264
</tr >
264
265
<tr style =" display :none " >
Original file line number Diff line number Diff line change
1
+ <%@ page import =" org.owasp.encoder.Encode" %>
1
2
<html >
2
3
<head >
3
4
<%@ include file =" header.jsp" %>
50
51
<th style =" width : 50% " >Input</th >
51
52
</tr >
52
53
<tr >
53
- <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= bnf % > </textarea ></td >
54
+ <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( bnf) % > </textarea ></td >
54
55
</tr >
55
56
<tr >
56
57
<th style =" width : 50% " >TestText</th >
57
58
</tr >
58
59
<tr >
59
- <td ><textarea name =" b" rows =" 8" cols =" 10" style =" width : 100% " ><%= test % > </textarea ></td >
60
+ <td ><textarea name =" b" rows =" 8" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( test) % > </textarea ></td >
60
61
</tr >
61
62
</table >
62
63
<input id =' main' type =" submit" value =" Show Modified BNF Pattern" onClick =" window.location.href='bnf.jsp?a='+document.getElementById('main').value" />
63
64
</form >
64
65
<hr >
65
66
<h2 >Modified BNF Pattern</h2 >
66
- <p ><%= fixedbnf % > </p >
67
+ <p ><%= Encode . forHtmlContent( fixedbnf) % > </p >
67
68
<hr >
68
69
<h2 >Underlined Find Values</h2 >
69
- <p ><%= testPattern % > </p >
70
+ <p ><%= Encode . forHtmlContent( testPattern) % > </p >
70
71
<hr >
71
72
<h2 >Random Generation</h2 >
72
73
<%= random % >
Original file line number Diff line number Diff line change
1
+ <%@ page import =" org.owasp.encoder.Encode" %>
1
2
<html >
2
3
3
4
<head >
@@ -38,7 +39,7 @@ span.break { border-right: 1px solid red;}
38
39
<input type="submit" value="Test" /> </td >
39
40
</tr >
40
41
<tr >
41
- <td > <textarea name="a" rows="30" cols="30" style="width:100%; height:100%"> <%=text%> </textarea > </td >
42
+ <td > <textarea name="a" rows="30" cols="30" style="width:100%; height:100%"> <%=Encode.forHtmlContent( text ) %> </textarea > </td >
42
43
<td >
43
44
<%=UnicodeJsp.showBreaks(text , choice)%> </td >
44
45
</tr >
Original file line number Diff line number Diff line change
1
+ <%@ page import =" org.owasp.encoder.Encode" %>
1
2
<html >
2
3
<head >
3
4
<%@ include file =" header.jsp" %>
29
30
<th class =' r' >For special characters, you can use <a target =" picker" href =" http://macchiato.com/picker/MyApplication.html" >Picker</a ></th >
30
31
</tr >
31
32
<tr >
32
- <td colSpan =' 2' ><textarea name =" a" rows =" 12" cols =" 10" style =" width : 100% " ><%= IDNA2008 % > </textarea ></td >
33
+ <td colSpan =' 2' ><textarea name =" a" rows =" 12" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( IDNA2008 ) % > </textarea ></td >
33
34
</tr >
34
35
</table >
35
36
<input id =' main' type =" submit" value =" Show IDNA Status" onClick =" window.location.href='idna.jsp?a='+document.getElementById('main').value" />
Original file line number Diff line number Diff line change
1
+ <%@ page import =" org.owasp.encoder.Encode" %>
1
2
<html >
2
3
<head >
3
4
<%@ include file =" header.jsp" %>
45
46
<th style =" width : 50% " >Input</th >
46
47
</tr >
47
48
<tr >
48
- <td ><input type =" text" name =" a" rows =" 8" cols =" 10" style =" width : 100% " value =" <%= languageCode % >" /></td >
49
+ <td ><input type =" text" name =" a" rows =" 8" cols =" 10" style =" width : 100% " value =" <%= Encode . forHtmlAttribute( languageCode) % >" /></td >
49
50
</tr >
50
51
</table >
51
52
Original file line number Diff line number Diff line change 1
1
<html >
2
2
<head >
3
+ <%@ page import =" org.owasp.encoder.Encode" %>
3
4
<%@ include file =" header.jsp" %>
4
5
<title >Unicode Utilities: UnicodeSet</title >
5
6
</head >
36
37
<th style =" width : 50% " >Input</th >
37
38
</tr >
38
39
<tr >
39
- <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= setA % > </textarea ></td >
40
+ <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( setA) % > </textarea ></td >
40
41
</tr >
41
42
<tr >
42
43
<td >
46
47
<input type =" checkbox" <% =ucdFormat ? " checked" : " " % > name="ucd"><label for =" ucd" >UCD format</label >  ;  ;
47
48
<input type =" checkbox" <% =escape ? " checked" : " " % > name="esc"><label for =" esc" >Escape</label >  ;  ;
48
49
<label for =" g" >Group by:</label >
49
- <input type =" text" <% =escape ? " checked" : " " % > name="g" size="25" value="<%= group % > ">
50
+ <input type =" text" <% =escape ? " checked" : " " % > name="g" size="25" value="<%= Encode . forHtmlAttribute( group) % > ">
50
51
<label for =" i" >Info:</label >
51
- <input type =" text" <% =escape ? " checked" : " " % > name="i" size="25" value="<%= info % > ">
52
+ <input type =" text" <% =escape ? " checked" : " " % > name="i" size="25" value="<%= Encode . forHtmlAttribute( info) % > ">
52
53
</td >
53
54
</tr >
54
55
</table >
Original file line number Diff line number Diff line change
1
+ <%@ page import =" org.owasp.encoder.Encode" %>
1
2
<html >
2
3
<head >
3
4
<%@ include file =" header.jsp" %>
41
42
<th style =" width : 50% " >Input</th >
42
43
</tr >
43
44
<tr >
44
- <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= regex % > </textarea ></td >
45
+ <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( regex) % > </textarea ></td >
45
46
</tr >
46
47
<tr >
47
48
<th style =" width : 50% " >TestText</th >
48
49
</tr >
49
50
<tr >
50
- <td ><textarea name =" b" rows =" 8" cols =" 10" style =" width : 100% " ><%= test % > </textarea ></td >
51
+ <td ><textarea name =" b" rows =" 8" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( test) % > </textarea ></td >
51
52
</tr >
52
53
</table >
53
54
<input id =' main' type =" submit" value =" Show Modified Regex Pattern" onClick =" window.location.href='regex.jsp?a='+document.getElementById('main').value" />
54
55
</form >
55
56
<hr >
56
57
<h2 >Modified Regex Pattern</h2 >
57
- <p ><%= fixedRegex % > </p >
58
+ <p ><%= Encode . forHtmlContent( fixedRegex) % > </p >
58
59
<hr >
59
60
<h2 >Underlined Find Values</h2 >
60
61
<p ><%= testPattern % > </p >
Original file line number Diff line number Diff line change
1
+ <%@ page import =" org.owasp.encoder.Encode" %>
1
2
<html >
2
3
<head >
3
4
<%@ include file =" header.jsp" %>
24
25
<th style =" width : 50% " >Transform Rules</th >
25
26
</tr >
26
27
<tr >
27
- <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= transform % > </textarea ></td >
28
+ <td ><textarea name =" a" rows =" 8" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( transform) % > </textarea ></td >
28
29
</tr >
29
30
<tr >
30
31
<th style =" width : 50% " >Sample</th >
31
32
</tr >
32
33
<tr >
33
- <td ><textarea name =" b" rows =" 8" cols =" 10" style =" width : 100% " ><%= sample % > </textarea ></td >
34
+ <td ><textarea name =" b" rows =" 8" cols =" 10" style =" width : 100% " ><%= Encode . forHtmlContent( sample) % > </textarea ></td >
34
35
</tr >
35
36
</table >
36
37
<input id =' main' type =" submit" value =" Show Transform" onClick =" window.location.href='transform.jsp?a='+document.getElementById('main').value" />
You can’t perform that action at this time.
0 commit comments