Whitespace in {displayname} conver to + instead of %20
When using {displayname} whitespaces are escaped as + (instead of %20) which makes jitsi display the + sign in the username.
Steps to reproduce
- Create an external link like 'https://meet.jit.si/A-meeting-room#userInfo.displayName=%22{displayname}%22'
- If {displayname} contains whitespace (e.g. "John Doe") this gets translated into 'https://meet.jit.si/A-meeting-room#userInfo.displayName=%22John+Doe%22'
- Jitsi shows the 'John+Doe' as the participant name
Expected behaviour
Whitespaces in {displayname} (and possible other fields containing text) are escaped using %20. This fixes the issue with jitsi URLS, e.g.
https://meet.jit.si/A-meeting-room#userInfo.displayName=%22John%20Doe%22
We use urlencode to encode the parameters. Can't really replace it as it would break existing usages
From the comments for urlencode [1] rawurlencode [2] is the function that implements RFC conforming encoding behaviour.
A quick test on my instance confirms expected behaviour.
I can relate to the issue of not breaking existing usages. Could using rawurlencode be a per-link option that defaults to false?
[1] https://www.php.net/manual/en/function.urlencode.php [2] https://www.php.net/manual/en/function.rawurlencode.php
Implemented in https://github.com/nextcloud/external/commit/86b41285e864025c5933a6ae51cad5952e82f909 accidentally pushed to master instead of a branch