summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-11 19:21:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-11 19:21:57 +0000
commit3cc7353093a7cb8160fd34cb16aff099c5517e32 (patch)
tree5f16348e9417af9402a29ccdf8954d76fc2a8413 /app/controllers
parent6db0e8dcef0bf1e4ece02641b51b9df38dae31dc (diff)
downloadredmine-3cc7353093a7cb8160fd34cb16aff099c5517e32.tar.gz
redmine-3cc7353093a7cb8160fd34cb16aff099c5517e32.zip
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
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/wiki_controller.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 84fb16d2e..f11b21264 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -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