aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-09-09 23:07:34 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-09-09 23:07:34 -0500
commit23a0e2c4a9c41936fec0c6e44b946108c701d33b (patch)
tree88dd67e244fe5fdca88d28d3e076d2209ac0b5b3
parentcc17863709882787654403fb20faf4a23eefb5ba (diff)
downloadrails-23a0e2c4a9c41936fec0c6e44b946108c701d33b.tar.gz
rails-23a0e2c4a9c41936fec0c6e44b946108c701d33b.tar.bz2
rails-23a0e2c4a9c41936fec0c6e44b946108c701d33b.zip
Fixed that REXML fix would break on earlier versions of ruby (Frederick Cheung) [state:resolved #987]
-rw-r--r--activesupport/lib/active_support/core_ext/rexml.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/rexml.rb b/activesupport/lib/active_support/core_ext/rexml.rb
index af8ce3af47..baced8111a 100644
--- a/activesupport/lib/active_support/core_ext/rexml.rb
+++ b/activesupport/lib/active_support/core_ext/rexml.rb
@@ -5,7 +5,9 @@ require 'rexml/entity'
# http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
# This fix is identical to rexml-expansion-fix version 1.0.1
-unless REXML::VERSION > "3.1.7.2"
+#earlier versions of rexml defined REXML::Version, newer ones REXML::VERSION
+version = defined?(REXML::VERSION) ? REXML::VERSION : REXML::Version
+unless version > "3.1.7.2"
module REXML
class Entity < Child
undef_method :unnormalized