]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Nickname::normalize now checks for path name collision too.
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 16 Oct 2013 11:22:43 +0000 (13:22 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 16 Oct 2013 11:22:43 +0000 (13:22 +0200)
lib/nickname.php

index 4d3795e392231fe5a8bd9966f8f28f504dd847c7..e05e58c83bc4e88d64bd94b71295d1ca195dbf20 100644 (file)
@@ -118,6 +118,9 @@ class Nickname
         if (!self::isCanonical($str)) {
             throw new NicknameInvalidException();
         }
+        if (!User::allowed_nickname($str)) {
+            throw new NicknameBlacklistException();
+        }
 
         return $str;
     }
@@ -194,3 +197,12 @@ class NicknameTooLongException extends NicknameInvalidException
                        Nickname::MAX_LEN);
     }
 }
+
+class NicknameBlacklistException extends NicknameInvalidException
+{
+    protected function defaultMessage()
+    {
+        // TRANS: Validation error in form for registration, profile and group settings, etc.
+        return _('Nickname is disallowed through blacklist or system path list.');
+    }
+}