Skip to content

Sabre: Incorrect string value #7661

@Priebojp

Description

@Priebojp

Hello,

If i want to sync a calendar event through CalDav from EmClient i got an Exception.
The problem is with table "oc_calendarobjects_props" and Sabre.
This function "apps/dav/lib/CalDAV/CalDavBackend.updateProperties()" try to save a UTF-8 converted text into db but they save only the first xy char of the text.
And this is the problem. Because after the Split of the text there is a chance of get Incorrect string.

Text:
Obchod pouze baby ideálně kolem 30ti možná po mateřské
Ohodnocení Obchodniček - dodržet parametry ale velmi motivační musí při dobrém výkonu dosáhnout 100% při vynikajícím 120%
Podřídit veškerou kontrolu kontrole parametrů
Co nejví

Expected decode:
\x4f\x62\x63\x68\x6f\x64\u20\x70\x6f\x75\x7a\x65\u20\x62\x61\x62\x79\u20\x69\x64\x65\xc3\xa1\x6c\x6e\xc4\x9b\u20\x6b\x6f\x6c\x65\x6d\u20\x33\x30\x74\x69\u20\x6d\x6f\xc5\xbe\x6e\xc3\xa1\u20\x70\x6f\u20\x6d\x61\x74\x65\xc5\x99\x73\x6b\xc3\xa9\x0a\x4f\x68\x6f\x64\x6e\x6f\x63\x65\x6e\xc3\xad\u20\x4f\x62\x63\x68\x6f\x64\x6e\x69\xc4\x8d\x65\x6b\u20\x2d\u20\x64\x6f\x64\x72\xc5\xbe\x65\x74\u20\x70\x61\x72\x61\x6d\x65\x74\x72\x79\u20\x61\x6c\x65\u20\x76\x65\x6c\x6d\x69\u20\x6d\x6f\x74\x69\x76\x61\xc4\x8d\x6e\xc3\xad\u20\x6d\x75\x73\xc3\xad\u20\x70\xc5\x99\x69\u20\x64\x6f\x62\x72\xc3\xa9\x6d\u20\x76\xc3\xbd\x6b\x6f\x6e\x75\u20\x64\x6f\x73\xc3\xa1\x68\x6e\x6f\x75\x74\u20\x31\x30\x30\x25\u20\x70\xc5\x99\x69\u20\x76\x79\x6e\x69\x6b\x61\x6a\xc3\xad\x63\xc3\xad\x6d\u20\x31\x32\x30\x25\x0a\x50\x6f\x64\xc5\x99\xc3\xad\x64\x69\x74\u20\x76\x65\xc5\xa1\x6b\x65\x72\x6f\x75\u20\x6b\x6f\x6e\x74\x72\x6f\x6c\x75\u20\x6b\x6f\x6e\x74\x72\x6f\x6c\x65\u20\x70\x61\x72\x61\x6d\x65\x74\x72\xc5\xaf\x0a\x43\x6f\u20\x6e\x65\x6a\x76\xc3\xad

Actual decode:
\x4f\x62\x63\x68\x6f\x64\x20\x70\x6f\x75\x7a\x65\x20\x62\x61\x62\x79\x20\x69\x64\x65\xc3\xa1\x6c\x6e\xc4\x9b\x20\x6b\x6f\x6c\x65\x6d\x20\x33\x30\x74\x69\x20\x6d\x6f\xc5\xbe\x6e\xc3\xa1\x20\x70\x6f\x20\x6d\x61\x74\x65\xc5\x99\x73\x6b\xc3\xa9\x0a\x4f\x68\x6f\x64\x6e\x6f\x63\x65\x6e\xc3\xad\x20\x4f\x62\x63\x68\x6f\x64\x6e\x69\xc4\x8d\x65\x6b\x20\x2d\x20\x64\x6f\x64\x72\xc5\xbe\x65\x74\x20\x70\x61\x72\x61\x6d\x65\x74\x72\x79\x20\x61\x6c\x65\x20\x76\x65\x6c\x6d\x69\x20\x6d\x6f\x74\x69\x76\x61\xc4\x8d\x6e\xc3\xad\x20\x6d\x75\x73\xc3\xad\x20\x70\xc5\x99\x69\x20\x64\x6f\x62\x72\xc3\xa9\x6d\x20\x76\xc3\xbd\x6b\x6f\x6e\x75\x20\x64\x6f\x73\xc3\xa1\x68\x6e\x6f\x75\x74\x20\x31\x30\x30\x25\x20\x70\xc5\x99\x69\x20\x76\x79\x6e\x69\x6b\x61\x6a\xc3\xad\x63\xc3\xad\x6d\x20\x31\x32\x30\x25\x0a\x50\x6f\x64\xc5\x99\xc3\xad\x64\x69\x74\x20\x76\x65\xc5\xa1\x6b\x65\x72\x6f\x75\x20\x6b\x6f\x6e\x74\x72\x6f\x6c\x75\x20\x6b\x6f\x6e\x74\x72\x6f\x6c\x65\x20\x70\x61\x72\x61\x6d\x65\x74\x72\xc5\xaf\x0a\x43\x6f\x20\x6e\x65\x6a\x76\xc3

And the problem is this char "\xc3" and the reason of "General error: 1366 Incorrect string value: '\xC3' for column 'value' at row 1"

Steps to reproduce

  1. Sync calendar with CalDav.
  2. Create new event with this text
    "Obchod pouze baby ideálně kolem 30ti možná po mateřské
    Ohodnocení Obchodniček - dodržet parametry ale velmi motivační musí při dobrém výkonu dosáhnout 100% při vynikajícím 120%
    Podřídit veškerou kontrolu kontrole parametrů
    Co nejví" - without quote
  3. sync with server

Expected behaviour

save the event

Actual behaviour

Throw Exception.

Server configuration

Operating system:

Web server:

Database: MySql 5.7.15-9-log

PHP version: 7.1.6

Nextcloud version: 12.0.4

Updated from an older Nextcloud/ownCloud or fresh install:
2 Month old install

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions