Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nokogiri 1.9.0 breaks some Loofah behavior #161

Closed
simpsora opened this issue Dec 18, 2018 · 5 comments
Closed

Nokogiri 1.9.0 breaks some Loofah behavior #161

simpsora opened this issue Dec 18, 2018 · 5 comments

Comments

@simpsora
Copy link

The bundled tests fail when using the recently-released nokogiri 1.9.0:

$ rake test
/src/.rbenv/versions/2.5.0/bin/ruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "minitest/autorun"; require "test/html5/test_sanitizer.rb"; require "test/integration/test_ad_hoc.rb"; require "test/integration/test_helpers.rb"; require "test/integration/test_html.rb"; require "test/integration/test_scrubbers.rb"; require "test/integration/test_xml.rb"; require "test/unit/test_api.rb"; require "test/unit/test_encoding.rb"; require "test/unit/test_helpers.rb"; require "test/unit/test_scrubber.rb"; require "test/unit/test_scrubbers.rb"' --
=> testing with Nokogiri {"warnings"=>[], "nokogiri"=>"1.9.0", "ruby"=>{"version"=>"2.5.0", "platform"=>"x86_64-darwin16", "description"=>"ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]", "engine"=>"ruby"}, "libxml"=>{"binding"=>"extension", "source"=>"packaged", "libxml2_path"=>"/src/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/nokogiri-1.9.0/ports/x86_64-apple-darwin16.7.0/libxml2/2.9.8", "libxslt_path"=>"/src/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/nokogiri-1.9.0/ports/x86_64-apple-darwin16.7.0/libxslt/1.1.32", "libxml2_patches"=>["0001-Revert-Do-not-URI-escape-in-server-side-includes.patch", "0002-Fix-nullptr-deref-with-XPath-logic-ops.patch", "0003-Fix-infinite-loop-in-LZMA-decompression.patch"], "libxslt_patches"=>[], "compiled"=>"2.9.8", "loaded"=>"2.9.8"}}
Run options: --seed 5821

# Running:

..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S...........................................................................................................................................................................SE

Error:
html fragment::#to_text#test_0002_add newlines before and after html5 block elements:
ArgumentError: wrong number of arguments (given 1, expected 0)
    /src/code/loofah/lib/loofah/instance_methods.rb:116:in `content'
    /src/code/loofah/lib/loofah/instance_methods.rb:116:in `to_text'
    /src/code/loofah/test/integration/test_html.rb:29:in `block (3 levels) in <class:IntegrationTestHtml>'

bin/rails test src/code/loofah/test/integration/test_html.rb:27

E

Error:
html fragment::#to_text#test_0001_add newlines before and after html4 block elements:
ArgumentError: wrong number of arguments (given 1, expected 0)
    /src/code/loofah/lib/loofah/instance_methods.rb:116:in `content'
    /src/code/loofah/lib/loofah/instance_methods.rb:116:in `to_text'
    /src/code/loofah/test/integration/test_html.rb:24:in `block (3 levels) in <class:IntegrationTestHtml>'

bin/rails test src/code/loofah/test/integration/test_html.rb:22

E

Error:
html fragment::#to_text#test_0003_remove extraneous whitespace:
ArgumentError: wrong number of arguments (given 1, expected 0)
    /src/code/loofah/lib/loofah/instance_methods.rb:116:in `content'
    /src/code/loofah/lib/loofah/instance_methods.rb:116:in `to_text'
    /src/code/loofah/test/integration/test_html.rb:34:in `block (3 levels) in <class:IntegrationTestHtml>'

bin/rails test src/code/loofah/test/integration/test_html.rb:32

.........S...........................

Finished in 0.303175s, 2688.2164 runs/s, 3090.6242 assertions/s.
815 runs, 937 assertions, 0 failures, 3 errors, 3 skips

You have skipped tests. Run with --verbose for details.
rake aborted!
Command failed with status (1): [/src/.rbenv/versions/2.5.0/b...]

Tasks: TOP => test
(See full trace by running task with --trace)
$ ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
@flavorjones
Copy link
Owner

Thanks for reporting this ... verifying now. Will cut a release to fix if necessary.

@flavorjones
Copy link
Owner

@flavorjones
Copy link
Owner

I've opened a bug under Nokogiri at sparklemotion/nokogiri#1846

@flavorjones flavorjones changed the title 2.2.3 (and HEAD) incompatible with nokogiri 1.9.0 Nokogiri 1.9.0 breaks some Loofah behavior Dec 18, 2018
@flavorjones
Copy link
Owner

A new version of Nokogiri, v1.9.1, should be out in the next few minutes that addresses this issue.

@flavorjones
Copy link
Owner

Nokogiri v1.9.1 is now out, which addresses the underlying issue. Closing.

Thanks so much for reporting this so quickly! ❤️ ❤️ ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants