Merge remote-tracking branch 'upstream/master'
[quix0rs-gnu-social.git] / lib / nickname.php
index 80be6239c500decb6064920e21f342c924acd36d..1ed0abbe78dbfcec46365c97f73684cb2ff34b83 100644 (file)
@@ -48,6 +48,14 @@ class Nickname
      */
     const DISPLAY_FMT = '[0-9a-zA-Z_]{1,64}';
 
+    /**
+     * Simplified regex fragment for acceptable full WebFinger ID of a user
+     *
+     * We could probably use an email regex here, but mainly we are interested
+     * in matching it in our URLs, like https://social.example/user@example.com
+     */
+    const WEBFINGER_FMT = '[0-9a-zA-Z_]{1,64}\@[0-9a-zA-Z_-.]{3,255}';
+
     /**
      * Regex fragment for checking a canonical nickname.
      *