Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORGANIZER e-mail address are case-insensitive #435

Merged
merged 2 commits into from Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ITip/Broker.php
Expand Up @@ -847,7 +847,7 @@ protected function parseEventInfo(VCalendar $calendar = null)
$organizer = $vevent->ORGANIZER->getNormalizedValue();
$organizerName = isset($vevent->ORGANIZER['CN']) ? $vevent->ORGANIZER['CN'] : null;
} else {
if ($organizer !== $vevent->ORGANIZER->getNormalizedValue()) {
if (strtoupper($organizer) !== strtoupper($vevent->ORGANIZER->getNormalizedValue())) {
throw new SameOrganizerForAllComponentsException('Every instance of the event must have the same organizer.');
}
}
Expand Down
48 changes: 47 additions & 1 deletion tests/VObject/ITip/BrokerNewEventTest.php
Expand Up @@ -508,10 +508,56 @@ public function testChangingOrganizers()
END:VCALENDAR
ICS;

$version = \Sabre\VObject\Version::VERSION;
$this->parse(null, $message, [], 'mailto:strunk@example.org');
}

public function testCaseInsensitiveOrganizers()
{
$message = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:foobar
ORGANIZER;CN=Strunk:mailto:strunk@example.org
ATTENDEE;CN=One:mailto:one@example.org
ATTENDEE;CN=Two:mailto:two@example.org
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
RRULE:FREQ=DAILY
END:VEVENT
BEGIN:VEVENT
UID:foobar
RECURRENCE-ID:20140718T120000Z
ORGANIZER;CN=Strunk:mailto:Strunk@example.org
ATTENDEE;CN=Two:mailto:two@example.org
ATTENDEE;CN=Three:mailto:three@example.org
DTSTART:20140718T120000Z
DTEND:20140718T130000Z
END:VEVENT
END:VCALENDAR
ICS;

$this->parse(null, $message, [
[
'uid' => 'foobar',
'method' => 'REQUEST',
'component' => 'VEVENT',
'sender' => 'mailto:strunk@example.org',
],
[
'uid' => 'foobar',
'method' => 'REQUEST',
'component' => 'VEVENT',
'sender' => 'mailto:strunk@example.org',
],
['uid' => 'foobar',
'method' => 'REQUEST',
'component' => 'VEVENT',
'sender' => 'mailto:strunk@example.org',
],
], 'mailto:strunk@example.org');
}

public function testNoOrganizerHasAttendee()
{
$message = <<<ICS
Expand Down
2 changes: 1 addition & 1 deletion tests/VObject/ITip/EvolutionTest.php
Expand Up @@ -7,7 +7,7 @@ class EvolutionTest extends BrokerTester
/**
* Evolution does things as usual a little bit differently.
*
* We're adding a seprate test just for it.
* We're adding a separate test just for it.
*/
public function testNewEvolutionEvent()
{
Expand Down