Commit 1cd28600 authored by Hiroyuki Sato's avatar Hiroyuki Sato

Fix the image file that contains non-ascii character is not displayed

parent 8be3d120
Please view this file on the master branch, on stable branches it's out of date.
v 7.14.0 (unreleased)
- Fix the image file that contains non-ascii character is not displayed(Hiroyuki Sato)
- Fix URL used for refreshing notes if relative_url is present (Bartłomiej Święcki)
- Fix Error 500 when browsing projects with no HEAD (Stan Hu)
- Fix full screen mode for snippet comments (Daniel Gerhardt)
......
......@@ -98,9 +98,10 @@ module Gitlab
#
# Returns a String
def path_type(path)
if repository.tree(current_sha, path).entries.any?
unescaped_path = Addressable::URI.unescape(path)
if repository.tree(current_sha, unescaped_path).entries.any?
'tree'
elsif repository.blob_at(current_sha, path).try(:image?)
elsif repository.blob_at(current_sha, unescaped_path).try(:image?)
'raw'
else
'blob'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment