Whoops!
In some circumstances, the new Sanitizer was double-escaping text nodes. Fixed (with unit test).
This commit is contained in:
parent
45405fc97e
commit
f6508de6dd
4 changed files with 20 additions and 9 deletions
|
@ -2214,7 +2214,9 @@ class String
|
|||
def escapeHTML
|
||||
self.gsub( /&/, "&" ).
|
||||
gsub( /</, "<" ).
|
||||
gsub( />/, ">" )
|
||||
gsub( />/, ">" ).
|
||||
gsub(/'/, "'" ).
|
||||
gsub(/"/, """ )
|
||||
end
|
||||
|
||||
def unescapeHTML
|
||||
|
@ -2224,6 +2226,8 @@ class String
|
|||
when /\Aamp\z/ni then '&'
|
||||
when /\Agt\z/ni then '>'
|
||||
when /\Alt\z/ni then '<'
|
||||
when /\Aquot\z/ni then '"'
|
||||
when /\Aapos\z/ni then "'"
|
||||
when /\A#0*(\d+)\z/n then
|
||||
if Integer($1) < 256
|
||||
Integer($1).chr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue