nokogiri 1.11.5 → 1.11.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: 80609ec021e22dd8b9d8b242d454cc5e70d2101239b6cdab98077a596d31d123
4
- data.tar.gz: b539d9c99ad03558986088a6f2d30d50339e06748ab4fd955b6b16d19289f2f5
3
+ metadata.gz: 0cd8509ca6a1609635cf79076efa4d0ccc203d69e8a9ce68f7b4648e5a30c8b4
4
+ data.tar.gz: 171144f295bac5337867370b0b2ade023a697f08c089580d681dd4c9316494da
5
5
  SHA512:
6
- metadata.gz: fb154784e0701fa971219ee9f5bb063ddaed450e7a319838c6a42b1fe56e4ea5e686371e931df36194df0e8c23620ca967e4c7f37fc04ee1a5f22b3757fdee18
7
- data.tar.gz: 108feddcb715f056e823a560a6df65d04a2f818758986409396b3337124d6ac13e3b9b062495e950c7d37080298f3c895d483a2baa75f3d03bcbc3a179d000d9
6
+ metadata.gz: 40876ba4cda6e2191f4380340b4b35d1ac30906818c5a1fcddc7bda1aef767d31deef38683d19dc76560c55627103f481aedeb0b78ef083c7b51e64de0556dbd
7
+ data.tar.gz: 6739c13cbe2a3bab87bc02af7ff8209a60a6ddb30c05cce7a844cd4272937285f6617fb8cfe4def6e4e3fa1bd267b41672507bd682fdc050d6d69f512032458d
@@ -1292,17 +1292,25 @@ get_name(VALUE self)
1292
1292
  * Returns the path associated with this Node
1293
1293
  */
1294
1294
  static VALUE
1295
- path(VALUE self)
1295
+ noko_xml_node_path(VALUE rb_node)
1296
1296
  {
1297
- xmlNodePtr node;
1298
- xmlChar *path ;
1297
+ xmlNodePtr c_node;
1298
+ xmlChar *c_path ;
1299
1299
  VALUE rval;
1300
1300
 
1301
- Data_Get_Struct(self, xmlNode, node);
1301
+ Data_Get_Struct(rb_node, xmlNode, c_node);
1302
+
1303
+ c_path = xmlGetNodePath(c_node);
1304
+ if (c_path == NULL) {
1305
+ // see https://github.com/sparklemotion/nokogiri/issues/2250
1306
+ // this behavior is clearly undesirable, but is what libxml <= 2.9.10 returned, and so we
1307
+ // do this for now to preserve the behavior across libxml2 versions.
1308
+ rval = NOKOGIRI_STR_NEW2("?");
1309
+ } else {
1310
+ rval = NOKOGIRI_STR_NEW2(c_path);
1311
+ xmlFree(c_path);
1312
+ }
1302
1313
 
1303
- path = xmlGetNodePath(node);
1304
- rval = NOKOGIRI_STR_NEW2(path);
1305
- xmlFree(path);
1306
1314
  return rval ;
1307
1315
  }
1308
1316
 
@@ -1779,7 +1787,7 @@ noko_init_xml_node()
1779
1787
  rb_define_method(cNokogiriXmlNode, "next_element", next_element, 0);
1780
1788
  rb_define_method(cNokogiriXmlNode, "previous_element", previous_element, 0);
1781
1789
  rb_define_method(cNokogiriXmlNode, "node_type", node_type, 0);
1782
- rb_define_method(cNokogiriXmlNode, "path", path, 0);
1790
+ rb_define_method(cNokogiriXmlNode, "path", noko_xml_node_path, 0);
1783
1791
  rb_define_method(cNokogiriXmlNode, "key?", key_eh, 1);
1784
1792
  rb_define_method(cNokogiriXmlNode, "namespaced_key?", namespaced_key_eh, 2);
1785
1793
  rb_define_method(cNokogiriXmlNode, "blank?", blank_eh, 0);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Nokogiri
3
3
  # The version of Nokogiri you are using
4
- VERSION = "1.11.5"
4
+ VERSION = "1.11.6"
5
5
  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.11.5
4
+ version: 1.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
- date: 2021-05-20 00:00:00.000000000 Z
20
+ date: 2021-05-26 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: racc