Merge pull request #7 from kamionayuki/master

当params[:_rucaptcha] 不等于 session[:_rucaptcha]时,right 也为true
This commit is contained in:
Jason Lee 2015-10-28 09:54:28 +08:00
commit ddebafbbad
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ module RuCaptcha
end
def verify_rucaptcha?(resource = nil)
right = params[:_rucaptcha].present? and session[:_rucaptcha].present? and
right = params[:_rucaptcha].present? && session[:_rucaptcha].present? &&
params[:_rucaptcha].downcase.strip == session[:_rucaptcha]
if resource && resource.respond_to?(:errors)
resource.errors.add(:base, t('rucaptcha.invalid')) unless right