external icon indicating copy to clipboard operation
external copied to clipboard

Whitespace in {displayname} conver to + instead of %20

Open dantefromhell opened this issue 3 years ago • 2 comments

When using {displayname} whitespaces are escaped as + (instead of %20) which makes jitsi display the + sign in the username.

Steps to reproduce

  1. Create an external link like 'https://meet.jit.si/A-meeting-room#userInfo.displayName=%22{displayname}%22'
  2. If {displayname} contains whitespace (e.g. "John Doe") this gets translated into 'https://meet.jit.si/A-meeting-room#userInfo.displayName=%22John+Doe%22'
  3. 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

dantefromhell avatar Apr 26 '22 12:04 dantefromhell

We use urlencode to encode the parameters. Can't really replace it as it would break existing usages

nickvergessen avatar Apr 26 '22 13:04 nickvergessen

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

dantefromhell avatar Apr 26 '22 13:04 dantefromhell

Implemented in https://github.com/nextcloud/external/commit/86b41285e864025c5933a6ae51cad5952e82f909 accidentally pushed to master instead of a branch

nickvergessen avatar Sep 14 '22 09:09 nickvergessen