Sha256: e3108575d4651158615ca549f743b44783fbfafc5448f33f39f66c1f297fbaa6

Contents?: true

Size: 457 Bytes

Versions: 42

Compression:

Stored size: 457 Bytes

Contents

class CmsSnippet < ActiveRecord::Base
  acts_as_versioned
  
  attr_accessible :name, :content
  
  def content=(value)
    if value && value.is_a?(String)
      # filter suspicious content... go overboard for now, fine-tune later perhaps
      value.gsub!(/<(%.*?(exec|system)\s?\(.*?\s*%)>/, '&lt;\1&gt;')
      value.gsub!(/<(%.*?\%x\s?\[.*?\s*%)>/, '&lt;\1&gt;')
      value.gsub!(/<(%.*?`.*?\s*%)>/, '&lt;\1&gt;')
    end
    super(value)
  end
  
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
imagine_cms-3.0.33 app/models/cms_snippet.rb
imagine_cms-3.0.32 app/models/cms_snippet.rb
imagine_cms-3.0.31 app/models/cms_snippet.rb
imagine_cms-3.0.30 app/models/cms_snippet.rb
imagine_cms-3.0.29 app/models/cms_snippet.rb
imagine_cms-3.0.28 app/models/cms_snippet.rb
imagine_cms-3.0.27 app/models/cms_snippet.rb
imagine_cms-3.0.26 app/models/cms_snippet.rb
imagine_cms-3.0.25 app/models/cms_snippet.rb
imagine_cms-3.0.24 app/models/cms_snippet.rb
imagine_cms-3.0.23.1 app/models/cms_snippet.rb
imagine_cms-3.0.23 app/models/cms_snippet.rb
imagine_cms-3.0.22 app/models/cms_snippet.rb
imagine_cms-3.0.21 app/models/cms_snippet.rb
imagine_cms-3.0.20 app/models/cms_snippet.rb
imagine_cms-3.0.19 app/models/cms_snippet.rb
imagine_cms-3.0.18 app/models/cms_snippet.rb
imagine_cms-3.0.17 app/models/cms_snippet.rb
imagine_cms-3.0.16 app/models/cms_snippet.rb
imagine_cms-3.0.15 app/models/cms_snippet.rb