feedjira 4.0.3 → 4.0.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: 3f87fde64ce148ec9ebbd1da344070d1e9bb381904b377e030d9aae56b602aa3
4
- data.tar.gz: 82282b9e5c0b03acd93b5a7e11f697793ef1d2bd34014178fcde7f632d3259ec
3
+ metadata.gz: 1f6474b14f1393846dfeb3d06a542cb653b62943f0e41cccf731be876e9e2363
4
+ data.tar.gz: 5f1795b599c600e3a2ee6a9e0c2f2c80d21f822da10ce67791f30026f1ad6cbb
5
5
  SHA512:
6
- metadata.gz: 83b305a7cd33379b384ef8fe60928ba02cf7f64b0f49793d989c2a37a61ebf4a70d424b15709bd4b441de1b6bb2e170db1b646e590998bd31279b599d238fbc1
7
- data.tar.gz: ae3c9076b1ae95dd943be0e4903ceaade5c955dde3a8af6bb45b8da9e94390b5a0a4607e469537a090246762febd4dcb68da8c56659cacf198da8db79af4a585
6
+ metadata.gz: 24230edd72d9c272b05de0308b8576ebff8ecd5eef592ba4d6b7127dd59519a051dcc40f8d78a5a3e745394fbe57ddf7c21a53367fef98b6819ed960832aeee7
7
+ data.tar.gz: 2d703a159a159a1fa9bf137abbfcd193c451cb2f7e15ea44579dbfc3ab46c25c3c687d7d7e4b6798e41c833175b0d3520c387f735c3c89015316eac3d8ae0fc1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Feedjira Changelog
2
2
 
3
+ ## 4.0.4
4
+
5
+ * Detect Atom feeds that declare the iTunes namespace as Atom, not ITunesRSS (#584)
6
+
3
7
  ## 4.0.3
4
8
 
5
9
  * Security: stop loading external entities declared in a feed's DOCTYPE when
@@ -64,7 +64,8 @@ module Feedjira
64
64
 
65
65
  def self.able_to_parse?(xml)
66
66
  xml_without_cdata = xml.gsub(/<!\[CDATA\[.*?\]\]>/m, "")
67
- %r{xmlns:itunes\s?=\s?["']http://www\.itunes\.com/dtds/podcast-1\.0\.dtd["']}i =~ xml_without_cdata
67
+ xml_without_cdata.include?("<rss") &&
68
+ %r{xmlns:itunes\s?=\s?["']http://www\.itunes\.com/dtds/podcast-1\.0\.dtd["']}i.match?(xml_without_cdata)
68
69
  end
69
70
  end
70
71
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Feedjira
4
- VERSION = "4.0.3"
4
+ VERSION = "4.0.4"
5
5
  end
@@ -28,6 +28,10 @@ module Feedjira
28
28
  it "returns false for an atom feed with xmlns:itunes inside CDATA" do
29
29
  expect(ITunesRSS).not_to be_able_to_parse(sample_atom_with_itunes_in_cdata)
30
30
  end
31
+
32
+ it "returns false for an atom feed that declares the itunes namespace" do
33
+ expect(ITunesRSS).not_to be_able_to_parse(sample_atom_with_itunes_namespace)
34
+ end
31
35
  end
32
36
 
33
37
  describe "parsing" do
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <feed xmlns="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
3
+ <id>tag:example.com,2013:/posts</id>
4
+ <title>Example</title>
5
+ <updated>2026-11-17T17:58:10Z</updated>
6
+ <itunes:author>Jane Doe</itunes:author>
7
+ <entry>
8
+ <id>tag:example.com,2013:Post/1</id>
9
+ <updated>2026-11-17T17:58:10Z</updated>
10
+ <link rel="alternate" type="text/html" href="https://example.com/post-1"/>
11
+ <title>Post 1</title>
12
+ </entry>
13
+ </feed>
data/spec/sample_feeds.rb CHANGED
@@ -38,7 +38,8 @@ module SampleFeeds
38
38
  sample_rss_feed_permalinks: "Permalinks.xml",
39
39
  sample_rss_feed_with_a10_namespace: "a10.xml",
40
40
  sample_rss_feed_with_comments: "RSSWithComments.xml",
41
- sample_atom_with_itunes_in_cdata: "AtomWithITunesInCDATA.xml"
41
+ sample_atom_with_itunes_in_cdata: "AtomWithITunesInCDATA.xml",
42
+ sample_atom_with_itunes_namespace: "AtomWithITunesNamespace.xml"
42
43
  }.freeze
43
44
 
44
45
  FEEDS.each do |method, filename|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedjira
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hess
@@ -167,6 +167,7 @@ files:
167
167
  - spec/sample_feeds/AtomEscapedHTMLInPreTag.xml
168
168
  - spec/sample_feeds/AtomFeedWithSpacesAroundEquals.xml
169
169
  - spec/sample_feeds/AtomWithITunesInCDATA.xml
170
+ - spec/sample_feeds/AtomWithITunesNamespace.xml
170
171
  - spec/sample_feeds/CRE.xml
171
172
  - spec/sample_feeds/DuplicateContentAtomFeed.xml
172
173
  - spec/sample_feeds/FeedBurnerUrlNoAlternate.xml