From d95c3cb550bbbc44c22bce5ef758f0c2d502bbeb Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 20 Sep 2020 02:35:56 -0500 Subject: [Registration] Convert non-Unix newlines before verifying form --- app/models/user.rb | 2 +- public/registration.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index d20922993..0b2d61862 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -463,7 +463,7 @@ class User < ApplicationRecord end def kobold_hash - value = [account.username, username.downcase, email, invite_request.text].compact.map(&:downcase).join("\u{F0666}") + value = [account.username, username.downcase, email, invite_request.text.gsub(/\r\n?/, "\n")].compact.map(&:downcase).join("\u{F0666}") Digest::SHA512.hexdigest(value).upcase end diff --git a/public/registration.js b/public/registration.js index 0533a48c3..a859313a2 100644 --- a/public/registration.js +++ b/public/registration.js @@ -34,7 +34,7 @@ function handleSubmit(e) { const value = element.value; if (!!element && ['text', 'email', 'textarea'].includes(element.type) && !!value) { - values.push(value.trim().toLowerCase()); + values.push(value.trim().toLowerCase().replace(/\r\n?/g, "\n")); } } -- cgit