force var to be integer

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
Maxence Lange 2019-01-02 09:49:03 -01:00
parent 0c746c0826
commit bdf5c93c30

View file

@ -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();