1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

9 commits

Author SHA1 Message Date
Yehuda Katz
4cbb9db0a5 For performance reasons, you can no longer call html_safe! on Strings. Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self).
* Additionally, instead of doing concat("</form>".html_safe), you can do
    safe_concat("</form>"), which will skip both the flag set, and the flag
    check.
  * For the first pass, I converted virtually all #html_safe!s to #html_safe,
    and the tests pass. A further optimization would be to try to use
    #safe_concat as much as possible, reducing the performance impact if
    we know up front that a String is safe.
2010-01-31 19:39:13 -08:00
José Valim
a091e2e4f6 errors in ActionView should not be namespaced as well. 2010-01-07 15:31:50 +01:00
José Valim
9fbb2c571b Fix error_messages_for when instance variable names are given.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-21 11:18:36 -05:00
José Valim
cb87302689 Bring agnosticism to error_messages_for. 2009-10-17 13:03:28 -03:00
Michael Koziarski
c352ec060c error procs have to be safe too 2009-10-08 12:13:48 +13:00
Michael Koziarski
9415935902 Switch to on-by-default XSS escaping for rails.
This consists of:

  * String#html_safe! a method to mark a string as 'safe'
  * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it
  * Calls to String#html_safe! throughout the rails helpers
  * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB)
  * New ERB implementation based on erubis which uses a SafeBuffer instead of a String

Hat tip to Django for the inspiration.
2009-10-08 09:31:20 +13:00
Jeremy Kemper
12c271d1d2 Ruby 1.9.2: implicit argument passing of super from method defined by define_method() is not supported 2009-08-07 17:04:56 -07:00
Yehuda Katz
c4d1075bd3 Add support for error_messages_for(@obj) 2009-07-28 19:06:14 -07:00
Yehuda Katz
f2f5cdc8bc Rename ActiveRecordHelper to ActiveModelHelper 2009-07-20 01:30:49 +09:00
Renamed from actionpack/lib/action_view/helpers/active_record_helper.rb (Browse further)