summaryrefslogtreecommitdiff
path: root/modules/gallery/tests
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-08-29 13:41:18 -0700
committerAndy Staudacher <andy.st@gmail.com>2009-08-29 13:41:18 -0700
commitd5660d2d3ea6e8172272f1eb27e8071a1a42d87b (patch)
tree814fe98dbf50922698fbbb6dd63664f0d2c84668 /modules/gallery/tests
parent83344b9e7d5bdde05956a0a5c0b6578e19974066 (diff)
Fixing all detected XSS vectors in PHP->JS code.
Xss: Rename UNKNOWN back to DIRTY, JS_XSS to DIRTY_JS. (using a different flag value to highlight potential XSS vectors in JS)
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r--modules/gallery/tests/Xss_Security_Test.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/gallery/tests/Xss_Security_Test.php b/modules/gallery/tests/Xss_Security_Test.php
index fd596c69..690dc760 100644
--- a/modules/gallery/tests/Xss_Security_Test.php
+++ b/modules/gallery/tests/Xss_Security_Test.php
@@ -178,10 +178,10 @@ class Xss_Security_Test extends Unit_Test_Case {
* Generate the report
*
* States for uses of < ? = X ? >:
- * JS_XSS:
+ * DIRTY_JS:
* In <script> block
* X can be anything without calling ->for_js()
- * UNKNOWN:
+ * DIRTY:
* Outside <script> block:
* X can be anything without a call to ->for_html() or ->purified_html()
* CLEAN:
@@ -196,9 +196,9 @@ class Xss_Security_Test extends Unit_Test_Case {
ksort($found);
foreach ($found as $view => $frames) {
foreach ($frames as $frame) {
- $state = "UNKNOWN";
+ $state = "DIRTY";
if ($frame->in_script_block()) {
- $state = "JS_XSS";
+ $state = "DIRTY_JS";
if ($frame->for_js_called() || $frame->json_encode_called()) {
$state = "CLEAN";
}
@@ -207,6 +207,13 @@ class Xss_Security_Test extends Unit_Test_Case {
$state = "CLEAN";
}
}
+
+ if ("CLEAN" == $state) {
+ // Don't print CLEAN instances - No need to update the golden
+ // file when adding / moving clean instances.
+ continue;
+ }
+
fprintf($fd, "%-60s %-3s %-8s %s\n",
$view, $frame->line(), $state, $frame->expr());
}