Skip to content

Commit

Permalink
[webui] catch even more invalid utf-8 (hopefully ruby 2.0 is easier)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Apr 15, 2013
1 parent fca7d27 commit 81bcfd7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/webui/lib/frontend_compat.rb
Expand Up @@ -107,10 +107,14 @@ def get_log_chunk( project, package, repo, arch, start, theend )
# encode is documented not to throw it if undef: is :replace, but at least we tried - and ruby 1.9.3 is buggy
end
return log.gsub(/([^a-zA-Z0-9&;<>\/\n\r \t()])/n) do |c|
if c.ord < 32
begin
if c.ord < 32
''
else
c
end
rescue ArgumentError
''
else
c
end
end
end
Expand Down

0 comments on commit 81bcfd7

Please sign in to comment.