rexml 3.4.2 → 3.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75f7d0bba9d8346e2374abacaf7aea57044c66f368a695521bc16f6b07e31eaf
4
- data.tar.gz: 674cf531dbe9684f3cc9945255aec412d0b80ae0117da3c57552c5ae3bbc66a1
3
+ metadata.gz: 9ac95f1cecaf1fba6908b5cab0c3c41ec38df0744658888f783d02cdf64f12f2
4
+ data.tar.gz: cbfd7145ac0dd44987e9980ee96dd2bb42360b112ac0d5b09314c4fecb46fe99
5
5
  SHA512:
6
- metadata.gz: c36c00f2e2c0ed931c85a0e0fb7720771d314f93fa1e66e1057b4e8fb7fe1d1bd3f50debdfa05587e511f1cad8d7345aa8066b18392554da6e8f6baad6a3b9d7
7
- data.tar.gz: dc53db592782ad36f083493b8864d49872b8c989b9e2f5d9a1811d56fae3100cf2cad27bb4ab81b9d308715da523d0a4f71d4e236e5847d540d0e92a85c1bd20
6
+ metadata.gz: eef25a3cdfb1f408f2fe061168d907b97c13d82ca077a731eff284868164de16991ca779ab30e10050d67df0518eaf334add57b78998add1d108eae597001dc6
7
+ data.tar.gz: 2ec4a1b379e2f0e15c9161e929c9846aad47635b6a6705e8ae4bd985b8a8037b5f213e043d7811ce0530b7601d35e499006fe65911fcfdcdad089f6cbc7c0e72
data/NEWS.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # News
2
2
 
3
+ ## 3.4.4 - 2025-09-10 {#version-3-4-4}
4
+
5
+ ### Improvement
6
+
7
+ * Accept `REXML::Document.new("")` for backward compatibility
8
+ * GH-296
9
+ * GH-295
10
+ * Patch by NAITOH Jun
11
+ * Reported by Joe Rafaniello
12
+
13
+ ### Thanks
14
+
15
+ * NAITOH Jun
16
+
17
+ * Joe Rafaniello
18
+
19
+ ## 3.4.3 - 2025-09-07 {#version-3-4-3}
20
+
21
+ ### Improvement
22
+
23
+ * Reject no root element XML as an invalid XML
24
+ * GH-289
25
+ * GH-291
26
+ * Patch by NAITOH Jun
27
+ * Reported by Sutou Kouhei
28
+
29
+ ### Fixes
30
+
31
+ * Fixed an issue with `IOSource#read_until` when reaching the end of a file
32
+ * GH-287
33
+ * GH-288
34
+ * Patch by NAITOH Jun
35
+ * Reported by Jason Thomas
36
+
37
+ ### Thanks
38
+
39
+ * NAITOH Jun
40
+
41
+ * Sutou Kouhei
42
+
43
+ * Jason Thomas
44
+
3
45
  ## 3.4.2 - 2025-08-26 {#version-3-4-2}
4
46
 
5
47
  ### Improvement
@@ -95,7 +95,9 @@ module REXML
95
95
  @entity_expansion_text_limit = Security.entity_expansion_text_limit
96
96
  super()
97
97
  @context = context
98
- return if source.nil?
98
+ # `source = ""` is an invalid usage because no root element XML is an invalid XML.
99
+ # But we accept `""` for backward compatibility.
100
+ return if source.nil? or source == ""
99
101
  if source.kind_of? Document
100
102
  @context = source.context
101
103
  super source
@@ -266,6 +266,11 @@ module REXML
266
266
  path = "/" + @tags.join("/")
267
267
  raise ParseException.new("Missing end tag for '#{path}'", @source)
268
268
  end
269
+
270
+ unless @document_status == :in_element
271
+ raise ParseException.new("Malformed XML: No root element", @source)
272
+ end
273
+
269
274
  return [ :end_document ]
270
275
  end
271
276
  return @stack.shift if @stack.size > 0
data/lib/rexml/rexml.rb CHANGED
@@ -31,7 +31,7 @@
31
31
  module REXML
32
32
  COPYRIGHT = "Copyright © 2001-2008 Sean Russell <ser@germane-software.com>"
33
33
  DATE = "2008/019"
34
- VERSION = "3.4.2"
34
+ VERSION = "3.4.4"
35
35
  REVISION = ""
36
36
 
37
37
  Copyright = COPYRIGHT
data/lib/rexml/source.rb CHANGED
@@ -272,7 +272,7 @@ module REXML
272
272
  @scanner << readline(term)
273
273
  end
274
274
  if str
275
- read if @scanner.eos? and !@source.eof?
275
+ read if @scanner.eos? and @source and !@source.eof?
276
276
  str
277
277
  else
278
278
  rest = @scanner.rest
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexml
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.2
4
+ version: 3.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -102,7 +102,7 @@ homepage: https://github.com/ruby/rexml
102
102
  licenses:
103
103
  - BSD-2-Clause
104
104
  metadata:
105
- changelog_uri: https://github.com/ruby/rexml/releases/tag/v3.4.2
105
+ changelog_uri: https://github.com/ruby/rexml/releases/tag/v3.4.4
106
106
  rdoc_options:
107
107
  - "--main"
108
108
  - README.md