Fix use Sharing Api with calendar

Without this fix it logs this error:
Undefined index: itemSourceName at /opt/local/apache2/htdocs/oc7/core/ajax/share.php#44
I think the itemSourceName is only used with sharing files!
This commit is contained in:
libasys 2014-07-08 10:57:51 +02:00
parent 687cd7fe83
commit e6b093bfb9
1 changed files with 3 additions and 2 deletions

View File

@ -34,14 +34,15 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
if ($shareType === OCP\Share::SHARE_TYPE_LINK && $shareWith == '') { if ($shareType === OCP\Share::SHARE_TYPE_LINK && $shareWith == '') {
$shareWith = null; $shareWith = null;
} }
$itemSourceName=(isset($_POST['itemSourceName'])) ? $_POST['itemSourceName']:'';
$token = OCP\Share::shareItem( $token = OCP\Share::shareItem(
$_POST['itemType'], $_POST['itemType'],
$_POST['itemSource'], $_POST['itemSource'],
$shareType, $shareType,
$shareWith, $shareWith,
$_POST['permissions'], $_POST['permissions'],
$_POST['itemSourceName'], $itemSourceName,
(!empty($_POST['expirationDate']) ? new \DateTime($_POST['expirationDate']) : null) (!empty($_POST['expirationDate']) ? new \DateTime($_POST['expirationDate']) : null)
); );