diff options
author | Nick Thomas <nick@gitlab.com> | 2018-01-16 16:07:47 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-01-16 16:11:02 +0000 |
commit | 31e59219891cf755c9a71e145385af6da9d290b9 (patch) | |
tree | 406bdcf2a8e19269e986e675286292211481f834 /lib/banzai | |
parent | 0f449ecc3797337333f595a86a6b282b866067e3 (diff) | |
download | gitlab-ce-31e59219891cf755c9a71e145385af6da9d290b9.tar.gz |
Fix links to uploaded files on wiki pages
Diffstat (limited to 'lib/banzai')
-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! |