1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.ui.server.serialization; |
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
@author |
22 |
|
|
23 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 4 |
Complexity Density: 0.57 |
|
24 |
|
public class SerializationUtils { |
25 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
26 |
0
|
public static String escapeForSingleQuotedJavaScriptString( String s ) ... |
27 |
|
{ |
28 |
0
|
s = escapeScriptTags( s ); |
29 |
0
|
s = escapeBackslash( s ); |
30 |
0
|
s = escapeSingleQuotes( s ); |
31 |
0
|
return s; |
32 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
33 |
0
|
public static String escapeScriptTags( String s )... |
34 |
|
{ |
35 |
0
|
return s |
36 |
|
.replaceAll("(?si)<\\s*script.*?>", "<xxxscript>") |
37 |
|
.replaceAll("(?si)</\\s*script\\s*>", "</xxxscript>"); |
38 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
0
|
public static String escapeBackslash( String s )... |
40 |
|
{ |
41 |
0
|
return s.replaceAll("\\\\","\\\\\\\\" ); |
42 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
43 |
0
|
public static String escapeSingleQuotes( String s ) {... |
44 |
0
|
return s.replaceAll("'","\\\\'" ); |
45 |
|
} |
46 |
|
|
47 |
|
} |