Fix screen_name regex being too lenient

This commit is contained in:
Andreas Nedbal 2023-01-21 06:30:33 +01:00 committed by Andreas Nedbal
parent 7222f36ef3
commit 47bccdb0c3
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ class User < ApplicationRecord # rubocop:disable Metrics/ClassLength
foreign_key: "banned_by_id",
dependent: :nullify
SCREEN_NAME_REGEX = /[a-zA-Z0-9_]/
SCREEN_NAME_REGEX = /\A[a-zA-Z0-9_]+\z/
WEBSITE_REGEX = /https?:\/\/([A-Za-z.-]+)\/?(?:.*)/i
before_validation do