nextcloud / calendar

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

Error when calendar subscription url is surrounded with whitespace #6325

Open mpeter50 opened 2 months ago

mpeter50 commented 2 months ago

Steps to reproduce

  1. Select the option to add a new calendar by a subscription link image
  2. Insert the example link from the "additional info" section below

Expected behavior

Calendar subscription gets added to the list of calendars, and events are loaded from it

Actual behaviour

Calendar subscription gets added to the list of calendars, but events are not loaded from it, the calendar stays empty

Calendar app version

4.7.16

CalDAV-clients used

No response

Browser

Firefox

Client operating system

No response

Server operating system

Debian 12, using the AIO manual install Docker composition

Web server

None

Database engine version

None

PHP engine version

None

Nextcloud version

29.0.4

Updated from an older installed version or fresh install

Fresh install

List of activated apps

No response

Nextcloud configuration

No response

Web server error log

No response

Log file

https://gist.github.com/mpeter50/efd1e965a8f636bbbacf9fa64d62a4e7

Browser log

No response

Additional info

Example link:

 https://neptun.szte.hu/hallgato/cal/cal.ashx?id=test.ics 

Please copy the whole line, including the whitespace before and after the link. Also please note that this is not a working calendar URL. The difference is that working links have a long string of word characters in place of test, but unfortunately I cannot serve with a working testing link, neither one that I could revoke.

I have only included the single long JSON line from the nextcloud.log file that is generated when the issue happens. Before and after that there was no activity in the file for a while. I have also formatted the JSON object so that I can point to a line of it.

By looking at line 14 of the attached nextcloud.log excerpt, the problem may be that the URL is not trimmed before its prefix is being checked and prepended.

The problem reported in this issue may not seem to be a significant one at first, but it seems there are systems out there that invisibly include whitespace at both ends of the string when you copy the link it presented, after double clicking it to select the whole line. One such system is the countrywide education system for universities in my country.

nishantdecode commented 1 month ago

@mpeter50 @tcitworld could you please assign this issue to me!