DEV: using send can be harmful, public_send is less risky (#16135)

I can't see any harmful use case here, especially because only one param can be used ATM.
This commit is contained in:
Joffrey JAFFEUX 2022-03-08 17:13:26 +01:00 committed by GitHub
parent 28842d24d6
commit 690036225f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ class Admin::SiteSettingsController < Admin::AdminController
end
update_existing_users = params[:update_existing_user].present?
previous_value = SiteSetting.send(id) || "" if update_existing_users
previous_value = SiteSetting.public_send(id) || "" if update_existing_users
SiteSetting.set_and_log(id, value, current_user)