diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php index 635d9d5d0..8c3b2a129 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook.php @@ -223,7 +223,7 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider { $iCount = 0; - if (\class_exists('SabreForRainLoop\DAV\Client') && $this->IsActive() && \is_string($sVcfData)) + if (\class_exists('Sabre\DAV\Client') && $this->IsActive() && \is_string($sVcfData)) { $sVcfData = \trim($sVcfData); if ("\xef\xbb\xbf" === \substr($sVcfData, 0, 3)) @@ -234,7 +234,7 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider $oVCardSplitter = null; try { - $oVCardSplitter = new \SabreForRainLoop\VObject\Splitter\VCard($sVcfData); + $oVCardSplitter = new \Sabre\VObject\Splitter\VCard($sVcfData); } catch (\Throwable $oExc) { @@ -249,13 +249,13 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider while ($oVCard = $oVCardSplitter->getNext()) { - if ($oVCard instanceof \SabreForRainLoop\VObject\Component\VCard) + if ($oVCard instanceof \Sabre\VObject\Component\VCard) { \MailSo\Base\Utils::ResetTimeLimit(); if (empty($oVCard->UID)) { - $oVCard->UID = \SabreForRainLoop\DAV\UUIDUtil::getUUID(); + $oVCard->UID = \Sabre\DAV\UUIDUtil::getUUID(); } $oContact->PopulateByVCard($oVCard->UID, $oVCard->serialize()); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php index 3a564f7ba..72fb82175 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php @@ -163,8 +163,8 @@ class Contact implements \JsonSerializable public function RegenerateContactStr() : void { - $this->IdContactStr = \class_exists('SabreForRainLoop\DAV\Client') ? - \SabreForRainLoop\DAV\UUIDUtil::getUUID() : \MailSo\Base\Utils::Md5Rand(); + $this->IdContactStr = \class_exists('Sabre\DAV\Client') ? + \Sabre\DAV\UUIDUtil::getUUID() : \MailSo\Base\Utils::Md5Rand(); } public function GetEmails() : array @@ -190,7 +190,7 @@ class Contact implements \JsonSerializable { $this->UpdateDependentValues(); - if (!\class_exists('SabreForRainLoop\DAV\Client')) + if (!\class_exists('Sabre\DAV\Client')) { return ''; } @@ -205,7 +205,7 @@ class Contact implements \JsonSerializable { try { - $oVCard = \SabreForRainLoop\VObject\Reader::read($sPreVCard); + $oVCard = \Sabre\VObject\Reader::read($sPreVCard); } catch (\Throwable $oExc) { @@ -224,7 +224,7 @@ class Contact implements \JsonSerializable if (!$oVCard) { - $oVCard = new \SabreForRainLoop\VObject\Component\VCard(); + $oVCard = new \Sabre\VObject\Component\VCard(); } $oVCard->VERSION = '3.0'; @@ -510,7 +510,7 @@ class Contact implements \JsonSerializable $this->Properties = array(); - if (!\class_exists('SabreForRainLoop\DAV\Client')) + if (!\class_exists('Sabre\DAV\Client')) { return false; } @@ -524,7 +524,7 @@ class Contact implements \JsonSerializable try { - $oVCard = \SabreForRainLoop\VObject\Reader::read($sVCard); + $oVCard = \Sabre\VObject\Reader::read($sVCard); } catch (\Throwable $oExc) { @@ -621,7 +621,7 @@ class Contact implements \JsonSerializable $this->addArrayPropertyHelper($aProperties, $oVCard->TEL, PropertyType::PHONE); } - $sUidValue = $oVCard->UID ? (string) $oVCard->UID : \SabreForRainLoop\DAV\UUIDUtil::getUUID(); + $sUidValue = $oVCard->UID ? (string) $oVCard->UID : \Sabre\DAV\UUIDUtil::getUUID(); $aProperties[] = new Property(PropertyType::UID, $sUidValue); if (empty($this->IdContactStr)) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/PdoAddressBook.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/PdoAddressBook.php index 1fba18443..f8f1aed03 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/PdoAddressBook.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/AddressBook/PdoAddressBook.php @@ -214,7 +214,7 @@ class PdoAddressBook return $aResponse; } - private function detectionPropFind(\SabreForRainLoop\DAV\Client $oClient, string $sPath) : ?array + private function detectionPropFind(\Sabre\DAV\Client $oClient, string $sPath) : ?array { $aResponse = null; @@ -239,7 +239,7 @@ class PdoAddressBook return $aResponse; } - private function getContactsPaths(\SabreForRainLoop\DAV\Client $oClient, string $sUser, string $sPassword, string $sProxy = '') : array + private function getContactsPaths(\Sabre\DAV\Client $oClient, string $sUser, string $sPassword, string $sProxy = '') : array { $aContactsPaths = array(); @@ -285,7 +285,7 @@ class PdoAddressBook if (empty($sNextPath)) { $oResourceType = isset($aItem['{DAV:}resourcetype']) ? $aItem['{DAV:}resourcetype'] : null; - /* @var $oResourceType \SabreForRainLoop\DAV\Property\ResourceType */ + /* @var $oResourceType \Sabre\DAV\Property\ResourceType */ if ($oResourceType && $oResourceType->is('{DAV:}collection')) { $sNextPath = $sKey; @@ -408,7 +408,7 @@ class PdoAddressBook if (!empty($sKey) && $aItem && isset($aItem['{DAV:}resourcetype'])) { $oResourceType = $aItem['{DAV:}resourcetype']; - /* @var $oResourceType \SabreForRainLoop\DAV\Property\ResourceType */ + /* @var $oResourceType \Sabre\DAV\Property\ResourceType */ if ($oResourceType && $oResourceType->is('{DAV:}collection')) { @@ -425,7 +425,7 @@ class PdoAddressBook return $aContactsPaths; } - private function checkContactsPath(\SabreForRainLoop\DAV\Client $oClient, string $sPath) : bool + private function checkContactsPath(\Sabre\DAV\Client $oClient, string $sPath) : bool { if (!$oClient) { @@ -456,7 +456,7 @@ class PdoAddressBook if (!empty($sKey) && isset($aItem['{DAV:}resourcetype'])) { $oResourceType = $aItem['{DAV:}resourcetype']; - /* @var $oResourceType \SabreForRainLoop\DAV\Property\ResourceType */ + /* @var $oResourceType \Sabre\DAV\Property\ResourceType */ if ($oResourceType && $oResourceType->is('{DAV:}collection') && $oResourceType->is('{urn:ietf:params:xml:ns:carddav}addressbook')) @@ -475,7 +475,7 @@ class PdoAddressBook return $bGood; } - public function getDavClientFromUrl(string $sUrl, string $sUser, string $sPassword, string $sProxy = '') : \SabreForRainLoop\DAV\Client + public function getDavClientFromUrl(string $sUrl, string $sUser, string $sPassword, string $sProxy = '') : \Sabre\DAV\Client { if (!\preg_match('/^http[s]?:\/\//i', $sUrl)) { @@ -509,7 +509,7 @@ class PdoAddressBook $aSettings['proxy'] = $sProxy; } - $oClient = new \SabreForRainLoop\DAV\Client($aSettings); + $oClient = new \Sabre\DAV\Client($aSettings); $oClient->setVerifyPeer(false); $oClient->__UrlPath__ = $aUrl['path']; @@ -519,9 +519,9 @@ class PdoAddressBook return $oClient; } - public function getDavClient(string $sUrl, string $sUser, string $sPassword, string $sProxy = '') : ?\SabreForRainLoop\DAV\Client + public function getDavClient(string $sUrl, string $sUser, string $sPassword, string $sProxy = '') : ?\Sabre\DAV\Client { - if (!\class_exists('SabreForRainLoop\DAV\Client')) + if (!\class_exists('Sabre\DAV\Client')) { return null; } diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/AbstractBackend.php b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/AbstractBackend.php similarity index 91% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/AbstractBackend.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/AbstractBackend.php index eab644076..06fdbd9a9 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/AbstractBackend.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/AbstractBackend.php @@ -1,18 +1,18 @@ getCalendarObjects($calendarId); - $validator = new \SabreForRainLoop\CalDAV\CalendarQueryValidator(); + $validator = new \Sabre\CalDAV\CalendarQueryValidator(); foreach($objects as $object) { diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/BackendInterface.php b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/BackendInterface.php similarity index 96% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/BackendInterface.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/BackendInterface.php index ddfe5d8c0..e2a034240 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/BackendInterface.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/BackendInterface.php @@ -1,13 +1,13 @@ getValue()); } @@ -255,16 +255,16 @@ class PDO extends AbstractBackend { break; default : // Checking the property map - if (!isset($this->propertyMap[$propertyName])) { + if (isset($this->propertyMap[$propertyName])) { // We don't know about this property. $hasError = true; $result[403][$propertyName] = null; unset($mutations[$propertyName]); - break; - } + } else { - $fieldName = $this->propertyMap[$propertyName]; - $newValues[$fieldName] = $propertyValue; + $fieldName = $this->propertyMap[$propertyName]; + $newValues[$fieldName] = $propertyValue; + } } } @@ -497,7 +497,7 @@ class PDO extends AbstractBackend { } } if (!$componentType) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('Calendar objects must have a VJOURNAL, VEVENT or VTODO component'); + throw new \Sabre\DAV\Exception\BadRequest('Calendar objects must have a VJOURNAL, VEVENT or VTODO component'); } if ($componentType === 'VEVENT') { $firstOccurence = $component->DTSTART->getDateTime()->getTimeStamp(); @@ -572,7 +572,7 @@ class PDO extends AbstractBackend { * query. * * The list of filters are specified as an array. The exact array is - * documented by \SabreForRainLoop\CalDAV\CalendarQueryParser. + * documented by \Sabre\CalDAV\CalendarQueryParser. * * Note that it is extremely likely that getCalendarObject for every path * returned from this method will be called almost immediately after. You @@ -601,7 +601,7 @@ class PDO extends AbstractBackend { * time-range filter specified on a VEVENT must for instance also handle * recurrence rules correctly. * A good example of how to interprete all these filters can also simply - * be found in \SabreForRainLoop\CalDAV\CalendarQueryFilter. This class is as correct + * be found in \Sabre\CalDAV\CalendarQueryFilter. This class is as correct * as possible, so it gives you a good idea on what type of stuff you need * to think of. * @@ -615,7 +615,7 @@ class PDO extends AbstractBackend { public function calendarQuery($calendarId, array $filters) { $result = array(); - $validator = new \SabreForRainLoop\CalDAV\CalendarQueryValidator(); + $validator = new \Sabre\CalDAV\CalendarQueryValidator(); $componentType = null; $requirePostFilter = true; diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/SharingSupport.php b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/SharingSupport.php similarity index 94% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/SharingSupport.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/SharingSupport.php index 3bfcc145d..2d1e3662e 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/SharingSupport.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Backend/SharingSupport.php @@ -1,6 +1,6 @@ xpath->query('/cal:calendar-query/cal:filter'); if ($filter->length !== 1) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('Only one filter element is allowed'); + throw new \Sabre\DAV\Exception\BadRequest('Only one filter element is allowed'); } $compFilters = $this->parseCompFilters($filter->item(0)); if (count($compFilters)!==1) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('There must be exactly 1 top-level comp-filter.'); + throw new \Sabre\DAV\Exception\BadRequest('There must be exactly 1 top-level comp-filter.'); } $this->filters = $compFilters[0]; - $this->requestedProperties = array_keys(\SabreForRainLoop\DAV\XMLUtil::parseProperties($this->dom->firstChild)); + $this->requestedProperties = array_keys(\Sabre\DAV\XMLUtil::parseProperties($this->dom->firstChild)); $expand = $this->xpath->query('/cal:calendar-query/dav:prop/cal:calendar-data/cal:expand'); if ($expand->length>0) { @@ -132,7 +132,7 @@ class CalendarQueryParser { 'VFREEBUSY', 'VALARM', ))) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The time-range filter is not defined for the ' . $compFilter['name'] . ' component'); + throw new \Sabre\DAV\Exception\BadRequest('The time-range filter is not defined for the ' . $compFilter['name'] . ' component'); }; $result[] = $compFilter; @@ -253,7 +253,7 @@ class CalendarQueryParser { } if (!is_null($start) && !is_null($end) && $end <= $start) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the time-range filter'); + throw new \Sabre\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the time-range filter'); } return array( @@ -273,19 +273,19 @@ class CalendarQueryParser { $start = $parentNode->getAttribute('start'); if(!$start) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The "start" attribute is required for the CALDAV:expand element'); + throw new \Sabre\DAV\Exception\BadRequest('The "start" attribute is required for the CALDAV:expand element'); } $start = VObject\DateTimeParser::parseDateTime($start); $end = $parentNode->getAttribute('end'); if(!$end) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The "end" attribute is required for the CALDAV:expand element'); + throw new \Sabre\DAV\Exception\BadRequest('The "end" attribute is required for the CALDAV:expand element'); } $end = VObject\DateTimeParser::parseDateTime($end); if ($end <= $start) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the expand element.'); + throw new \Sabre\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the expand element.'); } return array( diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryValidator.php b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/CalendarQueryValidator.php similarity index 94% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryValidator.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/CalendarQueryValidator.php index 4537d3bf5..c9cb46338 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryValidator.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/CalendarQueryValidator.php @@ -1,8 +1,8 @@ name . ' components'); + throw new \Sabre\DAV\Exception\NotImplemented('time-range filters are currently not supported on ' . $component->name . ' components'); case 'COMPLETED' : case 'CREATED' : @@ -383,7 +383,7 @@ class CalendarQueryValidator { default : - throw new \SabreForRainLoop\DAV\Exception\BadRequest('You cannot create a time-range filter on a ' . $component->name . ' component'); + throw new \Sabre\DAV\Exception\BadRequest('You cannot create a time-range filter on a ' . $component->name . ' component'); } diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarRootNode.php b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/CalendarRootNode.php similarity index 78% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarRootNode.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/CalendarRootNode.php index 69e01b1a4..905155a60 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarRootNode.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/CalendarRootNode.php @@ -1,8 +1,8 @@ xmlNamespaces[self::NS_CALDAV] = 'cal'; $server->xmlNamespaces[self::NS_CALENDARSERVER] = 'cs'; - $server->propertyMap['{' . self::NS_CALDAV . '}supported-calendar-component-set'] = 'SabreForRainLoop\\CalDAV\\Property\\SupportedCalendarComponentSet'; - $server->propertyMap['{' . self::NS_CALDAV . '}schedule-calendar-transp'] = 'SabreForRainLoop\\CalDAV\\Property\\ScheduleCalendarTransp'; + $server->propertyMap['{' . self::NS_CALDAV . '}supported-calendar-component-set'] = 'Sabre\\CalDAV\\Property\\SupportedCalendarComponentSet'; + $server->propertyMap['{' . self::NS_CALDAV . '}schedule-calendar-transp'] = 'Sabre\\CalDAV\\Property\\ScheduleCalendarTransp'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Schedule\\IOutbox'] = '{urn:ietf:params:xml:ns:caldav}schedule-outbox'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Principal\\IProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Principal\\IProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Notifications\\ICollection'] = '{' . self::NS_CALENDARSERVER . '}notification'; + $server->resourceTypeMapping['\\Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar'; + $server->resourceTypeMapping['\\Sabre\\CalDAV\\Schedule\\IOutbox'] = '{urn:ietf:params:xml:ns:caldav}schedule-outbox'; + $server->resourceTypeMapping['\\Sabre\\CalDAV\\Principal\\IProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read'; + $server->resourceTypeMapping['\\Sabre\\CalDAV\\Principal\\IProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write'; + $server->resourceTypeMapping['\\Sabre\\CalDAV\\Notifications\\ICollection'] = '{' . self::NS_CALENDARSERVER . '}notification'; array_push($server->protectedProperties, @@ -286,7 +286,7 @@ class Plugin extends DAV\ServerPlugin { // for clients matching iCal in the user agent //$ua = $this->server->httpRequest->getHeader('User-Agent'); //if (strpos($ua,'iCal/')!==false) { - // throw new \SabreForRainLoop\DAV\Exception\Forbidden('iCal has major bugs in it\'s RFC3744 support. Therefore we are left with no other choice but disabling this feature.'); + // throw new \Sabre\DAV\Exception\Forbidden('iCal has major bugs in it\'s RFC3744 support. Therefore we are left with no other choice but disabling this feature.'); //} $body = $this->server->httpRequest->getBody(true); diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/Collection.php b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Principal/Collection.php similarity index 75% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/Collection.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Principal/Collection.php index e4559c878..8de530bcb 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/Collection.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/Principal/Collection.php @@ -1,7 +1,7 @@ server = $server; - $server->resourceTypeMapping['SabreForRainLoop\\CalDAV\\ISharedCalendar'] = '{' . Plugin::NS_CALENDARSERVER . '}shared'; + $server->resourceTypeMapping['Sabre\\CalDAV\\ISharedCalendar'] = '{' . Plugin::NS_CALENDARSERVER . '}shared'; array_push( $this->server->protectedProperties, diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/UserCalendars.php b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/UserCalendars.php similarity index 95% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/UserCalendars.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/UserCalendars.php index 17f7956f0..e2bc36f36 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/UserCalendars.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CalDAV/UserCalendars.php @@ -1,23 +1,23 @@ xmlNamespaces[self::NS_CARDDAV] = 'card'; /* Mapping Interfaces to {DAV:}resourcetype values */ - $server->resourceTypeMapping['SabreForRainLoop\\CardDAV\\IAddressBook'] = '{' . self::NS_CARDDAV . '}addressbook'; - $server->resourceTypeMapping['SabreForRainLoop\\CardDAV\\IDirectory'] = '{' . self::NS_CARDDAV . '}directory'; + $server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook'] = '{' . self::NS_CARDDAV . '}addressbook'; + $server->resourceTypeMapping['Sabre\\CardDAV\\IDirectory'] = '{' . self::NS_CARDDAV . '}directory'; /* Adding properties that may never be changed */ $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-address-data'; @@ -73,7 +73,7 @@ class Plugin extends DAV\ServerPlugin { $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}addressbook-home-set'; $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-collation-set'; - $server->propertyMap['{http://calendarserver.org/ns/}me-card'] = 'SabreForRainLoop\\DAV\\Property\\Href'; + $server->propertyMap['{http://calendarserver.org/ns/}me-card'] = 'Sabre\\DAV\\Property\\Href'; $this->server = $server; @@ -654,7 +654,7 @@ class Plugin extends DAV\ServerPlugin { /** * This method is used to generate HTML output for the - * SabreForRainLoop\DAV\Browser\Plugin. This allows us to generate an interface users + * Sabre\DAV\Browser\Plugin. This allows us to generate an interface users * can use to create new calendars. * * @param DAV\INode $node diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Property/SupportedAddressData.php b/snappymail/v/0.0.0/app/libraries/Sabre/CardDAV/Property/SupportedAddressData.php similarity index 87% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Property/SupportedAddressData.php rename to snappymail/v/0.0.0/app/libraries/Sabre/CardDAV/Property/SupportedAddressData.php index 084c06f32..39433234a 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Property/SupportedAddressData.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/CardDAV/Property/SupportedAddressData.php @@ -1,9 +1,9 @@ 'icons/file', - 'SabreForRainLoop\\DAV\\ICollection' => 'icons/collection', - 'SabreForRainLoop\\DAVACL\\IPrincipal' => 'icons/principal', - 'SabreForRainLoop\\CalDAV\\ICalendar' => 'icons/calendar', - 'SabreForRainLoop\\CardDAV\\IAddressBook' => 'icons/addressbook', - 'SabreForRainLoop\\CardDAV\\ICard' => 'icons/card', + 'Sabre\\DAV\\IFile' => 'icons/file', + 'Sabre\\DAV\\ICollection' => 'icons/collection', + 'Sabre\\DAVACL\\IPrincipal' => 'icons/principal', + 'Sabre\\CalDAV\\ICalendar' => 'icons/calendar', + 'Sabre\\CardDAV\\IAddressBook' => 'icons/addressbook', + 'Sabre\\CardDAV\\ICard' => 'icons/card', ); /** @@ -49,7 +49,7 @@ class Plugin extends DAV\ServerPlugin { /** * reference to server class * - * @var SabreForRainLoop\DAV\Server + * @var Sabre\DAV\Server */ protected $server; @@ -374,7 +374,7 @@ class Plugin extends DAV\ServerPlugin { $html.=$output; $html.= " -
Generated by SabreDAV " . $version . " (c)2007-2013 http://code.google.com/p/sabredav/
+
Generated by SabreDAV " . $version . " (c)2007-2015 http://sabre.io/
"; @@ -400,7 +400,7 @@ class Plugin extends DAV\ServerPlugin { // We also know fairly certain that if an object is a non-extended // SimpleCollection, we won't need to show the panel either. - if (get_class($node)==='SabreForRainLoop\\DAV\\SimpleCollection') + if (get_class($node)==='Sabre\\DAV\\SimpleCollection') return; $output.= '
diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/favicon.ico b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/favicon.ico similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/favicon.ico rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/favicon.ico diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/addressbook.png b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/addressbook.png similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/addressbook.png rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/addressbook.png diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/calendar.png b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/calendar.png similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/calendar.png rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/calendar.png diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/card.png b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/card.png similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/card.png rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/card.png diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/collection.png b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/collection.png similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/collection.png rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/collection.png diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/file.png b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/file.png similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/file.png rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/file.png diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/parent.png b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/parent.png similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/parent.png rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/parent.png diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/principal.png b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/principal.png similarity index 100% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/principal.png rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Browser/assets/icons/principal.png diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Client.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Client.php similarity index 82% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Client.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Client.php index b751993e8..2d7ea4040 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Client.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Client.php @@ -1,6 +1,6 @@ authType = self::AUTH_BASIC | self::AUTH_DIGEST; } - $this->propertyMap['{DAV:}resourcetype'] = 'SabreForRainLoop\\DAV\\Property\\ResourceType'; + $this->propertyMap['{DAV:}resourcetype'] = 'Sabre\\DAV\\Property\\ResourceType'; } @@ -149,7 +149,7 @@ class Client { * @param int $depth * @return array */ - public function propFind($url, array $properties, $depth = 0) : array { + public function propFind($url, array $properties, $depth = 0) { $body = '' . "\n"; $body.= '' . "\n"; @@ -304,8 +304,9 @@ class Client { * @param string $url * @param string $body * @param array $headers + * @return array */ - public function request($method, $url = '', $body = null, $headers = array()) : array { + public function request($method, $url = '', $body = null, $headers = array()) { $url = $this->getAbsoluteUrl($url); @@ -313,22 +314,29 @@ class Client { CURLOPT_RETURNTRANSFER => true, // Return headers as part of the response CURLOPT_HEADER => true, - CURLOPT_POSTFIELDS => $body, - CURLOPT_USERAGENT => 'SnappyMail DAV Client', // TODO rainloop + + // For security we cast this to a string. If somehow an array could + // be passed here, it would be possible for an attacker to use @ to + // post local files. + CURLOPT_POSTFIELDS => (string)$body, + CURLOPT_USERAGENT => 'SnappyMail DAV Client', // TODO rainloop // Automatically follow redirects CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, + CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS, + CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS, ); if($this->verifyPeer !== null) { $curlSettings[CURLOPT_SSL_VERIFYPEER] = $this->verifyPeer; - // TODO rainloop - if (!$this->verifyPeer) { - $curlSettings[CURLOPT_SSL_VERIFYHOST] = 0; - } // --- + // TODO rainloop + if (!$this->verifyPeer) { + $curlSettings[CURLOPT_SSL_VERIFYHOST] = 0; + } + // END rainloop } - if($this->trustedCertificates) { + if($this->trustedCertificates) { $curlSettings[CURLOPT_CAINFO] = $this->trustedCertificates; } @@ -375,9 +383,6 @@ class Client { $curlSettings[CURLOPT_USERPWD] = $this->userName . ':' . $this->password; } -// var_dump($url); -// var_dump($curlSettings); - list( $response, $curlInfo, @@ -385,12 +390,9 @@ class Client { $curlError ) = $this->curlRequest($url, $curlSettings); -// var_dump($response); - $headerBlob = substr($response, 0, $curlInfo['header_size']); $response = substr($response, $curlInfo['header_size']); - // In the case of 100 Continue, or redirects we'll have multiple lists // of headers for each separate HTTP response. We can easily split this // because they are separated by \r\n\r\n @@ -417,7 +419,7 @@ class Client { ); if ($curlErrNo) { - throw new Exception('[CURL] Error while making request: ' . $curlError . ' (error code: ' . $curlErrNo . ', uri: ' . $url . ')'); + throw new Exception('[CURL] Error while making request: ' . $curlError . ' (error code: ' . $curlErrNo . ')'); } if ($response['statusCode']>=400) { @@ -468,70 +470,70 @@ class Client { // @codeCoverageIgnoreStart protected function curlRequest($url, $settings) { - // TODO rainloop + // TODO rainloop $curl = curl_init($url); - if (ini_get('open_basedir') === '') - { - curl_setopt_array($curl, $settings); - $data = curl_exec($curl); - } - else - { - $settings[CURLOPT_FOLLOWLOCATION] = false; - curl_setopt_array($curl, $settings); + if (ini_get('open_basedir') === '') + { + curl_setopt_array($curl, $settings); + $data = curl_exec($curl); + } + else + { + $settings[CURLOPT_FOLLOWLOCATION] = false; + curl_setopt_array($curl, $settings); - $max_redirects = isset($settings[CURLOPT_MAXREDIRS]) ? $settings[CURLOPT_MAXREDIRS] : 5; - $mr = $max_redirects; - if ($mr > 0) - { - $newurl = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); + $max_redirects = isset($settings[CURLOPT_MAXREDIRS]) ? $settings[CURLOPT_MAXREDIRS] : 5; + $mr = $max_redirects; + if ($mr > 0) + { + $newurl = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); - $rcurl = curl_copy_handle($curl); - curl_setopt($rcurl, CURLOPT_HEADER, true); - curl_setopt($rcurl, CURLOPT_NOBODY, true); - curl_setopt($rcurl, CURLOPT_FORBID_REUSE, false); - curl_setopt($rcurl, CURLOPT_RETURNTRANSFER, true); - do - { - curl_setopt($rcurl, CURLOPT_URL, $newurl); - $header = curl_exec($rcurl); - if (curl_errno($rcurl)) - { - $code = 0; - } - else - { - $code = curl_getinfo($rcurl, CURLINFO_HTTP_CODE); - if ($code == 301 || $code == 302) - { - $matches = array(); - preg_match('/Location:(.*?)\n/', $header, $matches); - $newurl = trim(array_pop($matches)); - } - else - { - $code = 0; - } - } - } while ($code && --$mr); + $rcurl = curl_copy_handle($curl); + curl_setopt($rcurl, CURLOPT_HEADER, true); + curl_setopt($rcurl, CURLOPT_NOBODY, true); + curl_setopt($rcurl, CURLOPT_FORBID_REUSE, false); + curl_setopt($rcurl, CURLOPT_RETURNTRANSFER, true); + do + { + curl_setopt($rcurl, CURLOPT_URL, $newurl); + $header = curl_exec($rcurl); + if (curl_errno($rcurl)) + { + $code = 0; + } + else + { + $code = curl_getinfo($rcurl, CURLINFO_HTTP_CODE); + if ($code == 301 || $code == 302) + { + $matches = array(); + preg_match('/Location:(.*?)\n/', $header, $matches); + $newurl = trim(array_pop($matches)); + } + else + { + $code = 0; + } + } + } while ($code && --$mr); - curl_close($rcurl); - if ($mr > 0) - { - curl_setopt($curl, CURLOPT_URL, $newurl); - } - } + curl_close($rcurl); + if ($mr > 0) + { + curl_setopt($curl, CURLOPT_URL, $newurl); + } + } - if ($mr == 0 && $max_redirects > 0) - { - $data = false; - } - else - { - $data = curl_exec($curl); - } - } + if ($mr == 0 && $max_redirects > 0) + { + $data = false; + } + else + { + $data = curl_exec($curl); + } + } return array( $data, @@ -539,6 +541,17 @@ class Client { curl_errno($curl), curl_error($curl) ); + // END rainloop + + $curl = curl_init($url); + curl_setopt_array($curl, $settings); + + return array( + curl_exec($curl), + curl_getinfo($curl), + curl_errno($curl), + curl_error($curl) + ); } // @codeCoverageIgnoreEnd @@ -598,7 +611,12 @@ class Client { $body = XMLUtil::convertDAVNamespace($body); + // Fixes an XXE vulnerability on PHP versions older than 5.3.23 or + // 5.4.13. + $previous = libxml_disable_entity_loader(true); $responseXML = simplexml_load_string($body, null, LIBXML_NOBLANKS | LIBXML_NOCDATA); + libxml_disable_entity_loader($previous); + if ($responseXML===false) { throw new \InvalidArgumentException('The passed data is not valid XML'); } diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Collection.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Collection.php similarity index 91% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Collection.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Collection.php index 1e070e76c..caec02933 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Collection.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Collection.php @@ -1,6 +1,6 @@ ownerDocument->createElementNS('DAV:','d:valid-resourcetype'); $errorNode->appendChild($error); diff --git a/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/LengthRequired.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/LengthRequired.php new file mode 100644 index 000000000..d2a5a8e82 --- /dev/null +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/LengthRequired.php @@ -0,0 +1,30 @@ +getAllowedMethods($server->getRequestUri()); diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotAuthenticated.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/NotAuthenticated.php similarity index 65% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotAuthenticated.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/NotAuthenticated.php index 99e2ad262..26eb61d3d 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotAuthenticated.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/NotAuthenticated.php @@ -1,8 +1,8 @@ - * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/). + * @license http://sabre.io/license/ Modified BSD License */ class ServiceUnavailable extends DAV\Exception { diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/UnsupportedMediaType.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/UnsupportedMediaType.php similarity index 62% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/UnsupportedMediaType.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/UnsupportedMediaType.php index 05b245d91..990ca0ccb 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/UnsupportedMediaType.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Exception/UnsupportedMediaType.php @@ -1,6 +1,6 @@ path, 'c'); - fseek($f,$offset-1); + switch($rangeType) { + case 1 : + $f = fopen($this->path, 'a'); + break; + case 2 : + $f = fopen($this->path, 'c'); + fseek($f,$offset); + break; + case 3 : + $f = fopen($this->path, 'c'); + fseek($f, $offset, SEEK_END); + break; + } if (is_string($data)) { fwrite($f, $data); } else { diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Node.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/FSExt/Node.php similarity index 95% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Node.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/FSExt/Node.php index 17cd32c81..73467fffc 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Node.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/FSExt/Node.php @@ -1,17 +1,17 @@ addPlugin($lockPlugin); * - * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + * @license http://sabre.io/license/ Modified BSD License */ class Plugin extends DAV\ServerPlugin { @@ -30,7 +30,7 @@ class Plugin extends DAV\ServerPlugin { /** * server * - * @var SabreForRainLoop\DAV\Server + * @var Sabre\DAV\Server */ protected $server; @@ -66,7 +66,7 @@ class Plugin extends DAV\ServerPlugin { * Returns a plugin name. * * Using this name other plugins will be able to access other plugins - * using SabreForRainLoop\DAV\Server::getPlugin + * using Sabre\DAV\Server::getPlugin * * @return string */ @@ -216,7 +216,7 @@ class Plugin extends DAV\ServerPlugin { /** * Returns all lock information on a particular uri * - * This function should return an array with SabreForRainLoop\DAV\Locks\LockInfo objects. If there are no locks on a file, return an empty array. + * This function should return an array with Sabre\DAV\Locks\LockInfo objects. If there are no locks on a file, return an empty array. * * Additionally there is also the possibility of locks on parent nodes, so we'll need to traverse every part of the tree * If the $returnChildLocks argument is set to true, we'll also traverse all the children of the object @@ -449,7 +449,7 @@ class Plugin extends DAV\ServerPlugin { * It will check if the requested url is locked, and see if the correct lock tokens are passed * * @param mixed $urls List of relevant urls. Can be an array, a string or nothing at all for the current request uri - * @param mixed $lastLock This variable will be populated with the last checked lock object (SabreForRainLoop\DAV\Locks\LockInfo) + * @param mixed $lastLock This variable will be populated with the last checked lock object (Sabre\DAV\Locks\LockInfo) * @param bool $checkChildLocks If set to true, this function will also look for any locks set on child resources of the supplied urls. This is needed for for example deletion of entire trees. * @return bool */ @@ -503,7 +503,7 @@ class Plugin extends DAV\ServerPlugin { $uri = $conditionUri?$conditionUri:$this->server->getRequestUri(); $node = $this->server->tree->getNodeForPath($uri); - $etagValid = $node->getETag()==$conditionToken[2]; + $etagValid = $node instanceof DAV\IFile && $node->getETag()==$conditionToken[2]; } @@ -614,17 +614,24 @@ class Plugin extends DAV\ServerPlugin { } /** - * Parses a webdav lock xml body, and returns a new SabreForRainLoop\DAV\Locks\LockInfo object + * Parses a webdav lock xml body, and returns a new Sabre\DAV\Locks\LockInfo object * * @param string $body * @return DAV\Locks\LockInfo */ protected function parseLockRequest($body) { + // Fixes an XXE vulnerability on PHP versions older than 5.3.23 or + // 5.4.13. + $previous = libxml_disable_entity_loader(true); + + $xml = simplexml_load_string( DAV\XMLUtil::convertDAVNamespace($body), null, LIBXML_NOWARNING); + libxml_disable_entity_loader($previous); + $xml->registerXPathNamespace('d','urn:DAV'); $lockInfo = new LockInfo(); diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Mount/Plugin.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Mount/Plugin.php similarity index 88% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Mount/Plugin.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Mount/Plugin.php index 4959f012b..71cbe6e29 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Mount/Plugin.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Mount/Plugin.php @@ -1,24 +1,24 @@ addPlugin($patchPlugin); * - * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/). * @author Jean-Tiare LE BIGOT (http://www.jtlebi.fr/) - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + * @license http://sabre.io/license/ Modified BSD License */ class Plugin extends DAV\ServerPlugin { + const RANGE_APPEND = 1; + const RANGE_START = 2; + const RANGE_END = 3; + /** * Reference to server * - * @var SabreForRainLoop\DAV\Server + * @var Sabre\DAV\Server */ protected $server; @@ -94,13 +98,13 @@ class Plugin extends DAV\ServerPlugin { public function getHTTPMethods($uri) { $tree = $this->server->tree; - - if ($tree->nodeExists($uri) && - $tree->getNodeForPath($uri) instanceof IFile) { - return array('PATCH'); - } - - return array(); + if ($tree->nodeExists($uri)) { + $node = $tree->getNodeForPath($uri); + if ($node instanceof IFile || $node instanceof IPatchSupport) { + return array('PATCH'); + } + } + return array(); } @@ -129,7 +133,7 @@ class Plugin extends DAV\ServerPlugin { // Get the node. Will throw a 404 if not found $node = $this->server->tree->getNodeForPath($uri); - if (!($node instanceof IFile)) { + if (!$node instanceof IFile && !$node instanceof IPatchSupport) { throw new DAV\Exception\MethodNotAllowed('The target resource does not support the PATCH method.'); } @@ -148,17 +152,23 @@ class Plugin extends DAV\ServerPlugin { } $len = $this->server->httpRequest->getHeader('Content-Length'); + if (!$len) throw new DAV\Exception\LengthRequired('A Content-Length header is required'); - // Load the begin and end data - $start = ($range[0])?$range[0]:0; - $end = ($range[1])?$range[1]:$len-1; - - // Check consistency - if($end < $start) - throw new DAV\Exception\RequestedRangeNotSatisfiable('The end offset (' . $range[1] . ') is lower than the start offset (' . $range[0] . ')'); - if($end - $start + 1 != $len) - throw new DAV\Exception\RequestedRangeNotSatisfiable('Actual data length (' . $len . ') is not consistent with begin (' . $range[0] . ') and end (' . $range[1] . ') offsets'); - + switch($range[0]) { + case self::RANGE_START : + // Calculate the end-range if it doesn't exist. + if (!$range[2]) { + $range[2] = $range[1] + $len - 1; + } else { + if ($range[2] < $range[1]) { + throw new DAV\Exception\RequestedRangeNotSatisfiable('The end offset (' . $range[2] . ') is lower than the start offset (' . $range[1] . ')'); + } + if($range[2] - $range[1] + 1 != $len) { + throw new DAV\Exception\RequestedRangeNotSatisfiable('Actual data length (' . $len . ') is not consistent with begin (' . $range[1] . ') and end (' . $range[2] . ') offsets'); + } + } + break; + } // Checking If-None-Match and related headers. if (!$this->server->checkPreconditions()) return; @@ -166,7 +176,23 @@ class Plugin extends DAV\ServerPlugin { return; $body = $this->server->httpRequest->getBody(); - $etag = $node->putRange($body, $start-1); + + + if ($node instanceof IPatchSupport) { + $etag = $node->patch($body, $range[0], isset($range[1])?$range[1]:null); + } else { + // The old interface + switch($range[0]) { + case self::RANGE_APPEND : + throw new DAV\Exception\NotImplemented('This node does not support the append syntax. Please upgrade it to IPatchSupport'); + case self::RANGE_START : + $etag = $node->putRange($body, $range[1]); + break; + case self::RANGE_END : + throw new DAV\Exception\NotImplemented('This node does not support the end-range syntax. Please upgrade it to IPatchSupport'); + break; + } + } $this->server->broadcastEvent('afterWriteContent',array($uri, $node)); @@ -182,13 +208,18 @@ class Plugin extends DAV\ServerPlugin { * Returns the HTTP custom range update header * * This method returns null if there is no well-formed HTTP range request - * header or array($start, $end). + * header. It returns array(1) if it was an append request, array(2, + * $start, $end) if it's a start and end range, lastly it's array(3, + * $endoffset) if the offset was negative, and should be calculated from + * the end of the file. * - * The first number is the offset of the first byte in the range. - * The second number is the offset of the last byte in the range. + * Examples: * - * If the second offset is null, it should be treated as the offset of the last byte of the entity - * If the first offset is null, the second offset should be used to retrieve the last x bytes of the entity + * null - invalid + * array(1) - append + * array(2,10,15) - update bytes 10, 11, 12, 13, 14, 15 + * array(2,10,null) - update bytes 10 until the end of the patch body + * array(3,-5) - update from 5 bytes from the end of the file. * * @return array|null */ @@ -199,14 +230,17 @@ class Plugin extends DAV\ServerPlugin { // Matching "Range: bytes=1234-5678: both numbers are optional - if (!preg_match('/^bytes=([0-9]*)-([0-9]*)$/i',$range,$matches)) return null; + if (!preg_match('/^(append)|(?:bytes=([0-9]+)-([0-9]*))|(?:bytes=(-[0-9]+))$/i',$range,$matches)) return null; - if ($matches[1]==='' && $matches[2]==='') return null; - - return array( - $matches[1]!==''?$matches[1]:null, - $matches[2]!==''?$matches[2]:null, - ); + if ($matches[1]==='append') { + return array(self::RANGE_APPEND); + } elseif (strlen($matches[2])>0) { + return array(self::RANGE_START, $matches[2], $matches[3]?:null); + } elseif ($matches[4]) { + return array(self::RANGE_END, $matches[4]); + } else { + return null; + } } } diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Property.php similarity index 75% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Property.php index 36d4ea694..b2d5eb247 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Property.php @@ -1,15 +1,15 @@ responses = $responses; diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedLock.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Property/SupportedLock.php similarity index 90% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedLock.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/Property/SupportedLock.php index 5ddde6478..3898ecee6 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedLock.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/Property/SupportedLock.php @@ -1,8 +1,8 @@ 'SabreForRainLoop\\DAV\\Property\\ResourceType', + '{DAV:}resourcetype' => 'Sabre\\DAV\\Property\\ResourceType', ); public $protectedProperties = array( @@ -131,12 +131,12 @@ class Server { * based on a node's classname or interface. * * The preset ensures that {DAV:}collection is automaticlly added for nodes - * implementing SabreForRainLoop\DAV\ICollection. + * implementing Sabre\DAV\ICollection. * * @var array */ public $resourceTypeMapping = array( - 'SabreForRainLoop\\DAV\\ICollection' => '{DAV:}collection', + 'Sabre\\DAV\\ICollection' => '{DAV:}collection', ); /** @@ -152,12 +152,12 @@ class Server { /** * Sets up the server * - * If a SabreForRainLoop\DAV\Tree object is passed as an argument, it will - * use it as the directory tree. If a SabreForRainLoop\DAV\INode is passed, it - * will create a SabreForRainLoop\DAV\ObjectTree and use the node as the root. + * If a Sabre\DAV\Tree object is passed as an argument, it will + * use it as the directory tree. If a Sabre\DAV\INode is passed, it + * will create a Sabre\DAV\ObjectTree and use the node as the root. * - * If nothing is passed, a SabreForRainLoop\DAV\SimpleCollection is created in - * a SabreForRainLoop\DAV\ObjectTree. + * If nothing is passed, a Sabre\DAV\SimpleCollection is created in + * a Sabre\DAV\ObjectTree. * * If an array is passed, we automatically create a root node, and use * the nodes in the array as top-level children. @@ -176,7 +176,7 @@ class Server { // create the root node. foreach($treeOrNode as $node) { if (!($node instanceof INode)) { - throw new Exception('Invalid argument passed to constructor. If you\'re passing an array, all the values must implement SabreForRainLoop\\DAV\\INode'); + throw new Exception('Invalid argument passed to constructor. If you\'re passing an array, all the values must implement Sabre\\DAV\\INode'); } } @@ -187,7 +187,7 @@ class Server { $root = new SimpleCollection('root'); $this->tree = new ObjectTree($root); } else { - throw new Exception('Invalid argument passed to constructor. Argument must either be an instance of SabreForRainLoop\\DAV\\Tree, SabreForRainLoop\\DAV\\INode, an array or null'); + throw new Exception('Invalid argument passed to constructor. Argument must either be an instance of Sabre\\DAV\\Tree, Sabre\\DAV\\INode, an array or null'); } $this->httpResponse = new HTTP\Response(); $this->httpRequest = new HTTP\Request(); @@ -340,7 +340,7 @@ class Server { /** * Adds a plugin to the server * - * For more information, console the documentation of SabreForRainLoop\DAV\ServerPlugin + * For more information, console the documentation of Sabre\DAV\ServerPlugin * * @param ServerPlugin $plugin * @return void @@ -684,6 +684,9 @@ class Server { */ protected function httpDelete($uri) { + // Checking If-None-Match and related headers. + if (!$this->checkPreconditions()) return; + if (!$this->broadcastEvent('beforeUnbind',array($uri))) return; $this->tree->delete($uri); $this->broadcastEvent('afterUnbind',array($uri)); @@ -871,13 +874,13 @@ class Server { } + // Checking If-None-Match and related headers. + if (!$this->checkPreconditions()) return; + if ($this->tree->nodeExists($uri)) { $node = $this->tree->getNodeForPath($uri); - // Checking If-None-Match and related headers. - if (!$this->checkPreconditions()) return; - // If the node is a collection, we'll deny it if (!($node instanceof IFile)) throw new Exception\Conflict('PUT is not allowed on non-files.'); if (!$this->broadcastEvent('beforeWriteContent',array($uri, $node, &$body))) return false; @@ -1157,7 +1160,7 @@ class Server { /** * Returns the HTTP depth header * - * This method returns the contents of the HTTP depth request header. If the depth header was 'infinity' it will return the SabreForRainLoop\DAV\Server::DEPTH_INFINITY object + * This method returns the contents of the HTTP depth request header. If the depth header was 'infinity' it will return the Sabre\DAV\Server::DEPTH_INFINITY object * It is possible to supply a default depth value, which is used when the depth header has invalid content, or is completely non-existent * * @param mixed $default @@ -1820,7 +1823,7 @@ class Server { )); } - // If the node is not an instance of SabreForRainLoop\DAV\IProperties, every + // If the node is not an instance of Sabre\DAV\IProperties, every // property is 403 Forbidden if (!$hasError && count($remainingProperties) && !($node instanceof IProperties)) { $hasError = true; diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ServerPlugin.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/ServerPlugin.php similarity index 85% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ServerPlugin.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/ServerPlugin.php index 83cde5756..d232cfe4b 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ServerPlugin.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/ServerPlugin.php @@ -1,22 +1,22 @@ name = $name; foreach($children as $child) { - if (!($child instanceof INode)) throw new Exception('Only instances of SabreForRainLoop\DAV\INode are allowed to be passed in the children argument'); + if (!($child instanceof INode)) throw new Exception('Only instances of Sabre\DAV\INode are allowed to be passed in the children argument'); $this->addChild($child); } @@ -78,7 +78,7 @@ class SimpleCollection extends Collection { * This method makes use of the getChildren method to grab all the child nodes, and compares the name. * Generally its wise to override this, as this can usually be optimized * - * This method must throw SabreForRainLoop\DAV\Exception\NotFound if the node does not + * This method must throw Sabre\DAV\Exception\NotFound if the node does not * exist. * * @param string $name diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleFile.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/SimpleFile.php similarity index 93% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleFile.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAV/SimpleFile.php index d1b2d7e3a..ede3ff48e 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleFile.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAV/SimpleFile.php @@ -1,6 +1,6 @@ server->getPlugin('auth'); if (is_null($authPlugin)) return null; - /** @var $authPlugin SabreForRainLoop\DAV\Auth\Plugin */ + /** @var $authPlugin Sabre\DAV\Auth\Plugin */ $userName = $authPlugin->getCurrentUser(); if (!$userName) return null; @@ -599,7 +599,7 @@ class Plugin extends DAV\ServerPlugin { * If this is ommitted, the standard * principal collection-set will be used. * @return array This method returns an array structure similar to - * SabreForRainLoop\DAV\Server::getPropertiesForPath. Returned + * Sabre\DAV\Server::getPropertiesForPath. Returned * properties are index by a HTTP status code. * */ @@ -678,11 +678,11 @@ class Plugin extends DAV\ServerPlugin { // Automatically mapping nodes implementing IPrincipal to the // {DAV:}principal resourcetype. - $server->resourceTypeMapping['SabreForRainLoop\\DAVACL\\IPrincipal'] = '{DAV:}principal'; + $server->resourceTypeMapping['Sabre\\DAVACL\\IPrincipal'] = '{DAV:}principal'; // Mapping the group-member-set property to the HrefList property // class. - $server->propertyMap['{DAV:}group-member-set'] = 'SabreForRainLoop\\DAV\\Property\\HrefList'; + $server->propertyMap['{DAV:}group-member-set'] = 'Sabre\\DAV\\Property\\HrefList'; } @@ -965,7 +965,7 @@ class Plugin extends DAV\ServerPlugin { $propertyDelta['{DAV:}group-member-set']->getHrefs() ); } else { - throw new DAV\Exception('The group-member-set property MUST be an instance of SabreForRainLoop\DAV\Property\HrefList or null'); + throw new DAV\Exception('The group-member-set property MUST be an instance of Sabre\DAV\Property\HrefList or null'); } if (!($node instanceof IPrincipal)) { diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Principal.php b/snappymail/v/0.0.0/app/libraries/Sabre/DAVACL/Principal.php similarity index 94% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Principal.php rename to snappymail/v/0.0.0/app/libraries/Sabre/DAVACL/Principal.php index e99ec737d..7270aec39 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Principal.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/DAVACL/Principal.php @@ -1,8 +1,8 @@ httpRequest->getRawServerValue('PHP_AUTH_USER')) && ($pass = $this->httpRequest->getRawServerValue('PHP_AUTH_PW'))) { + if (($user = $this->httpRequest->getRawServerValue('PHP_AUTH_USER'))!==null && ($pass = $this->httpRequest->getRawServerValue('PHP_AUTH_PW'))!==null) { return array($user,$pass); diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/DigestAuth.php b/snappymail/v/0.0.0/app/libraries/Sabre/HTTP/DigestAuth.php similarity index 95% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/DigestAuth.php rename to snappymail/v/0.0.0/app/libraries/Sabre/HTTP/DigestAuth.php index 62310f7ce..c15273939 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/DigestAuth.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/HTTP/DigestAuth.php @@ -1,6 +1,6 @@ children[] = $property; } } else { - throw new \InvalidArgumentException('You must pass a \\SabreForRainLoop\\VObject\\Component, \\SabreForRainLoop\\VObject\\Property or scalar type'); + throw new \InvalidArgumentException('You must pass a \\Sabre\\VObject\\Component, \\Sabre\\VObject\\Property or scalar type'); } } diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VAlarm.php b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VAlarm.php similarity index 98% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VAlarm.php rename to snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VAlarm.php index 6951c1996..2f86c44fd 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VAlarm.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VAlarm.php @@ -1,7 +1,7 @@ 'SabreForRainLoop\\VObject\\Component\\VEvent', - 'VFREEBUSY' => 'SabreForRainLoop\\VObject\\Component\\VFreeBusy', - 'VJOURNAL' => 'SabreForRainLoop\\VObject\\Component\\VJournal', - 'VTODO' => 'SabreForRainLoop\\VObject\\Component\\VTodo', - 'VALARM' => 'SabreForRainLoop\\VObject\\Component\\VAlarm', + 'VEVENT' => 'Sabre\\VObject\\Component\\VEvent', + 'VFREEBUSY' => 'Sabre\\VObject\\Component\\VFreeBusy', + 'VJOURNAL' => 'Sabre\\VObject\\Component\\VJournal', + 'VTODO' => 'Sabre\\VObject\\Component\\VTodo', + 'VALARM' => 'Sabre\\VObject\\Component\\VAlarm', ); /** @@ -45,21 +45,21 @@ class VCalendar extends VObject\Document { * @var array */ static public $valueMap = array( - 'BINARY' => 'SabreForRainLoop\\VObject\\Property\\Binary', - 'BOOLEAN' => 'SabreForRainLoop\\VObject\\Property\\Boolean', - 'CAL-ADDRESS' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\CalAddress', - 'DATE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Date', - 'DATE-TIME' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DURATION' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Duration', - 'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\FloatValue', - 'INTEGER' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'PERIOD' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Period', - 'RECUR' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Recur', - 'TEXT' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'TIME' => 'SabreForRainLoop\\VObject\\Property\\Time', - 'UNKNOWN' => 'SabreForRainLoop\\VObject\\Property\\Unknown', // jCard / jCal-only. - 'URI' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'UTC-OFFSET' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', + 'BINARY' => 'Sabre\\VObject\\Property\\Binary', + 'BOOLEAN' => 'Sabre\\VObject\\Property\\Boolean', + 'CAL-ADDRESS' => 'Sabre\\VObject\\Property\\ICalendar\\CalAddress', + 'DATE' => 'Sabre\\VObject\\Property\\ICalendar\\Date', + 'DATE-TIME' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'DURATION' => 'Sabre\\VObject\\Property\\ICalendar\\Duration', + 'FLOAT' => 'Sabre\\VObject\\Property\\FloatValue', + 'INTEGER' => 'Sabre\\VObject\\Property\\Integer', + 'PERIOD' => 'Sabre\\VObject\\Property\\ICalendar\\Period', + 'RECUR' => 'Sabre\\VObject\\Property\\ICalendar\\Recur', + 'TEXT' => 'Sabre\\VObject\\Property\\Text', + 'TIME' => 'Sabre\\VObject\\Property\\Time', + 'UNKNOWN' => 'Sabre\\VObject\\Property\\Unknown', // jCard / jCal-only. + 'URI' => 'Sabre\\VObject\\Property\\Uri', + 'UTC-OFFSET' => 'Sabre\\VObject\\Property\\UtcOffset', ); /** @@ -69,75 +69,75 @@ class VCalendar extends VObject\Document { */ static public $propertyMap = array( // Calendar properties - 'CALSCALE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'METHOD' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PRODID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'VERSION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', + 'CALSCALE' => 'Sabre\\VObject\\Property\\FlatText', + 'METHOD' => 'Sabre\\VObject\\Property\\FlatText', + 'PRODID' => 'Sabre\\VObject\\Property\\FlatText', + 'VERSION' => 'Sabre\\VObject\\Property\\FlatText', // Component properties - 'ATTACH' => 'SabreForRainLoop\\VObject\\Property\\Binary', - 'CATEGORIES' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'CLASS' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'COMMENT' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'DESCRIPTION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'GEO' => 'SabreForRainLoop\\VObject\\Property\\FloatValue', - 'LOCATION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PERCENT-COMPLETE' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'PRIORITY' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'RESOURCES' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'STATUS' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'SUMMARY' => 'SabreForRainLoop\\VObject\\Property\\FlatText', + 'ATTACH' => 'Sabre\\VObject\\Property\\Binary', + 'CATEGORIES' => 'Sabre\\VObject\\Property\\Text', + 'CLASS' => 'Sabre\\VObject\\Property\\FlatText', + 'COMMENT' => 'Sabre\\VObject\\Property\\FlatText', + 'DESCRIPTION' => 'Sabre\\VObject\\Property\\FlatText', + 'GEO' => 'Sabre\\VObject\\Property\\FloatValue', + 'LOCATION' => 'Sabre\\VObject\\Property\\FlatText', + 'PERCENT-COMPLETE' => 'Sabre\\VObject\\Property\\Integer', + 'PRIORITY' => 'Sabre\\VObject\\Property\\Integer', + 'RESOURCES' => 'Sabre\\VObject\\Property\\Text', + 'STATUS' => 'Sabre\\VObject\\Property\\FlatText', + 'SUMMARY' => 'Sabre\\VObject\\Property\\FlatText', // Date and Time Component Properties - 'COMPLETED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DTEND' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DUE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DTSTART' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DURATION' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Duration', - 'FREEBUSY' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Period', - 'TRANSP' => 'SabreForRainLoop\\VObject\\Property\\FlatText', + 'COMPLETED' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'DTEND' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'DUE' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'DTSTART' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'DURATION' => 'Sabre\\VObject\\Property\\ICalendar\\Duration', + 'FREEBUSY' => 'Sabre\\VObject\\Property\\ICalendar\\Period', + 'TRANSP' => 'Sabre\\VObject\\Property\\FlatText', // Time Zone Component Properties - 'TZID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TZNAME' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TZOFFSETFROM' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', - 'TZOFFSETTO' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', - 'TZURL' => 'SabreForRainLoop\\VObject\\Property\\Uri', + 'TZID' => 'Sabre\\VObject\\Property\\FlatText', + 'TZNAME' => 'Sabre\\VObject\\Property\\FlatText', + 'TZOFFSETFROM' => 'Sabre\\VObject\\Property\\UtcOffset', + 'TZOFFSETTO' => 'Sabre\\VObject\\Property\\UtcOffset', + 'TZURL' => 'Sabre\\VObject\\Property\\Uri', // Relationship Component Properties - 'ATTENDEE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\CalAddress', - 'CONTACT' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'ORGANIZER' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\CalAddress', - 'RECURRENCE-ID' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'RELATED-TO' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'URL' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'UID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', + 'ATTENDEE' => 'Sabre\\VObject\\Property\\ICalendar\\CalAddress', + 'CONTACT' => 'Sabre\\VObject\\Property\\FlatText', + 'ORGANIZER' => 'Sabre\\VObject\\Property\\ICalendar\\CalAddress', + 'RECURRENCE-ID' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'RELATED-TO' => 'Sabre\\VObject\\Property\\FlatText', + 'URL' => 'Sabre\\VObject\\Property\\Uri', + 'UID' => 'Sabre\\VObject\\Property\\FlatText', // Recurrence Component Properties - 'EXDATE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'RDATE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'RRULE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Recur', - 'EXRULE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Recur', // Deprecated since rfc5545 + 'EXDATE' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'RDATE' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'RRULE' => 'Sabre\\VObject\\Property\\ICalendar\\Recur', + 'EXRULE' => 'Sabre\\VObject\\Property\\ICalendar\\Recur', // Deprecated since rfc5545 // Alarm Component Properties - 'ACTION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'REPEAT' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'TRIGGER' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Duration', + 'ACTION' => 'Sabre\\VObject\\Property\\FlatText', + 'REPEAT' => 'Sabre\\VObject\\Property\\Integer', + 'TRIGGER' => 'Sabre\\VObject\\Property\\ICalendar\\Duration', // Change Management Component Properties - 'CREATED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DTSTAMP' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'LAST-MODIFIED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'SEQUENCE' => 'SabreForRainLoop\\VObject\\Property\\Integer', + 'CREATED' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'DTSTAMP' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'LAST-MODIFIED' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'SEQUENCE' => 'Sabre\\VObject\\Property\\Integer', // Request Status - 'REQUEST-STATUS' => 'SabreForRainLoop\\VObject\\Property\\Text', + 'REQUEST-STATUS' => 'Sabre\\VObject\\Property\\Text', // Additions from draft-daboo-valarm-extensions-04 - 'ALARM-AGENT' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'ACKNOWLEDGED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'PROXIMITY' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'DEFAULT-ALARM' => 'SabreForRainLoop\\VObject\\Property\\Boolean', + 'ALARM-AGENT' => 'Sabre\\VObject\\Property\\Text', + 'ACKNOWLEDGED' => 'Sabre\\VObject\\Property\\ICalendar\\DateTime', + 'PROXIMITY' => 'Sabre\\VObject\\Property\\Text', + 'DEFAULT-ALARM' => 'Sabre\\VObject\\Property\\Boolean', ); diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCard.php b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VCard.php similarity index 63% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCard.php rename to snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VCard.php index 1390aca70..781158a87 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCard.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VCard.php @@ -1,9 +1,9 @@ 'SabreForRainLoop\\VObject\\Property\\Binary', - 'BOOLEAN' => 'SabreForRainLoop\\VObject\\Property\\Boolean', - 'CONTENT-ID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // vCard 2.1 only - 'DATE' => 'SabreForRainLoop\\VObject\\Property\\VCard\\Date', - 'DATE-TIME' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateTime', - 'DATE-AND-OR-TIME' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateAndOrTime', // vCard only - 'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\FloatValue', - 'INTEGER' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'LANGUAGE-TAG' => 'SabreForRainLoop\\VObject\\Property\\VCard\\LanguageTag', - 'TIMESTAMP' => 'SabreForRainLoop\\VObject\\Property\\VCard\\TimeStamp', - 'TEXT' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'TIME' => 'SabreForRainLoop\\VObject\\Property\\Time', - 'UNKNOWN' => 'SabreForRainLoop\\VObject\\Property\\Unknown', // jCard / jCal-only. - 'URI' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'URL' => 'SabreForRainLoop\\VObject\\Property\\Uri', // vCard 2.1 only - 'UTC-OFFSET' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', + 'BINARY' => 'Sabre\\VObject\\Property\\Binary', + 'BOOLEAN' => 'Sabre\\VObject\\Property\\Boolean', + 'CONTENT-ID' => 'Sabre\\VObject\\Property\\FlatText', // vCard 2.1 only + 'DATE' => 'Sabre\\VObject\\Property\\VCard\\Date', + 'DATE-TIME' => 'Sabre\\VObject\\Property\\VCard\\DateTime', + 'DATE-AND-OR-TIME' => 'Sabre\\VObject\\Property\\VCard\\DateAndOrTime', // vCard only + 'FLOAT' => 'Sabre\\VObject\\Property\\FloatValue', + 'INTEGER' => 'Sabre\\VObject\\Property\\Integer', + 'LANGUAGE-TAG' => 'Sabre\\VObject\\Property\\VCard\\LanguageTag', + 'TIMESTAMP' => 'Sabre\\VObject\\Property\\VCard\\TimeStamp', + 'TEXT' => 'Sabre\\VObject\\Property\\Text', + 'TIME' => 'Sabre\\VObject\\Property\\Time', + 'UNKNOWN' => 'Sabre\\VObject\\Property\\Unknown', // jCard / jCal-only. + 'URI' => 'Sabre\\VObject\\Property\\Uri', + 'URL' => 'Sabre\\VObject\\Property\\Uri', // vCard 2.1 only + 'UTC-OFFSET' => 'Sabre\\VObject\\Property\\UtcOffset', ); /** @@ -65,53 +65,53 @@ class VCard extends VObject\Document { static public $propertyMap = array( // vCard 2.1 properties and up - 'N' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'FN' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PHOTO' => 'SabreForRainLoop\\VObject\\Property\\Binary', // Todo: we should add a class for Binary values. - 'BDAY' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateAndOrTime', - 'ADR' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'LABEL' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // Removed in vCard 4.0 - 'TEL' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'EMAIL' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'MAILER' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // Removed in vCard 4.0 - 'GEO' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TITLE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'ROLE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'LOGO' => 'SabreForRainLoop\\VObject\\Property\\Binary', - // 'AGENT' => 'SabreForRainLoop\\VObject\\Property\\', // Todo: is an embedded vCard. Probably rare, so + 'N' => 'Sabre\\VObject\\Property\\Text', + 'FN' => 'Sabre\\VObject\\Property\\FlatText', + 'PHOTO' => 'Sabre\\VObject\\Property\\Binary', // Todo: we should add a class for Binary values. + 'BDAY' => 'Sabre\\VObject\\Property\\VCard\\DateAndOrTime', + 'ADR' => 'Sabre\\VObject\\Property\\Text', + 'LABEL' => 'Sabre\\VObject\\Property\\FlatText', // Removed in vCard 4.0 + 'TEL' => 'Sabre\\VObject\\Property\\FlatText', + 'EMAIL' => 'Sabre\\VObject\\Property\\FlatText', + 'MAILER' => 'Sabre\\VObject\\Property\\FlatText', // Removed in vCard 4.0 + 'GEO' => 'Sabre\\VObject\\Property\\FlatText', + 'TITLE' => 'Sabre\\VObject\\Property\\FlatText', + 'ROLE' => 'Sabre\\VObject\\Property\\FlatText', + 'LOGO' => 'Sabre\\VObject\\Property\\Binary', + // 'AGENT' => 'Sabre\\VObject\\Property\\', // Todo: is an embedded vCard. Probably rare, so // not supported at the moment - 'ORG' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'NOTE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'REV' => 'SabreForRainLoop\\VObject\\Property\\VCard\\TimeStamp', - 'SOUND' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'URL' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'UID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'VERSION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'KEY' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TZ' => 'SabreForRainLoop\\VObject\\Property\\Text', + 'ORG' => 'Sabre\\VObject\\Property\\Text', + 'NOTE' => 'Sabre\\VObject\\Property\\FlatText', + 'REV' => 'Sabre\\VObject\\Property\\VCard\\TimeStamp', + 'SOUND' => 'Sabre\\VObject\\Property\\FlatText', + 'URL' => 'Sabre\\VObject\\Property\\Uri', + 'UID' => 'Sabre\\VObject\\Property\\FlatText', + 'VERSION' => 'Sabre\\VObject\\Property\\FlatText', + 'KEY' => 'Sabre\\VObject\\Property\\FlatText', + 'TZ' => 'Sabre\\VObject\\Property\\Text', // vCard 3.0 properties - 'CATEGORIES' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'SORT-STRING' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PRODID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'NICKNAME' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'CLASS' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // Removed in vCard 4.0 + 'CATEGORIES' => 'Sabre\\VObject\\Property\\Text', + 'SORT-STRING' => 'Sabre\\VObject\\Property\\FlatText', + 'PRODID' => 'Sabre\\VObject\\Property\\FlatText', + 'NICKNAME' => 'Sabre\\VObject\\Property\\Text', + 'CLASS' => 'Sabre\\VObject\\Property\\FlatText', // Removed in vCard 4.0 // rfc2739 properties - 'FBURL' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'CAPURI' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'CALURI' => 'SabreForRainLoop\\VObject\\Property\\Uri', + 'FBURL' => 'Sabre\\VObject\\Property\\Uri', + 'CAPURI' => 'Sabre\\VObject\\Property\\Uri', + 'CALURI' => 'Sabre\\VObject\\Property\\Uri', // rfc4770 properties - 'IMPP' => 'SabreForRainLoop\\VObject\\Property\\Uri', + 'IMPP' => 'Sabre\\VObject\\Property\\Uri', // vCard 4.0 properties - 'XML' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'ANNIVERSARY' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateAndOrTime', - 'CLIENTPIDMAP' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'LANG' => 'SabreForRainLoop\\VObject\\Property\\VCard\\LanguageTag', - 'GENDER' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'KIND' => 'SabreForRainLoop\\VObject\\Property\\FlatText', + 'XML' => 'Sabre\\VObject\\Property\\FlatText', + 'ANNIVERSARY' => 'Sabre\\VObject\\Property\\VCard\\DateAndOrTime', + 'CLIENTPIDMAP' => 'Sabre\\VObject\\Property\\Text', + 'LANG' => 'Sabre\\VObject\\Property\\VCard\\LanguageTag', + 'GENDER' => 'Sabre\\VObject\\Property\\Text', + 'KIND' => 'Sabre\\VObject\\Property\\FlatText', ); @@ -342,8 +342,8 @@ class VCard extends VObject\Document { $className = parent::getClassNameForPropertyName($propertyName); // In vCard 4, BINARY no longer exists, and we need URI instead. - if ($className == 'SabreForRainLoop\\VObject\\Property\\Binary' && $this->getDocumentType()===self::VCARD40) { - return 'SabreForRainLoop\\VObject\\Property\\Uri'; + if ($className == 'Sabre\\VObject\\Property\\Binary' && $this->getDocumentType()===self::VCARD40) { + return 'Sabre\\VObject\\Property\\Uri'; } return $className; diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VEvent.php b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VEvent.php similarity index 96% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VEvent.php rename to snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VEvent.php index b1dc19331..0ce204566 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VEvent.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Component/VEvent.php @@ -1,7 +1,7 @@ objects[] = $object; } else { - throw new \InvalidArgumentException('You can only pass strings or \\SabreForRainLoop\\VObject\\Component arguments to setObjects'); + throw new \InvalidArgumentException('You can only pass strings or \\Sabre\\VObject\\Component arguments to setObjects'); } } diff --git a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Node.php b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Node.php similarity index 99% rename from snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Node.php rename to snappymail/v/0.0.0/app/libraries/Sabre/VObject/Node.php index 3330fceff..3260a8c02 100644 --- a/snappymail/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Node.php +++ b/snappymail/v/0.0.0/app/libraries/Sabre/VObject/Node.php @@ -1,6 +1,6 @@