nokogiri 1.5.3.rc4 → 1.5.3.rc5

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.

@@ -2,11 +2,15 @@
2
2
 
3
3
  * Features
4
4
 
5
- * Support for "prefixless" CSS selectors ~, > and + like jQuery supports. #621, #623. (Thanks, David Lee!)
5
+ * Support for "prefixless" CSS selectors ~, > and + like jQuery
6
+ supports. #621, #623. (Thanks, David Lee!)
7
+ * Attempting to improve installation on homebrew 0.9 (with regards
8
+ to iconv). Isn't package management convenient?
6
9
 
7
10
  * Bugfixes
8
11
 
9
- * Custom xpath functions with empty nodeset arguments cause a segfault. #634.
12
+ * Custom xpath functions with empty nodeset arguments cause a
13
+ segfault. #634.
10
14
  * Nokogiri::XML::Node#css now works for XML documents with default
11
15
  namespaces when the rule contains attribute selector without
12
16
  namespace.
@@ -14,9 +18,13 @@
14
18
  returned from) XSLT custom xpath functions. #640.
15
19
  * Nokogiri::XML::Reader#outer_xml がJRubyで正しく動作しない #617
16
20
  * Nokogiri::XML::Attribute が JRuby 上で nil namespace を返す #647
17
- * Nokogiri::XML::Node#namespace= メソッドが JRuby 上で prefix が無い namespace を設定できない #648
21
+ * Nokogiri::XML::Node#namespace= メソッドが JRuby 上で prefix
22
+  が無い namespace を設定できない #648
18
23
  * JRuby 1.9 モードで rake を実行するとデッドロックを引き起こす #571
19
- * HTML::Document#meta_encoding does not raise exception on docs with malformed content-type. #655
24
+ * HTML::Document#meta_encoding does not raise exception on docs with
25
+ malformed content-type. #655
26
+ * Fixing segfault related to unsupported encodings in in-context
27
+ parsing on 1.8.7. #643
20
28
 
21
29
 
22
30
  == 1.5.2 / 2012-03-09
@@ -2,11 +2,15 @@
2
2
 
3
3
  * Features
4
4
 
5
- * Support for "prefixless" CSS selectors ~, > and + like jQuery supports. #621, #623. (Thanks, David Lee!)
5
+ * Support for "prefixless" CSS selectors ~, > and + like jQuery
6
+ supports. #621, #623. (Thanks, David Lee!)
7
+ * Attempting to improve installation on homebrew 0.9 (with regards
8
+ to iconv). Isn't package management convenient?
6
9
 
7
10
  * Bugfixes
8
11
 
9
- * Custom xpath functions with empty nodeset arguments cause a segfault. #634.
12
+ * Custom xpath functions with empty nodeset arguments cause a
13
+ segfault. #634.
10
14
  * Nokogiri::XML::Node#css now works for XML documents with default
11
15
  namespaces when the rule contains attribute selector without
12
16
  namespace.
@@ -14,9 +18,13 @@
14
18
  returned from) XSLT custom xpath functions. #640.
15
19
  * Nokogiri::XML::Reader#outer_xml is broken in JRuby #617
16
20
  * Nokogiri::XML::Attribute on JRuby returns a nil namespace #647
17
- * Nokogiri::XML::Node#namespace= cannot set a namespace without a prefix on JRuby #648
21
+ * Nokogiri::XML::Node#namespace= cannot set a namespace without a
22
+ prefix on JRuby #648
18
23
  * JRuby 1.9 mode causes dead lock while running rake #571
19
- * HTML::Document#meta_encoding does not raise exception on docs with malformed content-type. #655
24
+ * HTML::Document#meta_encoding does not raise exception on docs with
25
+ malformed content-type. #655
26
+ * Fixing segfault related to unsupported encodings in in-context
27
+ parsing on 1.8.7. #643
20
28
 
21
29
 
22
30
  == 1.5.2 / 2012-03-09
data/ROADMAP.md CHANGED
@@ -62,9 +62,9 @@
62
62
 
63
63
  ## Encoding
64
64
 
65
- We have a lot of issues open around encoding. Is this really an issue?
66
- Somebody who knows something about encoding, and cares, should point
67
- this one.
65
+ We have a lot of issues open around encoding. How bad are things?
66
+ Would it help if we deprecated support for Ruby 1.8.7? Somebody who
67
+ knows encoding well should head this up.
68
68
 
69
69
  * Extract EncodingReader as a real object that can be injected
70
70
  https://groups.google.com/forum/#!msg/nokogiri-talk/arJeAtMqvkg/tGihB-iBRSAJ
@@ -104,7 +104,7 @@ pkg_config('libxslt') if RUBY_PLATFORM =~ /mingw/
104
104
  asplode "libxml2" unless find_header('libxml/parser.h')
105
105
  asplode "libxslt" unless find_header('libxslt/xslt.h')
106
106
  asplode "libexslt" unless find_header('libexslt/exslt.h')
