-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interpolated HTML attribute escaping improvements
- Loading branch information
1 parent
2729753
commit 97e6185
Showing
10 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
SafeString <: AbstractString | ||
Represents an internal string type that was created directly within a template, | ||
rather than being passed into a template from a potentially untrusted source as | ||
a parameter. Never create these objects from application-level code. | ||
""" | ||
struct SafeString <: AbstractString | ||
str::String | ||
end | ||
|
||
Base.show(io::IO, s::SafeString) = show(io, s.str) | ||
Base.ncodeunits(s::SafeString) = ncodeunits(s.str) | ||
Base.codeunit(s::SafeString) = codeunit(s.str) | ||
Base.codeunit(s::SafeString, i::Integer) = codeunit(s.str, i) | ||
Base.isvalid(s::SafeString, index::Integer) = isvalid(s.str, index) | ||
Base.iterate(s::SafeString) = iterate(s.str) | ||
Base.iterate(s::SafeString, state::Integer) = iterate(s.str, state) | ||
Base.String(s::SafeString) = String(s.str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<p>&='`<>/</p> | ||
<p>&='`<>/</p><a href="/api/user-name">Link</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>&='`<>/</p><a href="/api/"></a><script>alert('xss')</script><a href="">Link</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Node(CommonMark.Document)</p><a href="/api/user-name">Link</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<p><p><strong>bold</strong></p> | ||
</p><a href="/api/user-name">Link</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters