Sha256: f760bb4f59fc7c36feae703b66450dc99beddad4b28cce4b4431f0d92a1eac10

Contents?: true

Size: 670 Bytes

Versions: 12

Compression:

Stored size: 670 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*%)>/, '&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

12 entries across 12 versions & 1 rubygems

Version Path
imagine_cms-5.2.6 app/models/cms_page_object.rb
imagine_cms-5.2.5 app/models/cms_page_object.rb
imagine_cms-5.2.4 app/models/cms_page_object.rb
imagine_cms-5.2.3 app/models/cms_page_object.rb
imagine_cms-5.2.2 app/models/cms_page_object.rb
imagine_cms-5.2.1 app/models/cms_page_object.rb
imagine_cms-5.2.0 app/models/cms_page_object.rb
imagine_cms-4.2.4 app/models/cms_page_object.rb
imagine_cms-4.2.3 app/models/cms_page_object.rb
imagine_cms-4.2.2 app/models/cms_page_object.rb
imagine_cms-4.2.1 app/models/cms_page_object.rb
imagine_cms-4.2.0 app/models/cms_page_object.rb