Skip to content

Commit 126563c

Browse files
committed
fix: Improve string comparison
Signed-off-by: Cleopatra Enjeck M. <patrathewhiz@gmail.com>
1 parent 00c18bb commit 126563c

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
@@ -780,7 +780,7 @@ private function validateToken($token, $user = null) {
780780
* Check if login names match
781781
*/
782782
private function validateTokenLoginName(?string $loginName, IToken $token): bool {
783-
if (strtolower($token->getLoginName() ?? '') !== strtolower($loginName ?? '')) {
783+
if (strcasecmp($token->getLoginName(), $loginName ?? '') !== 0) {
784784
// TODO: this makes it impossible to use different login names on browser and client
785785
// e.g. login by e-mail 'user@example.com' on browser for generating the token will not
786786
// allow to use the client token with the login name 'user'.

0 commit comments

Comments
 (0)