]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix exception getCode type
authorCarl Schwan <carl@carlschwan.eu>
Mon, 17 Oct 2022 10:36:50 +0000 (12:36 +0200)
committerCarl Schwan <carl@carlschwan.eu>
Mon, 17 Oct 2022 10:36:50 +0000 (12:36 +0200)
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
apps/files_sharing/lib/Controller/ShareAPIController.php

index 1212414790c1959546618261ec4fa5719c4e20ed..0a876e98912fb640d6282363b9fa7c328e9f8dfc 100644 (file)
@@ -1271,7 +1271,7 @@ class ShareAPIController extends OCSController {
                        $share = $this->shareManager->updateShare($share);
                } catch (GenericShareException $e) {
                        $code = $e->getCode() === 0 ? 403 : $e->getCode();
-                       throw new OCSException($e->getHint(), $code);
+                       throw new OCSException($e->getHint(), (int)$code);
                } catch (\Exception $e) {
                        throw new OCSBadRequestException($e->getMessage(), $e);
                }
@@ -1353,7 +1353,7 @@ class ShareAPIController extends OCSController {
                        $this->shareManager->acceptShare($share, $this->currentUser);
                } catch (GenericShareException $e) {
                        $code = $e->getCode() === 0 ? 403 : $e->getCode();
-                       throw new OCSException($e->getHint(), $code);
+                       throw new OCSException($e->getHint(), (int)$code);
                } catch (\Exception $e) {
                        throw new OCSBadRequestException($e->getMessage(), $e);
                }