Commit 9ae29f76 authored by Stan Hu's avatar Stan Hu

Merge branch '43157_use_append_path' into 'master'

Use Gitlab::Utils#append_path for url generation

See merge request gitlab-org/gitlab!44725
parents ad9886b9 5e5f4694
......@@ -80,18 +80,17 @@ class HelpController < ApplicationController
def documentation_url
return unless documentation_base_url
@documentation_url ||= [
documentation_base_url.chomp('/'),
version_segment,
'ee',
"#{@path}.html"
].compact.join('/')
@documentation_url ||= Gitlab::Utils.append_path(documentation_base_url, documentation_file_path)
end
def documentation_base_url
@documentation_base_url ||= Gitlab::CurrentSettings.current_application_settings.help_page_documentation_base_url.presence
end
def documentation_file_path
@documentation_file_path ||= [version_segment, 'ee', "#{@path}.html"].compact.join('/')
end
def version_segment
return if Gitlab.pre_release?
......
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