UTF8 encoding 81/51481/2
authorMario Matzulla <mario@matzullas.de>
Tue, 31 Jan 2017 08:21:17 +0000 (09:21 +0100)
committerMario Matzulla <mario@matzullas.de>
Tue, 31 Jan 2017 08:26:04 +0000 (09:26 +0100)
Change-Id: I4c66a02df00c6e4b314fa4422968cc9f0a63f7a6
Reviewed-on: https://review.typo3.org/51481
Reviewed-by: Mario Matzulla <mario@matzullas.de>
Tested-by: Mario Matzulla <mario@matzullas.de>
Classes/Hooks/TceMainProcessdatamap.php
Classes/Service/IcsGenerator.php
lib/Sabre/CalDAV/Backend/TYPO3.php

index b90032e..c464edb 100644 (file)
@@ -66,7 +66,7 @@ class TceMainProcessdatamap {
                                        }
 
                                        if($table == 'tx_cal_event'){
-                                               $eventObject = $tx_cal_api->modelObj->findEvent($event['uid'], 'tx_cal_phpicalendar', $tx_cal_api->conf['pidList'], false, false, false, true, true);
+                                               $eventObject = $tx_cal_api->modelObj->findEvent($event['uid'], 'tx_cal_phpicalendar', $tx_cal_api->conf['pidList'], false, false, false, true, false);
 
                                                $oldPath = &$eventObject->conf['view.']['event.']['eventModelTemplate'];
                                                
@@ -88,7 +88,7 @@ class TceMainProcessdatamap {
                                                $drawnIcs = $viewObj->drawIcs($masterArray, '', false);
                                                $table = 'tx_cal_event';
                                                $where = 'uid = '.$event['uid'];
-                                               $eventData = Array('tx_caldav_data'=>$drawnIcs);
+                                               $eventData = Array('tx_caldav_data'=>utf8_encode($drawnIcs));
                                                $result = $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table,$where,$eventData);
                                                
                                                $table = 'tx_cal_calendar';
index acd5b87..bc39e5c 100644 (file)
@@ -135,7 +135,7 @@ class IcsGenerator {
                                                        $table = 'tx_cal_event';
                                                        $where = 'uid = ' . $event ['uid'];
                                                        $eventData = Array (
-                                                                       'tx_caldav_data' => $drawnIcs 
+                                                                       'tx_caldav_data' => rtrim(utf8_encode($drawnIcs)) 
                                                        );
                                                        if ($event ['tx_caldav_uid'] == null || $event ['tx_caldav_uid'] == '') {
                                                                
index e4daac7..4ecd6f9 100755 (executable)
@@ -335,7 +335,7 @@ class Sabre_CalDAV_Backend_TYPO3 extends Sabre_CalDAV_Backend_Abstract {
                        $preparedArray [] = Array (
                                        'id' => $eventRow ['uid'],
                                        'displayname' => $eventRow ['title'],
-                                       'calendardata' => $eventRow ['tx_caldav_data'],
+                                       'calendardata' => rtrim($eventRow ['tx_caldav_data']),
                                        'uri' => $eventRow ['tx_caldav_uid'],
                                        'calendarid' => $calendarId,
                                        'lastmodified' => $eventRow ['tstamp'] 
@@ -364,7 +364,7 @@ class Sabre_CalDAV_Backend_TYPO3 extends Sabre_CalDAV_Backend_Abstract {
                return Array (
                                'id' => $eventRow ['uid'],
                                'displayname' => $eventRow ['title'],
-                               'calendardata' => $eventRow ['tx_caldav_data'],
+                               'calendardata' => rtrim($eventRow ['tx_caldav_data']),
                                'uri' => $eventRow ['icsUid'],
                                'calendarid' => $calendarId,
                                'lastmodified' => $eventRow ['tstamp'] 
@@ -419,7 +419,7 @@ class Sabre_CalDAV_Backend_TYPO3 extends Sabre_CalDAV_Backend_Abstract {
                $calendarRow = $stmt->fetch ();
                $stmt = $this->pdo->prepare ( 'UPDATE tx_cal_event SET tx_caldav_data = ?, tstamp = ? WHERE calendar_id = ? AND icsUid = ? AND deleted = 0' );
                $stmt->execute ( array (
-                               $calendarData,
+                               rtrim($calendarData),
                                time (),
                                $calendarId,
                                $objectUri 
@@ -428,7 +428,7 @@ class Sabre_CalDAV_Backend_TYPO3 extends Sabre_CalDAV_Backend_Abstract {
                $stmt->execute ( array (
                                $calendarId 
                ) );
-               $this->updateCalEvent ( $calendarId, $objectUri, $calendarData );
+               $this->updateCalEvent ( $calendarId, $objectUri, rtrim($calendarData) );
                $this->clearCache ( $calendarRow ['pid'] );
        }