nokogiri 1.11.1 → 1.11.2
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 +4 -4
- data/LICENSE-DEPENDENCIES.md +12 -12
- data/LICENSE.md +1 -1
- data/README.md +20 -15
- data/ext/nokogiri/depend +34 -474
- data/ext/nokogiri/extconf.rb +253 -183
- data/ext/nokogiri/html_document.c +10 -15
- data/ext/nokogiri/html_element_description.c +84 -71
- data/ext/nokogiri/html_entity_lookup.c +21 -16
- data/ext/nokogiri/html_sax_parser_context.c +66 -65
- data/ext/nokogiri/html_sax_push_parser.c +29 -27
- data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
- data/ext/nokogiri/nokogiri.c +171 -63
- data/ext/nokogiri/nokogiri.h +158 -75
- data/ext/nokogiri/test_global_handlers.c +3 -4
- data/ext/nokogiri/xml_attr.c +15 -15
- data/ext/nokogiri/xml_attribute_decl.c +18 -18
- data/ext/nokogiri/xml_cdata.c +13 -18
- data/ext/nokogiri/xml_comment.c +19 -26
- data/ext/nokogiri/xml_document.c +221 -164
- data/ext/nokogiri/xml_document_fragment.c +13 -15
- data/ext/nokogiri/xml_dtd.c +54 -48
- data/ext/nokogiri/xml_element_content.c +30 -27
- data/ext/nokogiri/xml_element_decl.c +22 -22
- data/ext/nokogiri/xml_encoding_handler.c +17 -11
- data/ext/nokogiri/xml_entity_decl.c +32 -30
- data/ext/nokogiri/xml_entity_reference.c +16 -18
- data/ext/nokogiri/xml_namespace.c +56 -49
- data/ext/nokogiri/xml_node.c +338 -286
- data/ext/nokogiri/xml_node_set.c +168 -156
- data/ext/nokogiri/xml_processing_instruction.c +17 -19
- data/ext/nokogiri/xml_reader.c +191 -157
- data/ext/nokogiri/xml_relax_ng.c +29 -23
- data/ext/nokogiri/xml_sax_parser.c +117 -112
- data/ext/nokogiri/xml_sax_parser_context.c +100 -85
- data/ext/nokogiri/xml_sax_push_parser.c +34 -27
- data/ext/nokogiri/xml_schema.c +48 -42
- data/ext/nokogiri/xml_syntax_error.c +21 -23
- data/ext/nokogiri/xml_text.c +13 -17
- data/ext/nokogiri/xml_xpath_context.c +134 -127
- data/ext/nokogiri/xslt_stylesheet.c +157 -157
- data/lib/nokogiri.rb +1 -22
- data/lib/nokogiri/css/parser.rb +1 -1
- data/lib/nokogiri/extension.rb +26 -0
- data/lib/nokogiri/html/document_fragment.rb +15 -15
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/version/info.rb +31 -8
- data/lib/nokogiri/xml/document.rb +31 -11
- data/lib/nokogiri/xml/node.rb +38 -42
- data/lib/nokogiri/xml/reader.rb +2 -9
- data/lib/nokogiri/xml/xpath.rb +1 -3
- data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -1
- data/patches/libxml2/0010-parser.c-shrink-the-input-buffer-when-appropriate.patch +70 -0
- metadata +8 -41
- data/ext/nokogiri/html_document.h +0 -10
- data/ext/nokogiri/html_element_description.h +0 -10
- data/ext/nokogiri/html_entity_lookup.h +0 -8
- data/ext/nokogiri/html_sax_parser_context.h +0 -11
- data/ext/nokogiri/html_sax_push_parser.h +0 -9
- data/ext/nokogiri/xml_attr.h +0 -9
- data/ext/nokogiri/xml_attribute_decl.h +0 -9
- data/ext/nokogiri/xml_cdata.h +0 -9
- data/ext/nokogiri/xml_comment.h +0 -9
- data/ext/nokogiri/xml_document.h +0 -23
- data/ext/nokogiri/xml_document_fragment.h +0 -10
- data/ext/nokogiri/xml_dtd.h +0 -10
- data/ext/nokogiri/xml_element_content.h +0 -10
- data/ext/nokogiri/xml_element_decl.h +0 -9
- data/ext/nokogiri/xml_encoding_handler.h +0 -8
- data/ext/nokogiri/xml_entity_decl.h +0 -10
- data/ext/nokogiri/xml_entity_reference.h +0 -9
- data/ext/nokogiri/xml_io.c +0 -63
- data/ext/nokogiri/xml_io.h +0 -11
- data/ext/nokogiri/xml_libxml2_hacks.c +0 -112
- data/ext/nokogiri/xml_libxml2_hacks.h +0 -12
- data/ext/nokogiri/xml_namespace.h +0 -14
- data/ext/nokogiri/xml_node.h +0 -13
- data/ext/nokogiri/xml_node_set.h +0 -12
- data/ext/nokogiri/xml_processing_instruction.h +0 -9
- data/ext/nokogiri/xml_reader.h +0 -10
- data/ext/nokogiri/xml_relax_ng.h +0 -9
- data/ext/nokogiri/xml_sax_parser.h +0 -39
- data/ext/nokogiri/xml_sax_parser_context.h +0 -10
- data/ext/nokogiri/xml_sax_push_parser.h +0 -9
- data/ext/nokogiri/xml_schema.h +0 -9
- data/ext/nokogiri/xml_syntax_error.h +0 -25
- data/ext/nokogiri/xml_text.h +0 -9
- data/ext/nokogiri/xml_xpath_context.h +0 -10
- data/ext/nokogiri/xslt_stylesheet.h +0 -14
@@ -4,26 +4,26 @@ module Nokogiri
|
|
4
4
|
class DocumentFragment < Nokogiri::XML::DocumentFragment
|
5
5
|
####
|
6
6
|
# Create a Nokogiri::XML::DocumentFragment from +tags+, using +encoding+
|
7
|
-
def self.parse
|
7
|
+
def self.parse(tags, encoding = nil)
|
8
8
|
doc = HTML::Document.new
|
9
9
|
|
10
10
|
encoding ||= if tags.respond_to?(:encoding)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
encoding = tags.encoding
|
12
|
+
if encoding == ::Encoding::ASCII_8BIT
|
13
|
+
'UTF-8'
|
14
|
+
else
|
15
|
+
encoding.name
|
16
|
+
end
|
17
|
+
else
|
18
|
+
'UTF-8'
|
19
|
+
end
|
20
20
|
|
21
21
|
doc.encoding = encoding
|
22
22
|
|
23
23
|
new(doc, tags)
|
24
24
|
end
|
25
25
|
|
26
|
-
def initialize
|
26
|
+
def initialize(document, tags = nil, ctx = nil)
|
27
27
|
return self unless tags
|
28
28
|
|
29
29
|
if ctx
|
@@ -33,13 +33,13 @@ module Nokogiri
|
|
33
33
|
self.errors = document.errors - preexisting_errors
|
34
34
|
else
|
35
35
|
# This is a horrible hack, but I don't care
|
36
|
-
|
37
|
-
|
36
|
+
path = if /^\s*?<body/i.match?(tags)
|
37
|
+
"/html/body"
|
38
38
|
else
|
39
|
-
|
39
|
+
"/html/body/node()"
|
40
40
|
end
|
41
41
|
|
42
|
-
temp_doc = HTML::Document.parse
|
42
|
+
temp_doc = HTML::Document.parse("<html><body>#{tags}", nil, document.encoding)
|
43
43
|
temp_doc.xpath(path).each { |child| child.parent = self }
|
44
44
|
self.errors = temp_doc.errors
|
45
45
|
end
|
@@ -10,6 +10,14 @@ module Nokogiri
|
|
10
10
|
::JRUBY_VERSION if ::RUBY_PLATFORM == "java"
|
11
11
|
end
|
12
12
|
|
13
|
+
def windows?
|
14
|
+
::RUBY_PLATFORM =~ /mingw|mswin/
|
15
|
+
end
|
16
|
+
|
17
|
+
def ruby_minor
|
18
|
+
Gem::Version.new(::RUBY_VERSION).segments[0..1].join(".")
|
19
|
+
end
|
20
|
+
|
13
21
|
def engine
|
14
22
|
defined?(::RUBY_ENGINE) ? ::RUBY_ENGINE : "mri"
|
15
23
|
end
|
@@ -74,18 +82,38 @@ module Nokogiri
|
|
74
82
|
|
75
83
|
def to_hash
|
76
84
|
header_directory = File.expand_path(File.join(File.dirname(__FILE__), "../../../ext/nokogiri"))
|
85
|
+
|
77
86
|
{}.tap do |vi|
|
78
87
|
vi["warnings"] = []
|
79
88
|
vi["nokogiri"] = {}.tap do |nokogiri|
|
80
89
|
nokogiri["version"] = Nokogiri::VERSION
|
81
90
|
|
82
91
|
unless jruby?
|
92
|
+
# enable gems like nokogumbo to build with the following in their extconf.rb:
|
93
|
+
#
|
94
|
+
# append_cflags(Nokogiri::VERSION_INFO["nokogiri"]["cppflags"])
|
95
|
+
# append_ldflags(Nokogiri::VERSION_INFO["nokogiri"]["ldflags"])
|
96
|
+
#
|
83
97
|
cppflags = ["-I#{header_directory.shellescape}"]
|
98
|
+
ldflags = []
|
99
|
+
|
84
100
|
if libxml2_using_packaged?
|
85
|
-
cppflags << "-I#{File.join(header_directory,
|
86
|
-
cppflags << "-I#{File.join(header_directory,
|
101
|
+
cppflags << "-I#{File.join(header_directory, 'include').shellescape}"
|
102
|
+
cppflags << "-I#{File.join(header_directory, 'include/libxml2').shellescape}"
|
103
|
+
|
104
|
+
if windows?
|
105
|
+
# on windows, nokogumbo needs to link against nokogiri.so to resolve symbols. see #2167
|
106
|
+
lib_directory = File.expand_path(File.join(File.dirname(__FILE__), "../#{ruby_minor}"))
|
107
|
+
unless File.exist?(lib_directory)
|
108
|
+
lib_directory = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
109
|
+
end
|
110
|
+
ldflags << "-L#{lib_directory.shellescape}"
|
111
|
+
ldflags << "-l:nokogiri.so"
|
112
|
+
end
|
87
113
|
end
|
114
|
+
|
88
115
|
nokogiri["cppflags"] = cppflags
|
116
|
+
nokogiri["ldflags"] = ldflags
|
89
117
|
end
|
90
118
|
end
|
91
119
|
vi["ruby"] = {}.tap do |ruby|
|
@@ -170,12 +198,7 @@ module Nokogiri
|
|
170
198
|
if Nokogiri.jruby?
|
171
199
|
require "nokogiri/jruby/dependencies"
|
172
200
|
end
|
173
|
-
|
174
|
-
::RUBY_VERSION =~ /(\d+\.\d+)/
|
175
|
-
require "nokogiri/#{Regexp.last_match(1)}/nokogiri"
|
176
|
-
rescue LoadError
|
177
|
-
require "nokogiri/nokogiri"
|
178
|
-
end
|
201
|
+
require "nokogiri/extension"
|
179
202
|
|
180
203
|
# More complete version information about libxml
|
181
204
|
VERSION_INFO = VersionInfo.instance.to_hash
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'pathname'
|
@@ -79,6 +80,35 @@ module Nokogiri
|
|
79
80
|
return doc
|
80
81
|
end
|
81
82
|
|
83
|
+
##
|
84
|
+
# @!method wrap(java_document)
|
85
|
+
# @!scope class
|
86
|
+
#
|
87
|
+
# Create a {Document} using an existing Java DOM document object.
|
88
|
+
#
|
89
|
+
# The returned {Document} shares the same underlying data structure as the Java object, so
|
90
|
+
# changes in one are reflected in the other.
|
91
|
+
#
|
92
|
+
# @param java_document [Java::OrgW3cDom::Document]
|
93
|
+
# @return [Nokogiri::XML::Document]
|
94
|
+
# @note This method is only available when running JRuby.
|
95
|
+
# @note The class +Java::OrgW3cDom::Document+ is also accessible as +org.w3c.dom.Document+.
|
96
|
+
# @see #to_java
|
97
|
+
|
98
|
+
##
|
99
|
+
# @!method to_java()
|
100
|
+
#
|
101
|
+
# Returns the underlying Java DOM document object for the {Document}.
|
102
|
+
#
|
103
|
+
# The returned Java object shares the same underlying data structure as the {Document}, so
|
104
|
+
# changes in one are reflected in the other.
|
105
|
+
#
|
106
|
+
# @return [Java::OrgW3cDom::Document]
|
107
|
+
# @note This method is only available when running JRuby.
|
108
|
+
# @note The class +Java::OrgW3cDom::Document+ is also accessible as +org.w3c.dom.Document+.
|
109
|
+
# @see .wrap
|
110
|
+
|
111
|
+
|
82
112
|
# A list of Nokogiri::XML::SyntaxError found when parsing a document
|
83
113
|
attr_accessor :errors
|
84
114
|
|
@@ -262,24 +292,14 @@ module Nokogiri
|
|
262
292
|
end
|
263
293
|
alias :<< :add_child
|
264
294
|
|
265
|
-
##
|
266
|
-
# +JRuby+
|
267
|
-
# Wraps Java's org.w3c.dom.document and returns Nokogiri::XML::Document
|
268
|
-
def self.wrap(document) end if false # native-ext provides Document.wrap
|
269
|
-
|
270
|
-
##
|
271
|
-
# +JRuby+
|
272
|
-
# Returns Java's org.w3c.dom.document of this Document.
|
273
|
-
def to_java; end if false # JRuby provides #to_java
|
274
|
-
|
275
295
|
private
|
296
|
+
|
276
297
|
def self.empty_doc? string_or_io
|
277
298
|
string_or_io.nil? ||
|
278
299
|
(string_or_io.respond_to?(:empty?) && string_or_io.empty?) ||
|
279
300
|
(string_or_io.respond_to?(:eof?) && string_or_io.eof?)
|
280
301
|
end
|
281
302
|
|
282
|
-
# @private
|
283
303
|
IMPLIED_XPATH_CONTEXTS = [ '//'.freeze ].freeze # :nodoc:
|
284
304
|
|
285
305
|
def inspect_attributes
|
data/lib/nokogiri/xml/node.rb
CHANGED
@@ -5,64 +5,54 @@ require "nokogiri/xml/node/save_options"
|
|
5
5
|
|
6
6
|
module Nokogiri
|
7
7
|
module XML
|
8
|
-
|
9
|
-
# Nokogiri::XML::Node is your window to the fun filled world of dealing
|
10
|
-
#
|
11
|
-
#
|
8
|
+
##
|
9
|
+
# {Nokogiri::XML::Node} is your window to the fun filled world of dealing with XML and HTML
|
10
|
+
# tags. A {Nokogiri::XML::Node} may be treated similarly to a hash with regard to attributes. For
|
11
|
+
# example:
|
12
12
|
#
|
13
|
-
#
|
14
|
-
# => <a href
|
15
|
-
#
|
16
|
-
# => "
|
17
|
-
#
|
18
|
-
# =>
|
19
|
-
#
|
20
|
-
# => ["#foo", "link"]
|
21
|
-
# irb(main):008:0> node['class'] = 'green'
|
22
|
-
# => "green"
|
23
|
-
# irb(main):009:0> node
|
24
|
-
# => <a href="#foo" id="link" class="green">link</a>
|
25
|
-
# irb(main):010:0>
|
13
|
+
# node = Nokogiri::XML::DocumentFragment.parse("<a href='#foo' id='link'>link</a>").at_css("a")
|
14
|
+
# node.to_html # => "<a href=\"#foo\" id=\"link\">link</a>"
|
15
|
+
# node['href'] # => "#foo"
|
16
|
+
# node.keys # => ["href", "id"]
|
17
|
+
# node.values # => ["#foo", "link"]
|
18
|
+
# node['class'] = 'green' # => "green"
|
19
|
+
# node.to_html # => "<a href=\"#foo\" id=\"link\" class=\"green\">link</a>"
|
26
20
|
#
|
27
|
-
# See
|
21
|
+
# See the method group entitled "Working With Node Attributes" for the full set of methods.
|
28
22
|
#
|
29
|
-
# Nokogiri::XML::Node also has methods that let you move around your
|
23
|
+
# {Nokogiri::XML::Node} also has methods that let you move around your
|
30
24
|
# tree. For navigating your tree, see:
|
31
25
|
#
|
32
|
-
# *
|
33
|
-
# *
|
34
|
-
# *
|
35
|
-
# *
|
36
|
-
#
|
26
|
+
# * {#parent}
|
27
|
+
# * {#children}
|
28
|
+
# * {#next}
|
29
|
+
# * {#previous}
|
37
30
|
#
|
38
31
|
# When printing or otherwise emitting a document or a node (and
|
39
32
|
# its subtree), there are a few methods you might want to use:
|
40
33
|
#
|
41
|
-
# * content, text, inner_text, to_str: emit plaintext
|
42
|
-
#
|
43
|
-
#
|
44
|
-
# document, meaning that entities will be replaced (e.g., "<"
|
45
|
-
# will be replaced with "<"), meaning that any sanitizing will
|
46
|
-
# likely be un-done in the output.
|
34
|
+
# * {#content}, {#text}, {#inner_text}, {#to_str}: These methods will all <b>emit plaintext</b>,
|
35
|
+
# meaning that entities will be replaced (e.g., "<" will be replaced with "<"), meaning
|
36
|
+
# that any sanitizing will likely be un-done in the output.
|
47
37
|
#
|
48
|
-
# * to_s, to_xml, to_html, inner_html:
|
38
|
+
# * {#to_s}, {#to_xml}, {#to_html}, {#inner_html}: These methods will all <b>emit
|
39
|
+
# properly-escaped markup</b>, meaning that it's suitable for consumption by browsers,
|
40
|
+
# parsers, etc.
|
49
41
|
#
|
50
|
-
#
|
51
|
-
# that it's suitable for consumption by browsers, parsers, etc.
|
42
|
+
# You may search this node's subtree using {#xpath} and {#css}
|
52
43
|
#
|
53
|
-
# You may search this node's subtree using Searchable#xpath and Searchable#css
|
54
44
|
class Node
|
55
45
|
include Nokogiri::XML::PP::Node
|
56
46
|
include Nokogiri::XML::Searchable
|
57
47
|
include Enumerable
|
58
48
|
|
59
|
-
# Element node type, see Nokogiri::XML::Node#element?
|
49
|
+
# Element node type, see {Nokogiri::XML::Node#element?}
|
60
50
|
ELEMENT_NODE = 1
|
61
51
|
# Attribute node type
|
62
52
|
ATTRIBUTE_NODE = 2
|
63
|
-
# Text node type, see Nokogiri::XML::Node#text?
|
53
|
+
# Text node type, see {Nokogiri::XML::Node#text?}
|
64
54
|
TEXT_NODE = 3
|
65
|
-
# CDATA node type, see Nokogiri::XML::Node#cdata?
|
55
|
+
# CDATA node type, see {Nokogiri::XML::Node#cdata?}
|
66
56
|
CDATA_SECTION_NODE = 4
|
67
57
|
# Entity reference node type
|
68
58
|
ENTITY_REF_NODE = 5
|
@@ -70,9 +60,9 @@ module Nokogiri
|
|
70
60
|
ENTITY_NODE = 6
|
71
61
|
# PI node type
|
72
62
|
PI_NODE = 7
|
73
|
-
# Comment node type, see Nokogiri::XML::Node#comment?
|
63
|
+
# Comment node type, see {Nokogiri::XML::Node#comment?}
|
74
64
|
COMMENT_NODE = 8
|
75
|
-
# Document node type, see Nokogiri::XML::Node#xml?
|
65
|
+
# Document node type, see {Nokogiri::XML::Node#xml?}
|
76
66
|
DOCUMENT_NODE = 9
|
77
67
|
# Document type node type
|
78
68
|
DOCUMENT_TYPE_NODE = 10
|
@@ -80,7 +70,7 @@ module Nokogiri
|
|
80
70
|
DOCUMENT_FRAG_NODE = 11
|
81
71
|
# Notation node type
|
82
72
|
NOTATION_NODE = 12
|
83
|
-
# HTML document node type, see Nokogiri::XML::Node#html?
|
73
|
+
# HTML document node type, see {Nokogiri::XML::Node#html?}
|
84
74
|
HTML_DOCUMENT_NODE = 13
|
85
75
|
# DTD node type
|
86
76
|
DTD_NODE = 14
|
@@ -99,8 +89,14 @@ module Nokogiri
|
|
99
89
|
# DOCB document node type
|
100
90
|
DOCB_DOCUMENT_NODE = 21
|
101
91
|
|
102
|
-
|
103
|
-
|
92
|
+
##
|
93
|
+
# Create a new node with +name+ sharing GC lifecycle with +document+.
|
94
|
+
# @param name [String]
|
95
|
+
# @param document [Nokogiri::XML::Document]
|
96
|
+
# @return [Nokogiri::XML::Node]
|
97
|
+
# @see Nokogiri::XML::Node.new
|
98
|
+
def initialize(name, document)
|
99
|
+
# This is intentionally empty.
|
104
100
|
end
|
105
101
|
|
106
102
|
###
|
data/lib/nokogiri/xml/reader.rb
CHANGED
@@ -86,7 +86,8 @@ module Nokogiri
|
|
86
86
|
private :initialize
|
87
87
|
|
88
88
|
###
|
89
|
-
# Get
|
89
|
+
# Get the attributes of the current node as a Hash
|
90
|
+
# @return [Hash<String, String>] Attribute names and values
|
90
91
|
def attributes
|
91
92
|
attrs_hash = attribute_nodes.each_with_object({}) do |node, hash|
|
92
93
|
hash[node.name] = node.to_s
|
@@ -96,14 +97,6 @@ module Nokogiri
|
|
96
97
|
attrs_hash
|
97
98
|
end
|
98
99
|
|
99
|
-
###
|
100
|
-
# Get a list of attributes for the current node
|
101
|
-
def attribute_nodes
|
102
|
-
nodes = attr_nodes
|
103
|
-
nodes.each { |v| v.instance_variable_set(:@_r, self) }
|
104
|
-
nodes
|
105
|
-
end
|
106
|
-
|
107
100
|
###
|
108
101
|
# Move the cursor through the document yielding the cursor to the block
|
109
102
|
def each
|
data/lib/nokogiri/xml/xpath.rb
CHANGED
@@ -0,0 +1,70 @@
|
|
1
|
+
From ca565c1edef9a455453fa8564270cc9c5813e1b9 Mon Sep 17 00:00:00 2001
|
2
|
+
From: Mike Dalessio <mike.dalessio@gmail.com>
|
3
|
+
Date: Sun, 31 Jan 2021 09:53:56 -0500
|
4
|
+
Subject: [PATCH] parser.c: shrink the input buffer when appropriate
|
5
|
+
|
6
|
+
Fixes GNOME/libxml2#200
|
7
|
+
|
8
|
+
Also see discussions at:
|
9
|
+
- GNOME/libxml2#192
|
10
|
+
- https://gitlab.gnome.org/nwellnhof/libxml2/-/commit/99bda1e
|
11
|
+
- https://github.com/sparklemotion/nokogiri/issues/2132
|
12
|
+
---
|
13
|
+
parser.c | 6 ++++++
|
14
|
+
1 file changed, 6 insertions(+)
|
15
|
+
|
16
|
+
diff --git a/parser.c b/parser.c
|
17
|
+
index a7bdc7f..efde672 100644
|
18
|
+
--- a/parser.c
|
19
|
+
+++ b/parser.c
|
20
|
+
@@ -4204,6 +4204,7 @@ xmlParseSystemLiteral(xmlParserCtxtPtr ctxt) {
|
21
|
+
}
|
22
|
+
count++;
|
23
|
+
if (count > 50) {
|
24
|
+
+ SHRINK;
|
25
|
+
GROW;
|
26
|
+
count = 0;
|
27
|
+
if (ctxt->instate == XML_PARSER_EOF) {
|
28
|
+
@@ -4291,6 +4292,7 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
|
29
|
+
buf[len++] = cur;
|
30
|
+
count++;
|
31
|
+
if (count > 50) {
|
32
|
+
+ SHRINK;
|
33
|
+
GROW;
|
34
|
+
count = 0;
|
35
|
+
if (ctxt->instate == XML_PARSER_EOF) {
|
36
|
+
@@ -4571,6 +4573,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) {
|
37
|
+
}
|
38
|
+
count++;
|
39
|
+
if (count > 50) {
|
40
|
+
+ SHRINK;
|
41
|
+
GROW;
|
42
|
+
count = 0;
|
43
|
+
if (ctxt->instate == XML_PARSER_EOF)
|
44
|
+
@@ -4776,6 +4779,7 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf,
|
45
|
+
|
46
|
+
count++;
|
47
|
+
if (count > 50) {
|
48
|
+
+ SHRINK;
|
49
|
+
GROW;
|
50
|
+
count = 0;
|
51
|
+
if (ctxt->instate == XML_PARSER_EOF) {
|
52
|
+
@@ -5186,6 +5190,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
|
53
|
+
}
|
54
|
+
count++;
|
55
|
+
if (count > 50) {
|
56
|
+
+ SHRINK;
|
57
|
+
GROW;
|
58
|
+
if (ctxt->instate == XML_PARSER_EOF) {
|
59
|
+
xmlFree(buf);
|
60
|
+
@@ -9783,6 +9788,7 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
|
61
|
+
sl = l;
|
62
|
+
count++;
|
63
|
+
if (count > 50) {
|
64
|
+
+ SHRINK;
|
65
|
+
GROW;
|
66
|
+
if (ctxt->instate == XML_PARSER_EOF) {
|
67
|
+
xmlFree(buf);
|
68
|
+
--
|
69
|
+
2.25.1
|
70
|
+
|