nokogiri 1.13.8 → 1.13.9

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: 57a1be1596b77f21f907091ed4f729cc99bd4807cc8a116fdb2c705ff7be634c
4
- data.tar.gz: e885178e15ae558183b813476584f96c2723a5176e9bbc0d1afcdd94e7c5b02d
3
+ metadata.gz: ae3b5f6cb32585ea5caf7fdc4119cdbfb9fb2c1ef338e732a1a7e199a24a7eea
4
+ data.tar.gz: f95707623e5201074c68d49fb5cbaed6f15d8fd6c73e6a0f5cd3995da1c366ab
5
5
  SHA512:
6
- metadata.gz: 7b46507c07b2eb1e1747ea33a450cf28ebe719966bc394a1a0a25d348b189168cd8c4c75dbe0405dd1f40d386096468119492b96ddd6322a2ce02228a7e62ceb
7
- data.tar.gz: ea9338bde47956061977946250aa4d687cc1e526b99ced6f4413d1a57442390e133646cc0b8c9b7c9f169ecb96695873e4221b07803230dab1fe68420f6650eb
6
+ metadata.gz: 0e2c6b7c3f537da076a47da4e53fb9e2aed0658f9342f6e5de307938d525cd24942cef46ee7f500c144b50d1379ddae669586ff83552ae604f1131955566d572
7
+ data.tar.gz: ef3f5af7bc323c13f4319703363ed6100aa9077fab48e34b2c6e3456b8d4a6d1587a222ac025ee8c714c9262557c820b7df2d1f9f264148f742e7a182b64e1d4
data/dependencies.yml CHANGED
@@ -1,16 +1,16 @@
1
1
  libxml2:
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
2
+ version: "2.10.3"
3
+ sha256: "5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c"
4
+ # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.10/libxml2-2.10.3.sha256sum
5
5
 
6
6
  libxslt:
7
- version: "1.1.35"
8
- sha256: "8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79"
9
- # sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.35.sha256sum
7
+ version: "1.1.37"
8
+ sha256: "3a4b27dc8027ccd6146725950336f1ec520928f320f144eb5fa7990ae6123ab4"
9
+ # sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.37.sha256sum
10
10
 
11
11
  zlib:
12
- version: "1.2.12"
13
- sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9"
12
+ version: "1.2.13"
13
+ sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30"
14
14
  # SHA-256 hash provided on http://zlib.net/
15
15
 
16
16
  libiconv:
@@ -712,9 +712,17 @@ else
712
712
  else
713
713
  class << recipe
714
714
  def configure
715
- cflags = concat_flags(ENV["CFLAGS"], "-fPIC", "-g")
716
- execute("configure",
717
- ["env", "CHOST=#{host}", "CFLAGS=#{cflags}", "./configure", "--static", configure_prefix])
715
+ env = {}
716
+ env["CFLAGS"] = concat_flags(ENV["CFLAGS"], "-fPIC", "-g")
717
+ env["CHOST"] = host
718
+ execute("configure", ["./configure", "--static", configure_prefix], { env: env })
719
+ if darwin?
720
+ # needed as of zlib 1.2.13
721
+ Dir.chdir(work_path) do
722
+ makefile = File.read("Makefile").gsub(/^AR=.*$/, "AR=#{host}-libtool")
723
+ File.open("Makefile", "w") { |m| m.write(makefile) }
724
+ end
725
+ end
718
726
  end
719
727
  end
720
728
  end
@@ -839,6 +847,11 @@ else
839
847
  recipe.configure_options += ["RANLIB=/usr/bin/ranlib", "AR=/usr/bin/ar"]
840
848
  end
841
849
 
850
+ if windows?
851
+ cflags = concat_flags(cflags, "-ULIBXSLT_STATIC", "-DIN_LIBXSLT")
852
+ cflags = concat_flags(cflags, "-ULIBEXSLT_STATIC", "-DIN_LIBEXSLT")
853
+ end
854
+
842
855
  recipe.configure_options << if source_dir
843
856
  "--config-cache"
844
857
  else
@@ -171,6 +171,7 @@ int noko_io_write(void *ctx, char *buffer, int len);
171
171
  int noko_io_close(void *ctx);
172
172
 
173
173
  #define Noko_Node_Get_Struct(obj,type,sval) ((sval) = (type*)DATA_PTR(obj))
174
+ #define Noko_Namespace_Get_Struct(obj,type,sval) ((sval) = (type*)DATA_PTR(obj))
174
175
 
175
176
  VALUE noko_xml_node_wrap(VALUE klass, xmlNodePtr node) ;
176
177
  VALUE noko_xml_node_wrap_node_set_result(xmlNodePtr node, VALUE node_set) ;
@@ -104,7 +104,11 @@ recursively_remove_namespaces_from_node(xmlNodePtr node)
104
104
  (node->type == XML_XINCLUDE_START) ||
