Fix userid casting in notifications
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
147073911f
commit
49d5030a53
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
declare (strict_types = 1);
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
|
@ -133,7 +134,7 @@ class Notification implements INotification {
|
|||
* @throws \InvalidArgumentException if the app id is invalid
|
||||
* @since 8.2.0
|
||||
*/
|
||||
public function setApp($app) {
|
||||
public function setApp(string $app) {
|
||||
if (!is_string($app) || $app === '' || isset($app[32])) {
|
||||
throw new \InvalidArgumentException('The given app name is invalid');
|
||||
}
|
||||
|
@ -155,7 +156,7 @@ class Notification implements INotification {
|
|||
* @throws \InvalidArgumentException if the user id is invalid
|
||||
* @since 8.2.0
|
||||
*/
|
||||
public function setUser($user) {
|
||||
public function setUser(string $user) {
|
||||
if (!is_string($user) || $user === '' || isset($user[64])) {
|
||||
throw new \InvalidArgumentException('The given user id is invalid');
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ class RemoveLinkShares implements IRepairStep {
|
|||
|
||||
$users = array_keys($this->userToNotify);
|
||||
foreach ($users as $user) {
|
||||
$notification->setUser($user);
|
||||
$notification->setUser((string) $user);
|
||||
$this->notificationManager->notify($notification);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
declare (strict_types = 1);
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
|
@ -36,7 +37,7 @@ interface INotification {
|
|||
* @throws \InvalidArgumentException if the app id is invalid
|
||||
* @since 9.0.0
|
||||
*/
|
||||
public function setApp($app);
|
||||
public function setApp(string $app);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
@ -50,7 +51,7 @@ interface INotification {
|
|||
* @throws \InvalidArgumentException if the user id is invalid
|
||||
* @since 9.0.0
|
||||
*/
|
||||
public function setUser($user);
|
||||
public function setUser(string $user);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
|
Loading…
Reference in New Issue