Fix edit.
This commit is contained in:
@@ -146,16 +146,14 @@ module Precious
|
|||||||
end
|
end
|
||||||
|
|
||||||
post '/edit/*' do
|
post '/edit/*' do
|
||||||
# TODO: Why does exact = true break /edit unit tests?
|
path = sanitize_empty_params(params[:path])
|
||||||
# name, path, version = nil, exact = false
|
page_name = CGI.unescape(params[:page])
|
||||||
wikip = wiki_page(CGI.unescape(params[:page]), sanitize_empty_params(params[:path]), nil, false)
|
wiki = wiki_new
|
||||||
path = wikip.path
|
page = wiki.paged(page_name, path, exact = true)
|
||||||
wiki = wikip.wiki
|
rename = params[:rename].to_url if params[:rename]
|
||||||
page = wikip.page
|
name = rename || page.name
|
||||||
rename = params[:rename].to_url if params[:rename]
|
committer = Gollum::Committer.new(wiki, commit_message)
|
||||||
name = rename || page.name
|
commit = {:committer => committer}
|
||||||
committer = Gollum::Committer.new(wiki, commit_message)
|
|
||||||
commit = {:committer => committer}
|
|
||||||
|
|
||||||
update_wiki_page(wiki, page, params[:content], commit, name, params[:format])
|
update_wiki_page(wiki, page, params[:content], commit, name, params[:format])
|
||||||
update_wiki_page(wiki, page.header, params[:header], commit) if params[:header]
|
update_wiki_page(wiki, page.header, params[:header], commit) if params[:header]
|
||||||
|
|||||||
Reference in New Issue
Block a user