limit event SUMMARY and LOCATION to 1024 mb chars
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 11 Mar 2016 10:29:47 +0000 (11:29 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 11 Mar 2016 12:45:04 +0000 (13:45 +0100)
 ... as this breaks in pgsql for longer strings

Change-Id: If74509cb0515cf6082b9fe3fb95f15a3083b3633
Reviewed-on: http://gerrit.tine20.com/customers/2886
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Convert/Event/VCalendar/Abstract.php

index d227716..5b9b699 100644 (file)
@@ -788,8 +788,11 @@ class Calendar_Convert_Event_VCalendar_Abstract extends Tinebase_Convert_VCalend
                 case 'SUMMARY':
                     $key = strtolower($property->name);
                     $value = $property->getValue();
+                    if (in_array($key, array('location', 'summary')) && extension_loaded('mbstring')) {
+                        $value = mb_substr($value, 0, 1024, 'UTF-8');
+                    }
+
                     $event->$key = $value;
-                    
                     break;
                     
                 case 'ORGANIZER':