summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-05-15 14:06:07 +0000
committerGo MAEDA <maeda@farend.jp>2019-05-15 14:06:07 +0000
commitad816523ed74796dce4cdf9846970cbeb25881be (patch)
tree0335a881a2810807c38183c2693a0a5373738669 /app/controllers
parentfc570654f9715de859fd8ba515b899e527276bb6 (diff)
downloadredmine-ad816523ed74796dce4cdf9846970cbeb25881be.tar.gz
redmine-ad816523ed74796dce4cdf9846970cbeb25881be.zip
Merged r18165 from trunk to 3.4-stable (#31334).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@18167 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/wiki_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 5d9a91327..a28e2bd61 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -32,7 +32,7 @@
class WikiController < ApplicationController
default_search_scope :wiki_pages
before_action :find_wiki, :authorize
- before_action :find_existing_or_new_page, :only => [:show, :edit, :update]
+ before_action :find_existing_or_new_page, :only => [:show, :edit]
before_action :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy, :destroy_version]
before_action :find_attachments, :only => [:preview]
accept_api_auth :index, :show, :update, :destroy
@@ -150,6 +150,8 @@ class WikiController < ApplicationController
# Creates a new page or updates an existing one
def update
+ @page = @wiki.find_or_new_page(params[:id])
+
return render_403 unless editable?
was_new_page = @page.new_record?
@page.safe_attributes = params[:wiki_page]