Skip to content

Commit

Permalink
Don't overwrite allowed tags when allowing video embeds on Story
Browse files Browse the repository at this point in the history
  • Loading branch information
GIT_AUTHOR_NAME authored and veezus committed Mar 16, 2009
1 parent 4fba764 commit 3529eed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/story.rb
Expand Up @@ -40,8 +40,8 @@

class Story < NewsItem
cleanse_columns(:extended_description) do |sanitizer|
sanitizer.allowed_tags.replace(%w(object param embed a img))
sanitizer.allowed_attributes.replace(%w(width height name src value allowFullScreen type href allowScriptAccess style wmode pluginspage classid codebase data quality))
sanitizer.allowed_tags.add(%w(object param embed a img))
sanitizer.allowed_attributes.add(%w(width height name src value allowFullScreen type href allowScriptAccess style wmode pluginspage classid codebase data quality))
end

aasm_initial_state :draft
Expand Down
8 changes: 8 additions & 0 deletions spec/models/story_spec.rb
Expand Up @@ -13,6 +13,14 @@
end
end

describe "validation" do
it "should allow p tags in extended description" do
story = Factory(:story)
story.extended_description = "<p>Some html</p>"
story.save
story.extended_description.should include("<p>")
end
end
describe "status" do
before(:each) do
@story = Factory(:story)
Expand Down

0 comments on commit 3529eed

Please sign in to comment.