Skip to content

Commit

Permalink
[IP spinner] mark as spam requests with no spinner value (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
markets authored Mar 17, 2024
1 parent fc5dd70 commit 3a6abf2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/invisible_captcha/controller_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def detect_spam(options = {})
on_timestamp_spam(options)
return if performed?
end

if honeypot_spam?(options) || spinner_spam?
on_spam(options)
end
Expand Down Expand Up @@ -75,7 +76,7 @@ def timestamp_spam?(options = {})
end

def spinner_spam?
if InvisibleCaptcha.spinner_enabled && params[:spinner] != session[:invisible_captcha_spinner]
if InvisibleCaptcha.spinner_enabled && (params[:spinner].blank? || params[:spinner] != session[:invisible_captcha_spinner])
warn_spam("Spinner value mismatch")
return true
end
Expand Down

0 comments on commit 3a6abf2

Please sign in to comment.