Bug description
When a user whose uid contains a space (e.g. Elisa Ciria) creates a calendar event, the entry appears in the Activity stream ("X created event Y"). Clicking the event opens the Calendar app, which shows "Event does not exist" — even though the event exists and is perfectly usable inside the Calendar app itself.
Root cause
In apps/dav/lib/CalDAV/Activity/Provider/Event.php, generateObjectParameter() builds the event deep-link by base64-encoding a CalDAV path. Only calendar_uri is URL-encoded (urlencodeLowerHex()); the principal segment is inserted raw:
// owner branch
$objectId = base64_encode($this->url->getWebroot() . '/remote.php/dav/calendars/'
. $linkData['owner'] . '/' . $calendarUri . '/' . $linkData['object_uri']);
// shared branch
$objectId = base64_encode($this->url->getWebroot() . '/remote.php/dav/calendars/'
. $affectedUser . '/' . $calendarUri . '_shared_by_' . $linkData['owner'] . '/' . $linkData['object_uri']);
If the uid contains a space, the decoded path is /remote.php/dav/calendars/Elisa Ciria/... (literal space) instead of /remote.php/dav/calendars/Elisa%20Ciria/.... The Calendar app cannot match this against the actual (percent-encoded) CalDAV object href → "Event does not exist".
Steps to reproduce
- Create a user with a space in the uid (e.g.
Elisa Ciria).
- As that user, create a calendar event.
- Open Activity, click the event.
- → Calendar opens on "Event does not exist".
Expected behaviour
The link opens the event.
Actual behaviour
"Event does not exist" (while the event exists and opens fine from within Calendar).
Affected versions
Reproduced on Nextcloud 31.0.6 (dav app 1.33.0). The unencoded insertion is still present on master and stable31 (verified on GitHub). Related: #17610, nextcloud/calendar#2199, #43430. PR #45775 fixed only the shared-calendar notification link, not the owner/affectedUser encoding.
Proposed fix
Wrap the principal segments in rawurlencode() (space → %20):
// owner branch
... '/remote.php/dav/calendars/' . rawurlencode($linkData['owner']) . '/' . $calendarUri . '/' . $linkData['object_uri']
// shared branch
... '/remote.php/dav/calendars/' . rawurlencode($affectedUser) . '/' . $calendarUri . '_shared_by_' . rawurlencode($linkData['owner']) . '/' . $linkData['object_uri']
Since the link is generated on render (the oc_activity.link column stays empty), this fixes both existing and future activity entries.
Bug description
When a user whose uid contains a space (e.g.
Elisa Ciria) creates a calendar event, the entry appears in the Activity stream ("X created event Y"). Clicking the event opens the Calendar app, which shows "Event does not exist" — even though the event exists and is perfectly usable inside the Calendar app itself.Root cause
In
apps/dav/lib/CalDAV/Activity/Provider/Event.php,generateObjectParameter()builds the event deep-link by base64-encoding a CalDAV path. Onlycalendar_uriis URL-encoded (urlencodeLowerHex()); the principal segment is inserted raw:If the uid contains a space, the decoded path is
/remote.php/dav/calendars/Elisa Ciria/...(literal space) instead of/remote.php/dav/calendars/Elisa%20Ciria/.... The Calendar app cannot match this against the actual (percent-encoded) CalDAV object href → "Event does not exist".Steps to reproduce
Elisa Ciria).Expected behaviour
The link opens the event.
Actual behaviour
"Event does not exist" (while the event exists and opens fine from within Calendar).
Affected versions
Reproduced on Nextcloud 31.0.6 (dav app 1.33.0). The unencoded insertion is still present on
masterandstable31(verified on GitHub). Related: #17610, nextcloud/calendar#2199, #43430. PR #45775 fixed only the shared-calendar notification link, not theowner/affectedUserencoding.Proposed fix
Wrap the principal segments in
rawurlencode()(space →%20):Since the link is generated on render (the
oc_activity.linkcolumn stays empty), this fixes both existing and future activity entries.