Aliases: fix URL regex
authorAlex Gleason <alex@alexgleason.me>
Thu, 8 Oct 2020 21:33:47 +0000 (16:33 -0500)
committerAlex Gleason <alex@alexgleason.me>
Thu, 8 Oct 2020 21:33:47 +0000 (16:33 -0500)
lib/pleroma/user.ex

index e0252c8ee77c5146c030b8b69793d1c03e656462..d66c92b14916b2a537b9553559c8ef25b8cccbd7 100644 (file)
@@ -51,8 +51,7 @@ defmodule Pleroma.User do
 
   # credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
   @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])?)*$/
-  # credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
-  @url_regex ~r/https?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/
+  @url_regex ~r/^https?:\/\/[^\s]{1,256}$/
 
   @strict_local_nickname_regex ~r/^[a-zA-Z\d]+$/
   @extended_local_nickname_regex ~r/^[a-zA-Z\d_-]+$/