diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e137c8e..a936561bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ 1. [](#new) * Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete object * Added support for `flex-ignore@` to hide all the nested fields in the blueprint +1. [](#bugfix) + * Fixed loggin with a capitalised email address when using old users [getgrav/grav-plugin-login#229](https://github.com/getgrav/grav-plugin-login/issues/229) # v1.7.35 ## 08/04/2022 diff --git a/system/src/Grav/Common/User/DataUser/UserCollection.php b/system/src/Grav/Common/User/DataUser/UserCollection.php index d0ada09c9..c997bdc44 100644 --- a/system/src/Grav/Common/User/DataUser/UserCollection.php +++ b/system/src/Grav/Common/User/DataUser/UserCollection.php @@ -112,11 +112,12 @@ public function find($query, $fields = ['username', 'email']): UserInterface // If not found, try the fields if (!$user->exists()) { + $query = mb_strtolower($query); foreach ($files as $file) { if (Utils::endsWith($file, YAML_EXT)) { $find_user = $this->load(trim(Utils::pathinfo($file, PATHINFO_FILENAME))); foreach ($fields as $field) { - if (isset($find_user[$field]) && $find_user[$field] === $query) { + if (isset($find_user[$field]) && mb_strtolower($find_user[$field]) === $query) { return $find_user; } }