Skip to content

Commit b417275

Browse files
author
tchapi
committed
chore
1 parent f5595d6 commit b417275

8 files changed

Lines changed: 17 additions & 22 deletions

File tree

src/Entity/User.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ class User
2020

2121
/**
2222
* A username ends up in the principal URI (`principals/<username>`), so it must not carry
23-
* anything that would change that path's structure. Letters, digits and `_ . @ + ' -` are allowed:
24-
* the punctuation is what shows up in mail-derived login names. Enforced when a user is created; existing
25-
* accounts are left alone so that an odd username created before this rule stays editable.
23+
* anything that would change that path's structure. Letters, digits and `_ . @ + ' -` are
24+
* allowed: the punctuation is what shows up in mail-derived login names.
25+
*
26+
* Only checked in the `creation` validation group, so that an account whose name does not
27+
* match — an LDAP or IMAP login, say — stays editable.
2628
*/
2729
public const USERNAME_PATTERN = '/^[a-zA-Z0-9_.@+\'-]+$/';
2830

src/Plugins/DavisIMipPlugin.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,10 @@ public function schedule(ITip\Message $itip)
230230
->replyTo(new Address($senderEmail, $mailSenderName))
231231
->subject($subject);
232232

233-
// Keep holiday auto-replies from bouncing back at invitations. This used to sit behind
234-
// the version check, so disabling that would have silently dropped it too.
233+
// Keep holiday auto-replies from bouncing back at invitations.
235234
$message->getHeaders()->addTextHeader('X-Auto-Response-Suppress', 'OOF, DR, RN, NRN, AutoReply');
236235

237236
if (DAV\Server::$exposeVersion) {
238-
// NB: the header name carried a trailing ": " here, which is not a valid name
239237
$message->getHeaders()->addTextHeader('X-Sabre-Version', DAV\Version::VERSION);
240238
}
241239

tests/Functional/AddressBookDavTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ private function addressBookFor(string $uri): array
4444
}
4545

4646
/**
47-
* Regression test for issue #275: a display name is optional in CardDAV, but the column
48-
* was NOT NULL, so an MKCOL without {DAV:}displayname failed with a 500.
47+
* A display name is optional in CardDAV: an MKCOL without {DAV:}displayname must succeed.
4948
*/
5049
public function testAddressBookCanBeCreatedWithoutADisplayName(): void
5150
{

tests/Functional/CalendarSubscriptionTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ private function subscriptionFor(string $uri): array
4545
}
4646

4747
/**
48-
* Regression test: `calendarorder` had no default, and sabre only lists it in its INSERT
49-
* when the client sent {http://apple.com/ns/ical/}calendar-order. Subscribing without one
50-
* therefore failed with a NOT NULL violation.
48+
* sabre only lists `calendarorder` in its INSERT when the client sent
49+
* {http://apple.com/ns/ical/}calendar-order, so the column needs a default.
5150
*/
5251
public function testSubscriptionCanBeCreatedWithoutACalendarOrder(): void
5352
{

tests/Functional/Controllers/DashboardTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function testLoginCorrect(): void
9494
}
9595

9696
/**
97-
* A plain `GET /logout` from any page the admin happens to visit used to end their session.
97+
* Logging out is a state change: a bare `GET /logout` must not end the session.
9898
*/
9999
public function testLogoutRequiresACsrfToken(): void
100100
{

tests/Functional/DavTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ public function testAnonymousCannotReadCalendarObject(): void
129129
}
130130

131131
/**
132-
* Regression test: the ACL plugin used to skip all privilege checks whenever
133-
* `sabreAction=asset` was present in the query string, for any method and any path.
132+
* `sabreAction=asset` is only meaningful for the browser plugin's own assets: it must not
133+
* waive the privilege checks on an arbitrary path.
134134
*/
135135
public function testAssetQueryParameterDoesNotBypassReadAcl(): void
136136
{
@@ -208,8 +208,8 @@ public function testWellKnownUrlsRedirectToTheDavEndpoint(): void
208208
}
209209

210210
/**
211-
* OPTIONS used to answer for the server root whatever was asked, so it never advertised
212-
* the methods that only exist deeper in the tree, MKCALENDAR being the obvious one.
211+
* The advertised methods depend on the node: MKCALENDAR only exists inside a calendar home,
212+
* so OPTIONS has to answer for the path it was asked about rather than for the root.
213213
*/
214214
public function testOptionsDescribesTheRequestedPath(): void
215215
{

tests/Functional/Service/LDAPAuthTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public function testDomainComponentsAreAvailableInReverseOrder(): void
6363
}
6464

6565
/**
66-
* Regression test: the username was interpolated into the DN pattern verbatim, so a name
67-
* carrying DN syntax added structure to the DN instead of being a value inside it.
66+
* A username carrying DN syntax must stay a value inside the DN, not add structure to it.
6867
*/
6968
public function testAUsernameCannotInjectDnStructure(): void
7069
{

tests/Functional/SyncTokenTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ private function createAddressBookAtTokenEleven(): int
5050
}
5151

5252
/**
53-
* Regression test: sync tokens were stored as text, so `synctoken >= 9 AND synctoken < 11`
54-
* was compared lexicographically ('10' sorts before '9'). A client syncing across a
55-
* decimal-width boundary was told the collection had advanced but received no changes at
56-
* all, silently losing contacts.
53+
* Sync tokens are compared numerically, so a client syncing across a decimal-width
54+
* boundary gets every change in the range. Compared as text, `'10' < '9'` would hide them.
5755
*/
5856
public function testChangesAcrossADecimalBoundaryAreReported(): void
5957
{

0 commit comments

Comments
 (0)