Skip to content

Commit

Permalink
fix #2626 in 2.0 (#2678)
Browse files Browse the repository at this point in the history
* fix #2626 in 2.0
  • Loading branch information
johrstrom authored Mar 24, 2023
1 parent ee9b712 commit 42f61f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/dashboard/app/models/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ def self.files_to_zip(path)
def ls(dirpath)
Pathname.new(dirpath).each_child.map do |path|
Files.stat(path)
end.select do |stats|
valid_encoding = stats[:name].to_s.valid_encoding?

unless valid_encoding
Rails.logger.warn("Not showing file '#{stats[:name]}' because it is not a UTF-8 filename.")
end

valid_encoding
end.sort_by { |p| p[:directory] ? 0 : 1 }
end

Expand Down

0 comments on commit 42f61f1

Please sign in to comment.