|
1 | 1 | Patch taken from https://github.com/ruby/rexml/pull/126/files#diff-93b40740603234e79b1d9be5ff2b3af80f3964a146183cbd698f14d7336726e9 |
2 | 2 | diff -ruN a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb |
3 | | ---- a/.bundle/gems/rexml-3.2.5/lib/parsers/baseparser.rb 2021-04-05 04:43:38.000000000 -0700 |
4 | | -+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb 2024-05-28 18:53:32.656078157 -0700 |
5 | | -@@ -589,60 +589,41 @@ |
| 3 | +--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb 2021-04-05 04:43:38.000000000 -0700 |
| 4 | ++++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb 2024-05-31 14:22:29.683378525 -0700 |
| 5 | +@@ -589,85 +589,58 @@ |
6 | 6 | def parse_attributes(prefixes, curr_ns) |
7 | 7 | attributes = {} |
8 | 8 | closed = false |
@@ -48,15 +48,6 @@ diff -ruN a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/g |
48 | 48 | end |
49 | 49 | - quote = scanner.scan(/['"]/) |
50 | 50 | - unless quote |
51 | | -+ unless match = @source.match(/(['"])(.*?)\1\s*/um, true) |
52 | | -+ if match = @source.match(/(['"])/, true) |
53 | | -+ message = |
54 | | -+ "Missing attribute value end quote: <#{name}>: <#{match[1]}>" |
55 | | -+ raise REXML::ParseException.new(message, @source) |
56 | | -+ else |
57 | | -+ message = "Missing attribute value start quote: <#{name}>" |
58 | | -+ raise REXML::ParseException.new(message, @source) |
59 | | -+ end |
60 | 51 | + unless match = @source.match(/(['"])/, true) |
61 | 52 | message = "Missing attribute value start quote: <#{name}>" |
62 | 53 | raise REXML::ParseException.new(message, @source) |
@@ -85,11 +76,57 @@ diff -ruN a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/g |
85 | 76 | - local_part = scanner[3] |
86 | 77 | - # quote = scanner[4] |
87 | 78 | - value = scanner[5] |
88 | | -+ value = match[2] |
| 79 | +- if prefix == "xmlns" |
| 80 | +- if local_part == "xml" |
| 81 | +- if value != "http://www.w3.org/XML/1998/namespace" |
| 82 | +- msg = "The 'xml' prefix must not be bound to any other namespace "+ |
89 | 83 | + @source.match(/\s*/um, true) |
90 | | - if prefix == "xmlns" |
91 | | - if local_part == "xml" |
92 | | - if value != "http://www.w3.org/XML/1998/namespace" |
| 84 | ++ if prefix == "xmlns" |
| 85 | ++ if local_part == "xml" |
| 86 | ++ if value != "http://www.w3.org/XML/1998/namespace" |
| 87 | ++ msg = "The 'xml' prefix must not be bound to any other namespace "+ |
| 88 | ++ "(http://www.w3.org/TR/REC-xml-names/#ns-decl)" |
| 89 | ++ raise REXML::ParseException.new( msg, @source, self) |
| 90 | ++ end |
| 91 | ++ elsif local_part == "xmlns" |
| 92 | ++ msg = "The 'xmlns' prefix must not be declared "+ |
| 93 | + "(http://www.w3.org/TR/REC-xml-names/#ns-decl)" |
| 94 | +- raise REXML::ParseException.new( msg, @source, self ) |
| 95 | ++ raise REXML::ParseException.new( msg, @source, self) |
| 96 | + end |
| 97 | +- elsif local_part == "xmlns" |
| 98 | +- msg = "The 'xmlns' prefix must not be declared "+ |
| 99 | +- "(http://www.w3.org/TR/REC-xml-names/#ns-decl)" |
| 100 | +- raise REXML::ParseException.new( msg, @source, self) |
| 101 | ++ curr_ns << local_part |
| 102 | ++ elsif prefix |
| 103 | ++ prefixes << prefix unless prefix == "xml" |
| 104 | + end |
| 105 | +- curr_ns << local_part |
| 106 | +- elsif prefix |
| 107 | +- prefixes << prefix unless prefix == "xml" |
| 108 | +- end |
| 109 | +- |
| 110 | +- if attributes.has_key?(name) |
| 111 | +- msg = "Duplicate attribute #{name.inspect}" |
| 112 | +- raise REXML::ParseException.new(msg, @source, self) |
| 113 | ++ if attributes[name] |
| 114 | ++ msg = "Duplicate attribute #{name.inspect}" |
| 115 | ++ raise REXML::ParseException.new(msg, @source, self) |
| 116 | ++ end |
| 117 | ++ |
| 118 | ++ attributes[name] = value |
| 119 | ++ else |
| 120 | ++ message = "Invalid attribute name: <#{@source.buffer.split(%r{[/>\s]}).first}>" |
| 121 | ++ raise REXML::ParseException.new(message, @source) |
| 122 | + end |
| 123 | +- |
| 124 | +- attributes[name] = value |
| 125 | + end |
| 126 | +- return attributes, closed |
| 127 | + end |
| 128 | + end |
| 129 | + end |
93 | 130 | diff -ruN a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb |
94 | 131 | --- a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb 2021-04-05 04:43:38.000000000 -0700 |
95 | 132 | +++ b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb 2024-05-28 17:10:36.356913505 -0700 |
|
0 commit comments