Fix vulnerable.
This commit is contained in:
parent
8ba1baa045
commit
e09ecd8ca4
|
@ -58,7 +58,7 @@ class Admin::WritingConferencesController < OrbitMemberController
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@member = Array(MemberProfile.find_by(:uid=>params['uid'])) rescue nil
|
@member = Array(MemberProfile.find_by(:uid=>params['uid'].to_s)) rescue nil
|
||||||
@writing_conference = WritingConference.new
|
@writing_conference = WritingConference.new
|
||||||
|
|
||||||
if params[:desktop]
|
if params[:desktop]
|
||||||
|
@ -207,7 +207,7 @@ class Admin::WritingConferencesController < OrbitMemberController
|
||||||
end
|
end
|
||||||
|
|
||||||
def frontend_setting
|
def frontend_setting
|
||||||
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
|
@member = MemberProfile.find_by(:uid=>params['uid'].to_s) rescue nil
|
||||||
@intro = WritingConferenceIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
@intro = WritingConferenceIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
||||||
@intro = @intro.nil? ? WritingConferenceIntro.new({:member_profile_id=>@member.id}) : @intro
|
@intro = @intro.nil? ? WritingConferenceIntro.new({:member_profile_id=>@member.id}) : @intro
|
||||||
end
|
end
|
||||||
|
|
|
@ -47,7 +47,11 @@ class PersonalConferencesController < ApplicationController
|
||||||
when 'authors'
|
when 'authors'
|
||||||
writing_conferences_show = writing_conferences_temp.select { |value| search_all_words(get_authors_text(value), params[:keywords]) }
|
writing_conferences_show = writing_conferences_temp.select { |value| search_all_words(get_authors_text(value), params[:keywords]) }
|
||||||
else
|
else
|
||||||
writing_conferences_show = writing_conferences_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) }
|
if fields_to_show.include?(params[:selectbox])
|
||||||
|
writing_conferences_show = writing_conferences_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) }
|
||||||
|
else
|
||||||
|
writing_conferences_show = writing_conferences_temp
|
||||||
|
end
|
||||||
end
|
end
|
||||||
page_to_show = params[:page_no].nil? ? 1 : params[:page_no].to_i
|
page_to_show = params[:page_no].nil? ? 1 : params[:page_no].to_i
|
||||||
writing_conferences = writing_conferences_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count]
|
writing_conferences = writing_conferences_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count]
|
||||||
|
@ -111,7 +115,8 @@ class PersonalConferencesController < ApplicationController
|
||||||
choice = choice.map { |value| value.inject :merge }
|
choice = choice.map { |value| value.inject :merge }
|
||||||
select_text = t('personal_conference.search_class')
|
select_text = t('personal_conference.search_class')
|
||||||
search_text = t('personal_conference.word_to_search')
|
search_text = t('personal_conference.word_to_search')
|
||||||
csrf_value = (0...46).map { ('a'..'z').to_a[rand(26)] }.join
|
@_request = OrbitHelper.request
|
||||||
|
csrf_value = form_authenticity_token
|
||||||
{
|
{
|
||||||
'writing_conferences' => writing_conference_list,
|
'writing_conferences' => writing_conference_list,
|
||||||
'extras' => { 'widget-title' => t('module_name.personal_conference'),
|
'extras' => { 'widget-title' => t('module_name.personal_conference'),
|
||||||
|
@ -128,7 +133,7 @@ class PersonalConferencesController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
plugin = WritingConference.where(is_hidden: false).find_by(uid: params[:uid])
|
plugin = WritingConference.where(is_hidden: false).find_by(uid: params[:uid].to_s)
|
||||||
fields_to_show = %w[
|
fields_to_show = %w[
|
||||||
year
|
year
|
||||||
authors
|
authors
|
||||||
|
|
Loading…
Reference in New Issue