Fix vulnerable.
This commit is contained in:
parent
8b71e8e54f
commit
9cb912be75
|
@ -3,14 +3,14 @@ class PageContentsController < OrbitAdminController
|
||||||
def index
|
def index
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
if params["wiki"].present?
|
if params["wiki"].present?
|
||||||
page = WikiPage.where(:uid => params["wiki"]).first
|
page = WikiPage.where(:uid => params["wiki"].to_s).first
|
||||||
page.view_count += 1
|
page.view_count += 1
|
||||||
page.save
|
page.save
|
||||||
name = page.title rescue ""
|
name = page.title rescue ""
|
||||||
html = page.content rescue ""
|
html = page.content rescue ""
|
||||||
url_to_edit = OrbitHelper.user_can_edit?(page) ? "/admin/wiki_pages/#{page.id}/edit?page_id=#{page.page.id.to_s}" : ""
|
url_to_edit = OrbitHelper.user_can_edit?(page) ? "/admin/wiki_pages/#{page.id}/edit?page_id=#{page.page.id.to_s}" : ""
|
||||||
else
|
else
|
||||||
page = Page.where(:page_id => params[:page_id]).first
|
page = Page.where(:page_id => params[:page_id].to_s).first
|
||||||
name = page.name rescue ""
|
name = page.name rescue ""
|
||||||
html = page.page_contexts.order(:version=>-1).first.content rescue ""
|
html = page.page_contexts.order(:version=>-1).first.content rescue ""
|
||||||
url_to_edit = OrbitHelper.user_can_edit?(page) ? "/admin/page_contents/new?page_id=#{page.id.to_s}" : ""
|
url_to_edit = OrbitHelper.user_can_edit?(page) ? "/admin/page_contents/new?page_id=#{page.id.to_s}" : ""
|
||||||
|
|
Loading…
Reference in New Issue