summaryrefslogtreecommitdiff
path: root/modules/gallery/tests/Xss_Security_Test.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/tests/Xss_Security_Test.php')
-rw-r--r--modules/gallery/tests/Xss_Security_Test.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/tests/Xss_Security_Test.php b/modules/gallery/tests/Xss_Security_Test.php
index 7a6589bd..85624517 100644
--- a/modules/gallery/tests/Xss_Security_Test.php
+++ b/modules/gallery/tests/Xss_Security_Test.php
@@ -66,7 +66,7 @@ class Xss_Security_Test extends Unit_Test_Case {
// of opening / closing tag count since it would be meaningless.
// Handle multiple start / end blocks on the same line?
- $opening_script_pos = $closing_script_pos = 0;
+ $opening_script_pos = $closing_script_pos = -1;
if (preg_match_all('{</script>}i', $inline_html, $matches, PREG_OFFSET_CAPTURE)) {
$last_match = array_pop($matches[0]);
if (is_array($last_match)) {
@@ -75,7 +75,7 @@ class Xss_Security_Test extends Unit_Test_Case {
$closing_script_pos = $last_match;
}
}
- if (preg_match('{<script\b[^>]*>}i', $inline_html, $matches, PREG_OFFSET_CAPTURE)) {
+ if (preg_match_all('{<script\b[^>]*>}i', $inline_html, $matches, PREG_OFFSET_CAPTURE)) {
$last_match = array_pop($matches[0]);
if (is_array($last_match)) {
$opening_script_pos = $last_match[1];