1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
From c562b654bef2bae0ac5b06fa7f1234e35d03e42c Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 13 Nov 2017 17:11:21 +0100
Subject: [PATCH] fix for BigEndian
---
lib/Horde/Mapi/Timezone.php | 5 ++---
test/Horde/Mapi/TimezoneTest.php | 6 +++---
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/Horde/Mapi/Timezone.php b/lib/Horde/Mapi/Timezone.php
index f63cbd1..6ab8a42 100644
--- a/lib/Horde/Mapi/Timezone.php
+++ b/lib/Horde/Mapi/Timezone.php
@@ -80,14 +80,13 @@ class Horde_Mapi_Timezone
. 'ldstbias';
}
$tz = unpack($format, base64_decode($data));
- $tz['timezone'] = $tz['bias'];
- $tz['timezonedst'] = $tz['dstbias'];
-
if (!Horde_Mapi::isLittleEndian()) {
$tz['bias'] = Horde_Mapi::chbo($tz['bias']);
$tz['stdbias'] = Horde_Mapi::chbo($tz['stdbias']);
$tz['dstbias'] = Horde_Mapi::chbo($tz['dstbias']);
}
+ $tz['timezone'] = $tz['bias'];
+ $tz['timezonedst'] = $tz['dstbias'];
return $tz;
}
diff --git a/test/Horde/Mapi/TimezoneTest.php b/test/Horde/Mapi/TimezoneTest.php
index 76794fe..52ef5a8 100644
--- a/test/Horde/Mapi/TimezoneTest.php
+++ b/test/Horde/Mapi/TimezoneTest.php
@@ -126,7 +126,7 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case
foreach ($this->_packed as $tz => $blob) {
$offsets = Horde_Mapi_Timezone::getOffsetsFromSyncTZ($blob);
foreach ($this->_offsets[$tz] as $key => $value) {
- $this->assertEquals($value, $offsets[$key]);
+ $this->assertEquals($value, $offsets[$key], "Comparing '$key' for '$tz'");
}
}
}
@@ -142,7 +142,7 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case
$date = new Horde_Date('2011-07-01', $tz);
$offsets = Horde_Mapi_Timezone::getOffsetsFromDate($date);
foreach ($offsets as $key => $value) {
- $this->assertEquals($expected[$key], $value);
+ $this->assertEquals($expected[$key], $value, "Comparing '$key' for '$tz'");
}
}
}
@@ -180,4 +180,4 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case
$this->assertEquals('Europe/Berlin', $guessed);
}
-}
\ No newline at end of file
+}
--
2.9.5
|