Sha256: 3702a09fe6bbb36e90a6d58da239e20f45ae5d258b021c9ac1d9d6e3435942d9
Contents?: true
Size: 674 Bytes
Versions: 24
Compression:
Stored size: 674 Bytes
Contents
class CmsPageObject < ActiveRecord::Base attr_accessible :name, :obj_type belongs_to :page, :class_name => 'CmsPage', :foreign_key => 'cms_page_id' before_create :set_page_version def set_page_version if cms_page_version.to_i == 0 self.cms_page_version = page.version end end 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*%)>/, '<\1>') value.gsub!(/<(%.*?\%x\s?\[.*?\s*%)>/, '<\1>') value.gsub!(/<(%.*?`.*?\s*%)>/, '<\1>') end super(value) end end
Version data entries
24 entries across 24 versions & 1 rubygems