diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-01-16 19:52:32 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-01-16 19:52:32 +0300 |
commit | 79b05cdd469726582e916cb606ba14b440a59011 (patch) | |
tree | 3e36b192aa9b7eea3fd21b50525e1f724194cc35 /lib | |
parent | f084525fe4cceee1c6c3d86d5bd3150fa6334e42 (diff) | |
parent | 31e59219891cf755c9a71e145385af6da9d290b9 (diff) |
Merge branch '42031-fix-links-to-uploads-in-wikis' into 'master'
Resolve "Wiki uploaded files are missing"
Closes #42031
See merge request gitlab-org/gitlab-ce!16499
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/wiki_link_filter/rewriter.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/banzai/filter/wiki_link_filter/rewriter.rb b/lib/banzai/filter/wiki_link_filter/rewriter.rb index e7a1ec8457d..072d24e5a11 100644 --- a/lib/banzai/filter/wiki_link_filter/rewriter.rb +++ b/lib/banzai/filter/wiki_link_filter/rewriter.rb @@ -9,6 +9,10 @@ module Banzai end def apply_rules + # Special case: relative URLs beginning with `/uploads/` refer to + # user-uploaded files and will be handled elsewhere. + return @uri.to_s if @uri.relative? && @uri.path.starts_with?('/uploads/') + apply_file_link_rules! apply_hierarchical_link_rules! apply_relative_link_rules! |