summaryrefslogtreecommitdiff
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
authorAlex Braha Stoll <alexbrahastoll@gmail.com>2016-12-18 21:37:10 -0200
committerAlex Braha Stoll <alexbrahastoll@gmail.com>2016-12-31 16:55:50 -0200
commit5607bb8f0921cbfa4586bb7b92acb6666a65b4e2 (patch)
tree0a2b529ff31fd7810d5dfa0eb38c709657ff40b4 /app/models/wiki_page.rb
parent904aa039e5ccb4d9f653d254ea5818be130fb218 (diff)
downloadgitlab-ce-5607bb8f0921cbfa4586bb7b92acb6666a65b4e2.tar.gz
Change WikiPage#directory to always start a directory hierarchy with '/'
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 1dbb3407623..a563b0b7a72 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -89,7 +89,7 @@ class WikiPage
# The hierarchy of the directory this page is contained in.
def directory
dir = wiki.page_title_and_dir(slug).last
- dir.present? ? dir : '/'
+ "/#{dir}"
end
# The processed/formatted content of this page.
@@ -106,7 +106,7 @@ class WikiPage
# The full path for this page, including its filename and extension.
def full_path
- "/#{directory}/#{page.filename}".gsub(/\/+/, '/')
+ "#{directory}/#{page.filename}".gsub(/\/+/, '/')
end
# The commit message for this page version.