Better handling of SVG attributes which admit uri refs
Just strip out the URI ref, leaving alternates.
This commit is contained in:
parent
5208bbf0af
commit
f24c60c3fb
2 changed files with 11 additions and 11 deletions
|
@ -123,9 +123,9 @@ module HTML5
|
|||
if val_unescaped =~ /^[a-z0-9][-+.a-z0-9]*:/ and !self.class.const_get("ALLOWED_PROTOCOLS").include?(val_unescaped.split(':')[0])
|
||||
attrs.delete attr
|
||||
end
|
||||
SVG_ATTR_VAL_ALLOWS_REF.each do |attr|
|
||||
attrs.delete attr if attrs[attr].to_s.downcase =~ /url\(\s*[^#]/m
|
||||
end
|
||||
end
|
||||
SVG_ATTR_VAL_ALLOWS_REF.each do |attr|
|
||||
attrs[attr] = attrs[attr].to_s.gsub(/url\s*\(\s*[^#\s][^)]+?\)/m, ' ') if attrs[attr]
|
||||
end
|
||||
if attrs['style']
|
||||
attrs['style'] = sanitize_css(attrs['style'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue