Fxed handling of a page that tries to include itself

This commit is contained in:
Alexey Verkhovsky 2005-08-02 03:23:05 +00:00
parent 66ab8df6f4
commit 9f36bd59a9

View file

@ -24,7 +24,7 @@ class Include < WikiChunk::WikiReference
def get_unmask_text_avoiding_recursion_loops
if refpage then
refpage.clear_display_cache
if refpage.wiki_includes.include?(@content.page_name)
if refpage.name == @content.page_name or refpage.wiki_includes.include?(@content.page_name)
# this will break the recursion
@content.delete_chunk(self)
return "<em>Recursive include detected; #{@page_name} --> #{@content.page_name} " +