public
Description: Kete was developed by Horowhenua Library Trust and Katipo Communications Ltd. to build a digital library of Horowhenua material.
Homepage: http://kete.net.nz/
Clone URL: git://github.com/kete/kete.git
KieranP (author)
Thu Nov 19 13:18:26 -0800 2009
commit  a1df72b4475d31ec0d6f5450d2c51bd146b95d1f
tree    a9312d2d7664aed704145f6458749d41849ba1b9
parent  2c56e60bec6ac42c9db6629fa0698beb0f30e02f
kete / vendor / plugins / acts_as_sanitized
name age message
..
file README Loading commit data...
file Rakefile
file init.rb Sun Jan 13 23:23:10 -0800 2008 adding acts_as_sanitized which i have modified ... [walter]
file install.rb
directory lib/
directory tasks/
directory test/
vendor/plugins/acts_as_sanitized/README
= Acts As Sanitized

Cleans up text data before it hits your database and, eventually, your users.
The goal is to reduce Cross-Site Scripting (XSS) attacks. Install and forget.

The plugin can figure out which fields it needs to sanitize, or you can 
specify fields manually.  The former is highly recommended.  Schemas change.

== Usage

If you'd like the plugin to figure out which fields to sanitize:

 class Comment < ActiveRecord::Base
   acts_as_sanitized
 end
 
If you'd like to specify the fields to sanitize:

 class Entry < ActiveRecord::Base
   acts_as_sanitized :fields => [ :title, :body ]
 end
 
If you'd like to strip all HTML tags, not just script and form:

 class Review < ActiveRecord::Base
   acts_as_sanitized :strip_tags => true
 end
 
If you'd like to use all the fancy options at once:

 class Message < ActiveRecord::Base
   acts_as_sanitized :fields => [ :content ], :strip_tags => true
 end
 
== Known Issues

- 12 Jan 2007: test schema is generated twice when running tests.  Not harmful.

== Credits

Written by Alex Payne of http://www.al3x.net.

Much was learned from reading Chris Wanstrath's acts_as_textiled and the Rails
core team's acts_as_taggable.