Changeset 7086
- Timestamp:
- 06/23/07 00:40:53 (1 year ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/hash/conversions.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r7083 r7086 1 1 *SVN* 2 3 * Demote Hash#to_xml to use XmlSimple#xml_in_string so it can't read files or stdin. #8453 [candlerb, Jeremy Kemper] 2 4 3 5 * Backport clean_logger changes to support ruby 1.8.2 [mislav] trunk/activesupport/lib/active_support/core_ext/hash/conversions.rb
r7085 r7086 18 18 def to_query(key) #:nodoc: 19 19 collect { |value| value.to_query("#{key}[]") } * '&' 20 end 21 end 22 23 # Locked down XmlSimple#xml_in_string 24 class XmlSimple 25 # Same as xml_in but doesn't try to smartly shoot itself in the foot. 26 def xml_in_string(string, options = nil) 27 handle_options('in', options) 28 29 @doc = parse(string) 30 result = collapse(@doc.root) 31 32 if @options['keeproot'] 33 merge({}, @doc.root.name, result) 34 else 35 result 36 end 37 end 38 39 def self.xml_in_string(string, options = nil) 40 new.xml_in_string(string, options) 20 41 end 21 42 end … … 136 157 def from_xml(xml) 137 158 # TODO: Refactor this into something much cleaner that doesn't rely on XmlSimple 138 typecast_xml_value(undasherize_keys(XmlSimple.xml_in (xml,159 typecast_xml_value(undasherize_keys(XmlSimple.xml_in_string(xml, 139 160 'forcearray' => false, 140 161 'forcecontent' => true,