nokogiri 1.13.4 → 1.13.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b49c5143224576879e1ebecbf90ec6a20a7bee3870b65abf2439241f82023cd
4
- data.tar.gz: 85d6f7e37a385880295658851ef8381a7efd93306dea8711d732f48db014d2f0
3
+ metadata.gz: 111da6f69d040f9ac5c3573b0e03cdc5e09fb27c5d8ae8bc6e0bf70079dbcdb8
4
+ data.tar.gz: ccbda476379e696103cf61983df914c6b7312090b5905daccb3077f0a25e60ba
5
5
  SHA512:
6
- metadata.gz: dd962310814487c4e193962f860e0ab21be7aa0014fd0258509f18c0b72757cb7b090a89b48e01e44381c6ef30e4f8ac7f46ff41ee1ecc2a4bae8722b9d42888
7
- data.tar.gz: 98d53814e674107cfed30523252e2f8d433a2d68b25294d7cc94fd5d7da426e11b01d43013df562f7d7c75df6f15290222671937942fc10ac70facbace5c3309
6
+ metadata.gz: bbf69d93304d43cf38667fe66e84caf84b8ca4b89a3ec3d8139fe2f986c10bc5b971d4ed97870601be2ed92b6e748593fea02b89e7f6e2deed09c5a604d2d101
7
+ data.tar.gz: 4a2a6b55fd87f8b4adb5e8687959d9f0c88334638ca2746761155b0214095ce14d648482833b8f80a59b94a54d29e26d9cae4caacda57b772fe00804de6cdabe
data/dependencies.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  libxml2:
2
- version: "2.9.13"
3
- sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e"
4
- # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.sha256sum
2
+ version: "2.9.14"
3
+ sha256: "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"
4
+ # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.sha256sum
5
5
 
6
6
  libxslt:
7
7
  version: "1.1.35"
