comfortable_mexican_sofa 1.10.2 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -81,3 +81,7 @@ Twitter: [@GroceryBagHead](http://twitter.com/#!/GroceryBagHead)
81
81
  ComfortableMexicanSofa is released under the [MIT license](https://github.com/comfy/comfortable-mexican-sofa/raw/master/LICENSE)
82
82
 
83
83
  Copyright 2009-2013 Oleg Khabarov, [The Working Group Inc](http://www.twg.ca)
84
+
85
+
86
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/comfy/comfortable-mexican-sofa/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
87
+
@@ -1,3 +1,3 @@
1
1
  module ComfortableMexicanSofa
2
- VERSION = "1.10.2"
2
+ VERSION = "1.10.3"
3
3
  end
@@ -35,7 +35,7 @@ module ComfortableMexicanSofa::ViewMethods
35
35
  end
36
36
 
37
37
  return '' unless snippet
38
- render :inline => ComfortableMexicanSofa::Tag.process_content(cms_site.pages.build, snippet.content)
38
+ render :inline => ComfortableMexicanSofa::Tag.process_content(cms_site.pages.build, ComfortableMexicanSofa::Tag.sanitize_irb(snippet.content))
39
39
  end
40
40
 
41
41
  # Content of a text based page block. This is the typical method for retrieving content from
@@ -79,7 +79,7 @@ module ComfortableMexicanSofa::ViewMethods
79
79
  when ComfortableMexicanSofa::Tag::PageFiles
80
80
  block.files
81
81
  else
82
- render :inline => ComfortableMexicanSofa::Tag.process_content(page, block.content)
82
+ render :inline => ComfortableMexicanSofa::Tag.process_content(page, ComfortableMexicanSofa::Tag.sanitize_irb(block.content))
83
83
  end
84
84
  end
85
85
  end
@@ -110,7 +110,13 @@ class ViewMethodsTest < ActionView::TestCase
110
110
  assert_equal 'default_snippet_content',
111
111
  action_result('test_cms_snippet_with_default_content_block')
112
112
  end
113
-
113
+
114
+ def test_cms_snippet_content_with_irb
115
+ cms_snippets(:default).update_column(:content, '<%= 1+1+1+1+1 %>')
116
+ assert_equal "&lt;%= 1+1+1+1+1 %&gt;", action_result('test_cms_snippet_content')
117
+ end
118
+
119
+
114
120
  def test_cms_page_content
115
121
  assert_equal 'default_field_text_content', action_result('test_cms_page_content')
116
122
  end
@@ -141,4 +147,9 @@ class ViewMethodsTest < ActionView::TestCase
141
147
  assert_equal page.blocks.find_by_identifier('files').files, cms_page_content(:files, page)
142
148
  end
143
149
 
150
+ def test_cms_page_content_with_irb
151
+ cms_blocks(:default_field_text).update_column(:content, '<%= 1+1+1+1+1 %>')
152
+ assert_equal "&lt;%= 1+1+1+1+1 %&gt;", action_result('test_cms_page_content')
153
+ end
154
+
144
155
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2
4
+ version: 1.10.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: