fix unsanitized -> sanitized typo, and don't add a new variable just to remove newlines

This commit is contained in:
erik-krogh
2024-04-03 09:19:18 +02:00
parent 1f27eb3658
commit ec32bdce63

View File

@@ -5,9 +5,8 @@ class UsersController < ApplicationController
logger = Logger.new STDOUT
username = params[:username]
# GOOD: log message constructed with unsanitized user input
sanitized_username = username.gsub("\n", "")
logger.info "attempting to login user: " + sanitized_username
# GOOD: log message constructed with sanitized user input
logger.info "attempting to login user: " + sanitized_username.gsub("\n", "")
# ... login logic ...
end