Do a redirect when accessing a renamed wiki page.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5423 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-04-11 19:21:57 +00:00
parent 6db0e8dcef
commit 3cc7353093
4 changed files with 55 additions and 7 deletions
+10 -1
View File
@@ -249,12 +249,21 @@ private
# Finds the requested page or a new page if it doesn't exist
def find_existing_or_new_page
@page = @wiki.find_or_new_page(params[:id])
if @wiki.page_found_with_redirect?
redirect_to params.update(:id => @page.title)
end
end
# Finds the requested page and returns a 404 error if it doesn't exist
def find_existing_page
@page = @wiki.find_page(params[:id])
render_404 if @page.nil?
if @page.nil?
render_404
return
end
if @wiki.page_found_with_redirect?
redirect_to params.update(:id => @page.title)
end
end
# Returns true if the current user is allowed to edit the page, otherwise false