summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormikesamuel <mikesamuel@ad8eed46-c659-4a31-e19d-951d88f54425>2013-07-21 15:26:27 +0000
committermikesamuel <mikesamuel@ad8eed46-c659-4a31-e19d-951d88f54425>2013-07-21 15:26:27 +0000
commitaaf3076dbab1d3484717a87085e27ec21c7217d1 (patch)
tree97285251941c87b6a8352cb6166433aefd7502d3
parentadf65fa8048eaf04e12e2b36e3ad9a78429ce96b (diff)
downloadsanitizer-aaf3076dbab1d3484717a87085e27ec21c7217d1.tar.gz
added main method to CssSchema to make reviewing the white-list easier
git-svn-id: http://owasp-java-html-sanitizer.googlecode.com/svn/trunk@194 ad8eed46-c659-4a31-e19d-951d88f54425
-rw-r--r--src/main/org/owasp/html/CssSchema.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/org/owasp/html/CssSchema.java b/src/main/org/owasp/html/CssSchema.java
index f46bcac..13ba66d 100644
--- a/src/main/org/owasp/html/CssSchema.java
+++ b/src/main/org/owasp/html/CssSchema.java
@@ -28,8 +28,11 @@
package org.owasp.html;
+import java.util.SortedSet;
+
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
/** Describes the kinds of tokens a CSS property's value can safely contain. */
final class CssSchema {
@@ -435,4 +438,21 @@ final class CssSchema {
}
return all.build();
}
+
+ /** Dumps key and literal list to stdout for easy examination. */
+ public static void main(String... argv) {
+ SortedSet<String> keys = Sets.newTreeSet();
+ SortedSet<String> literals = Sets.newTreeSet();
+ for (ImmutableMap.Entry<String, CssSchema> e : SCHEMA.entrySet()) {
+ keys.add(e.getKey());
+ literals.addAll(e.getValue().literals);
+ }
+ for (String key : keys) {
+ System.out.println(key);
+ }
+ System.out.println();
+ for (String literal : literals) {
+ System.out.println(literal);
+ }
+ }
}