diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-06-11 09:52:04 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-06-11 16:53:20 +0200 |
commit | 49d5030a532b811388c08a2340a6745255268107 (patch) | |
tree | 3a5e129b9db25e5d8f6a9ad392683ba5bd747e8f /lib | |
parent | 147073911fd2c4caf37c33bf4d5ae0e2727d8eba (diff) | |
download | nextcloud-server-49d5030a532b811388c08a2340a6745255268107.tar.gz nextcloud-server-49d5030a532b811388c08a2340a6745255268107.zip |
Fix userid casting in notifications
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Notification/Notification.php | 5 | ||||
-rw-r--r-- | lib/private/Repair/RemoveLinkShares.php | 2 | ||||
-rw-r--r-- | lib/public/Notification/INotification.php | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/Notification/Notification.php b/lib/private/Notification/Notification.php index ef7cdb5d444..ff3826047dd 100644 --- a/lib/private/Notification/Notification.php +++ b/lib/private/Notification/Notification.php @@ -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'); } diff --git a/lib/private/Repair/RemoveLinkShares.php b/lib/private/Repair/RemoveLinkShares.php index dd020dae502..ed1be705336 100644 --- a/lib/private/Repair/RemoveLinkShares.php +++ b/lib/private/Repair/RemoveLinkShares.php @@ -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); } } diff --git a/lib/public/Notification/INotification.php b/lib/public/Notification/INotification.php index 29f2a0e7943..f71d0c53cc8 100644 --- a/lib/public/Notification/INotification.php +++ b/lib/public/Notification/INotification.php @@ -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 |