107
- asplode "libiconv" unless have_func('iconv_open', 'iconv.h') or have_library('iconv', 'iconv_open', 'iconv.h')
107
+ asplode "libiconv" unless have_func('iconv_open', 'iconv.h') or have_library('iconv', 'iconv_open', 'iconv.h') or find_library('iconv', 'iconv_open', 'iconv.h')
108
108
  asplode "libxml2" unless find_library("#{lib_prefix}xml2", 'xmlParseDoc')
109
109
  asplode "libxslt" unless find_library("#{lib_prefix}xslt", 'xsltParseStylesheetDoc')
110
110
  asplode "libexslt" unless find_library("#{lib_prefix}exslt", 'exsltFuncRegister')
@@ -1219,7 +1219,7 @@ static VALUE process_xincludes(VALUE self, VALUE options)
1219
1219
  /* TODO: DOCUMENT ME */
1220
1220
  static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1221
1221
  {
1222
- xmlNodePtr node, list, child_iter, tmp, node_children, doc_children;
1222
+ xmlNodePtr node, list = 0, child_iter, node_children, doc_children;
1223
1223
  xmlNodeSetPtr set;
1224
1224
  xmlParserErrors error;
1225
1225
  VALUE doc, err;
@@ -1257,8 +1257,8 @@ static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1257
1257
  * is because if there were errors, it's possible for the child pointers
1258
1258
  * to be manipulated. */
1259
1259
  if (error != XML_ERR_OK) {
1260
- node->doc->children = doc_children;
1261
- node->children = node_children;
1260
+ node->doc->children = doc_children;
1261
+ node->children = node_children;
1262
1262
  }
1263
1263
 
1264
1264
  /* make sure parent/child pointers are coherent so an unlink will work
@@ -1266,9 +1266,9 @@ static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1266
1266
  */
1267
1267
  child_iter = node->doc->children ;
1268
1268
  while (child_iter) {
1269
- if (child_iter->parent != (xmlNodePtr)node->doc)
1270
- child_iter->parent = (xmlNodePtr)node->doc;
1271
- child_iter = child_iter->next;
1269
+ if (child_iter->parent != (xmlNodePtr)node->doc)
1270
+ child_iter->parent = (xmlNodePtr)node->doc;
1271
+ child_iter = child_iter->next;
1272
1272
  }
1273
1273
 
1274
1274
  #ifndef HTML_PARSE_NOIMPLIED
@@ -1285,12 +1285,12 @@ static VALUE in_context(VALUE self, VALUE _str, VALUE _options)
1285
1285
  * https://bugzilla.gnome.org/show_bug.cgi?id=668155
1286
1286
  */
1287
1287
  if (error != XML_ERR_OK && doc_is_empty && node->doc->children != NULL) {
1288
- tmp = node;
1289
- while (tmp->parent)
1290
- tmp = tmp->parent;
1288
+ child_iter = node;
1289
+ while (child_iter->parent)
1290
+ child_iter = child_iter->parent;
1291
1291
 
1292
- if (tmp->type == XML_DOCUMENT_FRAG_NODE)
1293
- node->doc->children = NULL;
1292
+ if (child_iter->type == XML_DOCUMENT_FRAG_NODE)
1293
+ node->doc->children = NULL;
1294
1294
  }
1295
1295
 
1296
1296
  /* FIXME: This probably needs to handle more constants... */
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = '1.5.3.rc4'
3
+ VERSION = '1.5.3.rc5'
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -176,15 +176,34 @@ module Nokogiri
176
176
  assert fragment.children.respond_to?(:awesome!), fragment.children.class
177
177
  end
178
178
 
179
- def test_for_libxml_in_context_fragment_parsing_bug_workaround
180
- 10.times do
181
- begin
182
- fragment = Nokogiri::XML.fragment("<div></div>")
183
- parent = fragment.children.first
184
- child = parent.parse("<h1></h1>").first
185
- parent.add_child child
179
+ if Nokogiri.uses_libxml?
180
+ def test_for_libxml_in_context_fragment_parsing_bug_workaround
181
+ 10.times do
182
+ begin
183
+ fragment = Nokogiri::XML.fragment("<div></div>")
184
+ parent = fragment.children.first
185
+ child = parent.parse("<h1></h1>").first
186
+ parent.add_child child
187
+ end
188
+ GC.start
186
189
  end
187
- GC.start
190
+ end
191
+
192
+ def test_for_libxml_in_context_memory_badness_when_encountering_encoding_errors
193
+ # see issue #643 for background
194
+ # this test exists solely to raise an error during valgrind test runs.
195
+ html = <<-EOHTML
196
+ <html>
197
+ <head>
198
+ <meta http-equiv="Content-Type" content="text/html; charset=shizzle" />
199
+ </head>
200
+ <body>
201
+ <div>Foo</div>
202
+ </body>
203
+ </html>
204
+ EOHTML
205
+ doc = Nokogiri::HTML html
206
+ doc.at_css("div").replace("Bar")
188
207
  end
189
208
  end
190
209
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- hash: -2787530160
4
+ hash: 3772353977
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
9
  - 3
10
10
  - rc
11
- - 4
12
- version: 1.5.3.rc4
11
+ - 5
12
+ version: 1.5.3.rc5
13
13
  platform: ruby
14
14
  authors:
15
15
  - Aaron Patterson