1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-22 00:11:14 +00:00

Modify circular inclusion test to use page.id instead of page.title (#24869).

Patch by Michael Esemplare.

git-svn-id: http://svn.redmine.org/redmine/trunk@16227 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-01-19 18:32:06 +00:00
parent e8d7b36f1b
commit df5dba5dde

View File

@ -207,8 +207,8 @@ module Redmine
page = Wiki.find_page(args.first.to_s, :project => @project) page = Wiki.find_page(args.first.to_s, :project => @project)
raise 'Page not found' if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project) raise 'Page not found' if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project)
@included_wiki_pages ||= [] @included_wiki_pages ||= []
raise 'Circular inclusion detected' if @included_wiki_pages.include?(page.title) raise 'Circular inclusion detected' if @included_wiki_pages.include?(page.id)
@included_wiki_pages << page.title @included_wiki_pages << page.id
out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false) out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false)
@included_wiki_pages.pop @included_wiki_pages.pop
out out