Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
88778b56
Commit
88778b56
authored
10 years ago
by
Andreas Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Split testP() tests into multiple methods.
parent
0d3ddd9e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lib/template.php
+3
-1
3 additions, 1 deletion
tests/lib/template.php
with
3 additions
and
1 deletion
tests/lib/template.php
+
3
−
1
View file @
88778b56
...
@@ -27,13 +27,15 @@ class Test_TemplateFunctions extends PHPUnit_Framework_TestCase {
...
@@ -27,13 +27,15 @@ class Test_TemplateFunctions extends PHPUnit_Framework_TestCase {
$loader
->
load
(
'OC_Template'
);
$loader
->
load
(
'OC_Template'
);
}
}
public
function
testP
()
{
public
function
testP
JavaScript
()
{
$badString
=
'<img onload="alert(1)" />'
;
$badString
=
'<img onload="alert(1)" />'
;
ob_start
();
ob_start
();
p
(
$badString
);
p
(
$badString
);
$result
=
ob_get_clean
();
$result
=
ob_get_clean
();
$this
->
assertEquals
(
'<img onload="alert(1)" />'
,
$result
);
$this
->
assertEquals
(
'<img onload="alert(1)" />'
,
$result
);
}
public
function
testPJavaScriptWithScriptTags
()
{
$badString
=
"<script>alert('Hacked!');</script>"
;
$badString
=
"<script>alert('Hacked!');</script>"
;
ob_start
();
ob_start
();
p
(
$badString
);
p
(
$badString
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment