X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fapioauthstore.php;h=eca93866f002bc982c53aea354d88f2847ebd917;hb=621233e1ad6956cfb543042a1493a04b243e92ca;hp=84c4c78e53568fb206649914ddfbf97baff1e8ca;hpb=39802077a861c2d4e15bae5f04c9f7dbf94151b8;p=quix0rs-gnu-social.git diff --git a/lib/apioauthstore.php b/lib/apioauthstore.php index 84c4c78e53..eca93866f0 100644 --- a/lib/apioauthstore.php +++ b/lib/apioauthstore.php @@ -149,7 +149,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore // Okay, good return new OAuthToken($at->tok, $at->secret); } - } else { return null; } @@ -173,13 +172,15 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore $rt->tok = $token_key; $rt->type = $type; $rt->state = 0; + if (!$rt->find(true)) { // TRANS: Exception thrown when an attempt is made to revoke an unknown token. - throw new Exception(_('Tried to revoke unknown token')); + throw new Exception(_('Tried to revoke unknown token.')); } + if (!$rt->delete()) { // TRANS: Exception thrown when an attempt is made to remove a revoked token. - throw new Exception(_('Failed to delete revoked token')); + throw new Exception(_('Failed to delete revoked token.')); } } }