Visitar URL original
fix: generate the public calendar link server-side in sendmail [2.0] by oc-tmueller · Pull Request #1389 · owncloud/calendar · GitHub
Skip to content

fix: generate the public calendar link server-side in sendmail [2.0] - #1389

Open
oc-tmueller wants to merge 3 commits into
release-2.0from
fix/sendmail-server-side-link-2.0
Open

oc-tmueller wants to merge 3 commits into
release-2.0from
fix/sendmail-server-side-link-2.0

Conversation

@oc-tmueller

Copy link
Copy Markdown
Contributor

Backport of #1363 to release-2.0 (ownCloud 10.16, PHP 7.4), plus the follow-up from #1388.

Tested:

  • PHPUnit on PHP 7.4 / core 10.16: 93 tests pass. The new tests fail against the unfixed code.
  • Karma: 378 pass.
  • Manually on ownCloud 10.16.6 with mailpit and a German user. The mail carries the server-generated /p/<token> link and the translated, escaped publication line. A caller-supplied url is ignored, and a missing or malformed token gets 400.

The CHANGELOG link is added in the release commit.

🤖 Generated with Claude Code

oc-tmueller and others added 3 commits October 29, 2026 18:24
The public "send mail" endpoint now takes only the public sharing token
and builds the link itself via linkToRouteAbsolute(), instead of
accepting a caller-supplied URL. The calendar and user name are
HTML-escaped in the mail body.

Backport of #1363.

(cherry picked from commit db65a9a)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
A token the public route cannot hold (e.g. one containing "/") made
the router throw InvalidParameterException while building the link,
so the request ended in a 500. Validate the token with the same
allowlist the public calendar pages use and answer 400 instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
Core 10 runs vsprintf() on every translated string, also when no
parameters are given. The backported template translated the
publication line without parameters, so vsprintf() failed on the two
%s and core fell back to the English source text. Pass placeholder
tokens as parameters and replace them with the escaped values
afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants