summaryrefslogtreecommitdiffstats
path: root/tests/lib/template.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/template.php')
-rw-r--r--tests/lib/template.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/lib/template.php b/tests/lib/template.php
index 40aec402347..299eb2b9369 100644
--- a/tests/lib/template.php
+++ b/tests/lib/template.php
@@ -27,13 +27,15 @@ class Test_TemplateFunctions extends PHPUnit_Framework_TestCase {
$loader->load('OC_Template');
}
- public function testP() {
+ public function testPJavaScript() {
$badString = '<img onload="alert(1)" />';
ob_start();
p($badString);
$result = ob_get_clean();
$this->assertEquals('&lt;img onload=&quot;alert(1)&quot; /&gt;', $result);
+ }
+ public function testPJavaScriptWithScriptTags() {
$badString = "<script>alert('Hacked!');</script>";
ob_start();
p($badString);