forked from sparklemotion/nokogiri
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure EntityReferences ignore malformed children
libxml2 will cause EntityReferences to have a malformed child node for predefined entities. because any use of that child is likely to cause a segfault, we shall pretend that it doesn't exist. [fixes sparklemotion#1238]
- Loading branch information
1 parent
c216273
commit 84105bf
Showing
4 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Nokogiri | ||
module XML | ||
class EntityReference < Nokogiri::XML::Node | ||
def children | ||
# libxml2 will create a malformed child node for predefined | ||
# entities. because any use of that child is likely to cause a | ||
# segfault, we shall pretend that it doesn't exist. | ||
# | ||
# see https://github.com/sparklemotion/nokogiri/issues/1238 for details | ||
NodeSet.new(document) | ||
end | ||
|
||
def inspect_attributes | ||
[:name] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters