Sha256: 0d77ab763ccd2bd39bae826e1645675aaf0b6c9fa7e530341aaa7ef67d0da1e4

Contents?: true

Size: 477 Bytes

Versions: 5

Compression:

Stored size: 477 Bytes

Contents

module Refinery
  module PagesHelper

    def sanitize_hash(input_hash)
      sanitized_hash = HashWithIndifferentAccess.new
      input_hash.each do |key, value|
        # ActionPack's sanitize calls html_safe on sanitized input.
        sanitized_hash[key] = if value.respond_to? :html_safe
          sanitize value
        elsif value.respond_to? :each
          sanitize_hash value
        else
          value
        end
      end
      sanitized_hash
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
refinerycms-pages-2.0.10 app/helpers/refinery/pages_helper.rb
refinerycms-pages-2.0.9 app/helpers/refinery/pages_helper.rb
refinerycms-pages-2.0.8 app/helpers/refinery/pages_helper.rb
refinerycms-pages-2.0.7 app/helpers/refinery/pages_helper.rb
refinerycms-pages-2.0.6 app/helpers/refinery/pages_helper.rb