105
105
  (node->type == XML_XINCLUDE_END)) &&
106
106
  node->nsDef) {
107
- xmlFreeNsList(node->nsDef);
107
+ xmlNsPtr curr = node->nsDef;
108
+ while (curr) {
109
+ noko_xml_document_pin_namespace(curr, node->doc);
110
+ curr = curr->next;
111
+ }
108
112
  node->nsDef = NULL;
109
113
  }
110
114
 
@@ -25,13 +25,15 @@
25
25
  VALUE cNokogiriXmlNamespace ;
26
26
 
27
27
  static void
28
- dealloc_namespace(xmlNsPtr ns)
28
+ _xml_namespace_dealloc(void *ptr)
29
29
  {
30
30
  /*
31
31
  * this deallocator is only used for namespace nodes that are part of an xpath
32
32
  * node set. see noko_xml_namespace_wrap().
33
33
  */
34
+ xmlNsPtr ns = ptr;
34
35
  NOKOGIRI_DEBUG_START(ns) ;
36
+
35
37
  if (ns->href) {
36
38
  xmlFree(DISCARD_CONST_QUAL_XMLCHAR(ns->href));
37
39
  }
@@ -42,6 +44,36 @@ dealloc_namespace(xmlNsPtr ns)
42
44
  NOKOGIRI_DEBUG_END(ns) ;
43
45
  }
44
46
 
47
+ #ifdef HAVE_RB_GC_LOCATION
48
+ static void
49
+ _xml_namespace_update_references(void *ptr)
50
+ {
51
+ xmlNsPtr ns = ptr;
52
+ if (ns->_private) {
53
+ ns->_private = (void *)rb_gc_location((VALUE)ns->_private);
54
+ }
55
+ }
56
+ #else
57
+ # define _xml_namespace_update_references 0
58
+ #endif
59
+
60
+ static const rb_data_type_t nokogiri_xml_namespace_type_with_dealloc = {
61
+ "Nokogiri/XMLNamespace/WithDealloc",
62
+ {0, _xml_namespace_dealloc, 0, _xml_namespace_update_references},
63
+ 0, 0,
64
+ #ifdef RUBY_TYPED_FREE_IMMEDIATELY
65
+ RUBY_TYPED_FREE_IMMEDIATELY,
66
+ #endif
67
+ };
68
+
69
+ static const rb_data_type_t nokogiri_xml_namespace_type_without_dealloc = {
70
+ "Nokogiri/XMLNamespace/WithoutDealloc",
71
+ {0, 0, 0, _xml_namespace_update_references},
72
+ 0, 0,
73
+ #ifdef RUBY_TYPED_FREE_IMMEDIATELY
74
+ RUBY_TYPED_FREE_IMMEDIATELY,
75
+ #endif
76
+ };
45
77
 
46
78
  /*
47
79
  * call-seq:
@@ -54,7 +86,7 @@ prefix(VALUE self)
54
86
  {
55
87
  xmlNsPtr ns;
56
88
 
57
- Data_Get_Struct(self, xmlNs, ns);
89
+ Noko_Namespace_Get_Struct(self, xmlNs, ns);
58
90
  if (!ns->prefix) { return Qnil; }
59
91
 
60
92
  return NOKOGIRI_STR_NEW2(ns->prefix);
@@ -71,7 +103,7 @@ href(VALUE self)
71
103
  {
72
104
  xmlNsPtr ns;
73
105
 
74
- Data_Get_Struct(self, xmlNs, ns);
106
+ Noko_Namespace_Get_Struct(self, xmlNs, ns);
75
107
  if (!ns->href) { return Qnil; }
76
108
 
77
109
  return NOKOGIRI_STR_NEW2(ns->href);
@@ -87,14 +119,18 @@ noko_xml_namespace_wrap(xmlNsPtr c_namespace, xmlDocPtr c_document)
87
119
  }
88
120
 
89
121
  if (c_document) {
90
- rb_namespace = Data_Wrap_Struct(cNokogiriXmlNamespace, 0, 0, c_namespace);
122
+ rb_namespace = TypedData_Wrap_Struct(cNokogiriXmlNamespace,
123
+ &nokogiri_xml_namespace_type_without_dealloc,
124
+ c_namespace);
91
125
 
92
126
  if (DOC_RUBY_OBJECT_TEST(c_document)) {
93
127
  rb_iv_set(rb_namespace, "@document", DOC_RUBY_OBJECT(c_document));
94
128
  rb_ary_push(DOC_NODE_CACHE(c_document), rb_namespace);
95
129
  }
96
130
  } else {
97
- rb_namespace = Data_Wrap_Struct(cNokogiriXmlNamespace, 0, dealloc_namespace, c_namespace);
131
+ rb_namespace = TypedData_Wrap_Struct(cNokogiriXmlNamespace,
132
+ &nokogiri_xml_namespace_type_with_dealloc,
133
+ c_namespace);
98
134
  }
99
135
 
100
136
  c_namespace->_private = (void *)rb_namespace;
@@ -1353,7 +1353,7 @@ set_namespace(VALUE self, VALUE namespace)
1353
1353
  Noko_Node_Get_Struct(self, xmlNode, node);
1354
1354
 
1355
1355
  if (!NIL_P(namespace)) {
1356
- Data_Get_Struct(namespace, xmlNs, ns);
1356
+ Noko_Namespace_Get_Struct(namespace, xmlNs, ns);
1357
1357
  }
1358
1358
 
1359
1359
  xmlSetNs(node, ns);
@@ -373,7 +373,10 @@ new (VALUE klass, VALUE nodeobj)
373
373
 
374
374
  Noko_Node_Get_Struct(nodeobj, xmlNode, node);
375
375
 
376
+ #if LIBXML_VERSION < 21000
377
+ /* deprecated in 40483d0 */
376
378
  xmlXPathInit();
