nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
569 stars 172 forks source link

URL's being imported and then displayed with the "\" #3918

Open DiagonalArg opened 6 months ago

DiagonalArg commented 6 months ago

Describe the bug

Import this vCard, which was exported from google, and find that the URL is being imported and then displayed with the "\"

BEGIN:VCARD
VERSION:3.0
FN:BMW of Southpoint (Durham; NC)
N:;BMW of Southpoint (Durham\; NC);;;
TEL;TYPE=MAIN:+1.888 693 3645
item1.ADR:;;225 Kentington Dr;Durham;NC;27713;US;225 Kentington Dr\nDurham
 \, NC 27713\nUS
item1.X-ABLabel:
item2.URL:https\://www.bmwsouthpoint.com/
item2.X-ABLabel:homePage
NOTE:Called 877-432-7841 to make appointment.\n\nHours: M-F\:9A-8P\; Sa\:9A
 -6P
CATEGORIES:Auto,myContacts
END:VCARD

image

Steps to reproduce

See above.

Expected behavior

https://www.bmwsouthpoint.com/

Actual behavior

https\\://www.bmwsouthpoint.com/

Contact version

5.5.3

Operating system

CentOS 7.9

PHP engine version

PHP 8.1

Web server

Nginx

Database

PostgreSQL

Additional info

Thanks for your work!

st3iny commented 6 months ago

There seems to be something wrong in Google's vCard exporter. In vCard version 3.0 the colon character must not be escaped anymore^1. I changed the URL line to item2.URL:https://www.bmwsouthpoint.com/ and it works as expected.

The original vCard passes validation checks and is not wrong per se but the escaped colon \: is superfluous and thus interpreted literally as part of the URL.

DiagonalArg commented 6 months ago

I see. Would that just be when it appears in a URL?

If so, I'll try sed'ing my DB to get rid of those and see what happens.