fixes #1099
This commit is contained in:
@@ -244,7 +244,7 @@ class DText
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.sanitize(text)
|
def self.sanitize(text)
|
||||||
text.gsub!(/<( |-|\Z)/, "<\\1")
|
text.gsub!(/<( |-|3|:|>|\Z)/, "<\\1")
|
||||||
|
|
||||||
Sanitize.clean(
|
Sanitize.clean(
|
||||||
text,
|
text,
|
||||||
|
|||||||
@@ -6428,3 +6428,5 @@ INSERT INTO schema_migrations (version) VALUES ('20130618230158');
|
|||||||
INSERT INTO schema_migrations (version) VALUES ('20130620215658');
|
INSERT INTO schema_migrations (version) VALUES ('20130620215658');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20130712162600');
|
INSERT INTO schema_migrations (version) VALUES ('20130712162600');
|
||||||
|
|
||||||
|
INSERT INTO schema_migrations (version) VALUES ('20130914175431');
|
||||||
@@ -5,6 +5,10 @@ class DTextTest < ActiveSupport::TestCase
|
|||||||
DText.parse(s)
|
DText.parse(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_sanitize_heart
|
||||||
|
assert_equal('<p><3</p>', p("<3"))
|
||||||
|
end
|
||||||
|
|
||||||
def test_sanitize_less_than
|
def test_sanitize_less_than
|
||||||
assert_equal('<p><</p>', p("<"))
|
assert_equal('<p><</p>', p("<"))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user