379
+ #endif
377
380
 
378
381
  ctx = xmlXPathNewContext(node->doc);
379
382
  ctx->node = node;
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nokogiri
4
4
  # The version of Nokogiri you are using
5
- VERSION = "1.13.8"
5
+ VERSION = "1.13.9"
6
6
  end
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.8
4
+ version: 1.13.9
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-07-23 00:00:00.000000000 Z
23
+ date: 2022-10-18 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mini_portile2
@@ -487,14 +487,11 @@ files:
487
487
  - patches/libxml2/0001-Remove-script-macro-support.patch
488
488
  - patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
489
489
  - patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
490
- - patches/libxml2/0004-use-glibc-strlen.patch
491
490
  - patches/libxml2/0005-avoid-isnan-isinf.patch
492
- - patches/libxml2/0006-update-automake-files-for-arm64.patch
493
- - patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch
494
491
  - patches/libxml2/0009-allow-wildcard-namespaces.patch
495
492
  - patches/libxslt/0001-update-automake-files-for-arm64.patch
496
- - ports/archives/libxml2-2.9.14.tar.xz
497
- - ports/archives/libxslt-1.1.35.tar.xz
493
+ - ports/archives/libxml2-2.10.3.tar.xz
494
+ - ports/archives/libxslt-1.1.37.tar.xz
498
495
  homepage: https://nokogiri.org
499
496
  licenses:
500
497
  - MIT
@@ -1,53 +0,0 @@
1
- From c94172d2a4451368530db2186190d70be8a1d9e5 Mon Sep 17 00:00:00 2001
2
- From: Ilya Zub <ilya@serpapi.com>
3
- Date: Wed, 23 Dec 2020 12:45:29 +0200
4
- Subject: Use glibc strlen to speed up xmlStrlen
5
- MIME-Version: 1.0
6
- Content-Type: text/plain; charset=UTF-8
7
- Content-Transfer-Encoding: 8bit
8
-
9
- xmlStrlen (entire HTML file): 926171.936981 μs
10
- glibc_xmlStrlen (entire HTML file): 36905.903992 μs
11
- delta (xmlStrlen ÷ glibc_xmlStrlen): 25.094584 times
12
-
13
- xmlStrlen (average string): 57479.204010 μs
14
- glibc_xmlStrlen (average string): 5802.069000 μs
15
- delta (xmlStrlen ÷ glibc_xmlStrlen): 9.905937 times
16
-
17
- xmlStrlen (bigger string): 388056.315979 μs
18
- glibc_xmlStrlen (bigger string): 12797.856995 μs
19
- delta (xmlStrlen ÷ glibc_xmlStrlen): 30.318382 times
20
-
21
- xmlStrlen (smallest string): 15870.046021 μs
22
- glibc_xmlStrlen (smallest string): 6282.208984 μs
23
- delta (xmlStrlen ÷ glibc_xmlStrlen): 2.527903 times
24
-
25
- See https://gitlab.gnome.org/GNOME/libxml2/-/issues/212 for reference.
26
- ---
27
- xmlstring.c | 9 ++-------
28
- 1 file changed, 2 insertions(+), 7 deletions(-)
29
-
30
- diff --git a/xmlstring.c b/xmlstring.c
31
- index e8a1e45d..df247dff 100644
32
- --- a/xmlstring.c
33
- +++ b/xmlstring.c
34
- @@ -423,12 +423,7 @@ xmlStrsub(const xmlChar *str, int start, int len) {
35
-
36
- int
37
- xmlStrlen(const xmlChar *str) {
38
- - size_t len = 0;
39
- -
40
- if (str == NULL) return(0);
41
- - while (*str != 0) { /* non input consuming */
42
- - str++;
43
- - len++;
44
- - }
45
- - return(len > INT_MAX ? 0 : len);
46
- +
47
- + return strlen((const char*)str);
48
- }
49
-
50
- /**
51
- --
52
- 2.29.2
53
-