]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Ticket #3076: fix regression in password recovery when email address given that doesn...
authorBrion Vibber <brion@pobox.com>
Wed, 9 Mar 2011 23:46:24 +0000 (15:46 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 9 Mar 2011 23:46:24 +0000 (15:46 -0800)
Was triggering errors due to use of common_canonical_nickname() on arbitrary input without checking for exceptions about invalid nicknames (which didn't exist long ago in the before time)

actions/recoverpassword.php

index 9019d6fb227359ba0b17c37801577e8458462b4f..a73872bfdb16f1ee2afc8369cd75665235076a7d 100644 (file)
@@ -282,7 +282,11 @@ class RecoverpasswordAction extends Action
         $user = User::staticGet('email', common_canonical_email($nore));
 
         if (!$user) {
-            $user = User::staticGet('nickname', common_canonical_nickname($nore));
+            try {
+                $user = User::staticGet('nickname', common_canonical_nickname($nore));
+            } catch (NicknameException $e) {
+                // invalid
+            }
         }
 
         # See if it's an unconfirmed email address