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*%)>/, '&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

24 entries across 24 versions & 1 rubygems

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