From: dtluna Date: Mon, 24 Apr 2017 12:33:27 +0000 (+0300) Subject: Add restriction on names X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=668b01da0b9f339aabedaae424023e60a38c2529;p=akkoma Add restriction on names --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 3ce07d510..5e579dc44 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -63,6 +63,7 @@ defmodule Pleroma.User do |> validate_confirmation(:password) |> unique_constraint(:email) |> unique_constraint(:nickname) + |> validate_format(:nickname, ~r/^[a-zA-Z\d]+$/) if changeset.valid? do hashed = Comeonin.Pbkdf2.hashpwsalt(changeset.changes[:password])