FYI:
I've got a bug in a Rails lighthouse ticket
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2258-libxml-xml_mini-backend-producing-incorrect-hashes
Showing a case where the libxml backend produces an incorrect hash.
Would be great to get this fixed before the next relea
Stephen,
And where is the Hash#to_xml method defined?
Charlie
Stephen Bannasch wrote:
FYI:
I've got a bug in a Rails lighthouse ticket
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2258-libxml-xml_mini-backend-producing-incorrect-hashes
Showing a case where the libxm
At 3:11 PM -0600 3/16/09, Charlie Savage wrote:
Stephen,
And where is the Hash#to_xml method defined?
It's part of what an activesupport xml_mini backend does.
Take a look in the rails source code here:
activesupport/lib/active_support/xml_mini
Which you can see here:
http://github.com/r
On the first test, its a bug in the activesupport code:
def to_hash(hash={})
if text?
raise LibXML::XML::Error if content.length >= LIB_XML_LIMIT
hash[CONTENT_ROOT] = content # ! INCORRECT !
else
This is the xml:
good
hello everyone
morning
And on the second test case:
The error is here:
def children_array_to_hash(hash={})
hash[child.name] = map do |child|
returning({}) { |sub_hash| child.children_to_hash(sub_hash) }
end
hash
end
There is no check to see if the element name has chan
In working on the rails xml_mini backend tests I found a test
generating a bus error when using libxml-ruby-1.1.2.
Here's a stand-alone adaptation of the test that runs on the just
released Rails 2.3.2:
file: test_attack_xml.rb
require 'rubygems'
require 'test/unit'
require 'activesupport'
Hi Stephen,
Here's the result running on MacOS 10.5.6
$ ruby test_attack_xml_with_libxml.rb
Loaded suite test_attack_xml
Started
/Library/Ruby/Gems/1.8/gems/libxml-ruby-1.1.2/lib/libxml/node.rb:100:
[BUG] Bus Error
ruby 1.8.6 (2008-03-03) [universal-darwin9.0]
Abort trap
Can you get a stac
On Mon, Mar 16, 2009 at 8:50 PM, Stephen Bannasch
wrote:
> In working on the rails xml_mini backend tests I found a test generating a
> bus error when using libxml-ruby-1.1.2.
>
> Here's a stand-alone adaptation of the test that runs on the just released
> Rails 2.3.2:
>
> file: test_attack_xml.r