[rubygem-activesupport/f15] fix for BZ #731435

Mohammed Morsi mmorsi at fedoraproject.org
Wed Aug 24 00:52:32 UTC 2011


commit 385ae68f4b8e1bea98bff79681e4e5d73669b6b2
Author: Mo Morsi <mmorsi at redhat.com>
Date:   Tue Aug 23 20:51:49 2011 -0400

    fix for BZ #731435

 .gitignore                        |    1 +
 activesupport-bz-731435-fix.patch |   35 +++++++++++++++++++++++++++++++++++
 activesupport-tests.tgz           |  Bin 94683 -> 0 bytes
 rubygem-activesupport.spec        |   10 +++++++++-
 sources                           |    1 +
 5 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index f632943..1c7051e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ activesupport-2.3.5.gem
 activesupport-2.3.8.gem
 /activesupport-3.0.3.gem
 /activesupport-3.0.5.gem
+/activesupport-tests.tgz
diff --git a/activesupport-bz-731435-fix.patch b/activesupport-bz-731435-fix.patch
new file mode 100644
index 0000000..9156fb9
--- /dev/null
+++ b/activesupport-bz-731435-fix.patch
@@ -0,0 +1,35 @@
+diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
+index 06baaa9..adfcc27 100644
+--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
++++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
+@@ -20,7 +20,7 @@ class ERB
+       if s.html_safe?
+         s
+       else
+-        s.gsub(/[&"><]/) { |special| HTML_ESCAPE[special] }.html_safe
++        s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;").html_safe
+       end
+     end
+ 
+diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
+index 024faf4..8f07cd1 100644
+--- a/activesupport/test/core_ext/string_ext_test.rb
++++ b/activesupport/test/core_ext/string_ext_test.rb
+@@ -7,10 +7,17 @@ require 'active_support/core_ext/string'
+ require 'active_support/time'
+ require 'active_support/core_ext/kernel/reporting'
+ require 'active_support/core_ext/string/strip'
++require 'active_support/core_ext/string/output_safety'
+ 
+ class StringInflectionsTest < Test::Unit::TestCase
+   include InflectorTestCases
+ 
++  def test_erb_escape
++    string = [192, 60].pack('CC')
++    expected = 192.chr + "&lt;"
++    assert_equal expected, ERB::Util.html_escape(string)
++  end
++
+   def test_strip_heredoc_on_an_empty_string
+     assert_equal '', ''.strip_heredoc
+   end
diff --git a/rubygem-activesupport.spec b/rubygem-activesupport.spec
index f4bb94d..c64b566 100644
--- a/rubygem-activesupport.spec
+++ b/rubygem-activesupport.spec
@@ -8,7 +8,7 @@ Summary: Support and utility classes used by the Rails framework
 Name: rubygem-%{gemname}
 Epoch: 1
 Version: 3.0.5
-Release: 3%{?dist}
+Release: 4%{?dist}
 Group: Development/Languages
 License: MIT
 URL: http://www.rubyonrails.org
@@ -36,6 +36,9 @@ Patch2: activesupport-remove-memcache-build-dep.patch
 # FIX: https://gist.github.com/b2ceb626fc2bcdfe497f
 Patch3: cve-2011-2197-fix.patch
 
+# FIX for https://bugzilla.redhat.com/show_bug.cgi?id=731435
+Patch4: activesupport-bz-731435-fix.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: rubygems
 Requires: ruby(abi) = %{rubyabi}
@@ -68,6 +71,7 @@ pushd .%{geminstdir}
 %patch1 -p0
 %patch2 -p0
 %patch3 -p0
+%patch4 -p2
 
 %build
 
@@ -75,6 +79,7 @@ pushd .%{geminstdir}
 rm -rf %{buildroot}
 mkdir -p %{buildroot}%{gemdir}
 cp -a .%{gemdir}/* %{buildroot}%{gemdir}
+rm -rf %{buildroot}/%{geminstdir}/.yardoc
 
 %clean
 rm -rf %{buildroot}
@@ -97,6 +102,9 @@ popd
 
 
 %changelog
+* Tue Aug 23 2011 Mo Morsi <mmorsi at redhat.com> - 1:3.0.5-4
+- fix for BZ #731435
+
 * Thu Jun 16 2011 Mo Morsi <mmorsi at redhat.com> - 1:3.0.5-3
 - Reverting accidental change adding a few gem flags
 
diff --git a/sources b/sources
index fdcd339..20a0fc8 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
 9a6b84bf4efae8742a555c7f35750a0d  activesupport-3.0.5.gem
+8c2fd1ab0bab1352e53dd0416795372d  activesupport-tests.tgz


More information about the scm-commits mailing list