]> git.openstreetmap.org Git - rails.git/commitdiff
Ignore GPX archive entries that aren't regular files
authorTom Hughes <tom@compton.nu>
Wed, 16 Dec 2020 11:17:51 +0000 (11:17 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 16 Dec 2020 11:17:51 +0000 (11:17 +0000)
Fixes #3008

lib/gpx.rb

index d0607233a2d7f4f108ce35f0b86122c71956a0c3..86cf2f49dab377fcaccde84920866430af8ffbc2 100644 (file)
@@ -44,8 +44,8 @@ module GPX
       @tracksegs = 0
 
       begin
-        Archive::Reader.open_filename(@file).each_entry_with_data do |_entry, data|
-          parse_file(XML::Reader.string(data), &block)
+        Archive::Reader.open_filename(@file).each_entry_with_data do |entry, data|
+          parse_file(XML::Reader.string(data), &block) if entry.regular?
         end
       rescue Archive::Error
         io = ::File.open(@file)