Skip to content

Commit de9e9ab

Browse files
enjeckbackportbot[bot]
authored andcommitted
fix: Improve string comparison
Signed-off-by: Cleopatra Enjeck M. <[email protected]>
1 parent 32b181d commit de9e9ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/User/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ private function validateToken($token, $user = null) {
809809
* Check if login names match
810810
*/
811811
private function validateTokenLoginName(?string $loginName, IToken $token): bool {
812-
if (strtolower($token->getLoginName() ?? '') !== strtolower($loginName ?? '')) {
812+
if (strcasecmp($token->getLoginName(), $loginName ?? '') !== 0) {
813813
// TODO: this makes it impossible to use different login names on browser and client
814814
// e.g. login by e-mail '[email protected]' on browser for generating the token will not
815815
// allow to use the client token with the login name 'user'.

0 commit comments

Comments
 (0)