From eb8ed7476d316634e3eb60a2b9ebe6c7b299cf76 Mon Sep 17 00:00:00 2001 From: bohung Date: Mon, 24 Oct 2022 16:10:01 +0800 Subject: [PATCH] Fix vulnerable. --- app/controllers/admin/labs_controller.rb | 4 ++-- app/controllers/personal_labs_controller.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/labs_controller.rb b/app/controllers/admin/labs_controller.rb index b5b4c7f..de4556f 100644 --- a/app/controllers/admin/labs_controller.rb +++ b/app/controllers/admin/labs_controller.rb @@ -14,7 +14,7 @@ class Admin::LabsController < OrbitMemberController end def new - @member = MemberProfile.find_by(:uid=>params['uid']) rescue nil + @member = MemberProfile.find_by(:uid=>params['uid'].to_s) rescue nil @lab = Lab.new if params[:desktop] render :layout => false @@ -160,7 +160,7 @@ class Admin::LabsController < OrbitMemberController end def frontend_setting - @member = MemberProfile.find_by(:uid=>params['uid']) rescue nil + @member = MemberProfile.find_by(:uid=>params['uid'].to_s) rescue nil @intro = LabIntro.find_by(:member_profile_id=>@member.id) rescue nil @intro = @intro.nil? ? LabIntro.new({:member_profile_id=>@member.id}) : @intro end diff --git a/app/controllers/personal_labs_controller.rb b/app/controllers/personal_labs_controller.rb index 743e571..c05de06 100644 --- a/app/controllers/personal_labs_controller.rb +++ b/app/controllers/personal_labs_controller.rb @@ -28,7 +28,7 @@ class PersonalLabsController < ApplicationController def show params = OrbitHelper.params - plugin = Lab.where(:is_hidden=>false).find_by(uid: params[:uid]) + plugin = Lab.where(:is_hidden=>false).find_by(uid: params[:uid].to_s) fields_to_show = [ "lab_title", "location",