diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-05-07 21:28:04 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-05-10 13:46:31 +0200 |
commit | 4c506c4498192b6d60a3731ad5428e2354b777cb (patch) | |
tree | 85e11bf7f853748e72e40a7e9bd79a7759071060 /lib/banzai | |
parent | 4cc85a58e8ca00f5a4ecbd2bca40a0cad867b817 (diff) | |
download | gitlab-ce-4c506c4498192b6d60a3731ad5428e2354b777cb.tar.gz |
Fix using link to uploads in global snippets
Closes #17342, closes #17363
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/upload_link_filter.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/banzai/filter/upload_link_filter.rb b/lib/banzai/filter/upload_link_filter.rb index 7edfe5ade2d..483d40c46df 100644 --- a/lib/banzai/filter/upload_link_filter.rb +++ b/lib/banzai/filter/upload_link_filter.rb @@ -31,7 +31,9 @@ module Banzai end def build_url(uri) - File.join(Gitlab.config.gitlab.url, context[:project].path_with_namespace, uri) + return '#' unless project = context[:project] + + File.join(Gitlab.config.gitlab.url, project.path_with_namespace, uri) end # Ensure that a :project key exists in context |