@@ -19,9 +19,8 @@ parse_memory(VALUE klass, VALUE data, VALUE encoding)
19
19
  {
20
20
  htmlParserCtxtPtr ctxt;
21
21
 
22
- if (NIL_P(data)) {
23
- rb_raise(rb_eArgError, "data cannot be nil");
24
- }
22
+ Check_Type(data, T_STRING);
23
+
25
24
  if (!(int)RSTRING_LEN(data)) {
26
25
  rb_raise(rb_eRuntimeError, "data cannot be empty");
27
26
  }
@@ -2,6 +2,8 @@
2
2
 
3
3
  VALUE cNokogiriXmlSaxParserContext ;
4
4
 
5
+ static ID id_read;
6
+
5
7
  static void
6
8
  deallocate(xmlParserCtxtPtr ctxt)
7
9
  {
@@ -26,6 +28,10 @@ parse_io(VALUE klass, VALUE io, VALUE encoding)
26
28
  xmlParserCtxtPtr ctxt;
27
29
  xmlCharEncoding enc = (xmlCharEncoding)NUM2INT(encoding);
28
30
 
31
+ if (!rb_respond_to(io, id_read)) {
32
+ rb_raise(rb_eTypeError, "argument expected to respond to :read");
33
+ }
34
+
29
35
  ctxt = xmlCreateIOParserCtxt(NULL, NULL,
30
36
  (xmlInputReadCallback)noko_io_read,
31
37
  (xmlInputCloseCallback)noko_io_close,
@@ -62,9 +68,8 @@ parse_memory(VALUE klass, VALUE data)
62
68
  {
63
69
  xmlParserCtxtPtr ctxt;
64
70
 
65
- if (NIL_P(data)) {
66
- rb_raise(rb_eArgError, "data cannot be nil");
67
- }
71
+ Check_Type(data, T_STRING);
72
+
68
73
  if (!(int)RSTRING_LEN(data)) {
69
74
  rb_raise(rb_eRuntimeError, "data cannot be empty");
70
75
  }
@@ -278,4 +283,6 @@ noko_init_xml_sax_parser_context()
278
283
  rb_define_method(cNokogiriXmlSaxParserContext, "recovery", get_recovery, 0);
279
284
  rb_define_method(cNokogiriXmlSaxParserContext, "line", line, 0);
280
285
  rb_define_method(cNokogiriXmlSaxParserContext, "column", column, 0);
286
+
287
+ id_read = rb_intern("read");
281
288
  }
@@ -28,7 +28,7 @@ module Nokogiri
28
28
  ###
29
29
  # Parse html stored in +data+ using +encoding+
30
30
  def parse_memory(data, encoding = "UTF-8")
31
- raise ArgumentError unless data
31
+ raise TypeError unless String === data
32
32
  return if data.empty?
33
33
 
34
34
  ctx = ParserContext.memory(data, encoding)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nokogiri
4
4
  # The version of Nokogiri you are using
5
- VERSION = "1.13.4"
5
+ VERSION = "1.13.6"
6
6
  end
@@ -123,8 +123,8 @@ module Nokogiri
123
123
  # [Yields] Nokogiri::XML::Node
124
124
  # [Returns] Nokogiri::XML::Node
125
125
  #
126
- def initialize(name, document) # rubocop:disable Style/RedundantInitialize
127
- # This is intentionally empty.
126
+ def initialize(name, document)
127
+ # This is intentionally empty, and sets the method signature for subclasses.
128
128
  end
129
129
 
130
130
  ###
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.4
4
+ version: 1.13.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2022-04-11 00:00:00.000000000 Z
23
+ date: 2022-05-08 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mini_portile2
@@ -182,14 +182,20 @@ dependencies:
182
182
  requirements:
183
183
  - - "~>"
184
184
  - !ruby/object:Gem::Version
185
- version: '1.23'
185
+ version: '1.28'
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: 1.28.2
186
189
  type: :development
187
190
  prerelease: false
188
191
  version_requirements: !ruby/object:Gem::Requirement
189
192
  requirements:
190
193
  - - "~>"
191
194
  - !ruby/object:Gem::Version
192
- version: '1.23'
195
+ version: '1.28'
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ version: 1.28.2
193
199
  - !ruby/object:Gem::Dependency
194
200
  name: rubocop-minitest
195
201
  requirement: !ruby/object:Gem::Requirement
@@ -492,9 +498,8 @@ files:
492
498
  - patches/libxml2/0006-update-automake-files-for-arm64.patch
493
499
  - patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch
494
500
  - patches/libxml2/0009-allow-wildcard-namespaces.patch
495
- - patches/libxml2/0010-Revert-Different-approach-to-fix-quadratic-behavior.patch
496
501
  - patches/libxslt/0001-update-automake-files-for-arm64.patch
497
- - ports/archives/libxml2-2.9.13.tar.xz
502
+ - ports/archives/libxml2-2.9.14.tar.xz
498
503
  - ports/archives/libxslt-1.1.35.tar.xz
499
504
  homepage: https://nokogiri.org
500
505
  licenses:
@@ -1,45 +0,0 @@
1
- From ddc5f3d22644e0f6fbcc20541c86825757ffee62 Mon Sep 17 00:00:00 2001
2
- From: Mike Dalessio <mike.dalessio@gmail.com>
3
- Date: Mon, 21 Feb 2022 18:27:45 -0500
4
- Subject: [PATCH] Revert "Different approach to fix quadratic behavior in HTML
5
- push parser"
6
-
7
- This reverts commit 798bdf13f6964a650b9a0b7b4b3a769f6f1d509a.
8
- ---
9
- HTMLparser.c | 14 +-------------
10
- 1 file changed, 1 insertion(+), 13 deletions(-)
11
-
12
- diff --git a/HTMLparser.c b/HTMLparser.c
13
- index eba2d7c..c0b8119 100644
14
- --- a/HTMLparser.c
15
- +++ b/HTMLparser.c
16
- @@ -3960,25 +3960,13 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
17
- htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
18
- "htmlParseStartTag: invalid element name\n",
19
- NULL, NULL);
20
- - /*
21
- - * The recovery code is disabled for now as it can result in
22
- - * quadratic behavior with the push parser. htmlParseStartTag
23
- - * must consume all content up to the final '>' in order to avoid
24
- - * rescanning for this terminator.
25
- - *
26
- - * For a proper fix in line with HTML5, htmlParseStartTag and
27
- - * htmlParseElement should only be called when there's an ASCII
28
- - * alpha character following the initial '<'. Otherwise, the '<'
29
- - * should be emitted as text (unless followed by '!', '/' or '?').
30
- - */
31
- -#if 0
32
- /* if recover preserve text on classic misconstructs */
33
- if ((ctxt->recovery) && ((IS_BLANK_CH(CUR)) || (CUR == '<') ||
34
- (CUR == '=') || (CUR == '>') || (((CUR >= '0') && (CUR <= '9'))))) {
35
- htmlParseCharDataInternal(ctxt, '<');
36
- return(-1);
37
- }
38
- -#endif
39
- +
40
-
41
- /* Dump the bogus tag like browsers do */
42
- while ((CUR != 0) && (CUR != '>') &&
43
- --
44
- 2.31.0
45
-
Binary file