Prevent 500 error on search results if description contains relative link
This commit is contained in:
parent
e586ee347f
commit
1e980ffbad
|
@ -73,7 +73,12 @@ module GitlabMarkdownHelper
|
|||
paths.uniq.each do |file_path|
|
||||
# If project does not have repository
|
||||
# its nothing to rebuild
|
||||
if @repository.exists? && !@repository.empty?
|
||||
#
|
||||
# TODO: pass project variable to markdown helper instead of using
|
||||
# instance variable. Right now it generates invalid path for pages out
|
||||
# of project scope. Example: search results where can be rendered markdown
|
||||
# from different projects
|
||||
if @repository && @repository.exists? && !@repository.empty?
|
||||
new_path = rebuild_path(file_path)
|
||||
# Finds quoted path so we don't replace other mentions of the string
|
||||
# eg. "doc/api" will be replaced and "/home/doc/api/text" won't
|
||||
|
|
Loading…
Reference in New Issue