nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
989 stars 240 forks source link

Share item to Group with Space in GID #3119

Closed weltermann closed 3 years ago

weltermann commented 3 years ago

If you share a calender to a group with an space in the name, the Request return status code 200, but the sharing is not safed.

I guess, it's because the URI Encoder change the space to %2b which, if you decode it again, convert it back to a plus (+), e.g.: <x4:share xmlns:x4="http://owncloud.org/ns"><x4:set><x0:href xmlns:x0="DAV:">principal:principals/groups/Test%2bGroup</x0:href></x4:set></x4:share> and decodeURIComponent("principal:principals/groups/Test%2bGroup") === "principal:principals/groups/Test+Group" This GID cannot be found in the groups table so check in https://github.com/nextcloud/server/blob/9de329a4c2327767d86bd7f594b232eb56af0d01/apps/dav/lib/DAV/Sharing/Backend.php#L113 fail

Steps to reproduce

  1. Create an group with a space in the name
  2. Share a calender with the Group
  3. Reload and check, if calender is still shared with group

Expected behaviour

Calender still shared

Actual behaviour

Calender is not shared

Calendar app

2.2.2

Client configuration

Calendar app

Calendar app version: 2.2.2

CalDAV-clients used: none

Client configuration

Browser: Firefox 78.10.1esr & Chrome 90.0.4430.212

Operating system: macOS 11.3.1

Server configuration

Operating system: centOS 7.2

Web server: Apache 2.4.41

Database: MySQL 5.7.30

PHP version: 7.4.19

Nextcloud Version: 20.0.10

Updated from an older installed version or fresh install: Updated

tcitworld commented 3 years ago

Duplicate from https://github.com/nextcloud/server/issues/25165