From bdf5c93c305e373e44c968c0ff69da2afb6f1b16 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 2 Jan 2019 09:49:03 -0100 Subject: [PATCH] force var to be integer Signed-off-by: Maxence Lange --- apps/files_sharing/lib/Controller/ShareAPIController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 1354c90a9f..21da5d72b1 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -239,6 +239,9 @@ class ShareAPIController extends OCSController { $shareWithStart = ($hasCircleId? strrpos($share->getSharedWith(), '[') + 1: 0); $shareWithLength = ($hasCircleId? -1: strpos($share->getSharedWith(), ' ')); + if (is_bool($shareWithLength)) { + $shareWithLength = -1; + } $result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength); } else if ($share->getShareType() === Share::SHARE_TYPE_ROOM) { $result['share_with'] = $share->getSharedWith();