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

ITip/Broker and plus signs in email addresses #612

Open
rotdrop opened this issue Feb 16, 2023 · 1 comment
Open

ITip/Broker and plus signs in email addresses #612

rotdrop opened this issue Feb 16, 2023 · 1 comment

Comments

@rotdrop
Copy link

rotdrop commented Feb 16, 2023

There might be a bug when organizers or attendees emails contain characters which need to be url-encoded like [email protected]. This is also discussed here: nextcloud/server#28162

if (in_array($eventInfo['organizer'], $userHref)) {

It seems that the email-address in $eventInfo['organizer'] is already decoded (e.g. %2b replaced by a literal +), however, the emails contained in the array $userHref are not.

A fix might be to inject a line

$userHref = array_map(fn($url) => urldecode($url), $userHref);

right after

https://github.com/nextcloud/3rdparty/blob/f143482ffb0b8dfdbc08cd848ce2e66f02a5d9b6/sabre/vobject/lib/ITip/Broker.php#L185-L186

However, I do not really know if the mistake is on the side of Nextcloud or Sabre and whether this hack has undesirable side-effects.

@rotdrop
Copy link
Author

rotdrop commented Feb 17, 2023

A fix might be to inject a line

$userHref = array_map(fn($url) => urldecode($url), $userHref);

right after

This actually does not hack the situation. In my setups the $userHref sometimes comes in url-encoded and sometimes not. Given that, a hackish "fix" would be something like this:

$userHref = array_map(fn($url) => rawurldecode($url), $userHref);

However, it would be good to understand under which circumstances $userHref comes in either way, encoded or not.

Note that urldecode() replaces a plus sign by a space which rawurldecode() does not.

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

No branches or pull requests

1 participant