Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-12-04 13:58:40 +0300
committerJoas Schilling <coding@schilljs.com>2020-12-10 13:47:04 +0300
commit11e8e28b87467954546ed5c5acf7ad78b38ec8f3 (patch)
tree66c29de975c913aa8e25f9b86f4fa347e24b7d7c /lib/Controller
parent4ebae32362d081c144717c58d4549e22aabb683e (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.php10
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;