diff options
author | Joas Schilling <coding@schilljs.com> | 2020-12-04 13:58:40 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-12-10 13:47:04 +0300 |
commit | 11e8e28b87467954546ed5c5acf7ad78b38ec8f3 (patch) | |
tree | 66c29de975c913aa8e25f9b86f4fa347e24b7d7c /lib/Controller | |
parent | 4ebae32362d081c144717c58d4549e22aabb683e (diff) |
Interact with integers so we can match it better in queries
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/SettingsController.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index db6b27e90..65907254a 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -72,10 +72,10 @@ class SettingsController extends OCSController { * @NoAdminRequired * * @param string $key - * @param string|null $value + * @param string|int|null $value * @return DataResponse */ - public function setUserSetting(string $key, ?string $value): DataResponse { + public function setUserSetting(string $key, $value): DataResponse { if (!$this->validateUserSetting($key, $value)) { return new DataResponse([], Http::STATUS_BAD_REQUEST); } @@ -85,7 +85,7 @@ class SettingsController extends OCSController { return new DataResponse(); } - protected function validateUserSetting(string $setting, ?string $value): bool { + protected function validateUserSetting(string $setting, $value): bool { if ($setting === 'attachment_folder') { $userFolder = $this->rootFolder->getUserFolder($this->userId); try { @@ -105,8 +105,8 @@ class SettingsController extends OCSController { } if ($setting === 'read_status_privacy') { - return $value === Participant::PRIVACY_PUBLIC || - $value === Participant::PRIVACY_PRIVATE; + return (int) $value === Participant::PRIVACY_PUBLIC || + (int) $value === Participant::PRIVACY_PRIVATE; } return false; |