Extended nicknames: allow dashes.
This commit is contained in:
parent
7d9ddbe689
commit
7214d57463
|
@ -63,7 +63,7 @@ This filter replaces the filename (not the path) of an upload. For complete obfu
|
||||||
* "masto": Copy verbatim, as in Mastodon.
|
* "masto": Copy verbatim, as in Mastodon.
|
||||||
* "noop": Don't copy the subject.
|
* "noop": Don't copy the subject.
|
||||||
* `always_show_subject_input`: When set to false, auto-hide the subject field when it's empty.
|
* `always_show_subject_input`: When set to false, auto-hide the subject field when it's empty.
|
||||||
* `extended_nickname_format`: Set to `true` to use extended local nicknames format (allows underscore). This will break federation with
|
* `extended_nickname_format`: Set to `true` to use extended local nicknames format (allows underscores/dashes). This will break federation with
|
||||||
older software for theses nicknames.
|
older software for theses nicknames.
|
||||||
|
|
||||||
## :fe
|
## :fe
|
||||||
|
|
|
@ -18,7 +18,7 @@ def parse_tags(text, data \\ %{}) do
|
||||||
def parse_mentions(text) do
|
def parse_mentions(text) do
|
||||||
# Modified from https://www.w3.org/TR/html5/forms.html#valid-e-mail-address
|
# Modified from https://www.w3.org/TR/html5/forms.html#valid-e-mail-address
|
||||||
regex =
|
regex =
|
||||||
~r/@[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]*@?[a-zA-Z0-9_](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/u
|
~r/@[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]*@?[a-zA-Z0-9_-](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/u
|
||||||
|
|
||||||
Regex.scan(regex, text)
|
Regex.scan(regex, text)
|
||||||
|> List.flatten()
|
|> List.flatten()
|
||||||
|
|
|
@ -14,7 +14,7 @@ defmodule Pleroma.User do
|
||||||
@email_regex ~r/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
|
@email_regex ~r/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
|
||||||
|
|
||||||
@strict_local_nickname_regex ~r/^[a-zA-Z\d]+$/
|
@strict_local_nickname_regex ~r/^[a-zA-Z\d]+$/
|
||||||
@extended_local_nickname_regex ~r/^[a-zA-Z\d_]+$/
|
@extended_local_nickname_regex ~r/^[a-zA-Z\d_-]+$/
|
||||||
|
|
||||||
schema "users" do
|
schema "users" do
|
||||||
field(:bio, :string)
|
field(:bio, :string)
|
||||||
|
|
Loading…
Reference in a new issue