Projects
Kolab:Winterfell
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 60
View file
kolab-syncroton.spec
Changed
@@ -36,7 +36,7 @@ %global _ap_sysconfdir %{_sysconfdir}/%{httpd_name} Name: kolab-syncroton -Version: 2.3.19 +Version: 2.3.20 Release: 1%{?dist} Summary: ActiveSync for Kolab Groupware @@ -203,6 +203,9 @@ %attr(0770,%{httpd_user},%{httpd_group}) %{_var}/log/%{name} %changelog +* Fri Jul 02 2021 Jeroen van Meeuwen <vanmeeuwen@apheleia-it.ch> - 2.3.20-1 +- Release version 2.3.20 + * Thu Jan 28 2021 Christian Mollekopf <mollekopf@kolabsys.com> - 2.3.19-1 - Release version 2.3.19
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +kolab-syncroton (2.3.20-0~kolab1) unstable; urgency=low + + * Release version 2.3.20 + + -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Fri, 2 Jul 2021 15:13:40 +0200 + kolab-syncroton (2.3.19-0~kolab1) unstable; urgency=low * Release version 2.3.19
View file
kolab-syncroton-2.3.19.tar.gz/composer.json-dist -> kolab-syncroton-2.3.20.tar.gz/composer.json-dist
Changed
@@ -22,6 +22,6 @@ "zf1/zend-log": "~1.12.11" }, "require-dev": { - "phpunit/phpunit": "~4.4.0" + "phpunit/phpunit": "^4.8 || ^5.7 || ^6 || ^7" } }
View file
kolab-syncroton-2.3.19.tar.gz/config/config.inc.php.dist -> kolab-syncroton-2.3.20.tar.gz/config/config.inc.php.dist
Changed
@@ -118,6 +118,10 @@ $config['activesync_multifolder_blacklist_note'] = null; $config['activesync_multifolder_blacklist_task'] = null; +// Blacklist devices that can handle TNEF (winmail.dat) format email +// For all others we'll try to extract the contents as best as we can. +$config['activesync_tnef_blacklist'] = array('windowsoutlook'); + // Enables adding sender name in the From: header of send email // when a device uses email address only (e.g. iOS devices) $config['activesync_fix_from'] = false;
View file
kolab-syncroton-2.3.19.tar.gz/lib/ext/rtf.php -> kolab-syncroton-2.3.20.tar.gz/lib/ext/rtf.php
Changed
@@ -214,20 +214,20 @@ $flagCount = 0; $flags = 0; while ($out<$oblen) { - $flags = ($flagCount++ % 8 == 0) ? ord($src{$in++}) : $flags >> 1; + $flags = ($flagCount++ % 8 == 0) ? ord($src[$in++]) : $flags >> 1; if (($flags & 1) == 1) { - $offset = ord($src{$in++}); - $length = ord($src{$in++}); + $offset = ord($src[$in++]); + $length = ord($src[$in++]); $offset = ($offset << 4) | ($length >> 4); $length = ($length & 0xF) + 2; $offset = (int)($out / 4096) * 4096 + $offset; if ($offset >= $out) $offset -= 4096; $end = $offset + $length; while ($offset < $end) { - $dst{$out++} = $dst{$offset++}; + $dst[$out++] = $dst[$offset++]; }; } else { - $dst{$out++} = $src{$in++}; + $dst[$out++] = $src[$in++]; } } $src = $dst; @@ -249,7 +249,7 @@ $c=0; $end = $off + $len; for($i=$off;$i < $end;$i++) { - $c=$this->CRC32_TABLE[($c ^ ord($buf{$i})) & 0xFF] ^ (($c >> 8) & 0x00ffffff); + $c=$this->CRC32_TABLE[($c ^ ord($buf[$i])) & 0xFF] ^ (($c >> 8) & 0x00ffffff); } return $c; }
View file
kolab-syncroton-2.3.19.tar.gz/lib/kolab_sync_data_calendar.php -> kolab-syncroton-2.3.20.tar.gz/lib/kolab_sync_data_calendar.php
Changed
@@ -894,14 +894,14 @@ } } - if ($value && $value instanceof DateTime) { - if ($event['start'] && ($interval = $event['start']->diff($value))) { + if (!empty($value) && $value instanceof DateTime) { + if (!empty($event['start']) && ($interval = $event['start']->diff($value))) { if ($interval->invert && !$interval->m && !$interval->y) { return intval(round($interval->s/60) + $interval->i + $interval->h * 60 + $interval->d * 60 * 24); } } } - else if ($value && preg_match('/^([-+]*)[PT]*([0-9]+)([WDHMS])$/', $value, $matches)) { + else if (!empty($value) && preg_match('/^([-+]*)[PT]*([0-9]+)([WDHMS])$/', $value, $matches)) { $value = intval($matches[2]); if ($value && $matches[1] != '-') { @@ -925,7 +925,7 @@ protected function to_kolab_alarm($value, $event) { if ($value === null || $value === '') { - return (array) $event['valarms']; + return isset($event['valarms']) ? (array) $event['valarms'] : array(); } $valarms = array(); @@ -943,8 +943,8 @@ } $valarms[] = array( - 'action' => $current['action'] ?: 'DISPLAY', - 'description' => $current['description'] ?: '', + 'action' => !empty($current['action']) ? $current['action'] : 'DISPLAY', + 'description' => !empty($current['description']) ? $current['description'] : '', 'trigger' => sprintf('-PT%dM', $value), );
View file
kolab-syncroton-2.3.19.tar.gz/lib/kolab_sync_data_email.php -> kolab-syncroton-2.3.20.tar.gz/lib/kolab_sync_data_email.php
Changed
@@ -112,6 +112,14 @@ if ($this->asversion >= 14) { $this->tag_categories = true; } + + // Disable TNEF (winmail.dat) decoding, e.g. Outlook knows best how to handle it + $config = rcube::get_instance()->config; + $blacklist = $config->get('activesync_tnef_blacklist', array('windowsoutlook')); + + if (is_array($blacklist) && $this->deviceTypeFilter($blacklist)) { + $config->set('tnef_decode', false); + } } /**
View file
kolab-syncroton-2.3.19.tar.gz/lib/kolab_sync_message.php -> kolab-syncroton-2.3.20.tar.gz/lib/kolab_sync_message.php
Changed
@@ -193,75 +193,39 @@ // remove empty headers $headers = array_filter($headers); - // send thru SMTP server using custom SMTP library - if ($rcube->config->get('smtp_server')) { - $smtp_headers = $headers; - // generate list of recipients - $recipients = array(); - - if (!empty($headers['To'])) - $recipients[] = $headers['To']; - if (!empty($headers['Cc'])) - $recipients[] = $headers['Cc']; - if (!empty($headers['Bcc'])) - $recipients[] = $headers['Bcc']; - - // remove Bcc header - unset($smtp_headers['Bcc']); - - // send message - if (!is_object($rcube->smtp)) { - $rcube->smtp_init(true); - } + $smtp_headers = $headers; - $sent = $rcube->smtp->send_mail($headers['From'], $recipients, $smtp_headers, $this->body, $smtp_opts); - $smtp_response = $rcube->smtp->get_response(); - $smtp_error = $rcube->smtp->get_error(); + // generate list of recipients + $recipients = array(); - // log error - if (!$sent) { - rcube::raise_error(array('code' => 800, 'type' => 'smtp', - 'line' => __LINE__, 'file' => __FILE__, - 'message' => "SMTP error: ".join("\n", $smtp_response)), true, false); - } + if (!empty($headers['To'])) + $recipients[] = $headers['To']; + if (!empty($headers['Cc'])) + $recipients[] = $headers['Cc']; + if (!empty($headers['Bcc'])) + $recipients[] = $headers['Bcc']; + + if (empty($headers['To']) && empty($headers['Cc'])) { + $headers['To'] = 'undisclosed-recipients:;'; } - // send mail using PHP's mail() function - else { - $mail_headers = $headers; - $delim = $rcube->config->header_delimiter(); - $subject = $headers['Subject']; - $to = $headers['To']; - - // unset some headers because they will be added by the mail() function - unset($mail_headers['To'], $mail_headers['Subject']); - - // #1485779 - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - if (preg_match_all('/<([^@]+@[^>]+)>/', $to, $m)) { - $to = implode(', ', $m[1]); - } - } - foreach ($mail_headers as $header => $header_value) { - $mail_headers[$header] = $header . ': ' . $header_value; - } - $header_str = rtrim(implode("\r\n", $mail_headers)); + // remove Bcc header + unset($smtp_headers['Bcc']); - if ($delim != "\r\n") { - $header_str = str_replace("\r\n", $delim, $header_str); - $msg_body = str_replace("\r\n", $delim, $this->body); - $to = str_replace("\r\n", $delim, $to); - $subject = str_replace("\r\n", $delim, $subject); - } + // send message + if (!is_object($rcube->smtp)) { + $rcube->smtp_init(true); + } - if (ini_get('safe_mode')) { - $sent = mail($to, $subject, $msg_body, $header_str); - } - else { - $from = rcube_mime::decode_address_list($headers['From'], 1, false, null, true); - $from = $from[0]; - $sent = mail($to, $subject, $msg_body, $header_str, "-f$from"); - } + $sent = $rcube->smtp->send_mail($headers['From'], $recipients, $smtp_headers, $this->body, $smtp_opts); + $smtp_response = $rcube->smtp->get_response(); + $smtp_error = $rcube->smtp->get_error(); + + // log error + if (!$sent) { + rcube::raise_error(array('code' => 800, 'type' => 'smtp', + 'line' => __LINE__, 'file' => __FILE__, + 'message' => "SMTP error: ".join("\n", $smtp_response)), true, false); } if ($sent) { @@ -270,25 +234,20 @@ // remove MDN headers after sending unset($headers['Return-Receipt-To'], $headers['Disposition-Notification-To']); - // get all recipients - if ($headers['Cc']) - $mailto .= ' ' . $headers['Cc']; - if ($headers['Bcc']) - $mailto .= ' ' . $headers['Bcc']; - if (preg_match_all('/<([^@]+@[^>]+)>/', $mailto, $m)) - $mailto = implode(', ', array_unique($m[1])); - if ($rcube->config->get('smtp_log')) { - rcube::write_log('sendmail', sprintf("User %s [%s]; Message for %s; %s", + // get all recipient addresses + $mailto = rcube_mime::decode_address_list(implode(',', $recipients), null, false, null, true); + + rcube::write_log('sendmail', sprintf("User %s [%s]; Message %s for %s; %s", $rcube->get_user_name(), - $_SERVER['REMOTE_ADDR'], - $mailto, - !empty($smtp_response) ? join('; ', $smtp_response) : '')); + rcube_utils::remote_addr(), + $headers['Message-ID'], + implode(', ', $mailto), + !empty($smtp_response) ? implode('; ', $smtp_response) : '') + ); } } - unset($headers['Bcc']); - $this->headers = $headers; return $sent; @@ -327,7 +286,7 @@ } // single part - $enc = strtolower($hdrs['Content-Transfer-Encoding']); + $enc = !empty($hdrs['Content-Transfer-Encoding']) ? strtolower($hdrs['Content-Transfer-Encoding']) : null; // do nothing if already encoded if ($enc != 'quoted-printable' && $enc != 'base64') {
View file
kolab-syncroton-2.3.19.tar.gz/lib/kolab_sync_timezone_converter.php -> kolab-syncroton-2.3.20.tar.gz/lib/kolab_sync_timezone_converter.php
Changed
@@ -284,7 +284,7 @@ for ($i=5; $i>0; $i--) { if ($this->_isNthOcurrenceOfWeekdayInMonth($transitionDate, $i)) { - $_offsets[$_type . 'Day'] = $i; + $_offsets[$_type . 'Week'] = $i; break; }; } @@ -351,7 +351,7 @@ $standardOffset = ($_offsets['bias'] + $_offsets['standardBias']) * 60 * -1; // check each condition in a single if statement and break the chain when one condition is not met - for performance reasons - if ($standardOffset == $_standardTransition['offset'] ) { + if ($standardOffset == $_standardTransition['offset']) { if (empty($_offsets['daylightMonth']) && (empty($_daylightTransition) || empty($_daylightTransition['isdst']))) { // No DST @@ -363,17 +363,24 @@ // the milestone is sending a positive value for daylightBias while it should send a negative value $daylightOffsetMilestone = ($_offsets['bias'] + ($_offsets['daylightBias'] * -1) ) * 60 * -1; - if ($daylightOffset == $_daylightTransition['offset'] || $daylightOffsetMilestone == $_daylightTransition['offset']) { - $standardDate = new DateTime($_standardTransition['time'], $tz); - $daylightDate = new DateTime($_daylightTransition['time'], $tz); + if ( + !empty($_daylightTransition) + && ($daylightOffset == $_daylightTransition['offset'] || $daylightOffsetMilestone == $_daylightTransition['offset']) + ) { + // date-time input here contains UTC timezone specifier (+0000), + // we have to convert the date to the requested timezone afterwards. + $standardDate = new DateTime($_standardTransition['time']); + $daylightDate = new DateTime($_daylightTransition['time']); + $standardDate->setTimezone($tz); + $daylightDate->setTimezone($tz); if ($standardDate->format('n') == $_offsets['standardMonth'] && $daylightDate->format('n') == $_offsets['daylightMonth'] && $standardDate->format('w') == $_offsets['standardDayOfWeek'] && $daylightDate->format('w') == $_offsets['daylightDayOfWeek'] ) { - return $this->_isNthOcurrenceOfWeekdayInMonth($daylightDate, $_offsets['daylightDay']) && - $this->_isNthOcurrenceOfWeekdayInMonth($standardDate, $_offsets['standardDay']); + return $this->_isNthOcurrenceOfWeekdayInMonth($daylightDate, $_offsets['daylightWeek']) && + $this->_isNthOcurrenceOfWeekdayInMonth($standardDate, $_offsets['standardWeek']); } } } @@ -389,10 +396,20 @@ */ protected function _unpackTimezoneInfo($_packedTimezoneInfo) { - $timezoneUnpackString = 'lbias/a64standardName/vstandardYear/vstandardMonth/vstandardDayOfWeek/vstandardDay/vstandardHour/vstandardMinute/vstandardSecond/vstandardMilliseconds/lstandardBias/a64daylightName/vdaylightYear/vdaylightMonth/vdaylightDayOfWeek/vdaylightDay/vdaylightHour/vdaylightMinute/vdaylightSecond/vdaylightMilliseconds/ldaylightBias'; + $timezoneUnpackString = 'lbias/a64standardName/vstandardYear/vstandardMonth/vstandardDayOfWeek/vstandardWeek/vstandardHour/vstandardMinute/vstandardSecond/vstandardMilliseconds/lstandardBias' + . '/a64daylightName/vdaylightYear/vdaylightMonth/vdaylightDayOfWeek/vdaylightWeek/vdaylightHour/vdaylightMinute/vdaylightSecond/vdaylightMilliseconds/ldaylightBias'; $timezoneInfo = unpack($timezoneUnpackString, base64_decode($_packedTimezoneInfo)); + if ($timezoneInfo['standardHour'] == 23 && $timezoneInfo['standardMilliseconds'] == 999 + && $timezoneInfo['standardMinute'] == 59 && $timezoneInfo['standardSecond'] == 59 + ) { + $timezoneInfo['standardHour'] = 24; + $timezoneInfo['standardMinute'] = 0; + $timezoneInfo['standardSecond'] = 0; + $timezoneInfo['standardMilliseconds'] = 0; + } + return $timezoneInfo; } @@ -408,6 +425,16 @@ return null; } + // According to e.g. https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-systemtime, + // 24 is not allowed in the Hour field, and consequently Outlook can't deal with it. + // This is the same workaround that Outlook applies. + if ($_timezoneInfo['standardHour'] == 24) { + $_timezoneInfo['standardHour'] = 23; + $_timezoneInfo['standardMinute'] = 59; + $_timezoneInfo['standardSecond'] = 59; + $_timezoneInfo['standardMilliseconds'] = 999; + } + $packed = pack( "la64vvvvvvvvla64vvvvvvvvl", $_timezoneInfo['bias'], @@ -415,7 +442,7 @@ $_timezoneInfo['standardYear'], $_timezoneInfo['standardMonth'], $_timezoneInfo['standardDayOfWeek'], - $_timezoneInfo['standardDay'], + $_timezoneInfo['standardWeek'], $_timezoneInfo['standardHour'], $_timezoneInfo['standardMinute'], $_timezoneInfo['standardSecond'], @@ -425,7 +452,7 @@ $_timezoneInfo['daylightYear'], $_timezoneInfo['daylightMonth'], $_timezoneInfo['daylightDayOfWeek'], - $_timezoneInfo['daylightDay'], + $_timezoneInfo['daylightWeek'], $_timezoneInfo['daylightHour'], $_timezoneInfo['daylightMinute'], $_timezoneInfo['daylightSecond'], @@ -452,7 +479,7 @@ 'standardYear' => 0, 'standardMonth' => 0, 'standardDayOfWeek' => 0, - 'standardDay' => 0, + 'standardWeek' => 0, 'standardHour' => 0, 'standardMinute' => 0, 'standardSecond' => 0, @@ -462,7 +489,7 @@ 'daylightYear' => 0, 'daylightMonth' => 0, 'daylightDayOfWeek' => 0, - 'daylightDay' => 0, + 'daylightWeek' => 0, 'daylightHour' => 0, 'daylightMinute' => 0, 'daylightSecond' => 0, @@ -481,8 +508,8 @@ protected function _validateOffsets($value) { // validate $value - if ((!empty($value['standardMonth']) || !empty($value['standardDay']) || !empty($value['daylightMonth']) || !empty($value['daylightDay'])) && - (empty($value['standardMonth']) || empty($value['standardDay']) || empty($value['daylightMonth']) || empty($value['daylightDay'])) + if ((!empty($value['standardMonth']) || !empty($value['standardWeek']) || !empty($value['daylightMonth']) || !empty($value['daylightWeek'])) && + (empty($value['standardMonth']) || empty($value['standardWeek']) || empty($value['daylightMonth']) || empty($value['daylightWeek'])) ) { // It is not possible not set standard offsets without setting daylight offsets and vice versa return false; @@ -617,7 +644,7 @@ protected function _loadFromCache($key) { - if ($cache = $this->getCache) { + if ($cache = $this->getCache()) { return $cache->get($key); } @@ -626,7 +653,7 @@ protected function _saveInCache($value, $key) { - if ($cache = $this->getCache) { + if ($cache = $this->getCache()) { $cache->set($key, $value); } }
View file
kolab-syncroton-2.3.19.tar.gz/tests/body_converter.php -> kolab-syncroton-2.3.20.tar.gz/tests/body_converter.php
Changed
@@ -1,6 +1,6 @@ <?php -class body_converter extends PHPUnit_Framework_TestCase +class body_converter extends PHPUnit\Framework\TestCase { function setUp() {
View file
kolab-syncroton-2.3.19.tar.gz/tests/data.php -> kolab-syncroton-2.3.20.tar.gz/tests/data.php
Changed
@@ -1,6 +1,6 @@ <?php -class data extends PHPUnit_Framework_TestCase +class data extends PHPUnit\Framework\TestCase { /** * Test for kolab_sync_data::recurrence_to_kolab()
View file
kolab-syncroton-2.3.19.tar.gz/tests/data_calendar.php -> kolab-syncroton-2.3.20.tar.gz/tests/data_calendar.php
Changed
@@ -1,6 +1,6 @@ <?php -class data_calendar extends PHPUnit_Framework_TestCase +class data_calendar extends PHPUnit\Framework\TestCase { /** * Test for kolab_sync_data_calendar::from_kolab_alarm()
View file
kolab-syncroton-2.3.19.tar.gz/tests/data_tasks.php -> kolab-syncroton-2.3.20.tar.gz/tests/data_tasks.php
Changed
@@ -1,6 +1,6 @@ <?php -class data_tasks extends PHPUnit_Framework_TestCase +class data_tasks extends PHPUnit\Framework\TestCase { function data_prio() {
View file
kolab-syncroton-2.3.19.tar.gz/tests/message.php -> kolab-syncroton-2.3.20.tar.gz/tests/message.php
Changed
@@ -1,6 +1,6 @@ <?php -class message extends PHPUnit_Framework_TestCase +class message extends PHPUnit\Framework\TestCase { function setUp() {
View file
kolab-syncroton-2.3.19.tar.gz/tests/timezone_converter.php -> kolab-syncroton-2.3.20.tar.gz/tests/timezone_converter.php
Changed
@@ -1,6 +1,6 @@ <?php -class timezone_converter extends PHPUnit_Framework_TestCase +class timezone_converter extends PHPUnit\Framework\TestCase { function setUp() { @@ -9,14 +9,13 @@ function test_list_timezones() { - date_default_timezone_set('America/Los_Angeles'); +// date_default_timezone_set('America/Los_Angeles'); $converter = timezone_converter_test::getInstance(); - - $input = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAEAAAAAAAAAxP///w=='; - $output = $converter->getListOfTimezones($input); + $output = $converter->getListOfTimezones('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAEAAAAAAAAAxP///w=='); $this->assertTrue(is_array($output)); + $this->assertSame(array(), $output); $converter = timezone_converter_test::getInstance(); $output = $converter->getListOfTimezones('xP///0MAZQBuAHQAcgBhAGwAIABFAHUAcgBvAHAAZQAgAFMAdABhAG4AZABhAHIAZAAgAFQAaQBtAGUAAAAAAAAAAAAAAAoAAAAFAAMAAAAAAAAAAAAAAEMAZQBuAHQAcgBhAGwAIABFAHUAcgBvAHAAZQAgAEQAYQB5AGwAaQBnAGgAdAAgAFQAaQBtAGUAAAAAAAAAAAAAAAMAAAAFAAIAAAAAAAAAxP///w=='); @@ -29,6 +28,12 @@ $this->assertTrue(is_array($output)); $this->assertTrue(isset($output['America/Los_Angeles'])); + + $converter = timezone_converter_test::getInstance(); + $output = $converter->getListOfTimezones('Lv///0kAcgBhAG4AIABTAHQAYQBuAGQAYQByAGQAIABUAGkAbQBlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAgADABcAOwA7AOcDAAAAAEkAcgBhAG4AIABEAGEAeQBsAGkAZwBoAHQAIABUAGkAbQBlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAQAEAAAAAAAAAAAAxP///w=='); + + $this->assertTrue(is_array($output)); + $this->assertTrue(isset($output['Asia/Tehran'])); } function test_get_timezone() @@ -73,11 +78,11 @@ $this->assertSame($output['standardBias'], 0); $this->assertSame($output['standardMonth'], 10); - $this->assertSame($output['standardDay'], 5); + $this->assertSame($output['standardWeek'], 5); $this->assertSame($output['standardHour'], 3); $this->assertSame($output['daylightBias'], -60); $this->assertSame($output['daylightMonth'], 3); - $this->assertSame($output['daylightDay'], 5); + $this->assertSame($output['daylightWeek'], 5); $this->assertSame($output['daylightHour'], 2); $output = $converter->getOffsetsForTimezone('America/Los_Angeles', $datetime); @@ -85,11 +90,11 @@ $this->assertSame($output['bias'], 480); $this->assertSame($output['standardBias'], 0); $this->assertSame($output['standardMonth'], 11); - $this->assertSame($output['standardDay'], 1); + $this->assertSame($output['standardWeek'], 1); $this->assertSame($output['standardHour'], 2); $this->assertSame($output['daylightBias'], -60); $this->assertSame($output['daylightMonth'], 3); - $this->assertSame($output['daylightDay'], 2); + $this->assertSame($output['daylightWeek'], 2); $this->assertSame($output['daylightHour'], 2); $output = $converter->getOffsetsForTimezone('Atlantic/Azores', $datetime); @@ -97,13 +102,53 @@ $this->assertSame($output['bias'], 60); $this->assertSame($output['standardBias'], 0); $this->assertSame($output['standardMonth'], 10); - $this->assertSame($output['standardDay'], 5); + $this->assertSame($output['standardWeek'], 5); $this->assertSame($output['standardHour'], 1); $this->assertSame($output['daylightBias'], -60); $this->assertSame($output['daylightMonth'], 3); - $this->assertSame($output['daylightDay'], 5); + $this->assertSame($output['daylightWeek'], 5); + $this->assertSame($output['daylightHour'], 0); + + $output = $converter->getOffsetsForTimezone('Asia/Tehran', $datetime); + + $this->assertSame($output['bias'], -210); + $this->assertSame($output['standardBias'], 0); + $this->assertSame($output['standardMonth'], 9); + $this->assertSame($output['standardWeek'], 3); + $this->assertSame($output['standardDayOfWeek'], 2); + $this->assertSame($output['standardHour'], 24); + $this->assertSame($output['daylightBias'], -60); + $this->assertSame($output['daylightMonth'], 3); + $this->assertSame($output['daylightWeek'], 4); + $this->assertSame($output['daylightDayOfWeek'], 1); $this->assertSame($output['daylightHour'], 0); } + + function data_timezone_conversion() + { + return array( + array('Asia/Tehran', 'Lv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAgADABcAOwA7AOcDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAQAEAAAAAAAAAAAAxP///w=='), + array('Pacific/Pago_Pago', 'lAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='), + array('Europe/Warsaw', 'xP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAFAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAIAAAAAAAAAxP///w=='), + ); + } + + /** + * @dataProvider data_timezone_conversion + */ + function test_timezone_conversion($tz, $expected) + { + $datetime = new DateTime('2021-07-01T12:00:00Z'); + $converter = timezone_converter_test::getInstance(); + $output = $converter->encodeTimezone($tz, $datetime); + + $this->assertSame($expected, $output); + + $output = $converter->getListOfTimezones($output); + + $this->assertTrue(is_array($output)); + $this->assertTrue(isset($output[$tz])); + } } class timezone_converter_test extends kolab_sync_timezone_converter
View file
kolab-syncroton.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-syncroton Binary: kolab-syncroton Architecture: all -Version: 2.3.19-0~kolab1 +Version: 2.3.20-0~kolab1 Maintainer: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Uploaders: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Homepage: http://www.kolab.org/ @@ -12,5 +12,5 @@ Package-List: kolab-syncroton deb utils extra Files: - 00000000000000000000000000000000 0 kolab-syncroton-2.3.19.tar.gz + 00000000000000000000000000000000 0 kolab-syncroton-2.3.20.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.