[DRE-commits] r4535 - in trunk/redmine/debian: . patches

Jérémy Lal kapouer-guest at alioth.debian.org
Sun Jan 17 14:44:56 UTC 2010


Author: kapouer-guest
Date: 2010-01-17 14:44:55 +0000 (Sun, 17 Jan 2010)
New Revision: 4535

Added:
   trunk/redmine/debian/patches/0015-Sanitize-textarea-id-for-rails2.2.patch
Modified:
   trunk/redmine/debian/changelog
   trunk/redmine/debian/patches/series
Log:
Fix some rails 2.2 incompatibility.
And upstream update.

Modified: trunk/redmine/debian/changelog
===================================================================
--- trunk/redmine/debian/changelog	2010-01-17 14:44:49 UTC (rev 4534)
+++ trunk/redmine/debian/changelog	2010-01-17 14:44:55 UTC (rev 4535)
@@ -1,4 +1,4 @@
-redmine (0.9.0~svn3303-1) unstable; urgency=low
+redmine (0.9.0~svn3329-1) unstable; urgency=low
 
   * This is a release candidate.
   * Stop using deprecated dbfile param in database.yml.
@@ -10,8 +10,9 @@
     (Closes: #553375, #551002, #552736, #554351, #560999, #555693)
   * Fixes CVE-2009-4459 : uses the title tag before defining
     the character encoding in a meta tag. (Closes: #563940)
+  * Several rails 2.2 incompatibilities have been fixed.
 
- -- Jérémy Lal <kapouer at melix.org>  Sun, 10 Jan 2010 12:45:36 +0100
+ -- Jérémy Lal <kapouer at melix.org>  Sun, 17 Jan 2010 15:34:07 +0100
 
 redmine (0.9.0~svn2907-1) unstable; urgency=low
 

Added: trunk/redmine/debian/patches/0015-Sanitize-textarea-id-for-rails2.2.patch
===================================================================
--- trunk/redmine/debian/patches/0015-Sanitize-textarea-id-for-rails2.2.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0015-Sanitize-textarea-id-for-rails2.2.patch	2010-01-17 14:44:55 UTC (rev 4535)
@@ -0,0 +1,66 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 17 Jan 2010 15:18:41 +0100
+Subject: [PATCH] Sanitize textarea id for rails2.2
+
+In rails 2.2, the id attribute of a textarea is not sanitized as it is for other form tags. Fix this using a minimal monkey patch from rails 2.3.
+---
+ .../initializers/text_field_helper_santitize_id.rb |   49 ++++++++++++++++++++
+ 1 files changed, 49 insertions(+), 0 deletions(-)
+ create mode 100644 config/initializers/text_field_helper_santitize_id.rb
+
+diff --git a/config/initializers/text_field_helper_santitize_id.rb b/config/initializers/text_field_helper_santitize_id.rb
+new file mode 100644
+index 0000000..429c806
+--- /dev/null
++++ b/config/initializers/text_field_helper_santitize_id.rb
+@@ -0,0 +1,49 @@
++require 'action_view/helpers/tag_helper'
++
++module ActionView
++  module Helpers
++    module FormTagHelper
++      # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions.
++      #
++      # ==== Options
++      # * <tt>:size</tt> - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10").
++      # * <tt>:rows</tt> - Specify the number of rows in the textarea
++      # * <tt>:cols</tt> - Specify the number of columns in the textarea
++      # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
++      # * <tt>:escape</tt> - By default, the contents of the text input are HTML escaped.
++      #   If you need unescaped contents, set this to false.
++      # * Any other key creates standard HTML attributes for the tag.
++      #
++      # ==== Examples
++      #   text_area_tag 'post'
++      #   # => <textarea id="post" name="post"></textarea>
++      #
++      #   text_area_tag 'bio', @user.bio
++      #   # => <textarea id="bio" name="bio">This is my biography.</textarea>
++      #
++      #   text_area_tag 'body', nil, :rows => 10, :cols => 25
++      #   # => <textarea cols="25" id="body" name="body" rows="10"></textarea>
++      #
++      #   text_area_tag 'body', nil, :size => "25x10"
++      #   # => <textarea name="body" id="body" cols="25" rows="10"></textarea>
++      #
++      #   text_area_tag 'description', "Description goes here.", :disabled => true
++      #   # => <textarea disabled="disabled" id="description" name="description">Description goes here.</textarea>
++      #
++      #   text_area_tag 'comment', nil, :class => 'comment_input'
++      #   # => <textarea class="comment_input" id="comment" name="comment"></textarea>
++      def text_area_tag(name, content = nil, options = {})
++        options.stringify_keys!
++
++        if size = options.delete("size")
++          options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
++        end
++
++        escape = options.key?("escape") ? options.delete("escape") : true
++        content = html_escape(content) if escape
++
++        content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
++      end
++    end
++  end
++end
+-- 

Modified: trunk/redmine/debian/patches/series
===================================================================
--- trunk/redmine/debian/patches/series	2010-01-17 14:44:49 UTC (rev 4534)
+++ trunk/redmine/debian/patches/series	2010-01-17 14:44:55 UTC (rev 4535)
@@ -12,3 +12,4 @@
 0012-Move-session-configuration-to-YML-file-next-to-datab.patch
 0013-Duplicate-name-value-in-request.patch
 0014-REST-API-for-my-account.patch
+0015-Sanitize-textarea-id-for-rails2.2.patch




More information about the Pkg-ruby-extras-commits mailing list