Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
6df6fc56
Unverified
Commit
6df6fc56
authored
5 years ago
by
Roeland Jago Douma
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #16722 from nextcloud/bugfix/noid/remove_coffin
Replace coffin emoji with cross
parents
b1a0d464
befe38e1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/dav/lib/CalDAV/BirthdayService.php
+132
-49
132 additions, 49 deletions
apps/dav/lib/CalDAV/BirthdayService.php
apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
+41
-28
41 additions, 28 deletions
apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
with
173 additions
and
77 deletions
apps/dav/lib/CalDAV/BirthdayService.php
+
132
−
49
View file @
6df6fc56
<?php
declare
(
strict_types
=
1
);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 201
6
, Georg Ehrke
* @copyright Copyright (c) 201
9
, Georg Ehrke
*
* @author Achim Königs <garfonso@tratschtante.de>
* @author Georg Ehrke <oc.list@georgehrke.com>
...
...
@@ -33,6 +34,7 @@ use OCA\DAV\CardDAV\CardDavBackend;
use
OCA\DAV\DAV\GroupPrincipalBackend
;
use
OCP\IConfig
;
use
OCP\IDBConnection
;
use
OCP\IL10N
;
use
Sabre\VObject\Component\VCalendar
;
use
Sabre\VObject\Component\VCard
;
use
Sabre\VObject\DateTimeParser
;
...
...
@@ -41,6 +43,11 @@ use Sabre\VObject\InvalidDataException;
use
Sabre\VObject\Property\VCard\DateAndOrTime
;
use
Sabre\VObject\Reader
;
/**
* Class BirthdayService
*
* @package OCA\DAV\CalDAV
*/
class
BirthdayService
{
const
BIRTHDAY_CALENDAR_URI
=
'contact_birthdays'
;
...
...
@@ -60,20 +67,31 @@ class BirthdayService {
/** @var IDBConnection */
private
$dbConnection
;
/** @var IL10N */
private
$l10n
;
/**
* BirthdayService constructor.
*
* @param CalDavBackend $calDavBackEnd
* @param CardDavBackend $cardDavBackEnd
* @param GroupPrincipalBackend $principalBackend
* @param IConfig $config;
* @param IConfig $config
* @param IDBConnection $dbConnection
* @param IL10N $l10n
*/
public
function
__construct
(
CalDavBackend
$calDavBackEnd
,
CardDavBackend
$cardDavBackEnd
,
GroupPrincipalBackend
$principalBackend
,
IConfig
$config
,
IDBConnection
$dbConnection
)
{
public
function
__construct
(
CalDavBackend
$calDavBackEnd
,
CardDavBackend
$cardDavBackEnd
,
GroupPrincipalBackend
$principalBackend
,
IConfig
$config
,
IDBConnection
$dbConnection
,
IL10N
$l10n
)
{
$this
->
calDavBackEnd
=
$calDavBackEnd
;
$this
->
cardDavBackEnd
=
$cardDavBackEnd
;
$this
->
principalBackend
=
$principalBackend
;
$this
->
config
=
$config
;
$this
->
dbConnection
=
$dbConnection
;
$this
->
l10n
=
$l10n
;
}
/**
...
...
@@ -81,7 +99,9 @@ class BirthdayService {
* @param string $cardUri
* @param string $cardData
*/
public
function
onCardChanged
(
$addressBookId
,
$cardUri
,
$cardData
)
{
public
function
onCardChanged
(
int
$addressBookId
,
string
$cardUri
,
string
$cardData
)
{
if
(
!
$this
->
isGloballyEnabled
())
{
return
;
}
...
...
@@ -90,10 +110,11 @@ class BirthdayService {
$book
=
$this
->
cardDavBackEnd
->
getAddressBookById
(
$addressBookId
);
$targetPrincipals
[]
=
$book
[
'principaluri'
];
$datesToSync
=
[
[
'postfix'
=>
''
,
'field'
=>
'BDAY'
,
'symbol'
=>
'*'
,
'utfSymbol'
=>
'🎂'
],
[
'postfix'
=>
'-death'
,
'field'
=>
'DEATHDATE'
,
'symbol'
=>
"†"
,
'utfSymbol'
=>
'⚰️'
],
[
'postfix'
=>
'-anniversary'
,
'field'
=>
'ANNIVERSARY'
,
'symbol'
=>
"⚭"
,
'utfSymbol'
=>
'💍'
],
[
'postfix'
=>
''
,
'field'
=>
'BDAY'
],
[
'postfix'
=>
'-death'
,
'field'
=>
'DEATHDATE'
],
[
'postfix'
=>
'-anniversary'
,
'field'
=>
'ANNIVERSARY'
],
];
foreach
(
$targetPrincipals
as
$principalUri
)
{
if
(
!
$this
->
isUserEnabled
(
$principalUri
))
{
continue
;
...
...
@@ -101,7 +122,7 @@ class BirthdayService {
$calendar
=
$this
->
ensureCalendarExists
(
$principalUri
);
foreach
(
$datesToSync
as
$type
)
{
$this
->
updateCalendar
(
$cardUri
,
$cardData
,
$book
,
$calendar
[
'id'
],
$type
);
$this
->
updateCalendar
(
$cardUri
,
$cardData
,
$book
,
(
int
)
$calendar
[
'id'
],
$type
);
}
}
}
...
...
@@ -110,7 +131,8 @@ class BirthdayService {
* @param int $addressBookId
* @param string $cardUri
*/
public
function
onCardDeleted
(
$addressBookId
,
$cardUri
)
{
public
function
onCardDeleted
(
int
$addressBookId
,
string
$cardUri
)
{
if
(
!
$this
->
isGloballyEnabled
())
{
return
;
}
...
...
@@ -136,7 +158,7 @@ class BirthdayService {
* @return array|null
* @throws \Sabre\DAV\Exception\BadRequest
*/
public
function
ensureCalendarExists
(
$principal
)
{
public
function
ensureCalendarExists
(
string
$principal
)
:
?array
{
$calendar
=
$this
->
calDavBackEnd
->
getCalendarByUri
(
$principal
,
self
::
BIRTHDAY_CALENDAR_URI
);
if
(
!
is_null
(
$calendar
))
{
return
$calendar
;
...
...
@@ -151,14 +173,15 @@ class BirthdayService {
}
/**
* @param string $cardData
* @param string $dateField
* @param string $postfix
* @param string $summarySymbol
* @param string $utfSummarySymbol
* @return null|VCalendar
* @param $cardData
* @param $dateField
* @param $postfix
* @return VCalendar|null
* @throws InvalidDataException
*/
public
function
buildDateFromContact
(
$cardData
,
$dateField
,
$postfix
,
$summarySymbol
,
$utfSummarySymbol
)
{
public
function
buildDateFromContact
(
string
$cardData
,
string
$dateField
,
string
$postfix
):
?VCalendar
{
if
(
empty
(
$cardData
))
{
return
null
;
}
...
...
@@ -224,19 +247,8 @@ class BirthdayService {
}
catch
(
Exception
$e
)
{
return
null
;
}
if
(
$this
->
dbConnection
->
supports4ByteText
())
{
if
(
$unknownYear
)
{
$summary
=
$utfSummarySymbol
.
' '
.
$doc
->
FN
->
getValue
();
}
else
{
$summary
=
$utfSummarySymbol
.
' '
.
$doc
->
FN
->
getValue
()
.
" (
$originalYear
)"
;
}
}
else
{
if
(
$unknownYear
)
{
$summary
=
$doc
->
FN
->
getValue
()
.
' '
.
$summarySymbol
;
}
else
{
$summary
=
$doc
->
FN
->
getValue
()
.
" (
$summarySymbol$originalYear
)"
;
}
}
$summary
=
$this
->
formatTitle
(
$dateField
,
$doc
->
FN
->
getValue
(),
$originalYear
,
$this
->
dbConnection
->
supports4ByteText
());
$vCal
=
new
VCalendar
();
$vCal
->
VERSION
=
'2.0'
;
...
...
@@ -273,7 +285,7 @@ class BirthdayService {
/**
* @param string $user
*/
public
function
resetForUser
(
$user
)
{
public
function
resetForUser
(
string
$user
)
:
void
{
$principal
=
'principals/users/'
.
$user
;
$calendar
=
$this
->
calDavBackEnd
->
getCalendarByUri
(
$principal
,
self
::
BIRTHDAY_CALENDAR_URI
);
$calendarObjects
=
$this
->
calDavBackEnd
->
getCalendarObjects
(
$calendar
[
'id'
],
CalDavBackend
::
CALENDAR_TYPE_CALENDAR
);
...
...
@@ -285,8 +297,9 @@ class BirthdayService {
/**
* @param string $user
* @throws \Sabre\DAV\Exception\BadRequest
*/
public
function
syncUser
(
$user
)
{
public
function
syncUser
(
string
$user
)
:
void
{
$principal
=
'principals/users/'
.
$user
;
$this
->
ensureCalendarExists
(
$principal
);
$books
=
$this
->
cardDavBackEnd
->
getAddressBooksForUser
(
$principal
);
...
...
@@ -303,25 +316,25 @@ class BirthdayService {
* @param VCalendar $newCalendarData
* @return bool
*/
public
function
birthdayEvenChanged
(
$existingCalendarData
,
$newCalendarData
)
{
public
function
birthdayEvenChanged
(
string
$existingCalendarData
,
VCalendar
$newCalendarData
):
bool
{
try
{
$existingBirthday
=
Reader
::
read
(
$existingCalendarData
);
}
catch
(
Exception
$ex
)
{
return
true
;
}
if
(
$newCalendarData
->
VEVENT
->
DTSTART
->
getValue
()
!==
$existingBirthday
->
VEVENT
->
DTSTART
->
getValue
()
||
return
(
$newCalendarData
->
VEVENT
->
DTSTART
->
getValue
()
!==
$existingBirthday
->
VEVENT
->
DTSTART
->
getValue
()
||
$newCalendarData
->
VEVENT
->
SUMMARY
->
getValue
()
!==
$existingBirthday
->
VEVENT
->
SUMMARY
->
getValue
()
)
{
return
true
;
}
return
false
;
);
}
/**
* @param integer $addressBookId
* @return mixed
*/
protected
function
getAllAffectedPrincipals
(
$addressBookId
)
{
protected
function
getAllAffectedPrincipals
(
int
$addressBookId
)
{
$targetPrincipals
=
[];
$shares
=
$this
->
cardDavBackEnd
->
getShares
(
$addressBookId
);
foreach
(
$shares
as
$share
)
{
...
...
@@ -339,14 +352,20 @@ class BirthdayService {
/**
* @param string $cardUri
* @param string
$cardData
* @param string $cardData
* @param array $book
* @param int $calendarId
* @param string[] $type
* @param array $type
* @throws InvalidDataException
* @throws \Sabre\DAV\Exception\BadRequest
*/
private
function
updateCalendar
(
$cardUri
,
$cardData
,
$book
,
$calendarId
,
$type
)
{
private
function
updateCalendar
(
string
$cardUri
,
string
$cardData
,
array
$book
,
int
$calendarId
,
array
$type
):
void
{
$objectUri
=
$book
[
'uri'
]
.
'-'
.
$cardUri
.
$type
[
'postfix'
]
.
'.ics'
;
$calendarData
=
$this
->
buildDateFromContact
(
$cardData
,
$type
[
'field'
],
$type
[
'postfix'
]
,
$type
[
'symbol'
],
$type
[
'utfSymbol'
]
);
$calendarData
=
$this
->
buildDateFromContact
(
$cardData
,
$type
[
'field'
],
$type
[
'postfix'
]);
$existing
=
$this
->
calDavBackEnd
->
getCalendarObject
(
$calendarId
,
$objectUri
);
if
(
is_null
(
$calendarData
))
{
if
(
!
is_null
(
$existing
))
{
...
...
@@ -368,18 +387,17 @@ class BirthdayService {
*
* @return bool
*/
private
function
isGloballyEnabled
()
{
$isGloballyEnabled
=
$this
->
config
->
getAppValue
(
'dav'
,
'generateBirthdayCalendar'
,
'yes'
);
return
$isGloballyEnabled
===
'yes'
;
private
function
isGloballyEnabled
():
bool
{
return
$this
->
config
->
getAppValue
(
'dav'
,
'generateBirthdayCalendar'
,
'yes'
)
===
'yes'
;
}
/**
*
c
hecks if the user opted-out of birthday calendars
*
C
hecks if the user opted-out of birthday calendars
*
* @param $userPrincipal
* @param
string
$userPrincipal
The user principal to check for
* @return bool
*/
private
function
isUserEnabled
(
$userPrincipal
)
{
private
function
isUserEnabled
(
string
$userPrincipal
)
:
bool
{
if
(
strpos
(
$userPrincipal
,
'principals/users/'
)
===
0
)
{
$userId
=
substr
(
$userPrincipal
,
17
);
$isEnabled
=
$this
->
config
->
getUserValue
(
$userId
,
'dav'
,
'generateBirthdayCalendar'
,
'yes'
);
...
...
@@ -390,4 +408,69 @@ class BirthdayService {
return
true
;
}
/**
* Formats title of Birthday event
*
* @param string $field Field name like BDAY, ANNIVERSARY, ...
* @param string $name Name of contact
* @param int|null $year Year of birth, anniversary, ...
* @param bool $supports4Byte Whether or not the database supports 4 byte chars
* @return string The formatted title
*/
private
function
formatTitle
(
string
$field
,
string
$name
,
int
$year
=
null
,
bool
$supports4Byte
=
true
):
string
{
if
(
$supports4Byte
)
{
switch
(
$field
)
{
case
'BDAY'
:
return
implode
(
''
,
[
'🎂 '
,
$name
,
$year
?
(
' ('
.
$year
.
')'
)
:
''
,
]);
case
'DEATHDATE'
:
return
implode
(
''
,
[
$this
->
l10n
->
t
(
'Death of %s'
,
[
$name
]),
$year
?
(
' ('
.
$year
.
')'
)
:
''
,
]);
case
'ANNIVERSARY'
:
return
implode
(
''
,
[
'💍 '
,
$name
,
$year
?
(
' ('
.
$year
.
')'
)
:
''
,
]);
default
:
return
''
;
}
}
else
{
switch
(
$field
)
{
case
'BDAY'
:
return
implode
(
''
,
[
$name
,
' '
,
$year
?
(
'(*'
.
$year
.
')'
)
:
'*'
,
]);
case
'DEATHDATE'
:
return
implode
(
''
,
[
$this
->
l10n
->
t
(
'Death of %s'
,
[
$name
]),
$year
?
(
' ('
.
$year
.
')'
)
:
''
,
]);
case
'ANNIVERSARY'
:
return
implode
(
''
,
[
$name
,
' '
,
$year
?
(
'(⚭'
.
$year
.
')'
)
:
'⚭'
,
]);
default
:
return
''
;
}
}
}
}
This diff is collapsed.
Click to expand it.
apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
+
41
−
28
View file @
6df6fc56
...
...
@@ -30,6 +30,7 @@ use OCA\DAV\CardDAV\CardDavBackend;
use
OCA\DAV\DAV\GroupPrincipalBackend
;
use
OCP\IConfig
;
use
OCP\IDBConnection
;
use
OCP\IL10N
;
use
Sabre\VObject\Component\VCalendar
;
use
Sabre\VObject\Reader
;
use
Test\TestCase
;
...
...
@@ -48,6 +49,8 @@ class BirthdayServiceTest extends TestCase {
private
$config
;
/** @var IDBConnection | \PHPUnit_Framework_MockObject_MockObject */
private
$dbConnection
;
/** @var IL10N | \PHPUnit_Framework_MockObject_MockObject */
private
$l10n
;
public
function
setUp
()
{
parent
::
setUp
();
...
...
@@ -57,9 +60,17 @@ class BirthdayServiceTest extends TestCase {
$this
->
groupPrincipalBackend
=
$this
->
createMock
(
GroupPrincipalBackend
::
class
);
$this
->
config
=
$this
->
createMock
(
IConfig
::
class
);
$this
->
dbConnection
=
$this
->
createMock
(
IDBConnection
::
class
);
$this
->
l10n
=
$this
->
createMock
(
IL10N
::
class
);
$this
->
service
=
new
BirthdayService
(
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
);
$this
->
l10n
->
expects
(
$this
->
any
())
->
method
(
't'
)
->
willReturnCallback
(
function
(
$string
,
$args
)
{
return
vsprintf
(
$string
,
$args
);
});
$this
->
service
=
new
BirthdayService
(
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
,
$this
->
l10n
);
}
/**
...
...
@@ -71,9 +82,9 @@ class BirthdayServiceTest extends TestCase {
* @param string $expectedOriginalYear
* @param string | null $data
*/
public
function
testBuildBirthdayFromContact
(
$expectedSummary
,
$expectedDTStart
,
$expectedFieldType
,
$expectedUnknownYear
,
$expectedOriginalYear
,
$data
,
$supports4Bytes
)
{
public
function
testBuildBirthdayFromContact
(
$expectedSummary
,
$expectedDTStart
,
$expectedFieldType
,
$expectedUnknownYear
,
$expectedOriginalYear
,
$data
,
$fieldType
,
$prefix
,
$supports4Bytes
)
{
$this
->
dbConnection
->
method
(
'supports4ByteText'
)
->
willReturn
(
$supports4Bytes
);
$cal
=
$this
->
service
->
buildDateFromContact
(
$data
,
'BDAY'
,
''
,
'*'
,
'🎂'
);
$cal
=
$this
->
service
->
buildDateFromContact
(
$data
,
$fieldType
,
$prefix
);
if
(
$expectedSummary
===
null
)
{
$this
->
assertNull
(
$cal
);
...
...
@@ -169,7 +180,7 @@ class BirthdayServiceTest extends TestCase {
$service
=
$this
->
getMockBuilder
(
BirthdayService
::
class
)
->
setMethods
([
'buildDateFromContact'
,
'birthdayEvenChanged'
])
->
setConstructorArgs
([
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
])
->
setConstructorArgs
([
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
,
$this
->
l10n
])
->
getMock
();
$service
->
onCardChanged
(
666
,
'gump.vcf'
,
''
);
...
...
@@ -198,7 +209,7 @@ class BirthdayServiceTest extends TestCase {
/** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */
$service
=
$this
->
getMockBuilder
(
BirthdayService
::
class
)
->
setMethods
([
'buildDateFromContact'
,
'birthdayEvenChanged'
])
->
setConstructorArgs
([
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
])
->
setConstructorArgs
([
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
,
$this
->
l10n
])
->
getMock
();
$service
->
onCardChanged
(
666
,
'gump.vcf'
,
''
);
...
...
@@ -234,7 +245,7 @@ class BirthdayServiceTest extends TestCase {
/** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */
$service
=
$this
->
getMockBuilder
(
BirthdayService
::
class
)
->
setMethods
([
'buildDateFromContact'
,
'birthdayEvenChanged'
])
->
setConstructorArgs
([
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
])
->
setConstructorArgs
([
$this
->
calDav
,
$this
->
cardDav
,
$this
->
groupPrincipalBackend
,
$this
->
config
,
$this
->
dbConnection
,
$this
->
l10n
])
->
getMock
();
if
(
$expectedOp
===
'delete'
)
{
...
...
@@ -382,27 +393,29 @@ class BirthdayServiceTest extends TestCase {
public
function
providesVCards
()
{
return
[
// $expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $supports4Byte
[
null
,
null
,
null
,
null
,
null
,
null
,
true
],
[
null
,
null
,
null
,
null
,
null
,
''
,
true
],
[
null
,
null
,
null
,
null
,
null
,
'yasfewf'
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
END:VCARD
\r\n
"
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:
\r\n
END:VCARD
\r\n
"
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:someday
\r\n
END:VCARD
\r\n
"
,
true
],
[
'🎂 12345 (1900)'
,
'19700101'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19000101
\r\n
END:VCARD
\r\n
"
,
true
],
[
'🎂 12345 (1900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19001231
\r\n
END:VCARD
\r\n
"
,
true
],
[
'🎂 12345'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:--1231
\r\n
END:VCARD
\r\n
"
,
true
],
[
'🎂 12345'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY;X-APPLE-OMIT-YEAR=1604:16041231
\r\n
END:VCARD
\r\n
"
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:;VALUE=text:circa 1800
\r\n
END:VCARD
\r\n
"
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
N:12345;;;;
\r\n
BDAY:20031231
\r\n
END:VCARD
\r\n
"
,
true
],
[
'🎂 12345 (900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:09001231
\r\n
END:VCARD
\r\n
"
,
true
],
[
'12345 (*1900)'
,
'19700101'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19000101
\r\n
END:VCARD
\r\n
"
,
false
],
[
'12345 (*1900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19001231
\r\n
END:VCARD
\r\n
"
,
false
],
[
'12345 *'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:--1231
\r\n
END:VCARD
\r\n
"
,
false
],
[
'12345 *'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY;X-APPLE-OMIT-YEAR=1604:16041231
\r\n
END:VCARD
\r\n
"
,
false
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:;VALUE=text:circa 1800
\r\n
END:VCARD
\r\n
"
,
false
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
N:12345;;;;
\r\n
BDAY:20031231
\r\n
END:VCARD
\r\n
"
,
false
],
[
'12345 (*900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:09001231
\r\n
END:VCARD
\r\n
"
,
false
],
// $expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $fieldType, $prefix, $supports4Byte
[
null
,
null
,
null
,
null
,
null
,
'yasfewf'
,
''
,
''
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:someday
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
'🎂 12345 (1900)'
,
'19700101'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19000101
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
'🎂 12345 (1900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19001231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
'Death of 12345 (1900)'
,
'19701231'
,
'DEATHDATE'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
DEATHDATE:19001231
\r\n
END:VCARD
\r\n
"
,
'DEATHDATE'
,
'-death'
,
true
],
[
'Death of 12345 (1900)'
,
'19701231'
,
'DEATHDATE'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
DEATHDATE:19001231
\r\n
END:VCARD
\r\n
"
,
'DEATHDATE'
,
'-death'
,
false
],
[
'💍 12345 (1900)'
,
'19701231'
,
'ANNIVERSARY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
ANNIVERSARY:19001231
\r\n
END:VCARD
\r\n
"
,
'ANNIVERSARY'
,
'-anniversary'
,
true
],
[
'12345 (⚭1900)'
,
'19701231'
,
'ANNIVERSARY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
ANNIVERSARY:19001231
\r\n
END:VCARD
\r\n
"
,
'ANNIVERSARY'
,
'-anniversary'
,
false
],
[
'🎂 12345'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:--1231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
'🎂 12345'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY;X-APPLE-OMIT-YEAR=1604:16041231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:;VALUE=text:circa 1800
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
N:12345;;;;
\r\n
BDAY:20031231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
'🎂 12345 (900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:09001231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
true
],
[
'12345 (*1900)'
,
'19700101'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19000101
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
false
],
[
'12345 (*1900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'1900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:19001231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
false
],
[
'12345 *'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:--1231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
false
],
[
'12345 *'
,
'19701231'
,
'BDAY'
,
'1'
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY;X-APPLE-OMIT-YEAR=1604:16041231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
false
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:;VALUE=text:circa 1800
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
false
],
[
null
,
null
,
null
,
null
,
null
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
N:12345;;;;
\r\n
BDAY:20031231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
false
],
[
'12345 (*900)'
,
'19701231'
,
'BDAY'
,
'0'
,
'900'
,
"BEGIN:VCARD
\r\n
VERSION:3.0
\r\n
PRODID:-//Sabre//Sabre VObject 4.1.1//EN
\r\n
UID:12345
\r\n
FN:12345
\r\n
N:12345;;;;
\r\n
BDAY:09001231
\r\n
END:VCARD
\r\n
"
,
'BDAY'
,
''
,
false
],
];
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment