Fixed Argument 1 passed to Grav\Common\User\DataUser\User::filterUsername() must be of the type string [#1992]

This commit is contained in:
Matias Griese
2020-12-10 15:07:38 +02:00
parent ea358c239f
commit d34593928d
5 changed files with 8 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
* Fixed broken list in `bin/gpm index` [#3092](https://github.com/getgrav/grav/issues/3092)
* Fixed CLI/GPM command failures returning 0 (success) value [#3017](https://github.com/getgrav/grav/issues/3017)
* Fixed unimplemented `PageObject::getOriginal()` call [#3098](https://github.com/getgrav/grav/issues/3098)
* Fixed `Argument 1 passed to Grav\Common\User\DataUser\User::filterUsername() must be of the type string` [#1992](https://github.com/getgrav/grav-plugin-admin/issues/1992)
# v1.7.0-rc.19
## 12/02/2020

View File

@@ -43,6 +43,8 @@ class UserCollection extends FlexCollection implements UserCollectionInterface
*/
public function load($username): UserInterface
{
$username = (string)$username;
if ($username !== '') {
$key = $this->filterUsername($username);
$user = $this->get($key);

View File

@@ -79,6 +79,8 @@ class UserIndex extends FlexIndex
*/
public function load($username): UserInterface
{
$username = (string)$username;
if ($username !== '') {
$key = static::filterUsername($username, $this->getFlexDirectory()->getStorage());
$user = $this->get($key);

View File

@@ -120,7 +120,7 @@ class User extends Data implements UserInterface
}
if ($file) {
$username = $this->filterUsername($this->get('username'));
$username = $this->filterUsername((string)$this->get('username'));
if (!$file->filename()) {
$locator = Grav::instance()['locator'];

View File

@@ -48,6 +48,8 @@ class UserCollection implements UserCollectionInterface
*/
public function load($username): UserInterface
{
$username = (string)$username;
$grav = Grav::instance();
/** @var UniformResourceLocator $locator */
$locator = $grav['locator'];