mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-10 10:40:50 +00:00
Compare commits
907
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e808a7687e | ||
|
|
e9ae4f0795 | ||
|
|
d3d42b9550 | ||
|
|
7d5dbaed76 | ||
|
|
e4238f4bf5 | ||
|
|
24f21a3012 | ||
|
|
38b68fc042 | ||
|
|
56e7903131 | ||
|
|
00ed55005a | ||
|
|
0d84097d44 | ||
|
|
08080c18f5 | ||
|
|
c60d4b9770 | ||
|
|
84fd8ffa2a | ||
|
|
a90ce6de31 | ||
|
|
8da5752311 | ||
|
|
4173a667fa | ||
|
|
e6b46dc2ff | ||
|
|
1c72e5b299 | ||
|
|
532912d8ab | ||
|
|
d6b78a3511 | ||
|
|
b9845e5006 | ||
|
|
a2b85ddecf | ||
|
|
ab17840d33 | ||
|
|
205e0ba81d | ||
|
|
cbc71995a8 | ||
|
|
7b195c9875 | ||
|
|
a1c887964e | ||
|
|
b42eb16cf4 | ||
|
|
c8d6673b59 | ||
|
|
66c1f966f0 | ||
|
|
fba3985f23 | ||
|
|
822400ef3b | ||
|
|
25439e939e | ||
|
|
be6fd4ba89 | ||
|
|
15876e85e5 | ||
|
|
e5abc53701 | ||
|
|
f8bf9bd86b | ||
|
|
391087ed28 | ||
|
|
f72c7edfa4 | ||
|
|
b22636c838 | ||
|
|
1a12403002 | ||
|
|
fd61666d96 | ||
|
|
089ca134fb | ||
|
|
a57b205383 | ||
|
|
f88a9a9643 | ||
|
|
3060dfd92e | ||
|
|
1c0622a472 | ||
|
|
51218b3b9d | ||
|
|
227c898cd9 | ||
|
|
a23a88b3e7 | ||
|
|
37ed0dafe4 | ||
|
|
e62db72111 | ||
|
|
06c6b51e7d | ||
|
|
6d51b7b2e3 | ||
|
|
2f7a8515ca | ||
|
|
83bfefeccb | ||
|
|
36311ee4fd | ||
|
|
0e069fa57d | ||
|
|
22af88274b | ||
|
|
afd31489d0 | ||
|
|
8292260515 | ||
|
|
efd2b3f5f2 | ||
|
|
ccc95bf9df | ||
|
|
d5f76caf6c | ||
|
|
395ef4efb7 | ||
|
|
f3838a9c35 | ||
|
|
0b35e0c5a1 | ||
|
|
73384728ca | ||
|
|
c76fd640e6 | ||
|
|
b94f67885c | ||
|
|
718445b096 | ||
|
|
39a2514643 | ||
|
|
9501293de7 | ||
|
|
7f33ab834d | ||
|
|
2b5af600e3 | ||
|
|
5c19355095 | ||
|
|
4c8f064d7d | ||
|
|
acb2368976 | ||
|
|
22cbf68344 | ||
|
|
d160e98feb | ||
|
|
d7d01fc9a3 | ||
|
|
e19423f3cb | ||
|
|
bbae7ddf29 | ||
|
|
505c9c3742 | ||
|
|
052dd3005b | ||
|
|
2fb8bb1157 | ||
|
|
6876112c89 | ||
|
|
4744eec753 | ||
|
|
925412ee1c | ||
|
|
c147d90dbf | ||
|
|
83bef0ef83 | ||
|
|
fe1933aae2 | ||
|
|
6f895a29c9 | ||
|
|
c08824fd72 | ||
|
|
c98ea8465b | ||
|
|
0fd71d1184 | ||
|
|
d7fb43e30d | ||
|
|
3f08fc0466 | ||
|
|
07a8e5ce37 | ||
|
|
0c10e10ee8 | ||
|
|
264f33a23f | ||
|
|
62ff2d0bfe | ||
|
|
932f707177 | ||
|
|
2e267bd3c7 | ||
|
|
1ddf72180a | ||
|
|
51b23cd0f0 | ||
|
|
f98ab19dc0 | ||
|
|
e78ac461db | ||
|
|
f39a4ee0c9 | ||
|
|
d698f0ae51 | ||
|
|
84452dba8e | ||
|
|
629e4da7cc | ||
|
|
59de2c037c | ||
|
|
85be6fe96b | ||
|
|
f451b023d1 | ||
|
|
257693614e | ||
|
|
ca89d9a797 | ||
|
|
f79cd18789 | ||
|
|
368d3ff0d9 | ||
|
|
8317e0fa46 | ||
|
|
c505d55158 | ||
|
|
96d1d13d87 | ||
|
|
e4f3fb976b | ||
|
|
fab5cbab1a | ||
|
|
dcd569aad6 | ||
|
|
11cddaf6f4 | ||
|
|
37d814b84c | ||
|
|
059dd18c37 | ||
|
|
43f6099ce4 | ||
|
|
a483a79c85 | ||
|
|
cc7140e8d9 | ||
|
|
71da4f1f7f | ||
|
|
c3fc65eb7c | ||
|
|
b89f128480 | ||
|
|
7b3616db77 | ||
|
|
debfc866d2 | ||
|
|
d47029167d | ||
|
|
aed225b7e4 | ||
|
|
fd94c92171 | ||
|
|
f9ece83994 | ||
|
|
43b26c7b21 | ||
|
|
dc1a8dd7f0 | ||
|
|
b2954c64ab | ||
|
|
b59ea797f5 | ||
|
|
c77f783777 | ||
|
|
4b1dff6f43 | ||
|
|
52b2a3ff25 | ||
|
|
3759de241f | ||
|
|
c65350cd4d | ||
|
|
bb98ed600a | ||
|
|
a12cef979d | ||
|
|
c07150cd1a | ||
|
|
ea807f9c07 | ||
|
|
51fca4b77d | ||
|
|
a6c063d663 | ||
|
|
3fe509443c | ||
|
|
43c2dfa7b3 | ||
|
|
4aeff30337 | ||
|
|
1922c650ba | ||
|
|
c19d59c550 | ||
|
|
45e7e79485 | ||
|
|
32fe02c27d | ||
|
|
31b634bf7c | ||
|
|
0fac73a3bf | ||
|
|
7ceb0e3a18 | ||
|
|
53d274beb0 | ||
|
|
33d3acaae7 | ||
|
|
48cfd1160b | ||
|
|
7c31203935 | ||
|
|
e2291e4b1a | ||
|
|
1390a5812b | ||
|
|
3605d1baf5 | ||
|
|
906f19f136 | ||
|
|
6935058a98 | ||
|
|
c8f07ad477 | ||
|
|
259057b2a4 | ||
|
|
f06a069c46 | ||
|
|
e8429400d4 | ||
|
|
e201f01ac1 | ||
|
|
9da99d8c5f | ||
|
|
ef1bd8f0e6 | ||
|
|
f9c2bf73ad | ||
|
|
ce2c67c8e8 | ||
|
|
9d816f1bcf | ||
|
|
03964892c0 | ||
|
|
64043cb9e5 | ||
|
|
fc8eff897b | ||
|
|
00eebd7a47 | ||
|
|
5d2294e8b8 | ||
|
|
ebdd9cf6e8 | ||
|
|
4ddc4af87c | ||
|
|
e872f4d9c1 | ||
|
|
a5864d9917 | ||
|
|
24dda816d0 | ||
|
|
c39336d1d8 | ||
|
|
e5adf2b427 | ||
|
|
fc203fa37e | ||
|
|
95a0b11d0a | ||
|
|
e93d7953df | ||
|
|
941bbf2067 | ||
|
|
df4bf28f9f | ||
|
|
d735957cb5 | ||
|
|
85d34c3264 | ||
|
|
78b2b1d6f7 | ||
|
|
b460b530d6 | ||
|
|
24e78ec1d8 | ||
|
|
5786f86656 | ||
|
|
272cccd175 | ||
|
|
2b9c7f881a | ||
|
|
aa23bc6d1d | ||
|
|
9e69ef4ce2 | ||
|
|
e8f37fe3dc | ||
|
|
c7c9858ba1 | ||
|
|
6c99cb2929 | ||
|
|
484b92919b | ||
|
|
b584b51398 | ||
|
|
c12aa3c7ce | ||
|
|
54bd91175d | ||
|
|
40befb943c | ||
|
|
3ed58fb5d7 | ||
|
|
bb057498f7 | ||
|
|
1744be2d17 | ||
|
|
b010a9d846 | ||
|
|
b0c5439b5f | ||
|
|
71daca28d4 | ||
|
|
0d7159d26d | ||
|
|
a4e0539188 | ||
|
|
23d0b93893 | ||
|
|
9c805a6cb3 | ||
|
|
0e51f9798c | ||
|
|
e66bf11638 | ||
|
|
cd18ba117c | ||
|
|
b9f23c2152 | ||
|
|
f94bcb1026 | ||
|
|
890204fa45 | ||
|
|
a1c06f10dd | ||
|
|
c173fef363 | ||
|
|
797e30f4fc | ||
|
|
87db2e4a91 | ||
|
|
8708fe7835 | ||
|
|
80bc2133cd | ||
|
|
79cd9a18b5 | ||
|
|
42ef2b500b | ||
|
|
48c71cd94b | ||
|
|
8bac087a79 | ||
|
|
eaf5beabf4 | ||
|
|
c1127c4de3 | ||
|
|
9ff3334397 | ||
|
|
dc72378ff0 | ||
|
|
36cbb7cc4c | ||
|
|
72976e2497 | ||
|
|
1b4a80332c | ||
|
|
1797a716ed | ||
|
|
362bbaa2dc | ||
|
|
15e9f4baf4 | ||
|
|
b221df5549 | ||
|
|
54187fa4b9 | ||
|
|
2425f88afd | ||
|
|
da5321013c | ||
|
|
eb7ba73079 | ||
|
|
568a35f84f | ||
|
|
f2f8ea9ac5 | ||
|
|
f1acac154a | ||
|
|
ed709d5aa0 | ||
|
|
d52c485717 | ||
|
|
742c54aecf | ||
|
|
0a21b5d970 | ||
|
|
ee61c7175f | ||
|
|
69ed3969dd | ||
|
|
51f9a00b47 | ||
|
|
dda81f0505 | ||
|
|
0e09009753 | ||
|
|
4d2278143a | ||
|
|
863bf294fe | ||
|
|
7381b6accc | ||
|
|
c7d3c027d5 | ||
|
|
c2e197e4ef | ||
|
|
7fc04937f5 | ||
|
|
8d31e463a0 | ||
|
|
12f099e7bc | ||
|
|
6576d809a5 | ||
|
|
cdabbd9542 | ||
|
|
d7f354fa57 | ||
|
|
66edc15875 | ||
|
|
8f1baa6e1c | ||
|
|
9fdb8c2ccd | ||
|
|
54bf6352fe | ||
|
|
ce5c4500cd | ||
|
|
1647ee7ef0 | ||
|
|
20e765b841 | ||
|
|
16023f3e3b | ||
|
|
7a4584d3f6 | ||
|
|
b7fa67742c | ||
|
|
e488690d95 | ||
|
|
c96d08b272 | ||
|
|
e4153e9144 | ||
|
|
daa0abaf77 | ||
|
|
5be8872f44 | ||
|
|
e42a29bf81 | ||
|
|
05ccc1f2d4 | ||
|
|
1a7db40a1f | ||
|
|
35e717e12e | ||
|
|
87829c09a1 | ||
|
|
91f985b2f9 | ||
|
|
3d38db3576 | ||
|
|
6aa44ac73a | ||
|
|
8560138274 | ||
|
|
3eee495570 | ||
|
|
f18ba0f9c9 | ||
|
|
e3a85074ed | ||
|
|
f1228ebc61 | ||
|
|
8461a87454 | ||
|
|
e7f2356665 | ||
|
|
2ec8611293 | ||
|
|
72b73e24a0 | ||
|
|
90de2aeaac | ||
|
|
4b2d025937 | ||
|
|
a31fe58d80 | ||
|
|
d3958b32ca | ||
|
|
9e08c990ac | ||
|
|
96e42403d5 | ||
|
|
abc3598f47 | ||
|
|
8c483ce36c | ||
|
|
a66efb0b15 | ||
|
|
37e03f6b32 | ||
|
|
f57cb13c56 | ||
|
|
72554891e3 | ||
|
|
140e80acc0 | ||
|
|
2e34febb73 | ||
|
|
72c2fc44e0 | ||
|
|
1a4722a89e | ||
|
|
25e5c8ac31 | ||
|
|
fa53d8463f | ||
|
|
2939bce9f3 | ||
|
|
094decc3c0 | ||
|
|
591fd4cdc3 | ||
|
|
891ff131ef | ||
|
|
c0ac51dc07 | ||
|
|
ba7c3a1bb4 | ||
|
|
a8dbe655e5 | ||
|
|
bac1fe7438 | ||
|
|
c40f40656e | ||
|
|
6ac4c57f72 | ||
|
|
450fbdc740 | ||
|
|
49c0c1299a | ||
|
|
a7dc1274f0 | ||
|
|
ec25f69c5d | ||
|
|
ab66152c68 | ||
|
|
b1a9b89773 | ||
|
|
34b624f122 | ||
|
|
c75d245e82 | ||
|
|
94957a7091 | ||
|
|
ca30d5bf39 | ||
|
|
496f291f3d | ||
|
|
e68b5252a2 | ||
|
|
6c884e8e84 | ||
|
|
b4b082e63e | ||
|
|
545eddba93 | ||
|
|
c0142de470 | ||
|
|
885edfef0a | ||
|
|
c8157619ef | ||
|
|
97aa752fee | ||
|
|
6dedeb40db | ||
|
|
bf58162ddf | ||
|
|
4c34d57414 | ||
|
|
bdb9c0da86 | ||
|
|
b6f5cb11a4 | ||
|
|
29533ae528 | ||
|
|
26471eb69c | ||
|
|
e41f600365 | ||
|
|
c22da81b71 | ||
|
|
ed84af4b88 | ||
|
|
eda31f57fb | ||
|
|
09de64a58d | ||
|
|
61b0b80388 | ||
|
|
485b7c6981 | ||
|
|
c938d2f537 | ||
|
|
303d97feda | ||
|
|
0d2f147d80 | ||
|
|
022068342b | ||
|
|
42f7e4c044 | ||
|
|
b27bcd90b3 | ||
|
|
04ca04f830 | ||
|
|
3e88d610e5 | ||
|
|
452d30cf7d | ||
|
|
b281211979 | ||
|
|
344ff5dd4c | ||
|
|
d870683d6b | ||
|
|
48d71af7ed | ||
|
|
616661e0f8 | ||
|
|
16db4d1462 | ||
|
|
57525d01dc | ||
|
|
1b1a86c415 | ||
|
|
d2bc45f6b3 | ||
|
|
a8d61ab7f0 | ||
|
|
7acdfdc84e | ||
|
|
ee1e67fae6 | ||
|
|
2e85e6d3ee | ||
|
|
d7daf814b7 | ||
|
|
736d840c8b | ||
|
|
8f2e08239f | ||
|
|
cd9c39d77c | ||
|
|
7e97faa3e8 | ||
|
|
bbe28d3a55 | ||
|
|
b811bb3920 | ||
|
|
0730fc8830 | ||
|
|
1920ba6f7b | ||
|
|
6400ef192c | ||
|
|
bdf3bb668f | ||
|
|
af17316fcd | ||
|
|
2ff3dafccf | ||
|
|
b1ec4515b0 | ||
|
|
80f9a9725c | ||
|
|
7bb52dda6a | ||
|
|
1efe5b1157 | ||
|
|
ca82114f21 | ||
|
|
8e440dc1d7 | ||
|
|
c201b63873 | ||
|
|
cd068b1ed6 | ||
|
|
e181931f77 | ||
|
|
905c5f4858 | ||
|
|
b03f743e7d | ||
|
|
8da8dc04b6 | ||
|
|
921544cad9 | ||
|
|
a621781fdb | ||
|
|
13347225ac | ||
|
|
e1561c490e | ||
|
|
1cbcbcbc21 | ||
|
|
23e25f3319 | ||
|
|
868b9328a0 | ||
|
|
b883fe1547 | ||
|
|
eef6b10b7c | ||
|
|
5250fc772d | ||
|
|
7953ff4ea3 | ||
|
|
bc47f10a97 | ||
|
|
3e1aabbfc3 | ||
|
|
9bcdd2aabe | ||
|
|
ea49be9b37 | ||
|
|
75b2ce28aa | ||
|
|
a39beaa251 | ||
|
|
9e15ce9a38 | ||
|
|
b0954ebb79 | ||
|
|
3a169f6c0d | ||
|
|
8877feaeec | ||
|
|
fdb580a5ad | ||
|
|
e09d3155a1 | ||
|
|
5fe078abba | ||
|
|
d263ecd864 | ||
|
|
dacea3f6fb | ||
|
|
bca005c8d9 | ||
|
|
6a8db93115 | ||
|
|
962fe01473 | ||
|
|
657f93e7b9 | ||
|
|
c0119ca7f3 | ||
|
|
a85156db7d | ||
|
|
1edb2e9a10 | ||
|
|
3930e1f2fa | ||
|
|
ca33ae3eb2 | ||
|
|
cc7194dd10 | ||
|
|
811816dc25 | ||
|
|
0f49c205f4 | ||
|
|
991b2cc37b | ||
|
|
189af22cf0 | ||
|
|
5f67caad54 | ||
|
|
c4dd65c723 | ||
|
|
d241711f44 | ||
|
|
eb702637a9 | ||
|
|
e7af0fe1eb | ||
|
|
8836404faf | ||
|
|
e4917bc747 | ||
|
|
7958a7b38f | ||
|
|
61d58f2d9e | ||
|
|
7469c7e7d0 | ||
|
|
c661e7680f | ||
|
|
76c3117af5 | ||
|
|
558342124e | ||
|
|
22a43410cb | ||
|
|
dab34e2433 | ||
|
|
9026a66579 | ||
|
|
4903f1d139 | ||
|
|
3f93e4485e | ||
|
|
1d6f4891bd | ||
|
|
b564aa95be | ||
|
|
9e4d720825 | ||
|
|
7f4e1a0eef | ||
|
|
3bb1a4ffe3 | ||
|
|
b60efdce9f | ||
|
|
afa4c3e7c7 | ||
|
|
7c0b8f872e | ||
|
|
8de667b8d2 | ||
|
|
d8223c4424 | ||
|
|
44b09b80f2 | ||
|
|
1acf55eb75 | ||
|
|
3f471c1c69 | ||
|
|
8405265578 | ||
|
|
702e349df4 | ||
|
|
a037b6de21 | ||
|
|
d777669679 | ||
|
|
dcfd1153ec | ||
|
|
b19790ab34 | ||
|
|
e711325ca6 | ||
|
|
9d162550ac | ||
|
|
cd927cca50 | ||
|
|
f4d820f2ee | ||
|
|
72b8a30c1a | ||
|
|
2b0a19f4ed | ||
|
|
effbc87ff1 | ||
|
|
9d5ab7e22f | ||
|
|
9ba3a4c66a | ||
|
|
b1f3403c98 | ||
|
|
f14141aca2 | ||
|
|
2c55ae5261 | ||
|
|
64df05d5b1 | ||
|
|
60e181c20a | ||
|
|
0c8136654d | ||
|
|
82e5260104 | ||
|
|
741b949a6f | ||
|
|
f4707ed256 | ||
|
|
ca467d5117 | ||
|
|
aef5a02ebb | ||
|
|
36222eb4cc | ||
|
|
2ba9681e8e | ||
|
|
616b932ab0 | ||
|
|
b5d5baa882 | ||
|
|
0d7f22c157 | ||
|
|
2b8ba3e9f8 | ||
|
|
60a2742fd2 | ||
|
|
c2d4704744 | ||
|
|
f1ffb4b1ad | ||
|
|
c095af584c | ||
|
|
e10af61862 | ||
|
|
9d168b863e | ||
|
|
1346c3df42 | ||
|
|
6b53b7cd84 | ||
|
|
eee8b6c33f | ||
|
|
539738c438 | ||
|
|
8b1919ed73 | ||
|
|
4e2fb47092 | ||
|
|
8036758491 | ||
|
|
f7d7befae8 | ||
|
|
8574290d9b | ||
|
|
72d0796d66 | ||
|
|
632c5d6250 | ||
|
|
0bfb454acb | ||
|
|
5f7c1917e3 | ||
|
|
531c306fe6 | ||
|
|
5eecc6bcde | ||
|
|
b347f2c47a | ||
|
|
eb15ec385e | ||
|
|
6bb24823d0 | ||
|
|
b861a4a4d2 | ||
|
|
78d1228ef6 | ||
|
|
79528c5e24 | ||
|
|
f5bf7b6b27 | ||
|
|
eb7c33b204 | ||
|
|
b5d1530e4f | ||
|
|
33a9f01d36 | ||
|
|
7ced40e24e | ||
|
|
4cc46b2a99 | ||
|
|
90a8ea9827 | ||
|
|
18b3508c3c | ||
|
|
17f2d1e8a7 | ||
|
|
4482c03622 | ||
|
|
3c02e6f457 | ||
|
|
b754e3ec4b | ||
|
|
b470d9a0d6 | ||
|
|
9fde041a7d | ||
|
|
fb49ffe62e | ||
|
|
75c2aa9d3a | ||
|
|
5f80da29ee | ||
|
|
93b7ba4c9f | ||
|
|
9a0bdd9069 | ||
|
|
e96c64ed5e | ||
|
|
1cbd25ca15 | ||
|
|
f863d89b5c | ||
|
|
9031a902e3 | ||
|
|
4758505b27 | ||
|
|
8746163153 | ||
|
|
0765623d69 | ||
|
|
34bcd69f82 | ||
|
|
f029a2856b | ||
|
|
6f1c006b6d | ||
|
|
b24fedbd24 | ||
|
|
e44b040faf | ||
|
|
021effbe97 | ||
|
|
1e9522021a | ||
|
|
31d59bf915 | ||
|
|
50d4ea90b3 | ||
|
|
7e731e4d9d | ||
|
|
05351f9ccb | ||
|
|
60c925fd41 | ||
|
|
930fb8b1f3 | ||
|
|
f38ca75a3c | ||
|
|
ff30d0319a | ||
|
|
8e02be16d7 | ||
|
|
5683b6fa39 | ||
|
|
e7d0ca39e5 | ||
|
|
c4e9651b58 | ||
|
|
424005a301 | ||
|
|
de696d851f | ||
|
|
7611d1c41b | ||
|
|
09b92a3a54 | ||
|
|
482c69bf63 | ||
|
|
00d8e26d71 | ||
|
|
4d8ae36695 | ||
|
|
1f077cc4f4 | ||
|
|
76a290d0be | ||
|
|
c630779648 | ||
|
|
565de1ae64 | ||
|
|
4cab20bbb4 | ||
|
|
e807e07bfa | ||
|
|
4e002b4412 | ||
|
|
f3cec08e65 | ||
|
|
0bc3a74334 | ||
|
|
d9c266f4c9 | ||
|
|
2e2cbcc926 | ||
|
|
827d2c1415 | ||
|
|
f736934af0 | ||
|
|
7ecab5d23f | ||
|
|
c9ac441fe8 | ||
|
|
68e368ed34 | ||
|
|
17d5ebe76e | ||
|
|
a7de68f98a | ||
|
|
c3d983f3af | ||
|
|
4fe938b0a9 | ||
|
|
e85653051a | ||
|
|
fc94fb3e5b | ||
|
|
c507c533bd | ||
|
|
96629091a6 | ||
|
|
6895ae4553 | ||
|
|
8c6e8e7870 | ||
|
|
90aee01c85 | ||
|
|
ad4d022bdf | ||
|
|
75286ece1a | ||
|
|
88aab478bf | ||
|
|
59a78d48f0 | ||
|
|
3be4e5d71a | ||
|
|
593c4b9b00 | ||
|
|
3ee3066bd0 | ||
|
|
f93d24aa67 | ||
|
|
f228bc5230 | ||
|
|
716fe10d97 | ||
|
|
6da4feac35 | ||
|
|
e41a2009d6 | ||
|
|
4bda39b81d | ||
|
|
2cc4e69cc6 | ||
|
|
4c5efc7456 | ||
|
|
58e5e006e5 | ||
|
|
e09a0b74d9 | ||
|
|
8fc4c9444f | ||
|
|
7c5de1e99e | ||
|
|
dcd230de11 | ||
|
|
c09fad97d6 | ||
|
|
f7952b90ca | ||
|
|
c02c4aca00 | ||
|
|
1b12982d39 | ||
|
|
43c24da166 | ||
|
|
4ceb7b46ad | ||
|
|
587ddf6ddc | ||
|
|
c08f9c2c78 | ||
|
|
f473ea5464 | ||
|
|
2f83797a0c | ||
|
|
adbb301a70 | ||
|
|
2ddb560c2e | ||
|
|
c117548ea9 | ||
|
|
e1cb22a23e | ||
|
|
9c0813fd48 | ||
|
|
634aa0a2db | ||
|
|
ba1d9cc4b7 | ||
|
|
e2bbf0a2df | ||
|
|
c591f022f8 | ||
|
|
be9b2a95ad | ||
|
|
4605d536d2 | ||
|
|
33594b78ec | ||
|
|
473ec539a1 | ||
|
|
329513c3a7 | ||
|
|
8026001943 | ||
|
|
ac3ca0280a | ||
|
|
33e2aa452d | ||
|
|
741382d968 | ||
|
|
ba1c78c410 | ||
|
|
24992a1422 | ||
|
|
cf3e976c3b | ||
|
|
c4f8dd9071 | ||
|
|
7289981c61 | ||
|
|
7af9ba23a7 | ||
|
|
e49a0e17b7 | ||
|
|
fff921d7a3 | ||
|
|
9708378d13 | ||
|
|
56fdae9018 | ||
|
|
c27f012b7a | ||
|
|
ac28329354 | ||
|
|
428d0983cd | ||
|
|
ce6db558f9 | ||
|
|
95fa727992 | ||
|
|
9c7496e0dd | ||
|
|
d004c1d5ff | ||
|
|
775d0707ca | ||
|
|
ce9b6e5ee8 | ||
|
|
6a5798d990 | ||
|
|
7d6d8a3369 | ||
|
|
df49ce3d5a | ||
|
|
a1fef89abe | ||
|
|
912e42fc23 | ||
|
|
43c69443bb | ||
|
|
cdd2b8a79f | ||
|
|
c4739897e7 | ||
|
|
4af9ca544e | ||
|
|
3cd3881574 | ||
|
|
5cfb81d5b0 | ||
|
|
b78f8220e7 | ||
|
|
1c7a902d8a | ||
|
|
f505d11207 | ||
|
|
7ccafe40c2 | ||
|
|
768bbedf82 | ||
|
|
9c5c3ff022 | ||
|
|
e645837ba1 | ||
|
|
4cabbf9781 | ||
|
|
4131f6bf39 | ||
|
|
97fcbf041a | ||
|
|
c1e84a3bde | ||
|
|
194e64982e | ||
|
|
ba41b340c2 | ||
|
|
c39e777722 | ||
|
|
df490dcf0c | ||
|
|
b5e5098c50 | ||
|
|
19ad1389aa | ||
|
|
13c32a102c | ||
|
|
23917b451b | ||
|
|
1e18ffd2f8 | ||
|
|
957aa220aa | ||
|
|
ad9aaf8093 | ||
|
|
73a07522ef | ||
|
|
53c49994f2 | ||
|
|
02ff308e27 | ||
|
|
4c711200b4 | ||
|
|
4fd3c8aebb | ||
|
|
b35c02e2df | ||
|
|
bfa7e11c9c | ||
|
|
e48305cdb5 | ||
|
|
59f6d7cd4f | ||
|
|
9db4e25927 | ||
|
|
29c449ce98 | ||
|
|
a508693874 | ||
|
|
ceb992501b | ||
|
|
9d9ba493a2 | ||
|
|
c667c26f61 | ||
|
|
160bf9c072 | ||
|
|
0ec5477fbd | ||
|
|
35baf71466 | ||
|
|
a0accfa59f | ||
|
|
d66cb721d4 | ||
|
|
1302eb7f72 | ||
|
|
3bbfb96e1a | ||
|
|
3c81e945a3 | ||
|
|
984f4b09e0 | ||
|
|
cd93b120c3 | ||
|
|
ffb788800f | ||
|
|
b5b8cd5074 | ||
|
|
983f155e1c | ||
|
|
042fa25896 | ||
|
|
e09febb286 | ||
|
|
db1596c8b1 | ||
|
|
342acbe1c6 | ||
|
|
25e45a9350 | ||
|
|
7e049b0427 | ||
|
|
8e167a2a00 | ||
|
|
60830f49c0 | ||
|
|
4ddb92be45 | ||
|
|
ef5f4ef81f | ||
|
|
b75e30c667 | ||
|
|
272805c898 | ||
|
|
ad5723acf2 | ||
|
|
a07f3ed2a6 | ||
|
|
7abb318beb | ||
|
|
60b3526bfb | ||
|
|
d3d5e3db2c | ||
|
|
8827a56cb4 | ||
|
|
e53947609a | ||
|
|
8947c7aa0d | ||
|
|
0d562a8f44 | ||
|
|
caf4beab2d | ||
|
|
82ec0d5fc5 | ||
|
|
be504995c3 | ||
|
|
9d7b5e30eb | ||
|
|
df33731812 | ||
|
|
cee9722028 | ||
|
|
b9940ab1bd | ||
|
|
81f356b4ae | ||
|
|
601d60a978 | ||
|
|
ed7e6d4758 | ||
|
|
95650d0942 | ||
|
|
e8fb5201ba | ||
|
|
dc024f0bdc | ||
|
|
bc63491da8 | ||
|
|
3803bbde24 | ||
|
|
e1821090ef | ||
|
|
dfffa0ba5b | ||
|
|
5fc635548e | ||
|
|
4b27569dc3 | ||
|
|
d887ef5a04 | ||
|
|
8f384473b4 | ||
|
|
043f8ac51e | ||
|
|
5776fceb16 | ||
|
|
4782ceea80 | ||
|
|
9af582bbe0 | ||
|
|
7b3cce0ba0 | ||
|
|
e21f87e957 | ||
|
|
100614da27 | ||
|
|
e10272c628 | ||
|
|
d3aeb8a204 | ||
|
|
ae46d1ce19 | ||
|
|
d734e75599 | ||
|
|
aa2eca2e48 | ||
|
|
f59b67ae50 | ||
|
|
be34c82bfd | ||
|
|
ff70b40dc9 | ||
|
|
dc0f2a5bad | ||
|
|
c61ceef779 | ||
|
|
ba15e8dfd0 | ||
|
|
45facd15fb | ||
|
|
a643ccfb90 | ||
|
|
9bed19a1e0 | ||
|
|
ed7d4977bb | ||
|
|
9bbd995679 | ||
|
|
d82d68742c | ||
|
|
1defbb25ed | ||
|
|
dd50ec1538 | ||
|
|
0cb9d75cb6 | ||
|
|
12d3bdee3d | ||
|
|
a894a8155f | ||
|
|
4435b9142f | ||
|
|
9faaee66fa | ||
|
|
0ea75af9be | ||
|
|
809610f5ea | ||
|
|
f938112c49 | ||
|
|
920a0afbf8 | ||
|
|
8ebc443120 | ||
|
|
fa0608077b | ||
|
|
429f411eb3 | ||
|
|
1f5f78d4aa | ||
|
|
741c5e4c0c | ||
|
|
174b9ee634 | ||
|
|
f5c8a79fa5 | ||
|
|
923102230b | ||
|
|
ec0b888a82 | ||
|
|
1955403ed5 | ||
|
|
7e9a1c1e3f | ||
|
|
cc70a46525 | ||
|
|
d819b45597 | ||
|
|
160dbe91a9 | ||
|
|
812106d0c6 | ||
|
|
21bb33cc72 | ||
|
|
6a7a03644a | ||
|
|
890195f85c | ||
|
|
9a404df382 | ||
|
|
2a81733c87 | ||
|
|
66b853d426 | ||
|
|
5ae20c6247 | ||
|
|
c167029eb6 | ||
|
|
96f5be53f6 | ||
|
|
bd31cb7563 | ||
|
|
afbf725e73 | ||
|
|
e78552f3aa | ||
|
|
829ea23d34 | ||
|
|
d19842f613 | ||
|
|
cb0d325066 | ||
|
|
af1cd45d17 | ||
|
|
80e2632776 | ||
|
|
c585b4845c | ||
|
|
b1997278fd | ||
|
|
8751e0fe71 | ||
|
|
7eda18514d | ||
|
|
0ae0d0bc53 | ||
|
|
d27d9158c9 | ||
|
|
5c2aa71e0c | ||
|
|
a5bb37117c | ||
|
|
baf5fdf598 | ||
|
|
f29c98c128 | ||
|
|
caecd88237 | ||
|
|
97123042a2 | ||
|
|
3645a80b38 | ||
|
|
9806a37a79 | ||
|
|
9991b8ecee | ||
|
|
e70e2d8310 | ||
|
|
7c1a1189be | ||
|
|
faab430141 | ||
|
|
0a41af216e | ||
|
|
2d9399af35 | ||
|
|
978128b446 | ||
|
|
9ec3e7d98c | ||
|
|
9433b33ac1 | ||
|
|
2533fde199 | ||
|
|
86f983bd3e | ||
|
|
3409d87eab | ||
|
|
2fd74c7f03 | ||
|
|
87cc7caa10 | ||
|
|
59c2a55ec7 | ||
|
|
8de838dc26 | ||
|
|
b56f8022c8 | ||
|
|
30123005ff | ||
|
|
8e3e034469 | ||
|
|
75f40ae1f3 | ||
|
|
fe0ca2745f | ||
|
|
ef2db26c60 | ||
|
|
7e43b4f908 | ||
|
|
aee6344e24 |
No files matched your search
@@ -20,6 +20,9 @@
|
||||
*.tar.gz
|
||||
*.tar.bz2
|
||||
*.tar.xz
|
||||
*.tar.gz.asc
|
||||
*.tar.bz2.asc
|
||||
*.tar.xz.asc
|
||||
.FBCIndex
|
||||
.FBCLockFolder
|
||||
.deps
|
||||
|
||||
+22
-7
@@ -1,8 +1,30 @@
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- locales
|
||||
- language-pack-de
|
||||
- re2c
|
||||
- libgmp-dev
|
||||
- libicu-dev
|
||||
- libmcrypt-dev
|
||||
- libtidy-dev
|
||||
- libenchant-dev
|
||||
- libaspell-dev
|
||||
- libpspell-dev
|
||||
- librecode-dev
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_failure: change
|
||||
irc:
|
||||
template:
|
||||
- "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} - Change view : %{compare_url} - Build details : %{build_url}"
|
||||
channels:
|
||||
- "irc.efnet.org#php.pecl"
|
||||
on_success: change
|
||||
on_failure: always
|
||||
|
||||
cache:
|
||||
- apt
|
||||
@@ -20,13 +42,6 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev
|
||||
- sudo cp ./travis/de /var/lib/locales/supported.d/de
|
||||
- sudo dpkg-reconfigure locales
|
||||
- ./travis/install.sh
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ php_lcov.info: lcov-test
|
||||
cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
fi; \
|
||||
done; \
|
||||
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
if test -d lcov_data/$$dir; then \
|
||||
rm -rf lcov_data/$$dir ; \
|
||||
fi; \
|
||||
|
||||
@@ -1,5 +1,457 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
07 Jan 2016, PHP 5.6.17
|
||||
|
||||
- Core:
|
||||
. Fixed bug #66909 (configure fails utf8_to_mutf7 test). (Michael Orlitzky)
|
||||
. Fixed bug #70958 (Invalid opcode while using ::class as trait method
|
||||
paramater default value). (Laruence)
|
||||
. Fixed bug #70957 (self::class can not be resolved with reflection for
|
||||
abstract class). (Laruence)
|
||||
. Fixed bug #70944 (try{ } finally{} can create infinite chains of
|
||||
exceptions). (Laruence)
|
||||
. Fixed bug #61751 (SAPI build problem on AIX: Undefined symbol:
|
||||
php_register_internal_extensions). (Lior Kaplan)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #70755 (fpm_log.c memory leak and buffer overflow). (Stas)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #70976 (Memory Read via gdImageRotateInterpolated Array Index
|
||||
Out of Bounds). (emmanuel dot law at gmail dot com).
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction).
|
||||
(Laruence)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #70900 (SoapClient systematic out of memory error). (Dmitry)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #70960 (ReflectionFunction for array_unique returns wrong number
|
||||
of parameters). (Laruence)
|
||||
|
||||
- PDO_Firebird:
|
||||
. Fixed bug #60052 (Integer returned as a 64bit integer on X64_86). (Mariuz)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #70661 (Use After Free Vulnerability in WDDX Packet Deserialization).
|
||||
(taoguangchen at icloud dot com)
|
||||
. Fixed bug #70741 (Session WDDX Packet Deserialization Type Confusion
|
||||
Vulnerability). (taoguangchen at icloud dot com)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #70728 (Type Confusion Vulnerability in PHP_to_XMLRPC_worker()).
|
||||
(Julien)
|
||||
|
||||
26 Nov 2015, PHP 5.6.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #70828 (php-fpm 5.6 with opcache crashes when referencing a
|
||||
non-existent constant). (Laruence)
|
||||
. Fixed bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l).
|
||||
(Laruence)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #68344 (MySQLi does not provide way to disable peer certificate
|
||||
validation) by introducing MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT
|
||||
connection flag. (Andrey)
|
||||
|
||||
- OCI8:
|
||||
. Fixed bug #68298 (OCI int overflow). (Senthil)
|
||||
|
||||
- PDO_DBlib:
|
||||
. Fixed bug #69757 (Segmentation fault on nextRowset).
|
||||
(miracle at rpz dot name)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #70875 (Segmentation fault if wsdl has no targetNamespace
|
||||
attribute). (Matteo)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #70852 (Segfault getting NULL offset of an ArrayObject).
|
||||
(Reeze Xia)
|
||||
|
||||
29 Oct 2015, PHP 5.6.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #70681 (Segfault when binding $this of internal instance method
|
||||
to null). (Nikita)
|
||||
. Fixed bug #70685 (Segfault for getClosure() internal method rebind with
|
||||
invalid $this). (Nikita)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #70619 (DateTimeImmutable segfault). (Laruence)
|
||||
|
||||
- Mcrypt:
|
||||
. Fixed bug #70625 (mcrypt_encrypt() won't return data when no IV was
|
||||
specified under RC4). (Nikita)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #70384 (mysqli_real_query():Unknown type 245 sent by the server).
|
||||
(Andrey)
|
||||
. Fixed bug #70572 segfault in mysqlnd_connect. (Andrey, Remi)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #70632 (Third one of segfault in gc_remove_from_buffer).
|
||||
(Laruence)
|
||||
. Fixed bug #70631 (Another Segfault in gc_remove_from_buffer()). (Laruence)
|
||||
. Fixed bug #70601 (Segfault in gc_remove_from_buffer()). (Laruence)
|
||||
. Fixed compatibility with Windows 10 (see also bug #70652). (Anatol)
|
||||
|
||||
01 Oct 2015, PHP 5.6.14
|
||||
|
||||
- Core:
|
||||
. Fixed bug #70370 (Bundled libtool.m4 doesn't handle FreeBSD 10 when
|
||||
building extensions). (Adam)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #68291 (404 on urls with '+'). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #70001 (Assigning to DOMNode::textContent does additional entity
|
||||
encoding). (cmb)
|
||||
|
||||
- ldap:
|
||||
. Fixed bug #70465 (Bug in ldap_search() modifies LDAP_OPT_TIMELIMIT/DEREF's values). (Tyson Andre)
|
||||
. Fixed bug #69574 (ldap timeouts not enforced). (Côme Bernigaud)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #70456 (mysqlnd doesn't activate TCP keep-alive when connecting to
|
||||
a server). (Sergei Turchanov)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #55259 (openssl extension does not get the DH parameters from
|
||||
DH key resource). (Jakub Zelenka)
|
||||
. Fixed bug #70395 (Missing ARG_INFO for openssl_seal()). (cmb)
|
||||
. Fixed bug #60632 (openssl_seal fails with AES). (Jakub Zelenka)
|
||||
. Fixed bug #68312 (Lookup for openssl.cnf causes a message box). (Anatol)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #70389 (PDO constructor changes unrelated variables). (Laruence)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #69720 (Null pointer dereference in phar_get_fp_offset()). (Stas)
|
||||
. FIxed bug #70433 (Uninitialized pointer in phar_make_dirstream when zip
|
||||
entry filename is "/"). (Stas)
|
||||
|
||||
- Phpdbg:
|
||||
. Fix phpdbg_break_next() sometimes not breaking. (Bob)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #67131 (setcookie() conditional for empty values not met). (cmb)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #70361 (HTTP stream wrapper doesn't close keep-alive connections).
|
||||
(Niklas Keller)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #70322 (ZipArchive::close() doesn't indicate errors). (cmb)
|
||||
|
||||
03 Sep 2015, PHP 5.6.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #69900 (Too long timeout on pipes). (Anatol)
|
||||
. Fixed bug #69487 (SAPI may truncate POST data). (cmb)
|
||||
. Fixed bug #70198 (Checking liveness does not work as expected).
|
||||
(Shafreeck Sea, Anatol Belski)
|
||||
. Fixed bug #70172 (Use After Free Vulnerability in unserialize()). (Stas)
|
||||
. Fixed bug #70219 (Use after free vulnerability in session deserializer).
|
||||
(taoguangchen at icloud dot com)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #66606 (Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE).
|
||||
(wusuopu, cmb)
|
||||
. Fixed bug #70264 (CLI server directory traversal). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #70266 (DateInterval::__construct.interval_spec is not supposed to
|
||||
be optional). (cmb)
|
||||
. Fixed bug #70277 (new DateTimeZone($foo) is ignoring text after null byte).
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte
|
||||
value of 32 bytes). (Stas)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #70284 (Use after free vulnerability in unserialize() with GMP).
|
||||
(stas)
|
||||
|
||||
- hash:
|
||||
. Fixed bug #70312 (HAVAL gives wrong hashes in specific cases). (letsgolee
|
||||
at naver dot com)
|
||||
|
||||
- MCrypt:
|
||||
. Fixed bug #69833 (mcrypt fd caching not working). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #70237 (Empty while and do-while segmentation fault with opcode
|
||||
on CLI enabled). (Dmitry, Laruence)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #70232 (Incorrect bump-along behavior with \K and empty string
|
||||
match). (cmb)
|
||||
. Fixed bug #70345 (Multiple vulnerabilities related to PCRE functions).
|
||||
(Anatol Belski)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #70388 (SOAP serialize_function_call() type confusion / RCE).
|
||||
(Stas)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #70290 (Null pointer deref (segfault) in spl_autoload via
|
||||
ob_start). (hugh at allthethings dot co dot nz)
|
||||
. Fixed bug #70303 (Incorrect constructor reflection for ArrayObject). (cmb)
|
||||
. Fixed bug #70365 (Use-after-free vulnerability in unserialize() with
|
||||
SplObjectStorage). (taoguangchen at icloud dot com)
|
||||
. Fixed bug #70366 (Use-after-free vulnerability in unserialize() with
|
||||
SplDoublyLinkedList). (taoguangchen at icloud dot com)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #70052 (getimagesize() fails for very large and very small WBMP).
|
||||
(cmb)
|
||||
. Fixed bug #70157 (parse_ini_string() segmentation fault with
|
||||
INI_SCANNER_TYPED). (Tjerk)
|
||||
|
||||
- XSLT:
|
||||
. Fixed bug #69782 (NULL pointer dereference). (Stas)
|
||||
|
||||
- ZIP:
|
||||
. Fixed bug #70350 (ZipArchive::extractTo allows for directory traversal when
|
||||
creating directories). (neal at fb dot com)
|
||||
|
||||
06 Aug 2015, PHP 5.6.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #70012 (Exception lost with nested finally block). (Laruence)
|
||||
. Fixed bug #70002 (TS issues with temporary dir handling). (Anatol)
|
||||
. Fixed bug #69793 (Remotely triggerable stack exhaustion via recursive
|
||||
method calls). (Stas)
|
||||
. Fixed bug #69892 (Different arrays compare indentical due to integer key
|
||||
truncation). (Nikita)
|
||||
. Fixed bug #70121 (unserialize() could lead to unexpected methods execution
|
||||
/ NULL pointer deref). (Stas)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #69655 (php -S changes MKCALENDAR request method to MKCOL). (cmb)
|
||||
. Fixed bug #64878 (304 responses return Content-Type header). (cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #53156 (imagerectangle problem with point ordering). (cmb)
|
||||
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (cmb)
|
||||
. Fixed bug #70102 (imagecreatefromwebm() shifts colors). (cmb)
|
||||
. Fixed bug #66590 (imagewebp() doesn't pad to even length). (cmb)
|
||||
. Fixed bug #66882 (imagerotate by -90 degrees truncates image by 1px). (cmb)
|
||||
. Fixed bug #70064 (imagescale(..., IMG_BICUBIC) leaks memory). (cmb)
|
||||
. Fixed bug #69024 (imagescale segfault with palette based image). (cmb)
|
||||
. Fixed bug #53154 (Zero-height rectangle has whiskers). (cmb)
|
||||
. Fixed bug #67447 (imagecrop() add a black line when cropping). (cmb)
|
||||
. Fixed bug #68714 (copy 'n paste error). (cmb)
|
||||
. Fixed bug #66339 (PHP segfaults in imagexbm). (cmb)
|
||||
. Fixed bug #70047 (gd_info() doesn't report WebP support). (cmb)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #69975 (PHP segfaults when accessing nvarchar(max) defined
|
||||
columns). (cmb)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #69882 (OpenSSL error "key values mismatch" after
|
||||
openssl_pkcs12_read with extra cert). (Tomasz Sawicki)
|
||||
. Fixed bug #70014 (openssl_random_pseudo_bytes() is not cryptographically
|
||||
secure). (Stas)
|
||||
|
||||
- Phar:
|
||||
. Improved fix for bug #69441. (Anatol Belski)
|
||||
. Fixed bug #70019 (Files extracted from archive may be placed outside of
|
||||
destination directory). (Anatol Belski)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #70081 (SoapClient info leak / null pointer dereference via
|
||||
multiple type confusions). (Stas)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #70068 (Dangling pointer in the unserialization of ArrayObject
|
||||
items). (sean.heelan)
|
||||
. Fixed bug #70166 (Use After Free Vulnerability in unserialize() with
|
||||
SPLArrayObject). (taoguangchen at icloud dot com)
|
||||
. Fixed bug #70168 (Use After Free Vulnerability in unserialize() with
|
||||
SplObjectStorage). (taoguangchen at icloud dot com)
|
||||
. Fixed bug #70169 (Use After Free Vulnerability in unserialize() with
|
||||
SplDoublyLinkedList). (taoguangchen at icloud dot com)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #70096 (Repeated iptcembed() adds superfluous FF bytes). (cmb)
|
||||
|
||||
09 Jul 2015, PHP 5.6.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #69768 (escapeshell*() doesn't cater to !). (cmb)
|
||||
. Fixed bug #69703 (Use __builtin_clzl on PowerPC).
|
||||
(dja at axtens dot net, Kalle)
|
||||
. Fixed bug #69732 (can induce segmentation fault with basic php code).
|
||||
(Dmitry)
|
||||
. Fixed bug #69642 (Windows 10 reported as Windows 8).
|
||||
(Christian Wenz, Anatol Belski)
|
||||
. Fixed bug #69551 (parse_ini_file() and parse_ini_string() segmentation
|
||||
fault). (Christoph M. Becker)
|
||||
. Fixed bug #69781 (phpinfo() reports Professional Editions of Windows
|
||||
7/8/8.1/10 as "Business"). (Christian Wenz)
|
||||
. Fixed bug #69740 (finally in generator (yield) swallows exception in
|
||||
iteration). (Nikita)
|
||||
. Fixed bug #69835 (phpinfo() does not report many Windows SKUs).
|
||||
(Christian Wenz)
|
||||
. Fixed bug #69892 (Different arrays compare indentical due to integer key
|
||||
truncation). (Nikita)
|
||||
. Fixed bug #69874 (Can't set empty additional_headers for mail()), regression
|
||||
from fix to bug #68776. (Yasuo)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #61221 (imagegammacorrect function loses alpha channel). (cmb)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #69803 (gmp_random_range() modifies second parameter if GMP
|
||||
number). (Nikita)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #69669 (mysqlnd is vulnerable to BACKRONYM). (CVE-2015-3152)
|
||||
(Andrey)
|
||||
|
||||
- PCRE:
|
||||
. Fixed Bug #53823 (preg_replace: * qualifier on unicode replace garbles the
|
||||
string). (cmb)
|
||||
. Fixed bug #69864 (Segfault in preg_replace_callback) (cmb, ab)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #69752 (PDOStatement::execute() leaks memory with DML
|
||||
Statements when closeCuror() is u). (Philip Hofstetter)
|
||||
. Fixed bug #69362 (PDO-pgsql fails to connect if password contains a
|
||||
leading single quote). (Matteo)
|
||||
. Fixed bug #69344 (PDO PgSQL Incorrect binding numeric array with gaps).
|
||||
(Matteo)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #69958 (Segfault in Phar::convertToData on invalid file).
|
||||
(CVE-2015-5589) (Stas)
|
||||
. Fixed bug #69923 (Buffer overflow and stack smashing error in
|
||||
phar_fix_filepath). (CVE-2015-5590) (Stas)
|
||||
|
||||
- SimpleXML:
|
||||
. Refactored the fix for bug #66084 (simplexml_load_string() mangles empty
|
||||
node name). (Christoph Michael Becker)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #69737 (Segfault when SplMinHeap::compare produces fatal error).
|
||||
(Stas)
|
||||
. Fixed bug #67805 (SplFileObject setMaxLineLength). (Willian Gustavo Veiga).
|
||||
. Fixed bug #69970 (Use-after-free vulnerability in
|
||||
spl_recursive_it_move_forward_ex()). (Laruence)
|
||||
|
||||
- Sqlite3:
|
||||
. Fixed bug #69972 (Use-after-free vulnerability in
|
||||
sqlite3SafetyCheckSickOrOk()). (Laruence)
|
||||
|
||||
11 Jun 2015, PHP 5.6.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #66048 (temp. directory is cached during multiple requests).
|
||||
(Julien)
|
||||
. Fixed bug #69566 (Conditional jump or move depends on uninitialised value
|
||||
in extension trait). (jbboehr at gmail dot com)
|
||||
. Fixed bug #69599 (Strange generator+exception+variadic crash). (Nikita)
|
||||
. Fixed bug #69628 (complex GLOB_BRACE fails on Windows).
|
||||
(Christoph M. Becker)
|
||||
. Fixed POST data processing slowdown due to small input buffer size
|
||||
on Windows. (Jorge Oliveira, Anatol)
|
||||
. Fixed bug #69646 (OS command injection vulnerability in escapeshellarg).
|
||||
(CVE-2015-4642) (Anatol Belski)
|
||||
. Fixed bug #69719 (Incorrect handling of paths with NULs). (Stas)
|
||||
|
||||
- FTP
|
||||
. Improved fix for bug #69545 (Integer overflow in ftp_genlist() resulting in
|
||||
heap overflow). (CVE-2015-4643) (Max Spelsberg)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #69479 (GD fails to build with newer libvpx). (Remi)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #48147 (iconv with //IGNORE cuts the string). (Stas)
|
||||
|
||||
- Litespeed SAPI:
|
||||
. Fixed bug #68812 (Unchecked return value). (George Wang)
|
||||
|
||||
- Mail:
|
||||
. Fixed bug #68776 (mail() does not have mail header injection prevention for
|
||||
additional headers). (Yasuo)
|
||||
|
||||
- MCrypt:
|
||||
. Added file descriptor caching to mcrypt_create_iv() (Leigh)
|
||||
|
||||
- Opcache
|
||||
. Fixed bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF).
|
||||
(Laruence, Dmitry)
|
||||
|
||||
- PCRE
|
||||
. Upgraded pcrelib to 8.37. (CVE-2015-2325, CVE-2015-2326)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #69680 (phar symlink in binary directory broken).
|
||||
(Matteo Bernardini, Remi)
|
||||
|
||||
- Postgres:
|
||||
. Fixed bug #69667 (segfault in php_pgsql_meta_data). (CVE-2015-4644) (Remi)
|
||||
|
||||
- Sqlite3:
|
||||
. Upgrade bundled sqlite to 3.8.10.2. (CVE-2015-3414, CVE-2015-3415,
|
||||
CVE-2015-3416) (Kaplan)
|
||||
|
||||
14 May 2015, PHP 5.6.9
|
||||
|
||||
- Core:
|
||||
. Fixed bug #69467 (Wrong checked for the interface by using Trait).
|
||||
(Laruence)
|
||||
. Fixed bug #69420 (Invalid read in zend_std_get_method). (Laruence)
|
||||
. Fixed bug #60022 ("use statement [...] has no effect" depends on leading
|
||||
backslash). (Nikita)
|
||||
. Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer).
|
||||
(Dmitry)
|
||||
. Fixed bug #68652 (segmentation fault in destructor). (Dmitry)
|
||||
. Fixed bug #69419 (Returning compatible sub generator produces a warning).
|
||||
(Nikita)
|
||||
. Fixed bug #69472 (php_sys_readlink ignores misc errors from
|
||||
GetFinalPathNameByHandleA). (Jan Starke)
|
||||
. Fixed bug #69364 (PHP Multipart/form-data remote dos Vulnerability).
|
||||
(CVE-2015-4024) (Stas)
|
||||
. Fixed bug #69403 (str_repeat() sign mismatch based memory corruption).
|
||||
(Stas)
|
||||
. Fixed bug #69418 (CVE-2006-7243 fix regressions in 5.4+). (CVE-2015-4025)
|
||||
(Stas)
|
||||
. Fixed bug #69522 (heap buffer overflow in unpack()). (Stas)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #69545 (Integer overflow in ftp_genlist() resulting in heap
|
||||
overflow). (CVE-2015-4022) (Stas)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #69354 (Incorrect use of SQLColAttributes with ODBC 3.0).
|
||||
(Anatol)
|
||||
. Fixed bug #69474 (ODBC: Query with same field name from two tables returns
|
||||
incorrect result). (Anatol)
|
||||
. Fixed bug #69381 (out of memory with sage odbc driver). (Frederic Marchall,
|
||||
Anatol Belski)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #69402 (Reading empty SSL stream hangs until timeout).
|
||||
(Daniel Lowrey)
|
||||
|
||||
- PCNTL:
|
||||
. Fixed bug #68598 (pcntl_exec() should not allow null char). (CVE-2015-4026)
|
||||
(Stas)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #69453 (Memory Corruption in phar_parse_tarfile when entry
|
||||
filename starts with null). (CVE-2015-4021) (Stas)
|
||||
|
||||
16 Apr 2015, PHP 5.6.8
|
||||
|
||||
- Core:
|
||||
@@ -48,18 +500,22 @@ PHP NEWS
|
||||
segfault). (Anatol Belski)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #69202: (FILTER_FLAG_STRIP_BACKTICK ignored unless other
|
||||
. Fixed bug #69202 (FILTER_FLAG_STRIP_BACKTICK ignored unless other
|
||||
flags are used). (Jeff Welch)
|
||||
. Fixed bug #69203 (FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127). (Jeff
|
||||
Welch)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #68846 (False detection of CJK Unified Ideographs Extension E).
|
||||
(Masaki Kagaya)
|
||||
|
||||
- OPCache:
|
||||
. Fixed bug #69297 (function_exists strange behavior with OPCache on
|
||||
disabled function). (Laruence)
|
||||
. Fixed bug #69281 (opcache_is_script_cached no longer works). (danack)
|
||||
. Fixed bug #68677 (Use After Free). (CVE-2015-1351) (Laruence)
|
||||
|
||||
- OpenSSL
|
||||
- OpenSSL:
|
||||
. Fixed bugs #68853, #65137 (Buffered crypto stream data breaks IO polling
|
||||
in stream_select() contexts) (Chris Wright)
|
||||
. Fixed bug #69197 (openssl_pkcs7_sign handles default value incorrectly)
|
||||
@@ -82,14 +538,16 @@ PHP NEWS
|
||||
- Postgres:
|
||||
. Fixed bug #68741 (Null pointer dereference). (CVE-2015-1352) (Laruence)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #69152 (Type Confusion Infoleak Vulnerability in unserialize()
|
||||
with SoapFault). (Dmitry)
|
||||
. Fixed bug #69293 (NEW segfault when using SoapClient::__setSoapHeader
|
||||
(bisected, regression)). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #69227 (Use after free in zval_scan caused by
|
||||
spl_object_storage_get_gc). (adam dot scarr at 99designs dot com)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #69293 (NEW segfault when using SoapClient::__setSoapHeader
|
||||
(bisected, regression)). (Laruence)
|
||||
|
||||
- Sqlite3:
|
||||
. Fixed bug #68760 (SQLITE segfaults if custom collator throws an exception).
|
||||
(Dan Ackroyd)
|
||||
@@ -170,7 +628,8 @@ PHP NEWS
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #69085 (SoapClient's __call() type confusion through
|
||||
unserialize()). (andrea dot palazzo at truel dot it, Laruence)
|
||||
unserialize()). (CVE-2015-4147, CVE-2015-4148) (andrea dot palazzo at truel
|
||||
dot it, Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #69108 ("Segmentation fault" when (de)serializing
|
||||
|
||||
+6
-6
@@ -12,7 +12,7 @@ Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following
|
||||
some basic rules with regards to Git usage will::
|
||||
|
||||
a. Make everybody happier, especially those responsible for maintaining
|
||||
Git itself.
|
||||
PHP itself.
|
||||
|
||||
b. Keep the changes consistently well documented and easily trackable.
|
||||
|
||||
@@ -48,11 +48,11 @@ Currently we have the following branches in use::
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is an old
|
||||
stable version and is open for security fixes only.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is an old
|
||||
stable version and is open for security fixes only.
|
||||
|
||||
PHP-5.3 This branch is closed.
|
||||
|
||||
@@ -67,7 +67,7 @@ Currently we have the following branches in use::
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.4) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.6) and then
|
||||
get merged up to all other branches. If a change is not needed for
|
||||
later branches (i.e. fixes for features which where dropped from later
|
||||
branches) an empty merge should be done.
|
||||
|
||||
+14
-4
@@ -213,12 +213,14 @@ Getting the stable release announced
|
||||
|
||||
c. ``$PHP_X_MD5`` array and update all the md5 sums
|
||||
|
||||
d. set ``$PHP_X_RC`` to false!
|
||||
d. ``$PHP_X_SHA256`` array and update all the SHA256 sums
|
||||
|
||||
e. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
e. set ``$PHP_X_RC`` to false!
|
||||
|
||||
f. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
``$RELEASES[X][$PHP_X_VERSION]["source"]`` array
|
||||
|
||||
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
|
||||
g. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
|
||||
|
||||
3. Create the release file (releases/x_y_z.php)
|
||||
Usually we use the same content as for point 6, but included in php template
|
||||
@@ -267,6 +269,9 @@ to upgrade.
|
||||
9. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
http://news.php.net/php.internals/17222.
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
--------------------------------------
|
||||
@@ -283,7 +288,9 @@ Re-releasing the same version (or -pl)
|
||||
|
||||
d. ``$PHP_X_MD5`` array and update all the md5 sums
|
||||
|
||||
e. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
e. ``$PHP_X_SHA256`` array and update all the SHA256 sums
|
||||
|
||||
f. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
``$RELEASES[X][$PHP_X_VERSION]["source"]`` array
|
||||
|
||||
3. Add a short notice to phpweb stating that there is a new release, and
|
||||
@@ -300,3 +307,6 @@ to upgrade.
|
||||
5. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
the news entry.
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
@@ -61,6 +61,9 @@ PHP 5.6 UPGRADE NOTES
|
||||
longer accept keys or IVs with incorrect sizes. Furthermore an IV is now
|
||||
required if the used block cipher mode requires it.
|
||||
|
||||
- cURL:
|
||||
Uploads using the @file syntax are now unsupported by default.
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
========================================
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #43201 (Crash on using unitialized vals and __get/__set)
|
||||
Bug #43201 (Crash on using uninitialized vals and __get/__set)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #63336 (invalid E_NOTICE error occur)
|
||||
--XFAIL--
|
||||
Bug is not fixed yet
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_NOTICE );
|
||||
@@ -18,7 +16,7 @@ class Child extends Base {
|
||||
public function bar($var, $more=self::DUMMY) { return true; }
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Strict Standards: Declaration of Child::foo() should be compatible with Base::foo($var = '123', $more = NULL) in %sbug63336.php on line %d
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of Child::foo() should be compatible with Base::foo($var = TEST, $more = NULL) in %sbug63336.php on line %d
|
||||
|
||||
Strict Standards: Declaration of Child::bar() should be compatible with Base::bar($var, $more = 'XXX') in %sbug63336.php on line %d
|
||||
Strict Standards: Declaration of Child::bar() should be compatible with Base::bar($more = self::DUMMY) in %sbug63336.php on line %d
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)
|
||||
--FILE--
|
||||
<?php
|
||||
function crash()
|
||||
{
|
||||
$notDefined[$i] = 'test';
|
||||
}
|
||||
|
||||
function error_handler() { return false; }
|
||||
|
||||
set_error_handler('error_handler');
|
||||
crash();
|
||||
echo "made it once\n";
|
||||
crash();
|
||||
echo "ok\n";
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: i in %sbug67314.php on line 4
|
||||
made it once
|
||||
|
||||
Notice: Undefined variable: i in %sbug67314.php on line 4
|
||||
ok
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #68652 (segmentation fault in destructor)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
private static $instance;
|
||||
public static function getInstance() {
|
||||
if (isset(self::$instance)) {
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance = new self();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
Bar::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
|
||||
private static $instance;
|
||||
public static function getInstance() {
|
||||
if (isset(self::$instance)) {
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance = new self();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
Foo::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$foo = new Foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Bar::$instance in %sbug68652.php on line %d
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #69420 (Invalid read in zend_std_get_method)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
protected function test() {
|
||||
echo "okey";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class A {
|
||||
protected function test() {
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
use T;
|
||||
public function foo() {
|
||||
$this->test();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$b = new B();
|
||||
$b->foo();
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #69467 (Wrong checked for the interface by using Trait)
|
||||
--FILE--
|
||||
<?php
|
||||
interface Baz {
|
||||
public function bad();
|
||||
}
|
||||
|
||||
trait Bar{
|
||||
protected function bad(){}
|
||||
}
|
||||
|
||||
class Foo implements Baz{
|
||||
use Bar;
|
||||
}
|
||||
|
||||
$test = new Foo();
|
||||
var_dump($test instanceof Baz);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to Bar::bad() must be public (as in class Baz) in %sbug69467.php on line %d
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #69551 - parse_ini_file() and parse_ini_string() segmentation fault
|
||||
--FILE--
|
||||
<?php
|
||||
$ini = <<<INI
|
||||
[Network.eth0]
|
||||
SubnetMask = "
|
||||
"
|
||||
INI;
|
||||
$settings = parse_ini_string($ini, false, INI_SCANNER_RAW);
|
||||
var_dump($settings);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: syntax error, unexpected '"' in Unknown on line %d
|
||||
in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #69599: Strange generator+exception+variadic crash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function crash() {
|
||||
sin(...[0]);
|
||||
throw new \Exception();
|
||||
yield;
|
||||
}
|
||||
|
||||
iterator_to_array(crash());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: crash()
|
||||
#1 %s(%d): iterator_to_array(Object(Generator))
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #69732 (can induce segmentation fault with basic php code)
|
||||
--FILE--
|
||||
<?php
|
||||
class wpq {
|
||||
private $unreferenced;
|
||||
|
||||
public function __get($name) {
|
||||
return $this->$name . "XXX";
|
||||
}
|
||||
}
|
||||
|
||||
function ret_assoc() {
|
||||
$x = "XXX";
|
||||
return array('foo' => 'bar', $x);
|
||||
}
|
||||
|
||||
$wpq = new wpq;
|
||||
$wpq->interesting =& ret_assoc();
|
||||
$x = $wpq->interesting;
|
||||
printf("%s\n", $x);
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: wpq::$interesting in %sbug69732.php on line 6
|
||||
|
||||
Notice: Indirect modification of overloaded property wpq::$interesting has no effect in %sbug69732.php on line 16
|
||||
|
||||
Fatal error: Cannot assign by reference to overloaded object in %sbug69732.php on line 16
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #69740: finally in generator (yield) swallows exception in iteration
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function generate() {
|
||||
try {
|
||||
yield 1;
|
||||
yield 2;
|
||||
} finally {
|
||||
echo "finally\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach (generate() as $i) {
|
||||
echo $i, "\n";
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
1
|
||||
finally
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #69892: Different arrays compare indentical due to integer key truncation
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump([0 => 0] === [0x100000000 => 0]);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #70012 (Exception lost with nested finally block)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
echo "Outer try\n";
|
||||
try {
|
||||
echo " Middle try\n";
|
||||
throw new Exception();
|
||||
} finally {
|
||||
echo " Middle finally\n";
|
||||
try {
|
||||
echo " Inner try\n";
|
||||
} finally {
|
||||
echo " Inner finally\n";
|
||||
}
|
||||
}
|
||||
echo "Outer shouldnt get here\n";
|
||||
} catch (Exception $e) {
|
||||
echo "Outer catch\n";
|
||||
} finally {
|
||||
echo "Outer finally\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Outer try
|
||||
Middle try
|
||||
Middle finally
|
||||
Inner try
|
||||
Inner finally
|
||||
Outer catch
|
||||
Outer finally
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
|
||||
--FILE--
|
||||
<?php
|
||||
unserialize('O:12:"DateInterval":1:{s:4:"days";O:9:"Exception":7:{s:10:"'."\0".'*'."\0".'message";s:1:"x";s:17:"'."\0".'Exception'."\0".'string";s:1:"A";s:7:"'."\0".'*'."\0".'code";i:0;s:7:"'."\0".'*'."\0".'file";s:1:"a";s:7:"'."\0".'*'."\0".'line";i:1337;s:16:"'."\0".'Exception'."\0".'trace";a:0:{}s:19:"'."\0".'Exception'."\0".'previous";O:8:"stdClass":0:{}}}');
|
||||
?>
|
||||
OK
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #70681: Segfault when binding $this of internal instance method to null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
|
||||
$c = $c->bindTo(null);
|
||||
|
||||
$c = (new ReflectionFunction('strlen'))->getClosure();
|
||||
$c = $c->bindTo(null);
|
||||
var_dump($c("foo"));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot unbind $this of internal method in %s on line %d
|
||||
int(3)
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70685: Segfault for getClosure() internal method rebind with invalid $this
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class cls {}
|
||||
|
||||
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
|
||||
$c = $c->bindTo(new cls);
|
||||
var_dump($c);
|
||||
|
||||
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
|
||||
$c = $c->bindTo(new SplStack, 'cls');
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot bind function SplDoublyLinkedList::count to scope class cls in %s on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l)
|
||||
--FILE--
|
||||
<?php
|
||||
$ini = '[${ ';
|
||||
|
||||
$ini_file = __DIR__ . "/bug70748.ini";
|
||||
|
||||
file_put_contents($ini_file, $ini);
|
||||
|
||||
var_dump(parse_ini_file($ini_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . "bug70748.ini");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d
|
||||
in %sbug70748.php on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace test {
|
||||
use const nonexistent;
|
||||
|
||||
class test {
|
||||
static function run(){
|
||||
var_dump(nonexistent);
|
||||
existent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
define("test\\existent", "bug!", 1);
|
||||
test\test::run();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Use of undefined constant nonexistent - assumed 'nonexistent' in %sbug70828.php on line %d
|
||||
string(11) "nonexistent"
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$e = new Exception("Foo");
|
||||
try {
|
||||
throw new Exception("Bar", 0, $e);
|
||||
} finally {
|
||||
throw $e;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
var_dump((string)$e);
|
||||
}
|
||||
|
||||
try {
|
||||
$e = new Exception("Foo");
|
||||
try {
|
||||
throw new Exception("Bar", 0, $e);
|
||||
} finally {
|
||||
throw new Exception("Dummy", 0, $e);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
var_dump((string)$e);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "exception 'Exception' with message 'Foo' in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
string(%d) "exception 'Exception' with message 'Foo' in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
Next exception 'Exception' with message 'Dummy' in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70957 (self::class can not be resolved with reflection for abstract class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class Foo
|
||||
{
|
||||
function bar($a = self::class) {}
|
||||
}
|
||||
|
||||
trait T {
|
||||
public function bar() {
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
use T;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
|
||||
--FILE--
|
||||
<?php
|
||||
trait Foo
|
||||
{
|
||||
function bar($a = self::class) {
|
||||
var_dump($a);
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
use Foo;
|
||||
}
|
||||
|
||||
$b = new B;
|
||||
|
||||
$b->bar();
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Testing declare statement with ticks
|
||||
--SKIPIF--
|
||||
--FILE--
|
||||
<?php
|
||||
register_tick_function(function () { echo "tick\n"; });
|
||||
function foo() { }
|
||||
|
||||
declare(ticks=1) {
|
||||
|
||||
$statement;
|
||||
foo();
|
||||
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
tick
|
||||
tick
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #69419: Returning compatible sub generator produces a warning
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function & genRefInner() {
|
||||
$var = 1;
|
||||
yield $var;
|
||||
}
|
||||
|
||||
function & genRefOuter() {
|
||||
return genRefInner();
|
||||
}
|
||||
|
||||
foreach(genRefOuter() as $i) {
|
||||
var_dump($i);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variable references should be returned by reference in %s on line %d
|
||||
int(1)
|
||||
@@ -3,6 +3,8 @@
|
||||
--FILE--
|
||||
<?php
|
||||
use A;
|
||||
use \B;
|
||||
--EXPECTF--
|
||||
Warning: The use statement with non-compound name 'A' has no effect in %sns_033.php on line 2
|
||||
|
||||
Warning: The use statement with non-compound name 'B' has no effect in %sns_033.php on line 3
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Closure::__invoke() with variadic parameter
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$closure = function(&...$refs) {};
|
||||
$closure->__invoke(
|
||||
$v1, $v2, $v3, $v4,
|
||||
$v5, $v6, $v7, $v8,
|
||||
$v9, $v10, $v11, $v12,
|
||||
$v13
|
||||
);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
+13
-13
@@ -678,7 +678,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size)
|
||||
__asm {
|
||||
bsr eax, _size
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
|
||||
#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__) || defined(__powerpc__))
|
||||
return (8 * SIZEOF_SIZE_T - 1) - __builtin_clzl(_size);
|
||||
#else
|
||||
unsigned int n = 0;
|
||||
@@ -706,7 +706,7 @@ static inline unsigned int zend_mm_low_bit(size_t _size)
|
||||
__asm {
|
||||
bsf eax, _size
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
|
||||
#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__) || defined(__powerpc__))
|
||||
return __builtin_ctzl(_size);
|
||||
#else
|
||||
static const int offset[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0};
|
||||
@@ -984,7 +984,7 @@ static void zend_mm_random(unsigned char *buf, size_t size) /* {{{ */
|
||||
int has_context = 0;
|
||||
|
||||
if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0)) {
|
||||
/* Could mean that the key container does not exist, let try
|
||||
/* Could mean that the key container does not exist, let try
|
||||
again by asking for a new one */
|
||||
if (GetLastError() == NTE_BAD_KEYSET) {
|
||||
if (CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET)) {
|
||||
@@ -1348,7 +1348,7 @@ static int zend_mm_check_ptr(zend_mm_heap *heap, void *ptr, int silent ZEND_FILE
|
||||
}
|
||||
if (!silent) {
|
||||
TSRMLS_FETCH();
|
||||
|
||||
|
||||
zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL TSRMLS_CC);
|
||||
zend_debug_alloc_output("---------------------------------------\n");
|
||||
zend_debug_alloc_output("%s(%d) : Block "PTR_FMT" status:\n" ZEND_FILE_LINE_RELAY_CC, ptr);
|
||||
@@ -2175,7 +2175,7 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_
|
||||
#if ZEND_MM_CACHE
|
||||
if (ZEND_MM_SMALL_SIZE(true_size)) {
|
||||
size_t index = ZEND_MM_BUCKET_INDEX(true_size);
|
||||
|
||||
|
||||
if (heap->cache[index] != NULL) {
|
||||
zend_mm_free_block *best_fit;
|
||||
zend_mm_free_block **cache;
|
||||
@@ -2188,7 +2188,7 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_
|
||||
heap->cache[index] = best_fit->prev_free_block;
|
||||
ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED);
|
||||
ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 0);
|
||||
|
||||
|
||||
ptr = ZEND_MM_DATA_OF(best_fit);
|
||||
|
||||
#if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION
|
||||
@@ -2470,7 +2470,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
: "%0"(res),
|
||||
"rm"(size),
|
||||
"rm"(offset));
|
||||
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
@@ -2619,7 +2619,7 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
|
||||
|
||||
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
int length;
|
||||
size_t length;
|
||||
char *p;
|
||||
#ifdef ZEND_SIGNALS
|
||||
TSRMLS_FETCH();
|
||||
@@ -2627,13 +2627,13 @@ ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
length = strlen(s)+1;
|
||||
p = (char *) _emalloc(length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
length = strlen(s);
|
||||
p = (char *) _emalloc(safe_address(length, 1, 1) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
if (UNEXPECTED(p == NULL)) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p;
|
||||
}
|
||||
memcpy(p, s, length);
|
||||
memcpy(p, s, length+1);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p;
|
||||
}
|
||||
@@ -2647,7 +2647,7 @@ ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
p = (char *) _emalloc(length+1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
p = (char *) _emalloc(safe_address(length, 1, 1) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
if (UNEXPECTED(p == NULL)) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p;
|
||||
@@ -2668,7 +2668,7 @@ ZEND_API char *zend_strndup(const char *s, uint length)
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
p = (char *) malloc(length+1);
|
||||
p = (char *) malloc(safe_address(length, 1, 1));
|
||||
if (UNEXPECTED(p == NULL)) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p;
|
||||
|
||||
+23
-14
@@ -88,6 +88,12 @@ ZEND_METHOD(Closure, bind)
|
||||
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
|
||||
}
|
||||
|
||||
if (newthis == NULL && !(closure->func.common.fn_flags & ZEND_ACC_STATIC)
|
||||
&& closure->func.common.scope && closure->func.type == ZEND_INTERNAL_FUNCTION) {
|
||||
zend_error(E_WARNING, "Cannot unbind $this of internal method");
|
||||
return;
|
||||
}
|
||||
|
||||
if (scope_arg != NULL) { /* scope argument was given */
|
||||
if (IS_ZEND_STD_OBJECT(*scope_arg)) {
|
||||
ce = Z_OBJCE_P(scope_arg);
|
||||
@@ -127,6 +133,19 @@ ZEND_METHOD(Closure, bind)
|
||||
ce = closure->func.common.scope;
|
||||
}
|
||||
|
||||
/* verify that we aren't binding internal function to a wrong scope */
|
||||
if (closure->func.type == ZEND_INTERNAL_FUNCTION && closure->func.common.scope != NULL) {
|
||||
if (ce && !instanceof_function(ce, closure->func.common.scope TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", closure->func.common.scope->name, closure->func.common.function_name, ce->name);
|
||||
return;
|
||||
}
|
||||
if (ce && newthis && (closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 &&
|
||||
!instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "Cannot bind internal method %s::%s() to object of class %s", closure->func.common.scope->name, closure->func.common.function_name, Z_OBJCE_P(newthis)->name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
zend_create_closure(return_value, &closure->func, ce, newthis TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -148,10 +167,12 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
zend_function *invoke = (zend_function*)emalloc(sizeof(zend_function));
|
||||
const zend_uint keep_flags = ZEND_ACC_RETURN_REFERENCE | ZEND_ACC_VARIADIC;
|
||||
|
||||
invoke->common = closure->func.common;
|
||||
invoke->type = ZEND_INTERNAL_FUNCTION;
|
||||
invoke->internal_function.fn_flags = ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure->func.common.fn_flags & ZEND_ACC_RETURN_REFERENCE);
|
||||
invoke->internal_function.fn_flags =
|
||||
ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure->func.common.fn_flags & keep_flags);
|
||||
invoke->internal_function.handler = ZEND_MN(Closure___invoke);
|
||||
invoke->internal_function.module = 0;
|
||||
invoke->internal_function.scope = zend_ce_closure;
|
||||
@@ -462,19 +483,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
closure->func.op_array.run_time_cache = NULL;
|
||||
(*closure->func.op_array.refcount)++;
|
||||
} else {
|
||||
/* verify that we aren't binding internal function to a wrong scope */
|
||||
if(func->common.scope != NULL) {
|
||||
if(scope && !instanceof_function(scope, func->common.scope TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", func->common.scope->name, func->common.function_name, scope->name);
|
||||
scope = NULL;
|
||||
}
|
||||
if(scope && this_ptr && (func->common.fn_flags & ZEND_ACC_STATIC) == 0 &&
|
||||
!instanceof_function(Z_OBJCE_P(this_ptr), closure->func.common.scope TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", func->common.scope->name, func->common.function_name, Z_OBJCE_P(this_ptr)->name);
|
||||
scope = NULL;
|
||||
this_ptr = NULL;
|
||||
}
|
||||
} else {
|
||||
if (!func->common.scope) {
|
||||
/* if it's a free function, we won't set scope & this since they're meaningless */
|
||||
this_ptr = NULL;
|
||||
scope = NULL;
|
||||
|
||||
+31
-20
@@ -2214,10 +2214,16 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static
|
||||
if (!CG(active_class_entry)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active");
|
||||
}
|
||||
if (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) {
|
||||
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
zval_dtor(&class_name->u.constant);
|
||||
constant_name.op_type = IS_CONST;
|
||||
ZVAL_STRINGL(&constant_name.u.constant, "class", sizeof("class")-1, 1);
|
||||
zend_do_fetch_constant(result, class_name, &constant_name, ZEND_RT, 1 TSRMLS_CC);
|
||||
ZVAL_STRINGL(&constant_name.u.constant, "__CLASS__", sizeof("__CLASS__")-1, 1);
|
||||
if (is_static) {
|
||||
*result = constant_name;
|
||||
result->u.constant.type = IS_CONSTANT;
|
||||
} else {
|
||||
zend_do_fetch_constant(result, NULL, &constant_name, ZEND_RT, 1 TSRMLS_CC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
zval_dtor(&class_name->u.constant);
|
||||
@@ -3472,10 +3478,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
|
||||
if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) {
|
||||
zval *zv, zv_copy;
|
||||
int use_copy;
|
||||
ALLOC_ZVAL(zv);
|
||||
*zv = *precv->op2.zv;
|
||||
zval_copy_ctor(zv);
|
||||
INIT_PZVAL(zv);
|
||||
zv = precv->op2.zv;
|
||||
if ((Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
|
||||
REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN_P(zv));
|
||||
memcpy(offset, Z_STRVAL_P(zv), Z_STRLEN_P(zv));
|
||||
@@ -3517,7 +3520,6 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
|
||||
zval_dtor(&zv_copy);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&zv);
|
||||
}
|
||||
} else {
|
||||
memcpy(offset, "NULL", 4);
|
||||
@@ -4051,7 +4053,8 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
|
||||
}
|
||||
zend_hash_quick_update(*overriden, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn);
|
||||
return;
|
||||
} else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
} else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT &&
|
||||
(existing_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0) {
|
||||
/* Make sure the trait method is compatible with previosly declared abstract method */
|
||||
if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
@@ -4081,6 +4084,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
|
||||
/* inherited members are overridden by members inserted by traits */
|
||||
/* check whether the trait method fulfills the inheritance requirements */
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
fn->common.prototype = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4099,7 +4103,7 @@ static int zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce TSRML
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
|
||||
}
|
||||
if (fn->op_array.static_variables) {
|
||||
if (fn->type == ZEND_USER_FUNCTION && fn->op_array.static_variables) {
|
||||
ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
|
||||
}
|
||||
}
|
||||
@@ -5806,7 +5810,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
|
||||
opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 0 TSRMLS_CC);
|
||||
} else {
|
||||
opline->extended_value = IS_CONSTANT_UNQUALIFIED;
|
||||
if (CG(current_namespace)) {
|
||||
if (check_namespace && CG(current_namespace)) {
|
||||
opline->extended_value |= IS_CONSTANT_IN_NAMESPACE;
|
||||
opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 1 TSRMLS_CC);
|
||||
} else {
|
||||
@@ -6825,7 +6829,14 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
|
||||
|
||||
void zend_do_ticks(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
zend_op *opline;
|
||||
|
||||
/* This prevents a double TICK generated by the parser statement of "declare()" */
|
||||
if (CG(active_op_array)->last && CG(active_op_array)->opcodes[CG(active_op_array)->last - 1].opcode == ZEND_TICKS) {
|
||||
return;
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_TICKS;
|
||||
SET_UNUSED(opline->op1);
|
||||
@@ -7141,7 +7152,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{{ */
|
||||
void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *lcname;
|
||||
zval *name, *ns, tmp;
|
||||
@@ -7168,7 +7179,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
|
||||
ZVAL_STRING(name, p+1, 1);
|
||||
} else {
|
||||
ZVAL_ZVAL(name, ns, 1, 0);
|
||||
warn = !is_global && !CG(current_namespace);
|
||||
warn = !CG(current_namespace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7224,7 +7235,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC) /* {{{ */
|
||||
void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *lookup_name;
|
||||
zval *name, *ns, tmp;
|
||||
@@ -7245,7 +7256,7 @@ void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, int i
|
||||
ZVAL_STRING(name, p+1, 1);
|
||||
} else {
|
||||
ZVAL_ZVAL(name, ns, 1, 0);
|
||||
warn = !is_global && !CG(current_namespace);
|
||||
warn = !CG(current_namespace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7309,25 +7320,25 @@ void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, int i
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_use_function(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{{ */
|
||||
void zend_do_use_function(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (!CG(current_import_function)) {
|
||||
CG(current_import_function) = emalloc(sizeof(HashTable));
|
||||
zend_hash_init(CG(current_import_function), 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
}
|
||||
|
||||
zend_do_use_non_class(ns_name, new_name, is_global, 1, 0, CG(current_import_function), CG(function_table) TSRMLS_CC);
|
||||
zend_do_use_non_class(ns_name, new_name, 1, 0, CG(current_import_function), CG(function_table) TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_use_const(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{{ */
|
||||
void zend_do_use_const(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (!CG(current_import_const)) {
|
||||
CG(current_import_const) = emalloc(sizeof(HashTable));
|
||||
zend_hash_init(CG(current_import_const), 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
}
|
||||
|
||||
zend_do_use_non_class(ns_name, new_name, is_global, 0, 1, CG(current_import_const), &CG(const_filenames) TSRMLS_CC);
|
||||
zend_do_use_non_class(ns_name, new_name, 0, 1, CG(current_import_const), &CG(const_filenames) TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+4
-4
@@ -651,10 +651,10 @@ void zend_do_build_namespace_name(znode *result, znode *prefix, znode *name TSRM
|
||||
void zend_do_begin_namespace(const znode *name, zend_bool with_brackets TSRMLS_DC);
|
||||
void zend_do_end_namespace(TSRMLS_D);
|
||||
void zend_verify_namespace(TSRMLS_D);
|
||||
void zend_do_use(znode *name, znode *new_name, int is_global TSRMLS_DC);
|
||||
void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC);
|
||||
void zend_do_use_function(znode *name, znode *new_name, int is_global TSRMLS_DC);
|
||||
void zend_do_use_const(znode *name, znode *new_name, int is_global TSRMLS_DC);
|
||||
void zend_do_use(znode *name, znode *new_name TSRMLS_DC);
|
||||
void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC);
|
||||
void zend_do_use_function(znode *name, znode *new_name TSRMLS_DC);
|
||||
void zend_do_use_const(znode *name, znode *new_name TSRMLS_DC);
|
||||
void zend_do_end_compilation(TSRMLS_D);
|
||||
void zend_do_constant_expression(znode *result, zend_ast *ast TSRMLS_DC);
|
||||
|
||||
|
||||
+47
-10
@@ -36,16 +36,24 @@ ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
|
||||
|
||||
void zend_exception_set_previous(zval *exception, zval *add_previous TSRMLS_DC)
|
||||
{
|
||||
zval *previous;
|
||||
zval *previous, *ancestor;
|
||||
|
||||
if (exception == add_previous || !add_previous || !exception) {
|
||||
return;
|
||||
}
|
||||
if (Z_TYPE_P(add_previous) != IS_OBJECT && !instanceof_function(Z_OBJCE_P(add_previous), default_exception_ce TSRMLS_CC)) {
|
||||
if (Z_TYPE_P(add_previous) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(add_previous), default_exception_ce TSRMLS_CC)) {
|
||||
zend_error(E_ERROR, "Cannot set non exception as previous exception");
|
||||
return;
|
||||
}
|
||||
while (exception && exception != add_previous && Z_OBJ_HANDLE_P(exception) != Z_OBJ_HANDLE_P(add_previous)) {
|
||||
ancestor = zend_read_property(default_exception_ce, add_previous, "previous", sizeof("previous")-1, 1 TSRMLS_CC);
|
||||
while (Z_TYPE_P(ancestor) == IS_OBJECT) {
|
||||
if (Z_OBJ_HANDLE_P(ancestor) == Z_OBJ_HANDLE_P(exception)) {
|
||||
zval_ptr_dtor(&add_previous);
|
||||
return;
|
||||
}
|
||||
ancestor = zend_read_property(default_exception_ce, ancestor, "previous", sizeof("previous")-1, 1 TSRMLS_CC);
|
||||
}
|
||||
previous = zend_read_property(default_exception_ce, exception, "previous", sizeof("previous")-1, 1 TSRMLS_CC);
|
||||
if (Z_TYPE_P(previous) == IS_NULL) {
|
||||
zend_update_property(default_exception_ce, exception, "previous", sizeof("previous")-1, add_previous TSRMLS_CC);
|
||||
@@ -218,6 +226,32 @@ ZEND_METHOD(exception, __construct)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto Exception::__wakeup()
|
||||
Exception unserialize checks */
|
||||
#define CHECK_EXC_TYPE(name, type) \
|
||||
value = zend_read_property(default_exception_ce, object, name, sizeof(name)-1, 0 TSRMLS_CC); \
|
||||
if(value && Z_TYPE_P(value) != type) { \
|
||||
zval *tmp; \
|
||||
MAKE_STD_ZVAL(tmp); \
|
||||
ZVAL_STRINGL(tmp, name, sizeof(name)-1, 1); \
|
||||
Z_OBJ_HANDLER_P(object, unset_property)(object, tmp, 0 TSRMLS_CC); \
|
||||
zval_ptr_dtor(&tmp); \
|
||||
}
|
||||
|
||||
ZEND_METHOD(exception, __wakeup)
|
||||
{
|
||||
zval *value;
|
||||
zval *object = getThis();
|
||||
CHECK_EXC_TYPE("message", IS_STRING);
|
||||
CHECK_EXC_TYPE("string", IS_STRING);
|
||||
CHECK_EXC_TYPE("code", IS_LONG);
|
||||
CHECK_EXC_TYPE("file", IS_STRING);
|
||||
CHECK_EXC_TYPE("line", IS_LONG);
|
||||
CHECK_EXC_TYPE("trace", IS_ARRAY);
|
||||
CHECK_EXC_TYPE("previous", IS_OBJECT);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno [, Exception previous]]])
|
||||
ErrorException constructor */
|
||||
ZEND_METHOD(error_exception, __construct)
|
||||
@@ -586,9 +620,9 @@ ZEND_METHOD(exception, getTraceAsString)
|
||||
int res_len = 0, *len = &res_len, num = 0;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
|
||||
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
|
||||
if(Z_TYPE_P(trace) != IS_ARRAY) {
|
||||
if (Z_TYPE_P(trace) != IS_ARRAY) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -602,8 +636,8 @@ ZEND_METHOD(exception, getTraceAsString)
|
||||
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
|
||||
efree(s_tmp);
|
||||
|
||||
res[res_len] = '\0';
|
||||
RETURN_STRINGL(res, res_len, 0);
|
||||
res[res_len] = '\0';
|
||||
RETURN_STRINGL(res, res_len, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -618,6 +652,7 @@ ZEND_METHOD(exception, getPrevious)
|
||||
previous = zend_read_property(default_exception_ce, getThis(), "previous", sizeof("previous")-1, 1 TSRMLS_CC);
|
||||
RETURN_ZVAL(previous, 1, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ */
|
||||
{
|
||||
@@ -640,15 +675,15 @@ ZEND_METHOD(exception, __toString)
|
||||
int len = 0;
|
||||
zend_fcall_info fci;
|
||||
zval fname;
|
||||
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
|
||||
str = estrndup("", 0);
|
||||
|
||||
exception = getThis();
|
||||
ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1, 1);
|
||||
|
||||
while (exception && Z_TYPE_P(exception) == IS_OBJECT) {
|
||||
while (exception && Z_TYPE_P(exception) == IS_OBJECT && instanceof_function(Z_OBJCE_P(exception), default_exception_ce TSRMLS_CC)) {
|
||||
prev_str = str;
|
||||
_default_exception_get_entry(exception, "message", sizeof("message")-1, &message TSRMLS_CC);
|
||||
_default_exception_get_entry(exception, "file", sizeof("file")-1, &file TSRMLS_CC);
|
||||
@@ -658,6 +693,7 @@ ZEND_METHOD(exception, __toString)
|
||||
convert_to_string(&file);
|
||||
convert_to_long(&line);
|
||||
|
||||
trace = NULL;
|
||||
fci.size = sizeof(fci);
|
||||
fci.function_table = &Z_OBJCE_P(exception)->function_table;
|
||||
fci.function_name = &fname;
|
||||
@@ -670,7 +706,7 @@ ZEND_METHOD(exception, __toString)
|
||||
|
||||
zend_call_function(&fci, NULL TSRMLS_CC);
|
||||
|
||||
if (Z_TYPE_P(trace) != IS_STRING) {
|
||||
if (trace && Z_TYPE_P(trace) != IS_STRING) {
|
||||
zval_ptr_dtor(&trace);
|
||||
trace = NULL;
|
||||
}
|
||||
@@ -727,6 +763,7 @@ ZEND_END_ARG_INFO()
|
||||
const static zend_function_entry default_exception_functions[] = {
|
||||
ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
|
||||
ZEND_ME(exception, __construct, arginfo_exception___construct, ZEND_ACC_PUBLIC)
|
||||
ZEND_ME(exception, __wakeup, NULL, ZEND_ACC_PUBLIC)
|
||||
ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
|
||||
ZEND_ME(exception, getCode, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
|
||||
ZEND_ME(exception, getFile, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
|
||||
|
||||
@@ -1585,6 +1585,10 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
|
||||
ex->symbol_table = EG(active_symbol_table);
|
||||
for (i = 0; i < ex->op_array->last_var; i++) {
|
||||
if (*EX_CV_NUM(ex, i)) {
|
||||
if (UNEXPECTED(**EX_CV_NUM(ex, i) == &EG(uninitialized_zval))) {
|
||||
Z_DELREF(EG(uninitialized_zval));
|
||||
ALLOC_INIT_ZVAL(**EX_CV_NUM(ex, i));
|
||||
}
|
||||
zend_hash_quick_update(EG(active_symbol_table),
|
||||
ex->op_array->vars[i].name,
|
||||
ex->op_array->vars[i].name_len + 1,
|
||||
|
||||
+2
-7
@@ -147,8 +147,6 @@ ZEND_API void gc_zval_possible_root(zval *zv TSRMLS_DC)
|
||||
GC_BENCH_INC(zval_possible_root);
|
||||
|
||||
if (GC_ZVAL_GET_COLOR(zv) != GC_PURPLE) {
|
||||
GC_ZVAL_SET_PURPLE(zv);
|
||||
|
||||
if (!GC_ZVAL_ADDRESS(zv)) {
|
||||
gc_root_buffer *newRoot = GC_G(unused);
|
||||
|
||||
@@ -159,7 +157,6 @@ ZEND_API void gc_zval_possible_root(zval *zv TSRMLS_DC)
|
||||
GC_G(first_unused)++;
|
||||
} else {
|
||||
if (!GC_G(gc_enabled)) {
|
||||
GC_ZVAL_SET_BLACK(zv);
|
||||
return;
|
||||
}
|
||||
zv->refcount__gc++;
|
||||
@@ -169,10 +166,10 @@ ZEND_API void gc_zval_possible_root(zval *zv TSRMLS_DC)
|
||||
if (!newRoot) {
|
||||
return;
|
||||
}
|
||||
GC_ZVAL_SET_PURPLE(zv);
|
||||
GC_G(unused) = newRoot->prev;
|
||||
}
|
||||
|
||||
GC_ZVAL_SET_PURPLE(zv);
|
||||
newRoot->next = GC_G(roots).next;
|
||||
newRoot->prev = &GC_G(roots);
|
||||
GC_G(roots).next->prev = newRoot;
|
||||
@@ -203,7 +200,6 @@ ZEND_API void gc_zobj_possible_root(zval *zv TSRMLS_DC)
|
||||
|
||||
obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zv)].bucket.obj;
|
||||
if (GC_GET_COLOR(obj->buffered) != GC_PURPLE) {
|
||||
GC_SET_PURPLE(obj->buffered);
|
||||
if (!GC_ADDRESS(obj->buffered)) {
|
||||
gc_root_buffer *newRoot = GC_G(unused);
|
||||
|
||||
@@ -214,7 +210,6 @@ ZEND_API void gc_zobj_possible_root(zval *zv TSRMLS_DC)
|
||||
GC_G(first_unused)++;
|
||||
} else {
|
||||
if (!GC_G(gc_enabled)) {
|
||||
GC_ZVAL_SET_BLACK(zv);
|
||||
return;
|
||||
}
|
||||
zv->refcount__gc++;
|
||||
@@ -225,10 +220,10 @@ ZEND_API void gc_zobj_possible_root(zval *zv TSRMLS_DC)
|
||||
return;
|
||||
}
|
||||
obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zv)].bucket.obj;
|
||||
GC_SET_PURPLE(obj->buffered);
|
||||
GC_G(unused) = newRoot->prev;
|
||||
}
|
||||
|
||||
GC_SET_PURPLE(obj->buffered);
|
||||
newRoot->next = GC_G(roots).next;
|
||||
newRoot->prev = &GC_G(roots);
|
||||
GC_G(roots).next->prev = newRoot;
|
||||
|
||||
@@ -198,6 +198,9 @@ static void zend_generator_dtor_storage(zend_generator *generator, zend_object_h
|
||||
if (finally_op_num) {
|
||||
ex->opline = &ex->op_array->opcodes[finally_op_num];
|
||||
ex->fast_ret = NULL;
|
||||
ex->delayed_exception = EG(exception);
|
||||
EG(exception) = NULL;
|
||||
|
||||
generator->flags |= ZEND_GENERATOR_FORCED_CLOSE;
|
||||
zend_generator_resume(generator TSRMLS_CC);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1446,11 +1446,10 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
|
||||
}
|
||||
if (ordered) {
|
||||
if (p1->nKeyLength==0 && p2->nKeyLength==0) { /* numeric indices */
|
||||
result = p1->h - p2->h;
|
||||
if (result!=0) {
|
||||
if (p1->h != p2->h) {
|
||||
HASH_UNPROTECT_RECURSION(ht1);
|
||||
HASH_UNPROTECT_RECURSION(ht2);
|
||||
return result;
|
||||
return p1->h > p2->h ? 1 : -1;
|
||||
}
|
||||
} else { /* string indices */
|
||||
result = p1->nKeyLength - p2->nKeyLength;
|
||||
|
||||
+18
-3
@@ -108,7 +108,18 @@ static void zend_ini_init_string(zval *result)
|
||||
*/
|
||||
static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
|
||||
int length;
|
||||
|
||||
if (Z_TYPE_P(op1) != IS_STRING) {
|
||||
zval copy;
|
||||
MAKE_COPY_ZVAL(&op1, ©);
|
||||
convert_to_string(©);
|
||||
Z_STRVAL_P(op1) = zend_strndup(Z_STRVAL(copy), Z_STRLEN(copy));
|
||||
Z_STRLEN_P(op1) = Z_STRLEN(copy);
|
||||
zval_dtor(©);
|
||||
}
|
||||
|
||||
length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
|
||||
|
||||
Z_STRVAL_P(result) = (char *) realloc(Z_STRVAL_P(op1), length+1);
|
||||
memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
|
||||
@@ -213,7 +224,7 @@ ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_erro
|
||||
zend_file_handle_dtor(fh TSRMLS_CC);
|
||||
|
||||
shutdown_ini_scanner(TSRMLS_C);
|
||||
|
||||
|
||||
if (retval == 0) {
|
||||
return SUCCESS;
|
||||
} else {
|
||||
@@ -303,7 +314,11 @@ statement:
|
||||
#endif
|
||||
ZEND_INI_PARSER_CB(&$1, &$5, &$2, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
|
||||
free(Z_STRVAL($1));
|
||||
free(Z_STRVAL($2));
|
||||
if (Z_TYPE($2) == IS_STRING) {
|
||||
free(Z_STRVAL($2));
|
||||
} else {
|
||||
zval_dtor(&$2);
|
||||
}
|
||||
zval_internal_dtor(&$5);
|
||||
}
|
||||
| TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC); free(Z_STRVAL($1)); }
|
||||
|
||||
+2094
-2093
File diff suppressed because it is too large.
Load diff
@@ -108,7 +108,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yytext[0]) { \
|
||||
while (yyleng) { \
|
||||
if (yytext[0] == ' ' || yytext[0] == '\t') { \
|
||||
SCNG(yy_text)++; \
|
||||
yyleng--; \
|
||||
@@ -119,7 +119,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat trailing whitespace + extra char */
|
||||
#define EAT_TRAILING_WHITESPACE_EX(ch) \
|
||||
while (yyleng > 0 && ( \
|
||||
while (yyleng && ( \
|
||||
(ch != 'X' && yytext[yyleng - 1] == ch) || \
|
||||
yytext[yyleng - 1] == '\n' || \
|
||||
yytext[yyleng - 1] == '\r' || \
|
||||
@@ -523,7 +523,7 @@ end_raw_value_chars:
|
||||
}
|
||||
|
||||
/* Eat leading and trailing double quotes */
|
||||
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
|
||||
if (yyleng > 1 && yytext[0] == '"' && yytext[yyleng - 1] == '"') {
|
||||
SCNG(yy_text)++;
|
||||
yyleng = yyleng - 2;
|
||||
} else if (sc) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycINITIAL,
|
||||
yycST_OFFSET,
|
||||
yycST_SECTION_VALUE,
|
||||
yycST_VALUE,
|
||||
yycST_SECTION_RAW,
|
||||
yycST_DOUBLE_QUOTES,
|
||||
yycST_VARNAME,
|
||||
yycST_RAW,
|
||||
};
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycINITIAL,
|
||||
yycST_OFFSET,
|
||||
yycST_SECTION_VALUE,
|
||||
yycST_VALUE,
|
||||
yycST_SECTION_RAW,
|
||||
yycST_DOUBLE_QUOTES,
|
||||
yycST_VARNAME,
|
||||
yycST_RAW,
|
||||
};
|
||||
+12
-12
@@ -255,10 +255,10 @@ use_declarations:
|
||||
;
|
||||
|
||||
use_declaration:
|
||||
namespace_name { zend_do_use(&$1, NULL, 0 TSRMLS_CC); }
|
||||
| namespace_name T_AS T_STRING { zend_do_use(&$1, &$3, 0 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name { zend_do_use(&$2, NULL, 1 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use(&$2, &$4, 1 TSRMLS_CC); }
|
||||
namespace_name { zend_do_use(&$1, NULL TSRMLS_CC); }
|
||||
| namespace_name T_AS T_STRING { zend_do_use(&$1, &$3 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name { zend_do_use(&$2, NULL TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use(&$2, &$4 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
use_function_declarations:
|
||||
@@ -267,10 +267,10 @@ use_function_declarations:
|
||||
;
|
||||
|
||||
use_function_declaration:
|
||||
namespace_name { zend_do_use_function(&$1, NULL, 0 TSRMLS_CC); }
|
||||
| namespace_name T_AS T_STRING { zend_do_use_function(&$1, &$3, 0 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name { zend_do_use_function(&$2, NULL, 1 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_function(&$2, &$4, 1 TSRMLS_CC); }
|
||||
namespace_name { zend_do_use_function(&$1, NULL TSRMLS_CC); }
|
||||
| namespace_name T_AS T_STRING { zend_do_use_function(&$1, &$3 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name { zend_do_use_function(&$2, NULL TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_function(&$2, &$4 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
use_const_declarations:
|
||||
@@ -279,10 +279,10 @@ use_const_declarations:
|
||||
;
|
||||
|
||||
use_const_declaration:
|
||||
namespace_name { zend_do_use_const(&$1, NULL, 0 TSRMLS_CC); }
|
||||
| namespace_name T_AS T_STRING { zend_do_use_const(&$1, &$3, 0 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name { zend_do_use_const(&$2, NULL, 1 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_const(&$2, &$4, 1 TSRMLS_CC); }
|
||||
namespace_name { zend_do_use_const(&$1, NULL TSRMLS_CC); }
|
||||
| namespace_name T_AS T_STRING { zend_do_use_const(&$1, &$3 TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name { zend_do_use_const(&$2, NULL TSRMLS_CC); }
|
||||
| T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_const(&$2, &$4 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
constant_declaration:
|
||||
|
||||
+7
-7
@@ -162,16 +162,16 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
|
||||
zend_hash_apply(&ce->function_table, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC);
|
||||
}
|
||||
if (ce->static_members_table) {
|
||||
zval **static_members = ce->static_members_table;
|
||||
int count = ce->default_static_members_count;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ce->default_static_members_count; i++) {
|
||||
if (ce->static_members_table[i]) {
|
||||
zval *p = ce->static_members_table[i];
|
||||
ce->static_members_table[i] = NULL;
|
||||
zval_ptr_dtor(&p);
|
||||
}
|
||||
ce->default_static_members_count = 0;
|
||||
ce->default_static_members_table = ce->static_members_table = NULL;
|
||||
for (i = 0; i < count; i++) {
|
||||
zval_ptr_dtor(&static_members[i]);
|
||||
}
|
||||
ce->static_members_table = NULL;
|
||||
efree(static_members);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1456,14 +1456,19 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
|
||||
zend_error(E_ERROR, "String size overflow");
|
||||
}
|
||||
|
||||
Z_STRVAL_P(result) = erealloc(Z_STRVAL_P(result), res_len+1);
|
||||
Z_STRVAL_P(result) = safe_erealloc(Z_STRVAL_P(result), res_len, 1, 1);
|
||||
|
||||
memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(result), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
|
||||
Z_STRVAL_P(result)[res_len]=0;
|
||||
Z_STRLEN_P(result) = res_len;
|
||||
} else {
|
||||
int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
|
||||
char *buf = (char *) emalloc(length + 1);
|
||||
char *buf;
|
||||
|
||||
if (Z_STRLEN_P(op1) < 0 || Z_STRLEN_P(op2) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) {
|
||||
zend_error(E_ERROR, "String size overflow");
|
||||
}
|
||||
buf = (char *) safe_emalloc(length, 1, 1);
|
||||
|
||||
memcpy(buf, Z_STRVAL_P(op1), Z_STRLEN_P(op1));
|
||||
memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
|
||||
|
||||
@@ -261,7 +261,7 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){
|
||||
}
|
||||
|
||||
dwRet = pGetFinalPathNameByHandle(hFile, target, MAXPATHLEN, VOLUME_NAME_DOS);
|
||||
if(dwRet >= MAXPATHLEN) {
|
||||
if(dwRet >= MAXPATHLEN || dwRet == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+20
-15
@@ -1753,7 +1753,9 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
|
||||
}
|
||||
}
|
||||
|
||||
FREE_OP1_VAR_PTR();
|
||||
if (OP1_TYPE == IS_VAR && OP1_FREE) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
FREE_OP2_IF_VAR();
|
||||
@@ -1772,6 +1774,10 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
|
||||
SAVE_OPLINE();
|
||||
value_ptr_ptr = GET_OP2_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
if (OP2_TYPE == IS_VAR &&
|
||||
value_ptr_ptr &&
|
||||
!Z_ISREF_PP(value_ptr_ptr) &&
|
||||
@@ -1789,9 +1795,6 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
|
||||
} else if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
|
||||
PZVAL_LOCK(*value_ptr_ptr);
|
||||
}
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
if ((OP2_TYPE == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
|
||||
@@ -1887,7 +1890,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -1995,13 +1998,12 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
EX_T(opline->result.var).var.ptr = NULL;
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
EG(active_symbol_table) = NULL;
|
||||
EG(active_op_array) = &fbc->op_array;
|
||||
EG(return_value_ptr_ptr) = NULL;
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
ret->var.ptr = NULL;
|
||||
EG(return_value_ptr_ptr) = &ret->var.ptr;
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
@@ -2010,7 +2012,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
|
||||
if (UNEXPECTED((EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
EX_T(opline->result.var).var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC);
|
||||
ret->var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC);
|
||||
ret->var.fcall_returned_reference = 0;
|
||||
}
|
||||
} else if (EXPECTED(zend_execute_ex == execute_ex)) {
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
@@ -2075,7 +2078,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -5425,7 +5428,6 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_function *op_array;
|
||||
int closure_is_static, closure_is_being_defined_inside_static_context;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
@@ -5434,9 +5436,9 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
|
||||
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
|
||||
}
|
||||
|
||||
closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC;
|
||||
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC;
|
||||
if (closure_is_static || closure_is_being_defined_inside_static_context) {
|
||||
if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) ||
|
||||
(EX(prev_execute_data) &&
|
||||
EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC);
|
||||
@@ -5649,8 +5651,11 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
|
||||
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
EX(fast_ret) = opline;
|
||||
EX(delayed_exception) = NULL;
|
||||
if (UNEXPECTED(EX(delayed_exception) != NULL)) {
|
||||
EX(fast_ret) = NULL;
|
||||
} else {
|
||||
EX(fast_ret) = opline;
|
||||
}
|
||||
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
|
||||
+57
-27
@@ -459,7 +459,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -567,13 +567,12 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
EX_T(opline->result.var).var.ptr = NULL;
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
EG(active_symbol_table) = NULL;
|
||||
EG(active_op_array) = &fbc->op_array;
|
||||
EG(return_value_ptr_ptr) = NULL;
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
ret->var.ptr = NULL;
|
||||
EG(return_value_ptr_ptr) = &ret->var.ptr;
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
@@ -582,7 +581,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
|
||||
if (UNEXPECTED((EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
EX_T(opline->result.var).var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC);
|
||||
ret->var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC);
|
||||
ret->var.fcall_returned_reference = 0;
|
||||
}
|
||||
} else if (EXPECTED(zend_execute_ex == execute_ex)) {
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
@@ -647,7 +647,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -1354,8 +1354,11 @@ static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
EX(fast_ret) = opline;
|
||||
EX(delayed_exception) = NULL;
|
||||
if (UNEXPECTED(EX(delayed_exception) != NULL)) {
|
||||
EX(fast_ret) = NULL;
|
||||
} else {
|
||||
EX(fast_ret) = opline;
|
||||
}
|
||||
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
@@ -6801,7 +6804,6 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_function *op_array;
|
||||
int closure_is_static, closure_is_being_defined_inside_static_context;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
@@ -6810,9 +6812,9 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
|
||||
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
|
||||
}
|
||||
|
||||
closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC;
|
||||
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC;
|
||||
if (closure_is_static || closure_is_being_defined_inside_static_context) {
|
||||
if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) ||
|
||||
(EX(prev_execute_data) &&
|
||||
EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC);
|
||||
@@ -15693,7 +15695,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
|
||||
}
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL)) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
|
||||
@@ -18044,7 +18048,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
}
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL)) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
|
||||
@@ -20304,7 +20310,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
}
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL)) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
zval_ptr_dtor_nogc(&free_op2.var);
|
||||
@@ -20323,6 +20331,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
|
||||
SAVE_OPLINE();
|
||||
value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
if (IS_VAR == IS_VAR &&
|
||||
value_ptr_ptr &&
|
||||
!Z_ISREF_PP(value_ptr_ptr) &&
|
||||
@@ -20340,9 +20352,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
|
||||
} else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
|
||||
PZVAL_LOCK(*value_ptr_ptr);
|
||||
}
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
|
||||
if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
|
||||
@@ -23773,7 +23782,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
|
||||
}
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL)) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
|
||||
@@ -23791,6 +23802,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
|
||||
SAVE_OPLINE();
|
||||
value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op2.var TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR &&
|
||||
value_ptr_ptr &&
|
||||
!Z_ISREF_PP(value_ptr_ptr) &&
|
||||
@@ -23808,9 +23823,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
|
||||
PZVAL_LOCK(*value_ptr_ptr);
|
||||
}
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
|
||||
if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
|
||||
@@ -33212,6 +33224,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR && 0) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
@@ -35332,6 +35348,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR && 0) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
@@ -37453,6 +37473,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR && 0) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
zval_ptr_dtor_nogc(&free_op2.var);
|
||||
|
||||
@@ -37470,6 +37494,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
SAVE_OPLINE();
|
||||
value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
if (IS_VAR == IS_VAR &&
|
||||
value_ptr_ptr &&
|
||||
!Z_ISREF_PP(value_ptr_ptr) &&
|
||||
@@ -37487,9 +37515,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
|
||||
PZVAL_LOCK(*value_ptr_ptr);
|
||||
}
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
|
||||
if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
|
||||
@@ -40633,6 +40658,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR && 0) {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
}
|
||||
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
@@ -40649,6 +40678,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
SAVE_OPLINE();
|
||||
value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op2.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR &&
|
||||
value_ptr_ptr &&
|
||||
!Z_ISREF_PP(value_ptr_ptr) &&
|
||||
@@ -40666,9 +40699,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
} else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
|
||||
PZVAL_LOCK(*value_ptr_ptr);
|
||||
}
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
|
||||
}
|
||||
|
||||
variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
|
||||
if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
|
||||
|
||||
Vendored
+2
-2
@@ -1545,7 +1545,7 @@ freebsd* | dragonfly*)
|
||||
objformat=`/usr/bin/objformat`
|
||||
else
|
||||
case $host_os in
|
||||
freebsd[[123]]*) objformat=aout ;;
|
||||
freebsd[[123]].*) objformat=aout ;;
|
||||
*) objformat=elf ;;
|
||||
esac
|
||||
fi
|
||||
@@ -3162,7 +3162,7 @@ case $host_os in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
freebsd[[12]]*)
|
||||
freebsd[[12]].*)
|
||||
# C++ shared libraries reported to be fairly broken before switch to ELF
|
||||
_LT_AC_TAGVAR(ld_shlibs, $1)=no
|
||||
;;
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=6
|
||||
PHP_RELEASE_VERSION=8
|
||||
PHP_RELEASE_VERSION=17
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -10,6 +10,7 @@ ADD_FLAG('CFLAGS_DATE', "/wd4244");
|
||||
var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
|
||||
tl_config.WriteLine("#include \"config.w32.h\"");
|
||||
tl_config.WriteLine("#include <php_stdint.h>");
|
||||
tl_config.WriteLine("#include \"win32/php_inttypes.h\"");
|
||||
tl_config.WriteLine("#define TIMELIB_OMIT_STDINT 1");
|
||||
tl_config.Close();
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Derick Rethans
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,7 +0,0 @@
|
||||
Regenerating Parser
|
||||
===================
|
||||
|
||||
Make sure you use re2c 0.9.10 or higher:
|
||||
|
||||
re2c -d -b -o ext/date/lib/parse_date.c ext/date/lib/parse_date.re
|
||||
re2c -d -b -o ext/date/lib/parse_iso_intervals.c ext/date/lib/parse_iso_intervals.re
|
||||
@@ -0,0 +1,8 @@
|
||||
timelib
|
||||
=======
|
||||
|
||||
Timelib is a timezone and date/time library that can calculate local time,
|
||||
convert between timezones and parse textual descriptions of date/time
|
||||
information.
|
||||
|
||||
It is the library supporting PHP's Date/Time extension.
|
||||
+50
-45
@@ -1,26 +1,31 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
| Algorithms are taken from a public domain source by Paul |
|
||||
| Schlyter, who wrote this in December 1992 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "timelib.h"
|
||||
@@ -115,7 +120,7 @@ static double astro_GMST0(double d)
|
||||
/* time, imposing no runtime or code overhead. */
|
||||
sidtim0 = astro_revolution((180.0 + 356.0470 + 282.9404) + (0.9856002585 + 4.70935E-5) * d);
|
||||
return sidtim0;
|
||||
}
|
||||
}
|
||||
|
||||
/* This function computes the Sun's position at any instant */
|
||||
|
||||
@@ -177,32 +182,32 @@ static void astro_sun_RA_dec(double d, double *RA, double *dec, double *r)
|
||||
|
||||
/**
|
||||
* Note: timestamp = unixtimestamp (NEEDS to be 00:00:00 UT)
|
||||
* Eastern longitude positive, Western longitude negative
|
||||
* Northern latitude positive, Southern latitude negative
|
||||
* The longitude value IS critical in this function!
|
||||
* altit = the altitude which the Sun should cross
|
||||
* Set to -35/60 degrees for rise/set, -6 degrees
|
||||
* for civil, -12 degrees for nautical and -18
|
||||
* degrees for astronomical twilight.
|
||||
* upper_limb: non-zero -> upper limb, zero -> center
|
||||
* Set to non-zero (e.g. 1) when computing rise/set
|
||||
* times, and to zero when computing start/end of
|
||||
* twilight.
|
||||
* *rise = where to store the rise time
|
||||
* *set = where to store the set time
|
||||
* Both times are relative to the specified altitude,
|
||||
* and thus this function can be used to compute
|
||||
* various twilight times, as well as rise/set times
|
||||
* Return value: 0 = sun rises/sets this day, times stored at
|
||||
* *trise and *tset.
|
||||
* +1 = sun above the specified "horizon" 24 hours.
|
||||
* *trise set to time when the sun is at south,
|
||||
* minus 12 hours while *tset is set to the south
|
||||
* time plus 12 hours. "Day" length = 24 hours
|
||||
* -1 = sun is below the specified "horizon" 24 hours
|
||||
* "Day" length = 0 hours, *trise and *tset are
|
||||
* both set to the time when the sun is at south.
|
||||
*
|
||||
* Eastern longitude positive, Western longitude negative
|
||||
* Northern latitude positive, Southern latitude negative
|
||||
* The longitude value IS critical in this function!
|
||||
* altit = the altitude which the Sun should cross
|
||||
* Set to -35/60 degrees for rise/set, -6 degrees
|
||||
* for civil, -12 degrees for nautical and -18
|
||||
* degrees for astronomical twilight.
|
||||
* upper_limb: non-zero -> upper limb, zero -> center
|
||||
* Set to non-zero (e.g. 1) when computing rise/set
|
||||
* times, and to zero when computing start/end of
|
||||
* twilight.
|
||||
* *rise = where to store the rise time
|
||||
* *set = where to store the set time
|
||||
* Both times are relative to the specified altitude,
|
||||
* and thus this function can be used to compute
|
||||
* various twilight times, as well as rise/set times
|
||||
* Return value: 0 = sun rises/sets this day, times stored at
|
||||
* *trise and *tset.
|
||||
* +1 = sun above the specified "horizon" 24 hours.
|
||||
* *trise set to time when the sun is at south,
|
||||
* minus 12 hours while *tset is set to the south
|
||||
* time plus 12 hours. "Day" length = 24 hours
|
||||
* -1 = sun is below the specified "horizon" 24 hours
|
||||
* "Day" length = 0 hours, *trise and *tset are
|
||||
* both set to the time when the sun is at south.
|
||||
*
|
||||
*/
|
||||
int timelib_astro_rise_set_altitude(timelib_time *t_loc, double lon, double lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll *ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,27 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* This macro computes the length of the day, from sunrise to sunset. */
|
||||
/* Sunrise/set is considered to occur when the Sun's upper limb is */
|
||||
/* 35 arc minutes below the horizon (this accounts for the refraction */
|
||||
|
||||
+22
-18
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "timelib.h"
|
||||
|
||||
static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
|
||||
@@ -136,7 +140,7 @@ void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, time
|
||||
timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d)
|
||||
{
|
||||
timelib_sll dow, day;
|
||||
|
||||
|
||||
/* Figure out the dayofweek for y-1-1 */
|
||||
dow = timelib_day_of_week(y, 1, 1);
|
||||
/* then use that to figure out the offset for day 1 of week 1 */
|
||||
|
||||
+21
-17
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "timelib.h"
|
||||
#include <math.h>
|
||||
|
||||
|
||||
+173
-167
File diff suppressed because it is too large.
Load diff
+76
-70
@@ -1,19 +1,25 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -104,7 +110,7 @@ typedef unsigned char uchar;
|
||||
|
||||
#define RET(i) {s->cur = cursor; return i;}
|
||||
|
||||
#define timelib_string_free free
|
||||
#define timelib_string_free timelib_free
|
||||
|
||||
#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { add_error(s, "Double time specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } }
|
||||
#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; }
|
||||
@@ -316,7 +322,7 @@ uchar *fill(Scanner *s, uchar *cursor){
|
||||
s->lim -= cnt;
|
||||
}
|
||||
if((s->top - s->lim) < BSIZE){
|
||||
uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
|
||||
uchar *buf = (uchar*) timelib_malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
|
||||
memcpy(buf, s->tok, s->lim - s->tok);
|
||||
s->tok = buf;
|
||||
s->ptr = &buf[s->ptr - s->bot];
|
||||
@@ -324,7 +330,7 @@ uchar *fill(Scanner *s, uchar *cursor){
|
||||
s->pos = &buf[s->pos - s->bot];
|
||||
s->lim = &buf[s->lim - s->bot];
|
||||
s->top = &s->lim[BSIZE];
|
||||
free(s->bot);
|
||||
timelib_free(s->bot);
|
||||
s->bot = buf;
|
||||
}
|
||||
if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){
|
||||
@@ -339,37 +345,37 @@ uchar *fill(Scanner *s, uchar *cursor){
|
||||
static void add_warning(Scanner *s, char *error)
|
||||
{
|
||||
s->errors->warning_count++;
|
||||
s->errors->warning_messages = realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages = timelib_realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].position = s->tok ? s->tok - s->str : 0;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].character = s->tok ? *s->tok : 0;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = strdup(error);
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static void add_error(Scanner *s, char *error)
|
||||
{
|
||||
s->errors->error_count++;
|
||||
s->errors->error_messages = realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages = timelib_realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages[s->errors->error_count - 1].position = s->tok ? s->tok - s->str : 0;
|
||||
s->errors->error_messages[s->errors->error_count - 1].character = s->tok ? *s->tok : 0;
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = strdup(error);
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static void add_pbf_warning(Scanner *s, char *error, char *sptr, char *cptr)
|
||||
{
|
||||
s->errors->warning_count++;
|
||||
s->errors->warning_messages = realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages = timelib_realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].position = cptr - sptr;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].character = *cptr;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = strdup(error);
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static void add_pbf_error(Scanner *s, char *error, char *sptr, char *cptr)
|
||||
{
|
||||
s->errors->error_count++;
|
||||
s->errors->error_messages = realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages = timelib_realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages[s->errors->error_count - 1].position = cptr - sptr;
|
||||
s->errors->error_messages[s->errors->error_count - 1].character = *cptr;
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = strdup(error);
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
|
||||
@@ -433,7 +439,7 @@ static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
|
||||
|
||||
static char *timelib_string(Scanner *s)
|
||||
{
|
||||
char *tmp = calloc(1, s->cur - s->tok + 1);
|
||||
char *tmp = timelib_calloc(1, s->cur - s->tok + 1);
|
||||
memcpy(tmp, s->tok, s->cur - s->tok);
|
||||
|
||||
return tmp;
|
||||
@@ -460,10 +466,10 @@ static timelib_sll timelib_get_nr_ex(char **ptr, int max_length, int *scanned_le
|
||||
if (scanned_length) {
|
||||
*scanned_length = end - begin;
|
||||
}
|
||||
str = calloc(1, end - begin + 1);
|
||||
str = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(str, begin, end - begin);
|
||||
tmp_nr = strtoll(str, NULL, 10);
|
||||
free(str);
|
||||
timelib_free(str);
|
||||
return tmp_nr;
|
||||
}
|
||||
|
||||
@@ -500,13 +506,13 @@ static double timelib_get_frac_nr(char **ptr, int max_length)
|
||||
++len;
|
||||
}
|
||||
end = *ptr;
|
||||
str = calloc(1, end - begin + 1);
|
||||
str = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(str, begin, end - begin);
|
||||
if (str[0] == ':') {
|
||||
str[0] = '.';
|
||||
}
|
||||
tmp_nr = strtod(str, NULL);
|
||||
free(str);
|
||||
timelib_free(str);
|
||||
return tmp_nr;
|
||||
}
|
||||
|
||||
@@ -542,7 +548,7 @@ static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
word = calloc(1, end - begin + 1);
|
||||
word = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_reltext_lookup; tp->name; tp++) {
|
||||
@@ -552,7 +558,7 @@ static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
|
||||
}
|
||||
}
|
||||
|
||||
free(word);
|
||||
timelib_free(word);
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -564,18 +570,18 @@ static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
|
||||
return timelib_lookup_relative_text(ptr, behavior);
|
||||
}
|
||||
|
||||
static long timelib_lookup_month(char **ptr)
|
||||
static timelib_long timelib_lookup_month(char **ptr)
|
||||
{
|
||||
char *word;
|
||||
char *begin = *ptr, *end;
|
||||
long value = 0;
|
||||
timelib_long value = 0;
|
||||
const timelib_lookup_table *tp;
|
||||
|
||||
while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
word = calloc(1, end - begin + 1);
|
||||
word = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_month_lookup; tp->name; tp++) {
|
||||
@@ -584,11 +590,11 @@ static long timelib_lookup_month(char **ptr)
|
||||
}
|
||||
}
|
||||
|
||||
free(word);
|
||||
timelib_free(word);
|
||||
return value;
|
||||
}
|
||||
|
||||
static long timelib_get_month(char **ptr)
|
||||
static timelib_long timelib_get_month(char **ptr)
|
||||
{
|
||||
while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
|
||||
++*ptr;
|
||||
@@ -622,7 +628,7 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
word = calloc(1, end - begin + 1);
|
||||
word = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_relunit_lookup; tp->name; tp++) {
|
||||
@@ -632,7 +638,7 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
}
|
||||
}
|
||||
|
||||
free(word);
|
||||
timelib_free(word);
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -668,7 +674,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
|
||||
}
|
||||
}
|
||||
|
||||
const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
|
||||
const static timelib_tz_lookup_table* abbr_search(const char *word, timelib_long gmtoffset, int isdst)
|
||||
{
|
||||
int first_found = 0;
|
||||
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
|
||||
@@ -677,7 +683,7 @@ const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffs
|
||||
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
|
||||
return timelib_timezone_utc;
|
||||
}
|
||||
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (!first_found) {
|
||||
@@ -706,18 +712,18 @@ const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffs
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
static timelib_long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
{
|
||||
char *word;
|
||||
char *begin = *ptr, *end;
|
||||
long value = 0;
|
||||
timelib_long value = 0;
|
||||
const timelib_tz_lookup_table *tp;
|
||||
|
||||
while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
word = calloc(1, end - begin + 1);
|
||||
word = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
if ((tp = abbr_search(word, -1, 0))) {
|
||||
@@ -733,10 +739,10 @@ static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found
|
||||
return value;
|
||||
}
|
||||
|
||||
long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
|
||||
timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
|
||||
{
|
||||
timelib_tzinfo *res;
|
||||
long retval = 0;
|
||||
timelib_long retval = 0;
|
||||
|
||||
*tz_not_found = 0;
|
||||
|
||||
@@ -764,7 +770,7 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
|
||||
retval = timelib_parse_tz_cor(ptr);
|
||||
} else {
|
||||
int found = 0;
|
||||
long offset = 0;
|
||||
timelib_long offset = 0;
|
||||
char *tz_abbr;
|
||||
|
||||
t->is_localtime = 1;
|
||||
@@ -784,7 +790,7 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
|
||||
found++;
|
||||
}
|
||||
}
|
||||
free(tz_abbr);
|
||||
timelib_free(tz_abbr);
|
||||
*tz_not_found = (found == 0);
|
||||
retval = offset;
|
||||
}
|
||||
@@ -797,10 +803,10 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
|
||||
#define timelib_split_free(arg) { \
|
||||
int i; \
|
||||
for (i = 0; i < arg.c; i++) { \
|
||||
free(arg.v[i]); \
|
||||
timelib_free(arg.v[i]); \
|
||||
} \
|
||||
if (arg.v) { \
|
||||
free(arg.v); \
|
||||
timelib_free(arg.v); \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -808,7 +814,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
{
|
||||
uchar *cursor = s->cur;
|
||||
char *str, *ptr = NULL;
|
||||
|
||||
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
@@ -871,7 +877,7 @@ iso8601normtz = 't'? hour24 [:.] minute [:.] secondlz space? (tzcorrection | tz
|
||||
|
||||
gnunocolon = 't'? hour24lz minutelz;
|
||||
/* gnunocolontz = hour24lz minutelz space? (tzcorrection | tz); */
|
||||
iso8601nocolon = 't'? hour24lz minutelz secondlz;
|
||||
iso8601nocolon = 't'? hour24lz minutelz secondlz;
|
||||
/* iso8601nocolontz = hour24lz minutelz secondlz space? (tzcorrection | tz); */
|
||||
|
||||
/* Date formats */
|
||||
@@ -1437,7 +1443,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
TIMELIB_HAVE_RELATIVE();
|
||||
|
||||
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
w = timelib_get_nr((char **) &ptr, 2);
|
||||
d = timelib_get_nr((char **) &ptr, 1);
|
||||
@@ -1456,7 +1462,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
TIMELIB_HAVE_RELATIVE();
|
||||
|
||||
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
w = timelib_get_nr((char **) &ptr, 2);
|
||||
d = 1;
|
||||
@@ -1560,7 +1566,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
if (s->time->relative.weekday_behavior != 2) {
|
||||
s->time->relative.weekday_behavior = 1;
|
||||
}
|
||||
|
||||
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
@@ -1721,14 +1727,14 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
/*!max:re2c */
|
||||
|
||||
timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
{
|
||||
Scanner in;
|
||||
int t;
|
||||
char *e = s + len - 1;
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.errors = malloc(sizeof(struct timelib_error_container));
|
||||
in.errors = timelib_malloc(sizeof(struct timelib_error_container));
|
||||
in.errors->warning_count = 0;
|
||||
in.errors->warning_messages = NULL;
|
||||
in.errors->error_count = 0;
|
||||
@@ -1756,7 +1762,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
||||
}
|
||||
e++;
|
||||
|
||||
in.str = malloc((e - s) + YYMAXFILL);
|
||||
in.str = timelib_malloc((e - s) + YYMAXFILL);
|
||||
memset(in.str, 0, (e - s) + YYMAXFILL);
|
||||
memcpy(in.str, s, (e - s));
|
||||
in.lim = in.str + (e - s) + YYMAXFILL;
|
||||
@@ -1792,7 +1798,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
||||
add_warning(&in, "The parsed date was invalid");
|
||||
}
|
||||
|
||||
free(in.str);
|
||||
timelib_free(in.str);
|
||||
if (errors) {
|
||||
*errors = in.errors;
|
||||
} else {
|
||||
@@ -1832,7 +1838,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time)
|
||||
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
|
||||
}
|
||||
|
||||
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
{
|
||||
char *fptr = format;
|
||||
char *ptr = string;
|
||||
@@ -1843,7 +1849,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
int allow_extra = 0;
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.errors = malloc(sizeof(struct timelib_error_container));
|
||||
in.errors = timelib_malloc(sizeof(struct timelib_error_container));
|
||||
in.errors->warning_count = 0;
|
||||
in.errors->warning_messages = NULL;
|
||||
in.errors->error_count = 0;
|
||||
@@ -1877,7 +1883,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
add_pbf_error(s, "A textual day could not be found", string, begin);
|
||||
break;
|
||||
} else {
|
||||
in.time->have_relative = 1;
|
||||
in.time->have_relative = 1;
|
||||
in.time->relative.have_weekday_relative = 1;
|
||||
in.time->relative.weekday = tmprel->multiplier;
|
||||
in.time->relative.weekday_behavior = 1;
|
||||
@@ -2148,13 +2154,13 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
|
||||
/* do funky checking whether the parsed time was valid time */
|
||||
if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
|
||||
s->time->s != TIMELIB_UNSET &&
|
||||
s->time->s != TIMELIB_UNSET &&
|
||||
!timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
|
||||
add_pbf_warning(s, "The parsed time was invalid", string, ptr);
|
||||
}
|
||||
/* do funky checking whether the parsed date was valid date */
|
||||
if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
|
||||
s->time->d != TIMELIB_UNSET &&
|
||||
s->time->d != TIMELIB_UNSET &&
|
||||
!timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
|
||||
add_pbf_warning(s, "The parsed date was invalid", string, ptr);
|
||||
}
|
||||
@@ -2186,14 +2192,14 @@ void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
|
||||
if (parsed->dst == TIMELIB_UNSET) parsed->dst = now->dst != TIMELIB_UNSET ? now->dst : 0;
|
||||
|
||||
if (!parsed->tz_abbr) {
|
||||
parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
|
||||
parsed->tz_abbr = now->tz_abbr ? timelib_strdup(now->tz_abbr) : NULL;
|
||||
}
|
||||
if (!parsed->tz_info) {
|
||||
parsed->tz_info = now->tz_info ? (!(options & TIMELIB_NO_CLONE) ? timelib_tzinfo_clone(now->tz_info) : now->tz_info) : NULL;
|
||||
}
|
||||
if (parsed->zone_type == 0 && now->zone_type != 0) {
|
||||
parsed->zone_type = now->zone_type;
|
||||
/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
|
||||
/* parsed->tz_abbr = now->tz_abbr ? timelib_strdup(now->tz_abbr) : NULL;
|
||||
parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL;
|
||||
*/ parsed->is_localtime = 1;
|
||||
}
|
||||
@@ -2202,7 +2208,7 @@ void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
|
||||
*/
|
||||
}
|
||||
|
||||
char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
|
||||
char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst)
|
||||
{
|
||||
const timelib_tz_lookup_table *tp;
|
||||
|
||||
@@ -2227,7 +2233,7 @@ int main(void)
|
||||
printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
|
||||
time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
|
||||
if (time.have_relative) {
|
||||
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
|
||||
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
|
||||
time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
|
||||
}
|
||||
if (time.have_weekday_relative) {
|
||||
@@ -2236,7 +2242,7 @@ int main(void)
|
||||
if (time.have_weeknr_day) {
|
||||
printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,21 +1,27 @@
|
||||
/* Generated by re2c 0.13.5 on Wed Nov 27 11:14:23 2013 */
|
||||
/* Generated by re2c 0.13.5 on Thu Aug 13 10:30:12 2015 */
|
||||
#line 1 "ext/date/lib/parse_iso_intervals.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -71,7 +77,7 @@ typedef unsigned char uchar;
|
||||
|
||||
#define RET(i) {s->cur = cursor; return i;}
|
||||
|
||||
#define timelib_string_free free
|
||||
#define timelib_string_free timelib_free
|
||||
|
||||
#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
|
||||
#define TIMELIB_DEINIT timelib_string_free(str)
|
||||
@@ -107,24 +113,24 @@ typedef struct Scanner {
|
||||
static void add_warning(Scanner *s, char *error)
|
||||
{
|
||||
s->errors->warning_count++;
|
||||
s->errors->warning_messages = realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages = timelib_realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].position = s->tok ? s->tok - s->str : 0;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].character = s->tok ? *s->tok : 0;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = strdup(error);
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static void add_error(Scanner *s, char *error)
|
||||
{
|
||||
s->errors->error_count++;
|
||||
s->errors->error_messages = realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages = timelib_realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages[s->errors->error_count - 1].position = s->tok ? s->tok - s->str : 0;
|
||||
s->errors->error_messages[s->errors->error_count - 1].character = s->tok ? *s->tok : 0;
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = strdup(error);
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static char *timelib_string(Scanner *s)
|
||||
{
|
||||
char *tmp = calloc(1, s->cur - s->tok + 1);
|
||||
char *tmp = timelib_calloc(1, s->cur - s->tok + 1);
|
||||
memcpy(tmp, s->tok, s->cur - s->tok);
|
||||
|
||||
return tmp;
|
||||
@@ -148,10 +154,10 @@ static timelib_sll timelib_get_nr(char **ptr, int max_length)
|
||||
++len;
|
||||
}
|
||||
end = *ptr;
|
||||
str = calloc(1, end - begin + 1);
|
||||
str = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(str, begin, end - begin);
|
||||
tmp_nr = strtoll(str, NULL, 10);
|
||||
free(str);
|
||||
timelib_free(str);
|
||||
return tmp_nr;
|
||||
}
|
||||
|
||||
@@ -190,9 +196,9 @@ static void timelib_eat_until_separator(char **ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
|
||||
static timelib_long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
|
||||
{
|
||||
long retval = 0;
|
||||
timelib_long retval = 0;
|
||||
|
||||
*tz_not_found = 0;
|
||||
|
||||
@@ -228,10 +234,10 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
#define timelib_split_free(arg) { \
|
||||
int i; \
|
||||
for (i = 0; i < arg.c; i++) { \
|
||||
free(arg.v[i]); \
|
||||
timelib_free(arg.v[i]); \
|
||||
} \
|
||||
if (arg.v) { \
|
||||
free(arg.v); \
|
||||
timelib_free(arg.v); \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -244,15 +250,15 @@ static int scan(Scanner *s)
|
||||
{
|
||||
uchar *cursor = s->cur;
|
||||
char *str, *ptr = NULL;
|
||||
|
||||
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 276 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 282 "ext/date/lib/parse_iso_intervals.re"
|
||||
|
||||
|
||||
|
||||
#line 256 "ext/date/lib/parse_iso_intervals.c"
|
||||
#line 262 "ext/date/lib/parse_iso_intervals.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -291,7 +297,6 @@ std:
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
YYDEBUG(0, *YYCURSOR);
|
||||
if ((YYLIMIT - YYCURSOR) < 20) YYFILL(20);
|
||||
yych = *YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -316,35 +321,30 @@ std:
|
||||
if (yych != 'R') goto yy11;
|
||||
}
|
||||
}
|
||||
YYDEBUG(2, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if ((yych = *YYCURSOR) <= '/') goto yy3;
|
||||
if (yych <= '9') goto yy98;
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
#line 389 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 395 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 331 "ext/date/lib/parse_iso_intervals.c"
|
||||
#line 334 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '/') goto yy3;
|
||||
if (yych <= '9') goto yy59;
|
||||
goto yy3;
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '/') goto yy6;
|
||||
if (yych <= '9') goto yy12;
|
||||
if (yych == 'T') goto yy14;
|
||||
yy6:
|
||||
YYDEBUG(6, *YYCURSOR);
|
||||
#line 316 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 322 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
timelib_sll nr;
|
||||
int in_time = 0;
|
||||
@@ -368,11 +368,11 @@ yy6:
|
||||
case 'D': s->period->d = nr; break;
|
||||
case 'H': s->period->h = nr; break;
|
||||
case 'S': s->period->s = nr; break;
|
||||
case 'M':
|
||||
case 'M':
|
||||
if (in_time) {
|
||||
s->period->i = nr;
|
||||
} else {
|
||||
s->period->m = nr;
|
||||
s->period->m = nr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -387,30 +387,24 @@ yy6:
|
||||
}
|
||||
#line 389 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy7:
|
||||
YYDEBUG(7, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(8, *YYCURSOR);
|
||||
#line 378 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 384 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 398 "ext/date/lib/parse_iso_intervals.c"
|
||||
#line 396 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy9:
|
||||
YYDEBUG(9, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(10, *YYCURSOR);
|
||||
#line 383 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 389 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 408 "ext/date/lib/parse_iso_intervals.c"
|
||||
#line 404 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy11:
|
||||
YYDEBUG(11, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
goto yy3;
|
||||
yy12:
|
||||
YYDEBUG(12, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'L') {
|
||||
if (yych <= '9') {
|
||||
@@ -427,7 +421,6 @@ yy12:
|
||||
}
|
||||
}
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
YYCURSOR = YYMARKER;
|
||||
if (yyaccept <= 0) {
|
||||
goto yy3;
|
||||
@@ -435,7 +428,6 @@ yy13:
|
||||
goto yy6;
|
||||
}
|
||||
yy14:
|
||||
YYDEBUG(14, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yybm[0+yych] & 128) {
|
||||
@@ -443,11 +435,9 @@ yy14:
|
||||
}
|
||||
goto yy6;
|
||||
yy15:
|
||||
YYDEBUG(15, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
||||
yych = *YYCURSOR;
|
||||
YYDEBUG(16, *YYCURSOR);
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy15;
|
||||
}
|
||||
@@ -459,28 +449,23 @@ yy15:
|
||||
if (yych != 'S') goto yy13;
|
||||
}
|
||||
yy17:
|
||||
YYDEBUG(17, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
goto yy6;
|
||||
yy18:
|
||||
YYDEBUG(18, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '/') goto yy6;
|
||||
if (yych <= '9') goto yy22;
|
||||
goto yy6;
|
||||
yy19:
|
||||
YYDEBUG(19, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '/') goto yy6;
|
||||
if (yych >= ':') goto yy6;
|
||||
yy20:
|
||||
YYDEBUG(20, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
||||
yych = *YYCURSOR;
|
||||
YYDEBUG(21, *YYCURSOR);
|
||||
if (yych <= 'L') {
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy20;
|
||||
@@ -491,22 +476,18 @@ yy20:
|
||||
goto yy13;
|
||||
}
|
||||
yy22:
|
||||
YYDEBUG(22, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
YYDEBUG(23, *YYCURSOR);
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy22;
|
||||
if (yych == 'S') goto yy17;
|
||||
goto yy13;
|
||||
yy24:
|
||||
YYDEBUG(24, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'T') goto yy14;
|
||||
goto yy6;
|
||||
yy25:
|
||||
YYDEBUG(25, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'L') {
|
||||
if (yych <= '9') {
|
||||
@@ -526,7 +507,6 @@ yy25:
|
||||
}
|
||||
}
|
||||
yy26:
|
||||
YYDEBUG(26, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '/') goto yy6;
|
||||
@@ -534,7 +514,6 @@ yy26:
|
||||
if (yych == 'T') goto yy14;
|
||||
goto yy6;
|
||||
yy27:
|
||||
YYDEBUG(27, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '/') goto yy6;
|
||||
@@ -542,7 +521,6 @@ yy27:
|
||||
if (yych == 'T') goto yy14;
|
||||
goto yy6;
|
||||
yy28:
|
||||
YYDEBUG(28, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= '/') goto yy6;
|
||||
@@ -550,11 +528,9 @@ yy28:
|
||||
if (yych == 'T') goto yy14;
|
||||
goto yy6;
|
||||
yy29:
|
||||
YYDEBUG(29, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
|
||||
yych = *YYCURSOR;
|
||||
YYDEBUG(30, *YYCURSOR);
|
||||
if (yych <= 'D') {
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy29;
|
||||
@@ -570,11 +546,9 @@ yy29:
|
||||
}
|
||||
}
|
||||
yy31:
|
||||
YYDEBUG(31, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
|
||||
yych = *YYCURSOR;
|
||||
YYDEBUG(32, *YYCURSOR);
|
||||
if (yych <= 'C') {
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy31;
|
||||
@@ -585,17 +559,14 @@ yy31:
|
||||
goto yy13;
|
||||
}
|
||||
yy33:
|
||||
YYDEBUG(33, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
|
||||
yych = *YYCURSOR;
|
||||
YYDEBUG(34, *YYCURSOR);
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy33;
|
||||
if (yych == 'D') goto yy24;
|
||||
goto yy13;
|
||||
yy35:
|
||||
YYDEBUG(35, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'L') {
|
||||
if (yych <= '9') {
|
||||
@@ -614,22 +585,18 @@ yy35:
|
||||
goto yy13;
|
||||
}
|
||||
}
|
||||
YYDEBUG(36, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '-') goto yy39;
|
||||
YYDEBUG(37, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '0') goto yy40;
|
||||
if (yych <= '1') goto yy41;
|
||||
goto yy13;
|
||||
yy38:
|
||||
YYDEBUG(38, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
|
||||
yych = *YYCURSOR;
|
||||
yy39:
|
||||
YYDEBUG(39, *YYCURSOR);
|
||||
if (yych <= 'L') {
|
||||
if (yych <= '9') {
|
||||
if (yych <= '/') goto yy13;
|
||||
@@ -649,21 +616,17 @@ yy39:
|
||||
}
|
||||
}
|
||||
yy40:
|
||||
YYDEBUG(40, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy42;
|
||||
goto yy13;
|
||||
yy41:
|
||||
YYDEBUG(41, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '3') goto yy13;
|
||||
yy42:
|
||||
YYDEBUG(42, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '-') goto yy13;
|
||||
YYDEBUG(43, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '0') goto yy44;
|
||||
@@ -671,70 +634,55 @@ yy42:
|
||||
if (yych <= '3') goto yy46;
|
||||
goto yy13;
|
||||
yy44:
|
||||
YYDEBUG(44, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy47;
|
||||
goto yy13;
|
||||
yy45:
|
||||
YYDEBUG(45, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy47;
|
||||
goto yy13;
|
||||
yy46:
|
||||
YYDEBUG(46, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '2') goto yy13;
|
||||
yy47:
|
||||
YYDEBUG(47, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != 'T') goto yy13;
|
||||
YYDEBUG(48, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '1') goto yy49;
|
||||
if (yych <= '2') goto yy50;
|
||||
goto yy13;
|
||||
yy49:
|
||||
YYDEBUG(49, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy51;
|
||||
goto yy13;
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '5') goto yy13;
|
||||
yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ':') goto yy13;
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '6') goto yy13;
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(54, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ':') goto yy13;
|
||||
YYDEBUG(55, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '6') goto yy13;
|
||||
YYDEBUG(56, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(57, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(58, *YYCURSOR);
|
||||
#line 358 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 364 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
DEBUG_OUTPUT("combinedrep");
|
||||
TIMELIB_INIT;
|
||||
@@ -753,17 +701,14 @@ yy51:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PERIOD;
|
||||
}
|
||||
#line 757 "ext/date/lib/parse_iso_intervals.c"
|
||||
#line 705 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy59:
|
||||
YYDEBUG(59, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(60, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(61, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') {
|
||||
if (yych == '-') goto yy64;
|
||||
@@ -774,40 +719,33 @@ yy59:
|
||||
goto yy13;
|
||||
}
|
||||
yy62:
|
||||
YYDEBUG(62, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '0') goto yy13;
|
||||
if (yych <= '9') goto yy85;
|
||||
goto yy13;
|
||||
yy63:
|
||||
YYDEBUG(63, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '2') goto yy85;
|
||||
goto yy13;
|
||||
yy64:
|
||||
YYDEBUG(64, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '0') goto yy65;
|
||||
if (yych <= '1') goto yy66;
|
||||
goto yy13;
|
||||
yy65:
|
||||
YYDEBUG(65, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '0') goto yy13;
|
||||
if (yych <= '9') goto yy67;
|
||||
goto yy13;
|
||||
yy66:
|
||||
YYDEBUG(66, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '3') goto yy13;
|
||||
yy67:
|
||||
YYDEBUG(67, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '-') goto yy13;
|
||||
YYDEBUG(68, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '0') goto yy69;
|
||||
@@ -815,74 +753,58 @@ yy67:
|
||||
if (yych <= '3') goto yy71;
|
||||
goto yy13;
|
||||
yy69:
|
||||
YYDEBUG(69, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '0') goto yy13;
|
||||
if (yych <= '9') goto yy72;
|
||||
goto yy13;
|
||||
yy70:
|
||||
YYDEBUG(70, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy72;
|
||||
goto yy13;
|
||||
yy71:
|
||||
YYDEBUG(71, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '2') goto yy13;
|
||||
yy72:
|
||||
YYDEBUG(72, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != 'T') goto yy13;
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '1') goto yy74;
|
||||
if (yych <= '2') goto yy75;
|
||||
goto yy13;
|
||||
yy74:
|
||||
YYDEBUG(74, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy76;
|
||||
goto yy13;
|
||||
yy75:
|
||||
YYDEBUG(75, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '5') goto yy13;
|
||||
yy76:
|
||||
YYDEBUG(76, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ':') goto yy13;
|
||||
YYDEBUG(77, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '6') goto yy13;
|
||||
YYDEBUG(78, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(79, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ':') goto yy13;
|
||||
YYDEBUG(80, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '6') goto yy13;
|
||||
YYDEBUG(81, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(82, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != 'Z') goto yy13;
|
||||
yy83:
|
||||
YYDEBUG(83, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(84, *YYCURSOR);
|
||||
#line 292 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 298 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
timelib_time *current;
|
||||
|
||||
@@ -905,9 +827,8 @@ yy83:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 909 "ext/date/lib/parse_iso_intervals.c"
|
||||
#line 831 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy85:
|
||||
YYDEBUG(85, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '0') goto yy86;
|
||||
@@ -915,75 +836,60 @@ yy85:
|
||||
if (yych <= '3') goto yy88;
|
||||
goto yy13;
|
||||
yy86:
|
||||
YYDEBUG(86, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '0') goto yy13;
|
||||
if (yych <= '9') goto yy89;
|
||||
goto yy13;
|
||||
yy87:
|
||||
YYDEBUG(87, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy89;
|
||||
goto yy13;
|
||||
yy88:
|
||||
YYDEBUG(88, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '2') goto yy13;
|
||||
yy89:
|
||||
YYDEBUG(89, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != 'T') goto yy13;
|
||||
YYDEBUG(90, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '1') goto yy91;
|
||||
if (yych <= '2') goto yy92;
|
||||
goto yy13;
|
||||
yy91:
|
||||
YYDEBUG(91, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych <= '9') goto yy93;
|
||||
goto yy13;
|
||||
yy92:
|
||||
YYDEBUG(92, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '5') goto yy13;
|
||||
yy93:
|
||||
YYDEBUG(93, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '6') goto yy13;
|
||||
YYDEBUG(94, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(95, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= '6') goto yy13;
|
||||
YYDEBUG(96, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
YYDEBUG(97, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'Z') goto yy83;
|
||||
goto yy13;
|
||||
yy98:
|
||||
YYDEBUG(98, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
YYDEBUG(99, *YYCURSOR);
|
||||
if (yych <= '/') goto yy100;
|
||||
if (yych <= '9') goto yy98;
|
||||
yy100:
|
||||
YYDEBUG(100, *YYCURSOR);
|
||||
#line 281 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 287 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
DEBUG_OUTPUT("recurrences");
|
||||
TIMELIB_INIT;
|
||||
@@ -993,9 +899,9 @@ yy100:
|
||||
s->have_recurrences = 1;
|
||||
return TIMELIB_PERIOD;
|
||||
}
|
||||
#line 997 "ext/date/lib/parse_iso_intervals.c"
|
||||
#line 903 "ext/date/lib/parse_iso_intervals.c"
|
||||
}
|
||||
#line 393 "ext/date/lib/parse_iso_intervals.re"
|
||||
#line 399 "ext/date/lib/parse_iso_intervals.re"
|
||||
|
||||
}
|
||||
#ifdef PHP_WIN32
|
||||
@@ -1004,9 +910,9 @@ yy100:
|
||||
|
||||
#define YYMAXFILL 20
|
||||
|
||||
void timelib_strtointerval(char *s, int len,
|
||||
timelib_time **begin, timelib_time **end,
|
||||
timelib_rel_time **period, int *recurrences,
|
||||
void timelib_strtointerval(char *s, size_t len,
|
||||
timelib_time **begin, timelib_time **end,
|
||||
timelib_rel_time **period, int *recurrences,
|
||||
struct timelib_error_container **errors)
|
||||
{
|
||||
Scanner in;
|
||||
@@ -1014,7 +920,7 @@ void timelib_strtointerval(char *s, int len,
|
||||
char *e = s + len - 1;
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.errors = malloc(sizeof(struct timelib_error_container));
|
||||
in.errors = timelib_malloc(sizeof(struct timelib_error_container));
|
||||
in.errors->warning_count = 0;
|
||||
in.errors->warning_messages = NULL;
|
||||
in.errors->error_count = 0;
|
||||
@@ -1040,7 +946,7 @@ void timelib_strtointerval(char *s, int len,
|
||||
e++;
|
||||
|
||||
/* init cursor */
|
||||
in.str = malloc((e - s) + YYMAXFILL);
|
||||
in.str = timelib_malloc((e - s) + YYMAXFILL);
|
||||
memset(in.str, 0, (e - s) + YYMAXFILL);
|
||||
memcpy(in.str, s, (e - s));
|
||||
in.lim = in.str + (e - s) + YYMAXFILL;
|
||||
@@ -1094,7 +1000,7 @@ void timelib_strtointerval(char *s, int len,
|
||||
#endif
|
||||
} while(t != EOI);
|
||||
|
||||
free(in.str);
|
||||
timelib_free(in.str);
|
||||
if (errors) {
|
||||
*errors = in.errors;
|
||||
} else {
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -69,7 +75,7 @@ typedef unsigned char uchar;
|
||||
|
||||
#define RET(i) {s->cur = cursor; return i;}
|
||||
|
||||
#define timelib_string_free free
|
||||
#define timelib_string_free timelib_free
|
||||
|
||||
#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
|
||||
#define TIMELIB_DEINIT timelib_string_free(str)
|
||||
@@ -105,24 +111,24 @@ typedef struct Scanner {
|
||||
static void add_warning(Scanner *s, char *error)
|
||||
{
|
||||
s->errors->warning_count++;
|
||||
s->errors->warning_messages = realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages = timelib_realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message));
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].position = s->tok ? s->tok - s->str : 0;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].character = s->tok ? *s->tok : 0;
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = strdup(error);
|
||||
s->errors->warning_messages[s->errors->warning_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static void add_error(Scanner *s, char *error)
|
||||
{
|
||||
s->errors->error_count++;
|
||||
s->errors->error_messages = realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages = timelib_realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message));
|
||||
s->errors->error_messages[s->errors->error_count - 1].position = s->tok ? s->tok - s->str : 0;
|
||||
s->errors->error_messages[s->errors->error_count - 1].character = s->tok ? *s->tok : 0;
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = strdup(error);
|
||||
s->errors->error_messages[s->errors->error_count - 1].message = timelib_strdup(error);
|
||||
}
|
||||
|
||||
static char *timelib_string(Scanner *s)
|
||||
{
|
||||
char *tmp = calloc(1, s->cur - s->tok + 1);
|
||||
char *tmp = timelib_calloc(1, s->cur - s->tok + 1);
|
||||
memcpy(tmp, s->tok, s->cur - s->tok);
|
||||
|
||||
return tmp;
|
||||
@@ -146,10 +152,10 @@ static timelib_sll timelib_get_nr(char **ptr, int max_length)
|
||||
++len;
|
||||
}
|
||||
end = *ptr;
|
||||
str = calloc(1, end - begin + 1);
|
||||
str = timelib_calloc(1, end - begin + 1);
|
||||
memcpy(str, begin, end - begin);
|
||||
tmp_nr = strtoll(str, NULL, 10);
|
||||
free(str);
|
||||
timelib_free(str);
|
||||
return tmp_nr;
|
||||
}
|
||||
|
||||
@@ -188,9 +194,9 @@ static void timelib_eat_until_separator(char **ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
|
||||
static timelib_long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
|
||||
{
|
||||
long retval = 0;
|
||||
timelib_long retval = 0;
|
||||
|
||||
*tz_not_found = 0;
|
||||
|
||||
@@ -226,10 +232,10 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
#define timelib_split_free(arg) { \
|
||||
int i; \
|
||||
for (i = 0; i < arg.c; i++) { \
|
||||
free(arg.v[i]); \
|
||||
timelib_free(arg.v[i]); \
|
||||
} \
|
||||
if (arg.v) { \
|
||||
free(arg.v); \
|
||||
timelib_free(arg.v); \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -242,7 +248,7 @@ static int scan(Scanner *s)
|
||||
{
|
||||
uchar *cursor = s->cur;
|
||||
char *str, *ptr = NULL;
|
||||
|
||||
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
@@ -336,11 +342,11 @@ isoweek = year4 "-"? "W" weekofyear;
|
||||
case 'D': s->period->d = nr; break;
|
||||
case 'H': s->period->h = nr; break;
|
||||
case 'S': s->period->s = nr; break;
|
||||
case 'M':
|
||||
case 'M':
|
||||
if (in_time) {
|
||||
s->period->i = nr;
|
||||
} else {
|
||||
s->period->m = nr;
|
||||
s->period->m = nr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -398,9 +404,9 @@ isoweek = year4 "-"? "W" weekofyear;
|
||||
|
||||
/*!max:re2c */
|
||||
|
||||
void timelib_strtointerval(char *s, int len,
|
||||
timelib_time **begin, timelib_time **end,
|
||||
timelib_rel_time **period, int *recurrences,
|
||||
void timelib_strtointerval(char *s, size_t len,
|
||||
timelib_time **begin, timelib_time **end,
|
||||
timelib_rel_time **period, int *recurrences,
|
||||
struct timelib_error_container **errors)
|
||||
{
|
||||
Scanner in;
|
||||
@@ -408,7 +414,7 @@ void timelib_strtointerval(char *s, int len,
|
||||
char *e = s + len - 1;
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.errors = malloc(sizeof(struct timelib_error_container));
|
||||
in.errors = timelib_malloc(sizeof(struct timelib_error_container));
|
||||
in.errors->warning_count = 0;
|
||||
in.errors->warning_messages = NULL;
|
||||
in.errors->error_count = 0;
|
||||
@@ -434,7 +440,7 @@ void timelib_strtointerval(char *s, int len,
|
||||
e++;
|
||||
|
||||
/* init cursor */
|
||||
in.str = malloc((e - s) + YYMAXFILL);
|
||||
in.str = timelib_malloc((e - s) + YYMAXFILL);
|
||||
memset(in.str, 0, (e - s) + YYMAXFILL);
|
||||
memcpy(in.str, s, (e - s));
|
||||
in.lim = in.str + (e - s) + YYMAXFILL;
|
||||
@@ -488,7 +494,7 @@ void timelib_strtointerval(char *s, int len,
|
||||
#endif
|
||||
} while(t != EOI);
|
||||
|
||||
free(in.str);
|
||||
timelib_free(in.str);
|
||||
if (errors) {
|
||||
*errors = in.errors;
|
||||
} else {
|
||||
|
||||
+171
-98
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "timelib.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -31,12 +35,14 @@
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#define TIMELIB_SUPPORTS_V2DATA
|
||||
#include "timezonedb.h"
|
||||
|
||||
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
|
||||
# if defined(__LITTLE_ENDIAN__)
|
||||
# undef WORDS_BIGENDIAN
|
||||
# else
|
||||
# else
|
||||
# if defined(__BIG_ENDIAN__)
|
||||
# define WORDS_BIGENDIAN
|
||||
# endif
|
||||
@@ -49,11 +55,14 @@
|
||||
#define timelib_conv_int(l) ((l & 0x000000ff) << 24) + ((l & 0x0000ff00) << 8) + ((l & 0x00ff0000) >> 8) + ((l & 0xff000000) >> 24)
|
||||
#endif
|
||||
|
||||
static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
static int read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
/* skip ID */
|
||||
uint32_t version;
|
||||
|
||||
/* read ID */
|
||||
version = (*tzf)[3] - '0';
|
||||
*tzf += 4;
|
||||
|
||||
|
||||
/* read BC flag */
|
||||
tz->bc = (**tzf == '\1');
|
||||
*tzf += 1;
|
||||
@@ -63,8 +72,10 @@ static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
tz->location.country_code[2] = '\0';
|
||||
*tzf += 2;
|
||||
|
||||
/* skip read of preamble */
|
||||
/* skip rest of preamble */
|
||||
*tzf += 13;
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
static void read_header(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
@@ -72,128 +83,163 @@ static void read_header(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
uint32_t buffer[6];
|
||||
|
||||
memcpy(&buffer, *tzf, sizeof(buffer));
|
||||
tz->ttisgmtcnt = timelib_conv_int(buffer[0]);
|
||||
tz->ttisstdcnt = timelib_conv_int(buffer[1]);
|
||||
tz->leapcnt = timelib_conv_int(buffer[2]);
|
||||
tz->timecnt = timelib_conv_int(buffer[3]);
|
||||
tz->typecnt = timelib_conv_int(buffer[4]);
|
||||
tz->charcnt = timelib_conv_int(buffer[5]);
|
||||
tz->bit32.ttisgmtcnt = timelib_conv_int(buffer[0]);
|
||||
tz->bit32.ttisstdcnt = timelib_conv_int(buffer[1]);
|
||||
tz->bit32.leapcnt = timelib_conv_int(buffer[2]);
|
||||
tz->bit32.timecnt = timelib_conv_int(buffer[3]);
|
||||
tz->bit32.typecnt = timelib_conv_int(buffer[4]);
|
||||
tz->bit32.charcnt = timelib_conv_int(buffer[5]);
|
||||
*tzf += sizeof(buffer);
|
||||
}
|
||||
|
||||
static void skip_64bit_transistions(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
if (tz->bit64.timecnt) {
|
||||
*tzf += (sizeof(int64_t) * tz->bit64.timecnt);
|
||||
*tzf += (sizeof(unsigned char) * tz->bit64.timecnt);
|
||||
}
|
||||
}
|
||||
|
||||
static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
int32_t *buffer = NULL;
|
||||
uint32_t i;
|
||||
unsigned char *cbuffer = NULL;
|
||||
|
||||
if (tz->timecnt) {
|
||||
buffer = (int32_t*) malloc(tz->timecnt * sizeof(int32_t));
|
||||
if (tz->bit32.timecnt) {
|
||||
buffer = (int32_t*) timelib_malloc(tz->bit32.timecnt * sizeof(int32_t));
|
||||
if (!buffer) {
|
||||
return;
|
||||
}
|
||||
memcpy(buffer, *tzf, sizeof(int32_t) * tz->timecnt);
|
||||
*tzf += (sizeof(int32_t) * tz->timecnt);
|
||||
for (i = 0; i < tz->timecnt; i++) {
|
||||
memcpy(buffer, *tzf, sizeof(int32_t) * tz->bit32.timecnt);
|
||||
*tzf += (sizeof(int32_t) * tz->bit32.timecnt);
|
||||
for (i = 0; i < tz->bit32.timecnt; i++) {
|
||||
buffer[i] = timelib_conv_int(buffer[i]);
|
||||
}
|
||||
|
||||
cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
|
||||
cbuffer = (unsigned char*) timelib_malloc(tz->bit32.timecnt * sizeof(unsigned char));
|
||||
if (!cbuffer) {
|
||||
free(buffer);
|
||||
timelib_free(buffer);
|
||||
return;
|
||||
}
|
||||
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
|
||||
*tzf += sizeof(unsigned char) * tz->timecnt;
|
||||
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->bit32.timecnt);
|
||||
*tzf += sizeof(unsigned char) * tz->bit32.timecnt;
|
||||
}
|
||||
|
||||
|
||||
tz->trans = buffer;
|
||||
tz->trans_idx = cbuffer;
|
||||
}
|
||||
|
||||
static void skip_64bit_types(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
*tzf += sizeof(unsigned char) * 6 * tz->bit64.typecnt;
|
||||
*tzf += sizeof(char) * tz->bit64.charcnt;
|
||||
if (tz->bit64.leapcnt) {
|
||||
*tzf += sizeof(int64_t) * tz->bit64.leapcnt * 2;
|
||||
}
|
||||
if (tz->bit64.ttisstdcnt) {
|
||||
*tzf += sizeof(unsigned char) * tz->bit64.ttisstdcnt;
|
||||
}
|
||||
if (tz->bit64.ttisgmtcnt) {
|
||||
*tzf += sizeof(unsigned char) * tz->bit64.ttisgmtcnt;
|
||||
}
|
||||
}
|
||||
|
||||
static void read_types(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
unsigned char *buffer;
|
||||
int32_t *leap_buffer;
|
||||
unsigned int i, j;
|
||||
|
||||
buffer = (unsigned char*) malloc(tz->typecnt * sizeof(unsigned char) * 6);
|
||||
buffer = (unsigned char*) timelib_malloc(tz->bit32.typecnt * sizeof(unsigned char) * 6);
|
||||
if (!buffer) {
|
||||
return;
|
||||
}
|
||||
memcpy(buffer, *tzf, sizeof(unsigned char) * 6 * tz->typecnt);
|
||||
*tzf += sizeof(unsigned char) * 6 * tz->typecnt;
|
||||
memcpy(buffer, *tzf, sizeof(unsigned char) * 6 * tz->bit32.typecnt);
|
||||
*tzf += sizeof(unsigned char) * 6 * tz->bit32.typecnt;
|
||||
|
||||
tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
|
||||
tz->type = (ttinfo*) timelib_malloc(tz->bit32.typecnt * sizeof(struct ttinfo));
|
||||
if (!tz->type) {
|
||||
free(buffer);
|
||||
timelib_free(buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < tz->typecnt; i++) {
|
||||
for (i = 0; i < tz->bit32.typecnt; i++) {
|
||||
j = i * 6;
|
||||
tz->type[i].offset = (buffer[j] * 16777216) + (buffer[j + 1] * 65536) + (buffer[j + 2] * 256) + buffer[j + 3];
|
||||
tz->type[i].isdst = buffer[j + 4];
|
||||
tz->type[i].abbr_idx = buffer[j + 5];
|
||||
}
|
||||
free(buffer);
|
||||
timelib_free(buffer);
|
||||
|
||||
tz->timezone_abbr = (char*) malloc(tz->charcnt);
|
||||
tz->timezone_abbr = (char*) timelib_malloc(tz->bit32.charcnt);
|
||||
if (!tz->timezone_abbr) {
|
||||
return;
|
||||
}
|
||||
memcpy(tz->timezone_abbr, *tzf, sizeof(char) * tz->charcnt);
|
||||
*tzf += sizeof(char) * tz->charcnt;
|
||||
memcpy(tz->timezone_abbr, *tzf, sizeof(char) * tz->bit32.charcnt);
|
||||
*tzf += sizeof(char) * tz->bit32.charcnt;
|
||||
|
||||
if (tz->leapcnt) {
|
||||
leap_buffer = (int32_t *) malloc(tz->leapcnt * 2 * sizeof(int32_t));
|
||||
if (tz->bit32.leapcnt) {
|
||||
leap_buffer = (int32_t *) timelib_malloc(tz->bit32.leapcnt * 2 * sizeof(int32_t));
|
||||
if (!leap_buffer) {
|
||||
return;
|
||||
}
|
||||
memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->leapcnt * 2);
|
||||
*tzf += sizeof(int32_t) * tz->leapcnt * 2;
|
||||
memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->bit32.leapcnt * 2);
|
||||
*tzf += sizeof(int32_t) * tz->bit32.leapcnt * 2;
|
||||
|
||||
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
|
||||
tz->leap_times = (tlinfo*) timelib_malloc(tz->bit32.leapcnt * sizeof(tlinfo));
|
||||
if (!tz->leap_times) {
|
||||
free(leap_buffer);
|
||||
timelib_free(leap_buffer);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < tz->leapcnt; i++) {
|
||||
for (i = 0; i < tz->bit32.leapcnt; i++) {
|
||||
tz->leap_times[i].trans = timelib_conv_int(leap_buffer[i * 2]);
|
||||
tz->leap_times[i].offset = timelib_conv_int(leap_buffer[i * 2 + 1]);
|
||||
}
|
||||
free(leap_buffer);
|
||||
timelib_free(leap_buffer);
|
||||
}
|
||||
|
||||
if (tz->ttisstdcnt) {
|
||||
buffer = (unsigned char*) malloc(tz->ttisstdcnt * sizeof(unsigned char));
|
||||
if (tz->bit32.ttisstdcnt) {
|
||||
buffer = (unsigned char*) timelib_malloc(tz->bit32.ttisstdcnt * sizeof(unsigned char));
|
||||
if (!buffer) {
|
||||
return;
|
||||
}
|
||||
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisstdcnt);
|
||||
*tzf += sizeof(unsigned char) * tz->ttisstdcnt;
|
||||
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->bit32.ttisstdcnt);
|
||||
*tzf += sizeof(unsigned char) * tz->bit32.ttisstdcnt;
|
||||
|
||||
for (i = 0; i < tz->ttisstdcnt; i++) {
|
||||
for (i = 0; i < tz->bit32.ttisstdcnt; i++) {
|
||||
tz->type[i].isstdcnt = buffer[i];
|
||||
}
|
||||
free(buffer);
|
||||
timelib_free(buffer);
|
||||
}
|
||||
|
||||
if (tz->ttisgmtcnt) {
|
||||
buffer = (unsigned char*) malloc(tz->ttisgmtcnt * sizeof(unsigned char));
|
||||
if (tz->bit32.ttisgmtcnt) {
|
||||
buffer = (unsigned char*) timelib_malloc(tz->bit32.ttisgmtcnt * sizeof(unsigned char));
|
||||
if (!buffer) {
|
||||
return;
|
||||
}
|
||||
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisgmtcnt);
|
||||
*tzf += sizeof(unsigned char) * tz->ttisgmtcnt;
|
||||
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->bit32.ttisgmtcnt);
|
||||
*tzf += sizeof(unsigned char) * tz->bit32.ttisgmtcnt;
|
||||
|
||||
for (i = 0; i < tz->ttisgmtcnt; i++) {
|
||||
for (i = 0; i < tz->bit32.ttisgmtcnt; i++) {
|
||||
tz->type[i].isgmtcnt = buffer[i];
|
||||
}
|
||||
free(buffer);
|
||||
timelib_free(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
static void skip_posix_string(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
int n_count = 0;
|
||||
|
||||
do {
|
||||
if (*tzf[0] == '\n') {
|
||||
n_count++;
|
||||
}
|
||||
(*tzf)++;
|
||||
} while (n_count < 2);
|
||||
}
|
||||
|
||||
static void read_location(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
uint32_t buffer[3];
|
||||
@@ -207,7 +253,7 @@ static void read_location(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
comments_len = timelib_conv_int(buffer[2]);
|
||||
*tzf += sizeof(buffer);
|
||||
|
||||
tz->location.comments = malloc(comments_len + 1);
|
||||
tz->location.comments = timelib_malloc(comments_len + 1);
|
||||
memcpy(tz->location.comments, *tzf, comments_len);
|
||||
tz->location.comments[comments_len] = '\0';
|
||||
*tzf += comments_len;
|
||||
@@ -221,12 +267,12 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
|
||||
printf("Geo Location: %f,%f\n", tz->location.latitude, tz->location.longitude);
|
||||
printf("Comments:\n%s\n", tz->location.comments);
|
||||
printf("BC: %s\n", tz->bc ? "" : "yes");
|
||||
printf("UTC/Local count: %lu\n", (unsigned long) tz->ttisgmtcnt);
|
||||
printf("Std/Wall count: %lu\n", (unsigned long) tz->ttisstdcnt);
|
||||
printf("Leap.sec. count: %lu\n", (unsigned long) tz->leapcnt);
|
||||
printf("Trans. count: %lu\n", (unsigned long) tz->timecnt);
|
||||
printf("Local types count: %lu\n", (unsigned long) tz->typecnt);
|
||||
printf("Zone Abbr. count: %lu\n", (unsigned long) tz->charcnt);
|
||||
printf("UTC/Local count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.ttisgmtcnt);
|
||||
printf("Std/Wall count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.ttisstdcnt);
|
||||
printf("Leap.sec. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.leapcnt);
|
||||
printf("Trans. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.timecnt);
|
||||
printf("Local types count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.typecnt);
|
||||
printf("Zone Abbr. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.charcnt);
|
||||
|
||||
printf ("%8s (%12s) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
|
||||
"", "", 0,
|
||||
@@ -237,7 +283,7 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
|
||||
tz->type[0].isstdcnt,
|
||||
tz->type[0].isgmtcnt
|
||||
);
|
||||
for (i = 0; i < tz->timecnt; i++) {
|
||||
for (i = 0; i < tz->bit32.timecnt; i++) {
|
||||
printf ("%08X (%12d) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
|
||||
tz->trans[i], tz->trans[i], tz->trans_idx[i],
|
||||
(long int) tz->type[tz->trans_idx[i]].offset,
|
||||
@@ -248,7 +294,7 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
|
||||
tz->type[tz->trans_idx[i]].isgmtcnt
|
||||
);
|
||||
}
|
||||
for (i = 0; i < tz->leapcnt; i++) {
|
||||
for (i = 0; i < tz->bit32.leapcnt; i++) {
|
||||
printf ("%08X (%12ld) = %d\n",
|
||||
tz->leap_times[i].trans,
|
||||
(long) tz->leap_times[i].trans,
|
||||
@@ -264,10 +310,10 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
|
||||
|
||||
tmp = setlocale(LC_CTYPE, NULL);
|
||||
if (tmp) {
|
||||
cur_locale = strdup(tmp);
|
||||
cur_locale = timelib_strdup(tmp);
|
||||
}
|
||||
setlocale(LC_CTYPE, "C");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
do {
|
||||
int mid = ((unsigned)left + right) >> 1;
|
||||
@@ -281,8 +327,8 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
|
||||
(*tzf) = &(tzdb->data[tzdb->index[mid].pos]);
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale(LC_CTYPE, cur_locale);
|
||||
if (cur_locale) free(cur_locale);
|
||||
#endif
|
||||
if (cur_locale) timelib_free(cur_locale);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -290,8 +336,8 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale(LC_CTYPE, cur_locale);
|
||||
if (cur_locale) free(cur_locale);
|
||||
#endif
|
||||
if (cur_locale) timelib_free(cur_locale);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -312,18 +358,45 @@ int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
|
||||
return (seek_to_tz_position(&tzf, timezone, tzdb));
|
||||
}
|
||||
|
||||
static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
*tzf += 20;
|
||||
}
|
||||
|
||||
static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
{
|
||||
uint32_t buffer[6];
|
||||
|
||||
memcpy(&buffer, *tzf, sizeof(buffer));
|
||||
tz->bit64.ttisgmtcnt = timelib_conv_int(buffer[0]);
|
||||
tz->bit64.ttisstdcnt = timelib_conv_int(buffer[1]);
|
||||
tz->bit64.leapcnt = timelib_conv_int(buffer[2]);
|
||||
tz->bit64.timecnt = timelib_conv_int(buffer[3]);
|
||||
tz->bit64.typecnt = timelib_conv_int(buffer[4]);
|
||||
tz->bit64.charcnt = timelib_conv_int(buffer[5]);
|
||||
*tzf += sizeof(buffer);
|
||||
}
|
||||
|
||||
timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
|
||||
{
|
||||
const unsigned char *tzf;
|
||||
timelib_tzinfo *tmp;
|
||||
int version;
|
||||
|
||||
if (seek_to_tz_position(&tzf, timezone, tzdb)) {
|
||||
tmp = timelib_tzinfo_ctor(timezone);
|
||||
|
||||
read_preamble(&tzf, tmp);
|
||||
version = read_preamble(&tzf, tmp);
|
||||
read_header(&tzf, tmp);
|
||||
read_transistions(&tzf, tmp);
|
||||
read_types(&tzf, tmp);
|
||||
if (version == 2) {
|
||||
skip_64bit_preamble(&tzf, tmp);
|
||||
read_64bit_header(&tzf, tmp);
|
||||
skip_64bit_transistions(&tzf, tmp);
|
||||
skip_64bit_types(&tzf, tmp);
|
||||
skip_posix_string(&tzf, tmp);
|
||||
}
|
||||
read_location(&tzf, tmp);
|
||||
} else {
|
||||
tmp = NULL;
|
||||
@@ -338,9 +411,9 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
|
||||
|
||||
/* If there is no transition time, we pick the first one, if that doesn't
|
||||
* exist we return NULL */
|
||||
if (!tz->timecnt || !tz->trans) {
|
||||
if (!tz->bit32.timecnt || !tz->trans) {
|
||||
*transition_time = 0;
|
||||
if (tz->typecnt == 1) {
|
||||
if (tz->bit32.typecnt == 1) {
|
||||
return &(tz->type[0]);
|
||||
}
|
||||
return NULL;
|
||||
@@ -355,36 +428,36 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
|
||||
|
||||
*transition_time = 0;
|
||||
j = 0;
|
||||
while (j < tz->timecnt && tz->type[j].isdst) {
|
||||
while (j < tz->bit32.timecnt && tz->type[tz->trans_idx[j]].isdst) {
|
||||
++j;
|
||||
}
|
||||
if (j == tz->timecnt) {
|
||||
if (j == tz->bit32.timecnt) {
|
||||
j = 0;
|
||||
}
|
||||
return &(tz->type[j]);
|
||||
return &(tz->type[tz->trans_idx[j]]);
|
||||
}
|
||||
|
||||
/* In all other cases we loop through the available transtion times to find
|
||||
* the correct entry */
|
||||
for (i = 0; i < tz->timecnt; i++) {
|
||||
for (i = 0; i < tz->bit32.timecnt; i++) {
|
||||
if (ts < tz->trans[i]) {
|
||||
*transition_time = tz->trans[i - 1];
|
||||
return &(tz->type[tz->trans_idx[i - 1]]);
|
||||
}
|
||||
}
|
||||
*transition_time = tz->trans[tz->timecnt - 1];
|
||||
return &(tz->type[tz->trans_idx[tz->timecnt - 1]]);
|
||||
*transition_time = tz->trans[tz->bit32.timecnt - 1];
|
||||
return &(tz->type[tz->trans_idx[tz->bit32.timecnt - 1]]);
|
||||
}
|
||||
|
||||
static tlinfo* fetch_leaptime_offset(timelib_tzinfo *tz, timelib_sll ts)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!tz->leapcnt || !tz->leap_times) {
|
||||
if (!tz->bit32.leapcnt || !tz->leap_times) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = tz->leapcnt - 1; i > 0; i--) {
|
||||
for (i = tz->bit32.leapcnt - 1; i > 0; i--) {
|
||||
if (ts > tz->leap_times[i].trans) {
|
||||
return &(tz->leap_times[i]);
|
||||
}
|
||||
@@ -396,7 +469,7 @@ int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz)
|
||||
{
|
||||
ttinfo *to;
|
||||
timelib_sll dummy;
|
||||
|
||||
|
||||
if ((to = fetch_timezone_offset(tz, ts, &dummy))) {
|
||||
return to->isdst;
|
||||
}
|
||||
@@ -430,7 +503,7 @@ timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *
|
||||
|
||||
tmp->offset = offset;
|
||||
tmp->leap_secs = leap_secs;
|
||||
tmp->abbr = abbr ? strdup(abbr) : strdup("GMT");
|
||||
tmp->abbr = abbr ? timelib_strdup(abbr) : timelib_strdup("GMT");
|
||||
|
||||
return tmp;
|
||||
}
|
||||
@@ -439,12 +512,12 @@ timelib_sll timelib_get_current_offset(timelib_time *t)
|
||||
{
|
||||
timelib_time_offset *gmt_offset;
|
||||
timelib_sll retval;
|
||||
|
||||
|
||||
switch (t->zone_type) {
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
case TIMELIB_ZONETYPE_OFFSET:
|
||||
return (t->z + t->dst) * -60;
|
||||
|
||||
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
gmt_offset = timelib_get_time_zone_info(t->sse, t->tz_info);
|
||||
retval = gmt_offset->offset;
|
||||
|
||||
+61
-56
@@ -1,30 +1,34 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "timelib.h"
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
||||
#define TIMELIB_TIME_FREE(m) \
|
||||
if (m) { \
|
||||
free(m); \
|
||||
timelib_free(m); \
|
||||
m = NULL; \
|
||||
} \
|
||||
|
||||
@@ -35,7 +39,7 @@
|
||||
timelib_time* timelib_time_ctor(void)
|
||||
{
|
||||
timelib_time *t;
|
||||
t = calloc(1, sizeof(timelib_time));
|
||||
t = timelib_calloc(1, sizeof(timelib_time));
|
||||
|
||||
return t;
|
||||
}
|
||||
@@ -43,7 +47,7 @@ timelib_time* timelib_time_ctor(void)
|
||||
timelib_rel_time* timelib_rel_time_ctor(void)
|
||||
{
|
||||
timelib_rel_time *t;
|
||||
t = calloc(1, sizeof(timelib_rel_time));
|
||||
t = timelib_calloc(1, sizeof(timelib_rel_time));
|
||||
|
||||
return t;
|
||||
}
|
||||
@@ -53,7 +57,7 @@ timelib_time* timelib_time_clone(timelib_time *orig)
|
||||
timelib_time *tmp = timelib_time_ctor();
|
||||
memcpy(tmp, orig, sizeof(timelib_time));
|
||||
if (orig->tz_abbr) {
|
||||
tmp->tz_abbr = strdup(orig->tz_abbr);
|
||||
tmp->tz_abbr = timelib_strdup(orig->tz_abbr);
|
||||
}
|
||||
if (orig->tz_info) {
|
||||
tmp->tz_info = orig->tz_info;
|
||||
@@ -71,10 +75,11 @@ timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel)
|
||||
void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
size_t tz_abbr_len = strlen(tz_abbr);
|
||||
|
||||
TIMELIB_TIME_FREE(tm->tz_abbr);
|
||||
tm->tz_abbr = strdup(tz_abbr);
|
||||
for (i = 0; i < strlen(tz_abbr); i++) {
|
||||
tm->tz_abbr = timelib_strdup(tz_abbr);
|
||||
for (i = 0; i < tz_abbr_len; i++) {
|
||||
tm->tz_abbr[i] = toupper(tz_abbr[i]);
|
||||
}
|
||||
}
|
||||
@@ -93,7 +98,7 @@ void timelib_rel_time_dtor(timelib_rel_time* t)
|
||||
timelib_time_offset* timelib_time_offset_ctor(void)
|
||||
{
|
||||
timelib_time_offset *t;
|
||||
t = calloc(1, sizeof(timelib_time_offset));
|
||||
t = timelib_calloc(1, sizeof(timelib_time_offset));
|
||||
|
||||
return t;
|
||||
}
|
||||
@@ -107,8 +112,8 @@ void timelib_time_offset_dtor(timelib_time_offset* t)
|
||||
timelib_tzinfo* timelib_tzinfo_ctor(char *name)
|
||||
{
|
||||
timelib_tzinfo *t;
|
||||
t = calloc(1, sizeof(timelib_tzinfo));
|
||||
t->name = strdup(name);
|
||||
t = timelib_calloc(1, sizeof(timelib_tzinfo));
|
||||
t->name = timelib_strdup(name);
|
||||
|
||||
return t;
|
||||
}
|
||||
@@ -116,26 +121,26 @@ timelib_tzinfo* timelib_tzinfo_ctor(char *name)
|
||||
timelib_tzinfo *timelib_tzinfo_clone(timelib_tzinfo *tz)
|
||||
{
|
||||
timelib_tzinfo *tmp = timelib_tzinfo_ctor(tz->name);
|
||||
tmp->ttisgmtcnt = tz->ttisgmtcnt;
|
||||
tmp->ttisstdcnt = tz->ttisstdcnt;
|
||||
tmp->leapcnt = tz->leapcnt;
|
||||
tmp->timecnt = tz->timecnt;
|
||||
tmp->typecnt = tz->typecnt;
|
||||
tmp->charcnt = tz->charcnt;
|
||||
|
||||
tmp->trans = (int32_t *) malloc(tz->timecnt * sizeof(int32_t));
|
||||
tmp->trans_idx = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
|
||||
memcpy(tmp->trans, tz->trans, tz->timecnt * sizeof(int32_t));
|
||||
memcpy(tmp->trans_idx, tz->trans_idx, tz->timecnt * sizeof(unsigned char));
|
||||
tmp->bit32.ttisgmtcnt = tz->bit32.ttisgmtcnt;
|
||||
tmp->bit32.ttisstdcnt = tz->bit32.ttisstdcnt;
|
||||
tmp->bit32.leapcnt = tz->bit32.leapcnt;
|
||||
tmp->bit32.timecnt = tz->bit32.timecnt;
|
||||
tmp->bit32.typecnt = tz->bit32.typecnt;
|
||||
tmp->bit32.charcnt = tz->bit32.charcnt;
|
||||
|
||||
tmp->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
|
||||
memcpy(tmp->type, tz->type, tz->typecnt * sizeof(struct ttinfo));
|
||||
tmp->trans = (int32_t *) timelib_malloc(tz->bit32.timecnt * sizeof(int32_t));
|
||||
tmp->trans_idx = (unsigned char*) timelib_malloc(tz->bit32.timecnt * sizeof(unsigned char));
|
||||
memcpy(tmp->trans, tz->trans, tz->bit32.timecnt * sizeof(int32_t));
|
||||
memcpy(tmp->trans_idx, tz->trans_idx, tz->bit32.timecnt * sizeof(unsigned char));
|
||||
|
||||
tmp->timezone_abbr = (char*) malloc(tz->charcnt);
|
||||
memcpy(tmp->timezone_abbr, tz->timezone_abbr, tz->charcnt);
|
||||
tmp->type = (ttinfo*) timelib_malloc(tz->bit32.typecnt * sizeof(struct ttinfo));
|
||||
memcpy(tmp->type, tz->type, tz->bit32.typecnt * sizeof(struct ttinfo));
|
||||
|
||||
tmp->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
|
||||
memcpy(tmp->leap_times, tz->leap_times, tz->leapcnt * sizeof(tlinfo));
|
||||
tmp->timezone_abbr = (char*) timelib_malloc(tz->bit32.charcnt);
|
||||
memcpy(tmp->timezone_abbr, tz->timezone_abbr, tz->bit32.charcnt);
|
||||
|
||||
tmp->leap_times = (tlinfo*) timelib_malloc(tz->bit32.leapcnt * sizeof(tlinfo));
|
||||
memcpy(tmp->leap_times, tz->leap_times, tz->bit32.leapcnt * sizeof(tlinfo));
|
||||
|
||||
return tmp;
|
||||
}
|
||||
@@ -166,23 +171,23 @@ void timelib_error_container_dtor(timelib_error_container *errors)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < errors->warning_count; i++) {
|
||||
free(errors->warning_messages[i].message);
|
||||
timelib_free(errors->warning_messages[i].message);
|
||||
}
|
||||
free(errors->warning_messages);
|
||||
timelib_free(errors->warning_messages);
|
||||
for (i = 0; i < errors->error_count; i++) {
|
||||
free(errors->error_messages[i].message);
|
||||
timelib_free(errors->error_messages[i].message);
|
||||
}
|
||||
free(errors->error_messages);
|
||||
free(errors);
|
||||
timelib_free(errors->error_messages);
|
||||
timelib_free(errors);
|
||||
}
|
||||
|
||||
signed long timelib_date_to_int(timelib_time *d, int *error)
|
||||
timelib_long timelib_date_to_int(timelib_time *d, int *error)
|
||||
{
|
||||
timelib_sll ts;
|
||||
|
||||
ts = d->sse;
|
||||
|
||||
if (ts < LONG_MIN || ts > LONG_MAX) {
|
||||
if (ts < TIMELIB_LONG_MIN || ts > TIMELIB_LONG_MAX) {
|
||||
if (error) {
|
||||
*error = 1;
|
||||
}
|
||||
@@ -191,7 +196,7 @@ signed long timelib_date_to_int(timelib_time *d, int *error)
|
||||
if (error) {
|
||||
*error = 0;
|
||||
}
|
||||
return (signed long) d->sse;
|
||||
return (timelib_long) d->sse;
|
||||
}
|
||||
|
||||
void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec)
|
||||
@@ -236,7 +241,7 @@ void timelib_dump_date(timelib_time *d, int options)
|
||||
|
||||
if ((options & 1) == 1) {
|
||||
if (d->have_relative) {
|
||||
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS",
|
||||
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS",
|
||||
d->relative.y, d->relative.m, d->relative.d, d->relative.h, d->relative.i, d->relative.s);
|
||||
if (d->relative.first_last_day_of != 0) {
|
||||
switch (d->relative.first_last_day_of) {
|
||||
@@ -271,7 +276,7 @@ void timelib_dump_date(timelib_time *d, int options)
|
||||
|
||||
void timelib_dump_rel_time(timelib_rel_time *d)
|
||||
{
|
||||
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS (days: %lld)%s",
|
||||
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS (days: %lld)%s",
|
||||
d->y, d->m, d->d, d->h, d->i, d->s, d->days, d->invert ? " inverted" : "");
|
||||
if (d->first_last_day_of != 0) {
|
||||
switch (d->first_last_day_of) {
|
||||
@@ -286,10 +291,10 @@ void timelib_dump_rel_time(timelib_rel_time *d)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
long timelib_parse_tz_cor(char **ptr)
|
||||
timelib_long timelib_parse_tz_cor(char **ptr)
|
||||
{
|
||||
char *begin = *ptr, *end;
|
||||
long tmp;
|
||||
timelib_long tmp;
|
||||
|
||||
while (isdigit(**ptr) || **ptr == ':') {
|
||||
++*ptr;
|
||||
|
||||
+41
-28
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef __TIMELIB_H__
|
||||
#define __TIMELIB_H__
|
||||
|
||||
@@ -26,7 +30,16 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201102
|
||||
#ifndef timelib_malloc
|
||||
# define timelib_malloc malloc
|
||||
# define timelib_realloc realloc
|
||||
# define timelib_calloc calloc
|
||||
# define timelib_strdup strdup
|
||||
# define timelib_free free
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201502
|
||||
#define TIMELIB_ASCII_VERSION "2015.02"
|
||||
|
||||
#define TIMELIB_NONE 0x00
|
||||
#define TIMELIB_OVERRIDE_TIME 0x01
|
||||
@@ -71,17 +84,17 @@ int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s);
|
||||
int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d);
|
||||
|
||||
/* From parse_date.re */
|
||||
timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
|
||||
timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
|
||||
timelib_time *timelib_strtotime(char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
|
||||
timelib_time *timelib_parse_from_format(char *format, char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
|
||||
void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options);
|
||||
char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst);
|
||||
char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst);
|
||||
const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
|
||||
long timelib_parse_tz_cor(char**);
|
||||
timelib_long timelib_parse_tz_cor(char**);
|
||||
|
||||
/* From parse_iso_intervals.re */
|
||||
void timelib_strtointerval(char *s, int len,
|
||||
timelib_time **begin, timelib_time **end,
|
||||
timelib_rel_time **period, int *recurrences,
|
||||
void timelib_strtointerval(char *s, size_t len,
|
||||
timelib_time **begin, timelib_time **end,
|
||||
timelib_rel_time **period, int *recurrences,
|
||||
struct timelib_error_container **errors);
|
||||
|
||||
|
||||
@@ -108,7 +121,7 @@ timelib_sll timelib_get_current_offset(timelib_time *t);
|
||||
void timelib_dump_tzinfo(timelib_tzinfo *tz);
|
||||
const timelib_tzdb *timelib_builtin_db(void);
|
||||
const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count);
|
||||
long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper);
|
||||
timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper);
|
||||
|
||||
/* From timelib.c */
|
||||
timelib_tzinfo* timelib_tzinfo_ctor(char *name);
|
||||
@@ -131,12 +144,12 @@ void timelib_time_offset_dtor(timelib_time_offset* t);
|
||||
|
||||
void timelib_error_container_dtor(timelib_error_container *errors);
|
||||
|
||||
signed long timelib_date_to_int(timelib_time *d, int *error);
|
||||
timelib_long timelib_date_to_int(timelib_time *d, int *error);
|
||||
void timelib_dump_date(timelib_time *d, int options);
|
||||
void timelib_dump_rel_time(timelib_rel_time *d);
|
||||
|
||||
void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec);
|
||||
long timelib_parse_tz_cor(char **ptr);
|
||||
timelib_long timelib_parse_tz_cor(char **ptr);
|
||||
|
||||
/* from astro.c */
|
||||
double timelib_ts_to_juliandate(timelib_sll ts);
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef __TIMELIB_STRUCTS_H__
|
||||
#define __TIMELIB_STRUCTS_H__
|
||||
|
||||
@@ -121,6 +125,24 @@ typedef unsigned __int64 uint64_t;
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
|
||||
typedef int64_t timelib_long;
|
||||
typedef uint64_t timelib_ulong;
|
||||
# define TIMELIB_LONG_MAX INT64_MAX
|
||||
# define TIMELIB_LONG_MIN INT64_MIN
|
||||
# define TIMELIB_ULONG_MAX UINT64_MAX
|
||||
# define TIMELIB_LONG_FMT "%" PRId64
|
||||
# define TIMELIB_ULONG_FMT "%" PRIu64
|
||||
#else
|
||||
typedef int32_t timelib_long;
|
||||
typedef uint32_t timelib_ulong;
|
||||
# define TIMELIB_LONG_MAX INT32_MAX
|
||||
# define TIMELIB_LONG_MIN INT32_MIN
|
||||
# define TIMELIB_ULONG_MAX UINT32_MAX
|
||||
# define TIMELIB_LONG_FMT "%" PRId32
|
||||
# define TIMELIB_ULONG_FMT "%" PRIu32
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
typedef uint64_t timelib_ull;
|
||||
typedef int64_t timelib_sll;
|
||||
@@ -158,12 +180,22 @@ typedef struct tlocinfo
|
||||
typedef struct timelib_tzinfo
|
||||
{
|
||||
char *name;
|
||||
uint32_t ttisgmtcnt;
|
||||
uint32_t ttisstdcnt;
|
||||
uint32_t leapcnt;
|
||||
uint32_t timecnt;
|
||||
uint32_t typecnt;
|
||||
uint32_t charcnt;
|
||||
struct {
|
||||
uint32_t ttisgmtcnt;
|
||||
uint32_t ttisstdcnt;
|
||||
uint32_t leapcnt;
|
||||
uint32_t timecnt;
|
||||
uint32_t typecnt;
|
||||
uint32_t charcnt;
|
||||
} bit32;
|
||||
struct {
|
||||
uint64_t ttisgmtcnt;
|
||||
uint64_t ttisstdcnt;
|
||||
uint64_t leapcnt;
|
||||
uint64_t timecnt;
|
||||
uint64_t typecnt;
|
||||
uint64_t charcnt;
|
||||
} bit64;
|
||||
|
||||
int32_t *trans;
|
||||
unsigned char *trans_idx;
|
||||
@@ -239,10 +271,10 @@ typedef struct timelib_error_message {
|
||||
} timelib_error_message;
|
||||
|
||||
typedef struct timelib_error_container {
|
||||
int warning_count;
|
||||
struct timelib_error_message *error_messages;
|
||||
struct timelib_error_message *warning_messages;
|
||||
int error_count;
|
||||
struct timelib_error_message *error_messages;
|
||||
int warning_count;
|
||||
} timelib_error_container;
|
||||
|
||||
typedef struct _timelib_tz_lookup_table {
|
||||
|
||||
+45360
-16631
File diff suppressed because it is too large.
Load diff
+47
-63
@@ -23,9 +23,6 @@
|
||||
{ "acwst", 0, 31500, "Australia/Eucla" },
|
||||
{ "addt", 1, -7200, "America/Goose_Bay" },
|
||||
{ "addt", 1, -7200, "America/Pangnirtung" },
|
||||
{ "admt", 0, 9320, "Africa/Addis_Ababa" },
|
||||
{ "admt", 0, 9320, "Africa/Asmara" },
|
||||
{ "admt", 0, 9320, "Africa/Asmera" },
|
||||
{ "adt", 1, -10800, "America/Halifax" },
|
||||
{ "adt", 1, -10800, "America/Barbados" },
|
||||
{ "adt", 1, -10800, "America/Blanc-Sablon" },
|
||||
@@ -124,7 +121,6 @@
|
||||
{ "ant", 0, -16200, "America/Aruba" },
|
||||
{ "ant", 0, -16200, "America/Kralendijk" },
|
||||
{ "ant", 0, -16200, "America/Lower_Princes" },
|
||||
{ "aot", 0, 3124, "Africa/Luanda" },
|
||||
{ "apt", 1, -10800, "America/Halifax" },
|
||||
{ "apt", 1, -10800, "America/Blanc-Sablon" },
|
||||
{ "apt", 1, -10800, "America/Glace_Bay" },
|
||||
@@ -236,6 +232,7 @@
|
||||
{ "ast", 0, -14400, "America/Dominica" },
|
||||
{ "ast", 0, -14400, "America/Glace_Bay" },
|
||||
{ "ast", 0, -14400, "America/Goose_Bay" },
|
||||
{ "ast", 0, -14400, "America/Grand_Turk" },
|
||||
{ "ast", 0, -14400, "America/Grenada" },
|
||||
{ "ast", 0, -14400, "America/Guadeloupe" },
|
||||
{ "ast", 0, -14400, "America/Halifax" },
|
||||
@@ -305,16 +302,34 @@
|
||||
{ "bdt", 1, -36000, "America/Nome" },
|
||||
{ "bdt", 0, 21600, "Asia/Dhaka" },
|
||||
{ "beat", 0, 9000, "Africa/Mogadishu" },
|
||||
{ "beat", 0, 9000, "Africa/Addis_Ababa" },
|
||||
{ "beat", 0, 9000, "Africa/Asmara" },
|
||||
{ "beat", 0, 9000, "Africa/Asmera" },
|
||||
{ "beat", 0, 9000, "Africa/Dar_es_Salaam" },
|
||||
{ "beat", 0, 9000, "Africa/Djibouti" },
|
||||
{ "beat", 0, 9000, "Africa/Kampala" },
|
||||
{ "beat", 0, 9000, "Africa/Nairobi" },
|
||||
{ "beat", 0, 9000, "Indian/Antananarivo" },
|
||||
{ "beat", 0, 9000, "Indian/Comoro" },
|
||||
{ "beat", 0, 9000, "Indian/Mayotte" },
|
||||
{ "beaut", 0, 9900, "Africa/Nairobi" },
|
||||
{ "beaut", 0, 9900, "Africa/Addis_Ababa" },
|
||||
{ "beaut", 0, 9900, "Africa/Asmara" },
|
||||
{ "beaut", 0, 9900, "Africa/Asmera" },
|
||||
{ "beaut", 0, 9900, "Africa/Dar_es_Salaam" },
|
||||
{ "beaut", 0, 9900, "Africa/Djibouti" },
|
||||
{ "beaut", 0, 9900, "Africa/Kampala" },
|
||||
{ "beaut", 0, 9900, "Africa/Mogadishu" },
|
||||
{ "beaut", 0, 9900, "Indian/Antananarivo" },
|
||||
{ "beaut", 0, 9900, "Indian/Comoro" },
|
||||
{ "beaut", 0, 9900, "Indian/Mayotte" },
|
||||
{ "bmt", 0, -14309, "America/Barbados" },
|
||||
{ "bmt", 0, 6264, "Europe/Tiraspol" },
|
||||
{ "bmt", 0, -17776, "America/Bogota" },
|
||||
{ "bmt", 0, 10656, "Asia/Baghdad" },
|
||||
{ "bmt", 0, 24124, "Asia/Bangkok" },
|
||||
{ "bmt", 0, 24124, "Asia/Phnom_Penh" },
|
||||
{ "bmt", 0, 24124, "Asia/Vientiane" },
|
||||
{ "bmt", 0, 25632, "Asia/Jakarta" },
|
||||
{ "bmt", 0, 6264, "Europe/Bucharest" },
|
||||
{ "bmt", 0, 6264, "Europe/Chisinau" },
|
||||
@@ -362,6 +377,7 @@
|
||||
{ "bst", 1, 3600, "Europe/Isle_of_Man" },
|
||||
{ "bst", 1, 3600, "Europe/Jersey" },
|
||||
{ "bst", 1, 3600, "GB" },
|
||||
{ "bst", 0, 39600, "Pacific/Bougainville" },
|
||||
{ "btt", 0, 21600, "Asia/Thimbu" },
|
||||
{ "btt", 0, 21600, "Asia/Thimphu" },
|
||||
{ "burt", 0, 23400, "Asia/Kolkata" },
|
||||
@@ -372,7 +388,6 @@
|
||||
{ "cant", 0, -3600, "Atlantic/Canary" },
|
||||
{ "capt", 1, -32400, "America/Anchorage" },
|
||||
{ "cast", 0, 34200, "Australia/Adelaide" },
|
||||
{ "cast", 1, 10800, "Africa/Gaborone" },
|
||||
{ "cast", 1, 10800, "Africa/Juba" },
|
||||
{ "cast", 1, 10800, "Africa/Khartoum" },
|
||||
{ "cast", 0, 39600, "Antarctica/Casey" },
|
||||
@@ -445,7 +460,6 @@
|
||||
{ "cdt", 1, 32400, "PRC" },
|
||||
{ "cdt", 1, 32400, "ROC" },
|
||||
{ "cemt", 1, 10800, "Europe/Berlin" },
|
||||
{ "cemt", 1, 10800, "CET" },
|
||||
{ "cest", 1, 7200, "Europe/Berlin" },
|
||||
{ "cest", 1, 10800, "Europe/Kaliningrad" },
|
||||
{ "cest", 1, 7200, "Africa/Algiers" },
|
||||
@@ -455,7 +469,6 @@
|
||||
{ "cest", 1, 7200, "Antarctica/Troll" },
|
||||
{ "cest", 1, 7200, "Arctic/Longyearbyen" },
|
||||
{ "cest", 1, 7200, "Atlantic/Jan_Mayen" },
|
||||
{ "cest", 1, 7200, "CET" },
|
||||
{ "cest", 1, 7200, "Europe/Amsterdam" },
|
||||
{ "cest", 1, 7200, "Europe/Andorra" },
|
||||
{ "cest", 1, 7200, "Europe/Athens" },
|
||||
@@ -500,7 +513,6 @@
|
||||
{ "cest", 1, 7200, "Europe/Zagreb" },
|
||||
{ "cest", 1, 7200, "Europe/Zaporozhye" },
|
||||
{ "cest", 1, 7200, "Europe/Zurich" },
|
||||
{ "cest", 1, 7200, "WET" },
|
||||
{ "cet", 0, 3600, "Europe/Berlin" },
|
||||
{ "cet", 0, 7200, "Europe/Kaliningrad" },
|
||||
{ "cet", 0, 3600, "Africa/Algiers" },
|
||||
@@ -510,7 +522,6 @@
|
||||
{ "cet", 0, 3600, "Africa/Tunis" },
|
||||
{ "cet", 0, 3600, "Arctic/Longyearbyen" },
|
||||
{ "cet", 0, 3600, "Atlantic/Jan_Mayen" },
|
||||
{ "cet", 0, 3600, "CET" },
|
||||
{ "cet", 0, 3600, "Europe/Amsterdam" },
|
||||
{ "cet", 0, 3600, "Europe/Andorra" },
|
||||
{ "cet", 0, 3600, "Europe/Athens" },
|
||||
@@ -555,7 +566,6 @@
|
||||
{ "cet", 0, 3600, "Europe/Zagreb" },
|
||||
{ "cet", 0, 3600, "Europe/Zaporozhye" },
|
||||
{ "cet", 0, 3600, "Europe/Zurich" },
|
||||
{ "cet", 0, 3600, "WET" },
|
||||
{ "cgst", 1, -3600, "America/Scoresbysund" },
|
||||
{ "cgt", 0, -7200, "America/Scoresbysund" },
|
||||
{ "chadt", 1, 49500, "Pacific/Chatham" },
|
||||
@@ -563,6 +573,7 @@
|
||||
{ "chast", 0, 44100, "Pacific/Chatham" },
|
||||
{ "chdt", 1, -19800, "America/Belize" },
|
||||
{ "chost", 1, 36000, "Asia/Choibalsan" },
|
||||
{ "chost", 1, 32400, "Asia/Choibalsan" },
|
||||
{ "chot", 0, 32400, "Asia/Choibalsan" },
|
||||
{ "chot", 0, 28800, "Asia/Choibalsan" },
|
||||
{ "chut", 0, 36000, "Pacific/Chuuk" },
|
||||
@@ -577,7 +588,10 @@
|
||||
{ "clst", 1, -10800, "Chile/Continental" },
|
||||
{ "clst", 1, -14400, "Chile/Continental" },
|
||||
{ "clt", 0, -14400, "America/Santiago" },
|
||||
{ "clt", 0, -10800, "America/Santiago" },
|
||||
{ "clt", 0, -18000, "America/Santiago" },
|
||||
{ "clt", 0, -10800, "Antarctica/Palmer" },
|
||||
{ "clt", 0, -10800, "Chile/Continental" },
|
||||
{ "clt", 0, -14400, "Antarctica/Palmer" },
|
||||
{ "clt", 0, -14400, "Chile/Continental" },
|
||||
{ "clt", 0, -18000, "Chile/Continental" },
|
||||
@@ -602,6 +616,7 @@
|
||||
{ "cmt", 0, -15408, "America/Rosario" },
|
||||
{ "cmt", 0, -16060, "America/Caracas" },
|
||||
{ "cmt", 0, -16356, "America/La_Paz" },
|
||||
{ "cmt", 0, -19176, "America/Cayman" },
|
||||
{ "cmt", 0, -19176, "America/Panama" },
|
||||
{ "cmt", 0, 6900, "Europe/Chisinau" },
|
||||
{ "cmt", 0, 6900, "Europe/Tiraspol" },
|
||||
@@ -735,9 +750,10 @@
|
||||
{ "easst", 1, -18000, "Chile/EasterIsland" },
|
||||
{ "easst", 1, -18000, "Pacific/Easter" },
|
||||
{ "easst", 1, -21600, "Pacific/Easter" },
|
||||
{ "east", 0, -18000, "Chile/EasterIsland" },
|
||||
{ "east", 0, -21600, "Chile/EasterIsland" },
|
||||
{ "east", 0, -25200, "Chile/EasterIsland" },
|
||||
{ "east", 1, 14400, "Indian/Antananarivo" },
|
||||
{ "east", 0, -18000, "Pacific/Easter" },
|
||||
{ "east", 0, -21600, "Pacific/Easter" },
|
||||
{ "east", 0, -25200, "Pacific/Easter" },
|
||||
{ "eat", 0, 10800, "Africa/Khartoum" },
|
||||
@@ -783,7 +799,6 @@
|
||||
{ "edt", 1, -14400, "America/Thunder_Bay" },
|
||||
{ "edt", 1, -14400, "America/Toronto" },
|
||||
{ "edt", 1, -14400, "Canada/Eastern" },
|
||||
{ "edt", 1, -14400, "EST" },
|
||||
{ "eest", 1, 10800, "Europe/Helsinki" },
|
||||
{ "eest", 1, 10800, "Africa/Cairo" },
|
||||
{ "eest", 1, 10800, "Asia/Amman" },
|
||||
@@ -793,7 +808,6 @@
|
||||
{ "eest", 1, 10800, "Asia/Hebron" },
|
||||
{ "eest", 1, 10800, "Asia/Istanbul" },
|
||||
{ "eest", 1, 10800, "Asia/Nicosia" },
|
||||
{ "eest", 1, 10800, "EET" },
|
||||
{ "eest", 1, 10800, "Europe/Athens" },
|
||||
{ "eest", 1, 10800, "Europe/Bucharest" },
|
||||
{ "eest", 1, 10800, "Europe/Chisinau" },
|
||||
@@ -826,7 +840,6 @@
|
||||
{ "eet", 0, 7200, "Asia/Hebron" },
|
||||
{ "eet", 0, 7200, "Asia/Istanbul" },
|
||||
{ "eet", 0, 7200, "Asia/Nicosia" },
|
||||
{ "eet", 0, 7200, "EET" },
|
||||
{ "eet", 0, 7200, "Europe/Athens" },
|
||||
{ "eet", 0, 7200, "Europe/Bucharest" },
|
||||
{ "eet", 0, 7200, "Europe/Chisinau" },
|
||||
@@ -859,9 +872,7 @@
|
||||
{ "ept", 1, -14400, "America/Thunder_Bay" },
|
||||
{ "ept", 1, -14400, "America/Toronto" },
|
||||
{ "ept", 1, -14400, "Canada/Eastern" },
|
||||
{ "ept", 1, -14400, "EST" },
|
||||
{ "est", 0, -18000, "America/New_York" },
|
||||
{ "est", 0, -18000, "America/Antigua" },
|
||||
{ "est", 0, -18000, "America/Atikokan" },
|
||||
{ "est", 0, -18000, "America/Cambridge_Bay" },
|
||||
{ "est", 0, -18000, "America/Cancun" },
|
||||
@@ -902,7 +913,6 @@
|
||||
{ "est", 0, -18000, "America/Thunder_Bay" },
|
||||
{ "est", 0, -18000, "America/Toronto" },
|
||||
{ "est", 0, -18000, "Canada/Eastern" },
|
||||
{ "est", 0, -18000, "EST" },
|
||||
{ "ewt", 1, -14400, "America/New_York" },
|
||||
{ "ewt", 1, -14400, "America/Detroit" },
|
||||
{ "ewt", 1, -14400, "America/Iqaluit" },
|
||||
@@ -911,7 +921,6 @@
|
||||
{ "ewt", 1, -14400, "America/Thunder_Bay" },
|
||||
{ "ewt", 1, -14400, "America/Toronto" },
|
||||
{ "ewt", 1, -14400, "Canada/Eastern" },
|
||||
{ "ewt", 1, -14400, "EST" },
|
||||
{ "fet", 0, 10800, "Europe/Kaliningrad" },
|
||||
{ "fet", 0, 10800, "Europe/Minsk" },
|
||||
{ "ffmt", 0, -14660, "America/Martinique" },
|
||||
@@ -953,12 +962,9 @@
|
||||
{ "gmt", 0, 0, "Africa/Dakar" },
|
||||
{ "gmt", 0, 0, "Africa/Freetown" },
|
||||
{ "gmt", 0, 0, "Africa/Lome" },
|
||||
{ "gmt", 0, 0, "Africa/Malabo" },
|
||||
{ "gmt", 0, 0, "Africa/Monrovia" },
|
||||
{ "gmt", 0, 0, "Africa/Niamey" },
|
||||
{ "gmt", 0, 0, "Africa/Nouakchott" },
|
||||
{ "gmt", 0, 0, "Africa/Ouagadougou" },
|
||||
{ "gmt", 0, 0, "Africa/Porto-Novo" },
|
||||
{ "gmt", 0, 0, "Africa/Sao_Tome" },
|
||||
{ "gmt", 0, 0, "Africa/Timbuktu" },
|
||||
{ "gmt", 0, 0, "America/Danmarkshavn" },
|
||||
@@ -980,6 +986,7 @@
|
||||
{ "gst", 0, 14400, "Asia/Muscat" },
|
||||
{ "gst", 0, 14400, "Asia/Qatar" },
|
||||
{ "gst", 0, 36000, "Pacific/Guam" },
|
||||
{ "gst", 0, 36000, "Pacific/Saipan" },
|
||||
{ "gyt", 0, -14400, "America/Guyana" },
|
||||
{ "gyt", 0, -10800, "America/Guyana" },
|
||||
{ "gyt", 0, -13500, "America/Guyana" },
|
||||
@@ -988,7 +995,6 @@
|
||||
{ "hast", 0, -36000, "America/Adak" },
|
||||
{ "hast", 0, -36000, "America/Atka" },
|
||||
{ "hdt", 1, -34200, "Pacific/Honolulu" },
|
||||
{ "hdt", 1, -34200, "HST" },
|
||||
{ "hdt", 1, -34200, "Pacific/Johnston" },
|
||||
{ "hkst", 1, 32400, "Asia/Hong_Kong" },
|
||||
{ "hkt", 0, 28800, "Asia/Hong_Kong" },
|
||||
@@ -998,7 +1004,6 @@
|
||||
{ "hmt", 0, 21200, "Asia/Dacca" },
|
||||
{ "hmt", 0, 21200, "Asia/Dhaka" },
|
||||
{ "hmt", 0, 21200, "Asia/Kolkata" },
|
||||
{ "hmt", 0, 5989, "EET" },
|
||||
{ "hmt", 0, 5989, "Europe/Helsinki" },
|
||||
{ "hmt", 0, 5989, "Europe/Mariehamn" },
|
||||
{ "hovst", 1, 28800, "Asia/Hovd" },
|
||||
@@ -1006,27 +1011,23 @@
|
||||
{ "hovt", 0, 21600, "Asia/Hovd" },
|
||||
{ "hst", 0, -36000, "Pacific/Honolulu" },
|
||||
{ "hst", 0, -37800, "Pacific/Honolulu" },
|
||||
{ "hst", 0, -36000, "HST" },
|
||||
{ "hst", 0, -36000, "Pacific/Johnston" },
|
||||
{ "hst", 0, -37800, "HST" },
|
||||
{ "hst", 0, -37800, "Pacific/Johnston" },
|
||||
{ "ict", 0, 25200, "Asia/Bangkok" },
|
||||
{ "ict", 0, 25200, "Asia/Ho_Chi_Minh" },
|
||||
{ "ict", 0, 25200, "Asia/Phnom_Penh" },
|
||||
{ "ict", 0, 25200, "Asia/Saigon" },
|
||||
{ "ict", 0, 25200, "Asia/Vientiane" },
|
||||
{ "ict", 0, 28800, "Asia/Ho_Chi_Minh" },
|
||||
{ "ict", 0, 28800, "Asia/Phnom_Penh" },
|
||||
{ "ict", 0, 28800, "Asia/Saigon" },
|
||||
{ "ict", 0, 28800, "Asia/Vientiane" },
|
||||
{ "iddt", 1, 14400, "Asia/Jerusalem" },
|
||||
{ "iddt", 1, 14400, "Asia/Tel_Aviv" },
|
||||
{ "idt", 1, 10800, "Asia/Jerusalem" },
|
||||
{ "idt", 1, 10800, "Asia/Gaza" },
|
||||
{ "idt", 1, 10800, "Asia/Hebron" },
|
||||
{ "idt", 1, 10800, "Asia/Tel_Aviv" },
|
||||
{ "idt", 0, 28800, "Asia/Ho_Chi_Minh" },
|
||||
{ "idt", 0, 28800, "Asia/Saigon" },
|
||||
{ "ihst", 1, 21600, "Asia/Colombo" },
|
||||
{ "imt", 0, 25035, "Asia/Irkutsk" },
|
||||
{ "imt", 0, 25025, "Asia/Irkutsk" },
|
||||
{ "imt", 0, 7016, "Asia/Istanbul" },
|
||||
{ "imt", 0, 7016, "Europe/Istanbul" },
|
||||
{ "iot", 0, 21600, "Indian/Chagos" },
|
||||
@@ -1075,6 +1076,7 @@
|
||||
{ "jmt", 0, 8440, "Asia/Tel_Aviv" },
|
||||
{ "jst", 0, 32400, "Asia/Tokyo" },
|
||||
{ "jst", 0, 32400, "Asia/Dili" },
|
||||
{ "jst", 0, 32400, "Asia/Ho_Chi_Minh" },
|
||||
{ "jst", 0, 32400, "Asia/Hong_Kong" },
|
||||
{ "jst", 0, 32400, "Asia/Jakarta" },
|
||||
{ "jst", 0, 32400, "Asia/Kuala_Lumpur" },
|
||||
@@ -1084,11 +1086,13 @@
|
||||
{ "jst", 0, 32400, "Asia/Pontianak" },
|
||||
{ "jst", 0, 32400, "Asia/Pyongyang" },
|
||||
{ "jst", 0, 32400, "Asia/Rangoon" },
|
||||
{ "jst", 0, 32400, "Asia/Saigon" },
|
||||
{ "jst", 0, 32400, "Asia/Sakhalin" },
|
||||
{ "jst", 0, 32400, "Asia/Seoul" },
|
||||
{ "jst", 0, 32400, "Asia/Singapore" },
|
||||
{ "jst", 0, 32400, "Asia/Taipei" },
|
||||
{ "jst", 0, 32400, "Asia/Ujung_Pandang" },
|
||||
{ "jst", 0, 32400, "Pacific/Bougainville" },
|
||||
{ "jst", 0, 32400, "Pacific/Nauru" },
|
||||
{ "jst", 0, 32400, "ROC" },
|
||||
{ "jst", 0, 32400, "ROK" },
|
||||
@@ -1096,8 +1100,8 @@
|
||||
{ "jwst", 0, 28800, "ROC" },
|
||||
{ "kart", 0, 18000, "Asia/Karachi" },
|
||||
{ "kdt", 1, 36000, "Asia/Seoul" },
|
||||
{ "kdt", 1, 32400, "Asia/Seoul" },
|
||||
{ "kdt", 1, 32400, "ROK" },
|
||||
{ "kdt", 1, 34200, "Asia/Seoul" },
|
||||
{ "kdt", 1, 34200, "ROK" },
|
||||
{ "kdt", 1, 36000, "ROK" },
|
||||
{ "kgst", 1, 21600, "Asia/Bishkek" },
|
||||
{ "kgt", 0, 18000, "Asia/Bishkek" },
|
||||
@@ -1107,7 +1111,6 @@
|
||||
{ "kizt", 0, 14400, "Asia/Qyzylorda" },
|
||||
{ "kizt", 0, 18000, "Asia/Qyzylorda" },
|
||||
{ "kmt", 0, 5736, "Europe/Vilnius" },
|
||||
{ "kmt", 0, -18431, "America/Cayman" },
|
||||
{ "kmt", 0, -18431, "America/Grand_Turk" },
|
||||
{ "kmt", 0, -18431, "America/Jamaica" },
|
||||
{ "kmt", 0, 7324, "Europe/Kiev" },
|
||||
@@ -1122,12 +1125,9 @@
|
||||
{ "krat", 0, 28800, "Asia/Krasnoyarsk" },
|
||||
{ "krat", 0, 21600, "Asia/Novokuznetsk" },
|
||||
{ "krat", 0, 25200, "Asia/Novokuznetsk" },
|
||||
{ "kst", 0, 28800, "Asia/Seoul" },
|
||||
{ "kst", 0, 30600, "Asia/Seoul" },
|
||||
{ "kst", 0, 32400, "Asia/Pyongyang" },
|
||||
{ "kst", 0, 32400, "Asia/Seoul" },
|
||||
{ "kst", 0, 28800, "Asia/Pyongyang" },
|
||||
{ "kst", 0, 28800, "ROK" },
|
||||
{ "kst", 0, 30600, "Asia/Pyongyang" },
|
||||
{ "kst", 0, 30600, "ROK" },
|
||||
{ "kst", 0, 32400, "ROK" },
|
||||
@@ -1147,7 +1147,7 @@
|
||||
{ "lkt", 0, 23400, "Asia/Colombo" },
|
||||
{ "lkt", 0, 21600, "Asia/Colombo" },
|
||||
{ "lrt", 0, -2670, "Africa/Monrovia" },
|
||||
{ "lst", 1, 9388, "Europe/Riga" },
|
||||
{ "lst", 1, 9394, "Europe/Riga" },
|
||||
{ "madmt", 1, 3600, "Atlantic/Madeira" },
|
||||
{ "madst", 1, 0, "Atlantic/Madeira" },
|
||||
{ "madt", 0, -3600, "Atlantic/Madeira" },
|
||||
@@ -1202,9 +1202,6 @@
|
||||
{ "mdt", 1, -21600, "Canada/Mountain" },
|
||||
{ "mdt", 1, -21600, "Canada/Saskatchewan" },
|
||||
{ "mdt", 1, -21600, "Mexico/BajaSur" },
|
||||
{ "mdt", 1, -21600, "MST" },
|
||||
{ "mest", 1, 7200, "MET" },
|
||||
{ "met", 0, 3600, "MET" },
|
||||
{ "mht", 0, 43200, "Pacific/Kwajalein" },
|
||||
{ "mht", 0, 39600, "Pacific/Kwajalein" },
|
||||
{ "mht", 0, 39600, "Pacific/Majuro" },
|
||||
@@ -1226,7 +1223,6 @@
|
||||
{ "mot", 0, 28800, "Asia/Macao" },
|
||||
{ "mot", 0, 28800, "Asia/Macau" },
|
||||
{ "mpt", 1, -21600, "America/Denver" },
|
||||
{ "mpt", 0, 36000, "Pacific/Saipan" },
|
||||
{ "mpt", 1, -21600, "America/Boise" },
|
||||
{ "mpt", 1, -21600, "America/Cambridge_Bay" },
|
||||
{ "mpt", 1, -21600, "America/Edmonton" },
|
||||
@@ -1240,8 +1236,6 @@
|
||||
{ "mpt", 1, -21600, "Canada/East-Saskatchewan" },
|
||||
{ "mpt", 1, -21600, "Canada/Mountain" },
|
||||
{ "mpt", 1, -21600, "Canada/Saskatchewan" },
|
||||
{ "mpt", 1, -21600, "MST" },
|
||||
{ "mpt", 0, 32400, "Pacific/Saipan" },
|
||||
{ "msd", 1, 14400, "Europe/Moscow" },
|
||||
{ "msd", 1, 14400, "Europe/Chisinau" },
|
||||
{ "msd", 1, 14400, "Europe/Kaliningrad" },
|
||||
@@ -1254,6 +1248,7 @@
|
||||
{ "msd", 1, 14400, "Europe/Tiraspol" },
|
||||
{ "msd", 1, 14400, "Europe/Uzhgorod" },
|
||||
{ "msd", 1, 14400, "Europe/Vilnius" },
|
||||
{ "msd", 1, 14400, "Europe/Volgograd" },
|
||||
{ "msd", 1, 14400, "Europe/Zaporozhye" },
|
||||
{ "msk", 0, 10800, "Europe/Moscow" },
|
||||
{ "msk", 0, 14400, "Europe/Moscow" },
|
||||
@@ -1272,7 +1267,6 @@
|
||||
{ "msk", 0, 10800, "Europe/Zaporozhye" },
|
||||
{ "msk", 0, 14400, "Europe/Simferopol" },
|
||||
{ "msk", 0, 14400, "Europe/Volgograd" },
|
||||
{ "msk", 1, 14400, "Europe/Volgograd" },
|
||||
{ "msm", 1, 18000, "Europe/Moscow" },
|
||||
{ "mst", 0, -25200, "America/Denver" },
|
||||
{ "mst", 0, -25200, "America/Bahia_Banderas" },
|
||||
@@ -1304,7 +1298,6 @@
|
||||
{ "mst", 0, -25200, "Mexico/BajaNorte" },
|
||||
{ "mst", 0, -25200, "Mexico/BajaSur" },
|
||||
{ "mst", 0, -25200, "Mexico/General" },
|
||||
{ "mst", 0, -25200, "MST" },
|
||||
{ "mst", 1, 12679, "Europe/Moscow" },
|
||||
{ "must", 1, 18000, "Indian/Mauritius" },
|
||||
{ "mut", 0, 14400, "Indian/Mauritius" },
|
||||
@@ -1324,7 +1317,6 @@
|
||||
{ "mwt", 1, -21600, "Canada/East-Saskatchewan" },
|
||||
{ "mwt", 1, -21600, "Canada/Mountain" },
|
||||
{ "mwt", 1, -21600, "Canada/Saskatchewan" },
|
||||
{ "mwt", 1, -21600, "MST" },
|
||||
{ "myt", 0, 28800, "Asia/Kuala_Lumpur" },
|
||||
{ "myt", 0, 28800, "Asia/Kuching" },
|
||||
{ "ncst", 1, 43200, "Pacific/Noumea" },
|
||||
@@ -1333,7 +1325,6 @@
|
||||
{ "nddt", 1, -5400, "Canada/Newfoundland" },
|
||||
{ "ndt", 1, -9052, "America/St_Johns" },
|
||||
{ "ndt", 1, -9000, "America/St_Johns" },
|
||||
{ "ndt", 1, -36000, "Pacific/Midway" },
|
||||
{ "ndt", 1, -9000, "America/Goose_Bay" },
|
||||
{ "ndt", 1, -9000, "Canada/Newfoundland" },
|
||||
{ "ndt", 1, -9052, "America/Goose_Bay" },
|
||||
@@ -1342,7 +1333,6 @@
|
||||
{ "nest", 1, 4800, "Europe/Amsterdam" },
|
||||
{ "net", 0, 1200, "Europe/Amsterdam" },
|
||||
{ "nft", 0, 41400, "Pacific/Norfolk" },
|
||||
{ "nmt", 0, 20928, "Asia/Novokuznetsk" },
|
||||
{ "nmt", 0, 40320, "Pacific/Norfolk" },
|
||||
{ "novst", 1, 25200, "Asia/Novosibirsk" },
|
||||
{ "novst", 1, 28800, "Asia/Novosibirsk" },
|
||||
@@ -1433,6 +1423,7 @@
|
||||
{ "pett", 0, 43200, "Asia/Kamchatka" },
|
||||
{ "pett", 0, 39600, "Asia/Kamchatka" },
|
||||
{ "pet", 0, -18000, "America/Lima" },
|
||||
{ "pgt", 0, 36000, "Pacific/Bougainville" },
|
||||
{ "pgt", 0, 36000, "Pacific/Port_Moresby" },
|
||||
{ "phot", 0, 46800, "Pacific/Enderbury" },
|
||||
{ "phot", 0, -39600, "Pacific/Enderbury" },
|
||||
@@ -1441,17 +1432,19 @@
|
||||
{ "pht", 0, 28800, "Asia/Manila" },
|
||||
{ "pkst", 1, 21600, "Asia/Karachi" },
|
||||
{ "pkt", 0, 18000, "Asia/Karachi" },
|
||||
{ "plmt", 0, 25590, "Asia/Ho_Chi_Minh" },
|
||||
{ "plmt", 0, 25590, "Asia/Saigon" },
|
||||
{ "pmdt", 1, -7200, "America/Miquelon" },
|
||||
{ "pmst", 0, -10800, "America/Miquelon" },
|
||||
{ "pmt", 0, -13236, "America/Paramaribo" },
|
||||
{ "pmt", 0, -13252, "America/Paramaribo" },
|
||||
{ "pmt", 0, 36000, "Antarctica/DumontDUrville" },
|
||||
{ "pmt", 0, 13505, "Asia/Yekaterinburg" },
|
||||
{ "pmt", 0, 26240, "Asia/Pontianak" },
|
||||
{ "pmt", 0, 561, "Africa/Algiers" },
|
||||
{ "pmt", 0, 561, "Africa/Tunis" },
|
||||
{ "pmt", 0, 561, "Europe/Monaco" },
|
||||
{ "pmt", 0, 561, "Europe/Paris" },
|
||||
{ "pmt", 0, 561, "WET" },
|
||||
{ "pnt", 0, -30600, "Pacific/Pitcairn" },
|
||||
{ "pont", 0, 39600, "Pacific/Pohnpei" },
|
||||
{ "pont", 0, 39600, "Pacific/Ponape" },
|
||||
@@ -1509,8 +1502,7 @@
|
||||
{ "qyzt", 0, 21600, "Asia/Qyzylorda" },
|
||||
{ "qyzt", 0, 18000, "Asia/Qyzylorda" },
|
||||
{ "ret", 0, 14400, "Indian/Reunion" },
|
||||
{ "rmt", 0, 5788, "Europe/Riga" },
|
||||
{ "rmt", 0, -5268, "Atlantic/Reykjavik" },
|
||||
{ "rmt", 0, 5794, "Europe/Riga" },
|
||||
{ "rmt", 0, 23080, "Asia/Rangoon" },
|
||||
{ "rott", 0, -10800, "Antarctica/Rothera" },
|
||||
{ "sakst", 1, 39600, "Asia/Sakhalin" },
|
||||
@@ -1528,8 +1520,10 @@
|
||||
{ "sast", 1, 10800, "Africa/Johannesburg" },
|
||||
{ "sast", 0, 5400, "Africa/Johannesburg" },
|
||||
{ "sast", 1, 10800, "Africa/Maseru" },
|
||||
{ "sast", 1, 10800, "Africa/Mbabane" },
|
||||
{ "sast", 1, 10800, "Africa/Windhoek" },
|
||||
{ "sast", 0, 5400, "Africa/Gaborone" },
|
||||
{ "sast", 0, 5400, "Africa/Maseru" },
|
||||
{ "sast", 0, 5400, "Africa/Mbabane" },
|
||||
{ "sast", 0, 7200, "Africa/Maseru" },
|
||||
{ "sast", 0, 7200, "Africa/Mbabane" },
|
||||
{ "sast", 0, 7200, "Africa/Windhoek" },
|
||||
@@ -1543,15 +1537,11 @@
|
||||
{ "shet", 0, 21600, "Asia/Aqtau" },
|
||||
{ "shet", 0, 18000, "Asia/Aqtau" },
|
||||
{ "sjmt", 0, -20173, "America/Costa_Rica" },
|
||||
{ "smt", 0, 25580, "Asia/Saigon" },
|
||||
{ "smt", 0, -13884, "Atlantic/Stanley" },
|
||||
{ "smt", 0, -16966, "America/Santiago" },
|
||||
{ "smt", 0, -16966, "Chile/Continental" },
|
||||
{ "smt", 0, 24925, "Asia/Kuala_Lumpur" },
|
||||
{ "smt", 0, 24925, "Asia/Singapore" },
|
||||
{ "smt", 0, 25580, "Asia/Ho_Chi_Minh" },
|
||||
{ "smt", 0, 25580, "Asia/Phnom_Penh" },
|
||||
{ "smt", 0, 25580, "Asia/Vientiane" },
|
||||
{ "smt", 0, 8160, "Europe/Simferopol" },
|
||||
{ "sret", 0, 39600, "Asia/Srednekolymsk" },
|
||||
{ "srt", 0, -10800, "America/Paramaribo" },
|
||||
@@ -1579,7 +1569,7 @@
|
||||
{ "tbist", 1, 14400, "Asia/Tbilisi" },
|
||||
{ "tbit", 0, 14400, "Asia/Tbilisi" },
|
||||
{ "tbit", 0, 10800, "Asia/Tbilisi" },
|
||||
{ "tbmt", 0, 10746, "Asia/Tbilisi" },
|
||||
{ "tbmt", 0, 10751, "Asia/Tbilisi" },
|
||||
{ "tft", 0, 18000, "Indian/Kerguelen" },
|
||||
{ "tjt", 0, 18000, "Asia/Dushanbe" },
|
||||
{ "tkt", 0, -39600, "Pacific/Fakaofo" },
|
||||
@@ -1602,7 +1592,6 @@
|
||||
{ "tsat", 0, 10800, "Europe/Volgograd" },
|
||||
{ "tvt", 0, 43200, "Pacific/Funafuti" },
|
||||
{ "uct", 0, 0, "Etc/UCT" },
|
||||
{ "uct", 0, 0, "UCT" },
|
||||
{ "ulast", 1, 32400, "Asia/Ulaanbaatar" },
|
||||
{ "ulast", 1, 32400, "Asia/Ulan_Bator" },
|
||||
{ "ulat", 0, 28800, "Asia/Ulaanbaatar" },
|
||||
@@ -1620,7 +1609,6 @@
|
||||
{ "utc", 0, 0, "Etc/Universal" },
|
||||
{ "utc", 0, 0, "Etc/UTC" },
|
||||
{ "utc", 0, 0, "Etc/Zulu" },
|
||||
{ "utc", 0, 0, "GMT" },
|
||||
{ "utc", 0, 0, "UTC" },
|
||||
{ "utc", 0, 0, "UTC" },
|
||||
{ "uyhst", 1, -9000, "America/Montevideo" },
|
||||
@@ -1679,7 +1667,6 @@
|
||||
{ "wat", 0, 3600, "Africa/Brazzaville" },
|
||||
{ "wat", 0, -3600, "Africa/Bissau" },
|
||||
{ "wat", 0, -3600, "Africa/El_Aaiun" },
|
||||
{ "wat", 0, -3600, "Africa/Niamey" },
|
||||
{ "wat", 0, 3600, "Africa/Bangui" },
|
||||
{ "wat", 0, 3600, "Africa/Douala" },
|
||||
{ "wat", 0, 3600, "Africa/Kinshasa" },
|
||||
@@ -1695,7 +1682,6 @@
|
||||
{ "wemt", 1, 7200, "Europe/Madrid" },
|
||||
{ "wemt", 1, 7200, "Europe/Monaco" },
|
||||
{ "wemt", 1, 7200, "Europe/Paris" },
|
||||
{ "wemt", 1, 7200, "WET" },
|
||||
{ "west", 1, 3600, "Europe/Paris" },
|
||||
{ "west", 1, 7200, "Europe/Luxembourg" },
|
||||
{ "west", 1, 3600, "Africa/Algiers" },
|
||||
@@ -1711,7 +1697,6 @@
|
||||
{ "west", 1, 3600, "Europe/Luxembourg" },
|
||||
{ "west", 1, 3600, "Europe/Madrid" },
|
||||
{ "west", 1, 3600, "Europe/Monaco" },
|
||||
{ "west", 1, 3600, "WET" },
|
||||
{ "wet", 0, 0, "Europe/Paris" },
|
||||
{ "wet", 0, 3600, "Europe/Luxembourg" },
|
||||
{ "wet", 0, 0, "Africa/Algiers" },
|
||||
@@ -1729,7 +1714,6 @@
|
||||
{ "wet", 0, 0, "Europe/Luxembourg" },
|
||||
{ "wet", 0, 0, "Europe/Madrid" },
|
||||
{ "wet", 0, 0, "Europe/Monaco" },
|
||||
{ "wet", 0, 0, "WET" },
|
||||
{ "wft", 0, 43200, "Pacific/Wallis" },
|
||||
{ "wgst", 1, -7200, "America/Godthab" },
|
||||
{ "wgst", 1, -7200, "America/Danmarkshavn" },
|
||||
|
||||
+27
-23
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "timelib.h"
|
||||
|
||||
/* jan feb mrt apr may jun jul aug sep oct nov dec */
|
||||
@@ -106,7 +110,7 @@ static int do_range_limit_days(timelib_sll *y, timelib_sll *m, timelib_sll *d)
|
||||
timelib_sll days_this_month;
|
||||
timelib_sll last_month, last_year;
|
||||
timelib_sll days_last_month;
|
||||
|
||||
|
||||
/* can jump an entire leap year period quickly */
|
||||
if (*d >= DAYS_PER_LYEAR_PERIOD || *d <= -DAYS_PER_LYEAR_PERIOD) {
|
||||
*y += YEARS_PER_LYEAR_PERIOD * (*d / DAYS_PER_LYEAR_PERIOD);
|
||||
@@ -396,7 +400,7 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi)
|
||||
timelib_time_offset *before, *after;
|
||||
timelib_sll tmp;
|
||||
int in_transistion;
|
||||
|
||||
|
||||
tz->is_localtime = 1;
|
||||
before = timelib_get_time_zone_info(tz->sse, tzi);
|
||||
after = timelib_get_time_zone_info(tz->sse - before->offset, tzi);
|
||||
@@ -406,7 +410,7 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi)
|
||||
((tz->sse - after->offset) >= (after->transistion_time + (before->offset - after->offset))) &&
|
||||
((tz->sse - after->offset) < after->transistion_time)
|
||||
);
|
||||
|
||||
|
||||
if ((before->offset != after->offset) && !in_transistion) {
|
||||
tmp = -after->offset;
|
||||
} else {
|
||||
@@ -423,9 +427,9 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi)
|
||||
|
||||
tz->dst = gmt_offset->is_dst;
|
||||
if (tz->tz_abbr) {
|
||||
free(tz->tz_abbr);
|
||||
timelib_free(tz->tz_abbr);
|
||||
}
|
||||
tz->tz_abbr = strdup(gmt_offset->abbr);
|
||||
tz->tz_abbr = timelib_strdup(gmt_offset->abbr);
|
||||
timelib_time_offset_dtor(gmt_offset);
|
||||
}
|
||||
return tmp;
|
||||
@@ -464,7 +468,7 @@ int main(void)
|
||||
printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
|
||||
time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
|
||||
if (time.have_relative) {
|
||||
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
|
||||
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
|
||||
time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
|
||||
}
|
||||
if (time.have_weekday_relative) {
|
||||
|
||||
+31
-27
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
||||
+----------------------------------------------------------------------+
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "timelib.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -141,7 +145,7 @@ void timelib_update_from_sse(timelib_time *tm)
|
||||
signed int dst = tm->dst;
|
||||
|
||||
sse = tm->sse;
|
||||
|
||||
|
||||
switch (tm->zone_type) {
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
@@ -152,11 +156,11 @@ void timelib_update_from_sse(timelib_time *tm)
|
||||
|
||||
case TIMELIB_ZONETYPE_ID: {
|
||||
timelib_time_offset *gmt_offset;
|
||||
|
||||
|
||||
gmt_offset = timelib_get_time_zone_info(tm->sse, tm->tz_info);
|
||||
timelib_unixtime2gmt(tm, tm->sse + gmt_offset->offset);
|
||||
timelib_time_offset_dtor(gmt_offset);
|
||||
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -182,7 +186,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
int z = tm->z;
|
||||
signed int dst = tm->dst;
|
||||
|
||||
|
||||
timelib_unixtime2gmt(tm, ts - (tm->z * 60) + (tm->dst * 3600));
|
||||
|
||||
tm->z = z;
|
||||
@@ -195,7 +199,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
|
||||
timelib_unixtime2gmt(tm, ts + gmt_offset->offset);
|
||||
|
||||
/* we need to reset the sse here as unixtime2gmt modifies it */
|
||||
tm->sse = ts;
|
||||
tm->sse = ts;
|
||||
tm->dst = gmt_offset->is_dst;
|
||||
tm->z = gmt_offset->offset;
|
||||
tm->tz_info = tz;
|
||||
@@ -217,7 +221,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
|
||||
void timelib_set_timezone_from_offset(timelib_time *t, timelib_sll utc_offset)
|
||||
{
|
||||
if (t->tz_abbr) {
|
||||
free(t->tz_abbr);
|
||||
timelib_free(t->tz_abbr);
|
||||
}
|
||||
t->tz_abbr = NULL;
|
||||
|
||||
@@ -231,9 +235,9 @@ void timelib_set_timezone_from_offset(timelib_time *t, timelib_sll utc_offset)
|
||||
void timelib_set_timezone_from_abbr(timelib_time *t, timelib_abbr_info abbr_info)
|
||||
{
|
||||
if (t->tz_abbr) {
|
||||
free(t->tz_abbr);
|
||||
timelib_free(t->tz_abbr);
|
||||
}
|
||||
t->tz_abbr = strdup(abbr_info.abbr);
|
||||
t->tz_abbr = timelib_strdup(abbr_info.abbr);
|
||||
|
||||
t->z = abbr_info.utc_offset;
|
||||
t->have_zone = 1;
|
||||
@@ -257,9 +261,9 @@ void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz)
|
||||
t->dst = gmt_offset->is_dst;
|
||||
t->tz_info = tz;
|
||||
if (t->tz_abbr) {
|
||||
free(t->tz_abbr);
|
||||
timelib_free(t->tz_abbr);
|
||||
}
|
||||
t->tz_abbr = strdup(gmt_offset->abbr);
|
||||
t->tz_abbr = timelib_strdup(gmt_offset->abbr);
|
||||
timelib_time_offset_dtor(gmt_offset);
|
||||
|
||||
t->have_zone = 1;
|
||||
|
||||
+88
-73
@@ -383,7 +383,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_date_period_construct, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, end)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_interval_construct, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_interval_construct, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, interval_spec)
|
||||
ZEND_END_ARG_INFO()
|
||||
/* }}} */
|
||||
@@ -601,7 +601,7 @@ static zend_object_handlers date_object_handlers_period;
|
||||
#define DATE_SET_CONTEXT \
|
||||
zval *object; \
|
||||
object = getThis(); \
|
||||
|
||||
|
||||
#define DATE_FETCH_OBJECT \
|
||||
php_date_obj *obj; \
|
||||
DATE_SET_CONTEXT; \
|
||||
@@ -770,7 +770,7 @@ PHP_RSHUTDOWN_FUNCTION(date)
|
||||
* RFC2822, Section 3.3: http://www.ietf.org/rfc/rfc2822.txt
|
||||
* FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space
|
||||
* CFWS = *([FWS] comment) (([FWS] comment) / FWS)
|
||||
*
|
||||
*
|
||||
* date-time = [ day-of-week "," ] date FWS time [CFWS]
|
||||
* day-of-week = ([FWS] day-name)
|
||||
* day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
|
||||
@@ -792,19 +792,19 @@ PHP_RSHUTDOWN_FUNCTION(date)
|
||||
* date-fullyear = 4DIGIT
|
||||
* date-month = 2DIGIT ; 01-12
|
||||
* date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on month/year
|
||||
*
|
||||
*
|
||||
* time-hour = 2DIGIT ; 00-23
|
||||
* time-minute = 2DIGIT ; 00-59
|
||||
* time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second rules
|
||||
*
|
||||
*
|
||||
* time-secfrac = "." 1*DIGIT
|
||||
* time-numoffset = ("+" / "-") time-hour ":" time-minute
|
||||
* time-offset = "Z" / time-numoffset
|
||||
*
|
||||
*
|
||||
* partial-time = time-hour ":" time-minute ":" time-second [time-secfrac]
|
||||
* full-date = date-fullyear "-" date-month "-" date-mday
|
||||
* full-time = partial-time time-offset
|
||||
*
|
||||
*
|
||||
* date-time = full-date "T" full-time
|
||||
*/
|
||||
#define DATE_FORMAT_RFC3339 "Y-m-d\\TH:i:sP"
|
||||
@@ -885,6 +885,10 @@ PHP_MSHUTDOWN_FUNCTION(date)
|
||||
timelib_error_container_dtor(DATEG(last_errors));
|
||||
}
|
||||
|
||||
#ifndef ZTS
|
||||
DATEG(default_timezone) = NULL;
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -893,7 +897,7 @@ PHP_MSHUTDOWN_FUNCTION(date)
|
||||
PHP_MINFO_FUNCTION(date)
|
||||
{
|
||||
const timelib_tzdb *tzdb = DATE_TIMEZONEDB;
|
||||
|
||||
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "date/time support", "enabled");
|
||||
php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
|
||||
@@ -1045,8 +1049,8 @@ char *php_date_full_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
|
||||
timelib_sll day_of_week = timelib_day_of_week(y, m, d);
|
||||
if (day_of_week < 0) {
|
||||
return "Unknown";
|
||||
}
|
||||
return day_full_names[day_of_week];
|
||||
}
|
||||
return day_full_names[day_of_week];
|
||||
}
|
||||
|
||||
char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
|
||||
@@ -1054,8 +1058,8 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
|
||||
timelib_sll day_of_week = timelib_day_of_week(y, m, d);
|
||||
if (day_of_week < 0) {
|
||||
return "Unknown";
|
||||
}
|
||||
return day_short_names[day_of_week];
|
||||
}
|
||||
return day_short_names[day_of_week];
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1087,7 +1091,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
|
||||
offset->leap_secs = 0;
|
||||
offset->is_dst = 0;
|
||||
offset->abbr = malloc(9); /* GMT�xxxx\0 */
|
||||
snprintf(offset->abbr, 9, "GMT%c%02d%02d",
|
||||
snprintf(offset->abbr, 9, "GMT%c%02d%02d",
|
||||
localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
|
||||
localtime ? abs(offset->offset / 3600) : 0,
|
||||
localtime ? abs((offset->offset % 3600) / 60) : 0 );
|
||||
@@ -1133,7 +1137,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
|
||||
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
|
||||
case 'A': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break;
|
||||
case 'B': {
|
||||
int retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
|
||||
int retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
|
||||
while (retval < 0) {
|
||||
retval += 1000;
|
||||
}
|
||||
@@ -1233,7 +1237,7 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime)
|
||||
}
|
||||
|
||||
string = php_format_date(format, format_len, ts, localtime TSRMLS_CC);
|
||||
|
||||
|
||||
RETVAL_STRING(string, 0);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1257,7 +1261,7 @@ PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localt
|
||||
}
|
||||
|
||||
string = date_format(format, format_len, t, localtime);
|
||||
|
||||
|
||||
timelib_time_dtor(t);
|
||||
return string;
|
||||
}
|
||||
@@ -1298,7 +1302,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
|
||||
offset->leap_secs = 0;
|
||||
offset->is_dst = t->dst;
|
||||
offset->abbr = malloc(9); /* GMT�xxxx\0 */
|
||||
snprintf(offset->abbr, 9, "GMT%c%02d%02d",
|
||||
snprintf(offset->abbr, 9, "GMT%c%02d%02d",
|
||||
!localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
|
||||
!localtime ? abs(offset->offset / 3600) : 0,
|
||||
!localtime ? abs((offset->offset % 3600) / 60) : 0 );
|
||||
@@ -1330,7 +1334,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
|
||||
|
||||
/* Swatch Beat a.k.a. Internet Time */
|
||||
case 'B':
|
||||
retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
|
||||
retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
|
||||
while (retval < 0) {
|
||||
retval += 1000;
|
||||
}
|
||||
@@ -1382,7 +1386,7 @@ PHP_FUNCTION(idate)
|
||||
char *format;
|
||||
int format_len;
|
||||
long ts = 0;
|
||||
int ret;
|
||||
int ret;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
@@ -1410,7 +1414,7 @@ PHP_FUNCTION(idate)
|
||||
PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb)
|
||||
{
|
||||
const timelib_tzdb *builtin = timelib_builtin_db();
|
||||
|
||||
|
||||
if (php_version_compare(tzdb->version, builtin->version) > 0) {
|
||||
php_date_global_timezone_db = tzdb;
|
||||
php_date_global_timezone_db_enabled = 1;
|
||||
@@ -1481,7 +1485,7 @@ PHP_FUNCTION(strtotime)
|
||||
}
|
||||
|
||||
if (!time_len) {
|
||||
timelib_time_dtor(now);
|
||||
timelib_time_dtor(now);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1930,7 +1934,7 @@ static void date_period_it_current_data(zend_object_iterator *iter, zval ***data
|
||||
if (it_time->tz_info) {
|
||||
newdateobj->time->tz_info = it_time->tz_info;
|
||||
}
|
||||
|
||||
|
||||
*data = &iterator->current;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2124,13 +2128,13 @@ static inline zend_object_value date_object_new_date_ex(zend_class_entry *class_
|
||||
if (ptr) {
|
||||
*ptr = intern;
|
||||
}
|
||||
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
object_properties_init(&intern->std, class_type);
|
||||
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_date, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_date;
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -2144,12 +2148,12 @@ static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC)
|
||||
php_date_obj *new_obj = NULL;
|
||||
php_date_obj *old_obj = (php_date_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC);
|
||||
zend_object_value new_ov = date_object_new_date_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
|
||||
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
|
||||
if (!old_obj->time) {
|
||||
return new_ov;
|
||||
}
|
||||
|
||||
|
||||
/* this should probably moved to a new `timelib_time *timelime_time_clone(timelib_time *)` */
|
||||
new_obj->time = timelib_time_ctor();
|
||||
*new_obj->time = *old_obj->time;
|
||||
@@ -2159,7 +2163,7 @@ static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC)
|
||||
if (old_obj->time->tz_info) {
|
||||
new_obj->time->tz_info = old_obj->time->tz_info;
|
||||
}
|
||||
|
||||
|
||||
return new_ov;
|
||||
}
|
||||
|
||||
@@ -2276,10 +2280,10 @@ static inline zend_object_value date_object_new_timezone_ex(zend_class_entry *cl
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
object_properties_init(&intern->std, class_type);
|
||||
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_timezone;
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -2293,12 +2297,12 @@ static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC)
|
||||
php_timezone_obj *new_obj = NULL;
|
||||
php_timezone_obj *old_obj = (php_timezone_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC);
|
||||
zend_object_value new_ov = date_object_new_timezone_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
|
||||
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
|
||||
if (!old_obj->initialized) {
|
||||
return new_ov;
|
||||
}
|
||||
|
||||
|
||||
new_obj->type = old_obj->type;
|
||||
new_obj->initialized = 1;
|
||||
switch (new_obj->type) {
|
||||
@@ -2314,7 +2318,7 @@ static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC)
|
||||
new_obj->tzi.z.abbr = strdup(old_obj->tzi.z.abbr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return new_ov;
|
||||
}
|
||||
|
||||
@@ -2375,10 +2379,10 @@ static inline zend_object_value date_object_new_interval_ex(zend_class_entry *cl
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
object_properties_init(&intern->std, class_type);
|
||||
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_interval, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_interval;
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -2392,7 +2396,7 @@ static zend_object_value date_object_clone_interval(zval *this_ptr TSRMLS_DC)
|
||||
php_interval_obj *new_obj = NULL;
|
||||
php_interval_obj *old_obj = (php_interval_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC);
|
||||
zend_object_value new_ov = date_object_new_interval_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
|
||||
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
|
||||
|
||||
/** FIX ME ADD CLONE STUFF **/
|
||||
@@ -2464,10 +2468,10 @@ static inline zend_object_value date_object_new_period_ex(zend_class_entry *clas
|
||||
|
||||
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
||||
object_properties_init(&intern->std, class_type);
|
||||
|
||||
|
||||
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_period, NULL TSRMLS_CC);
|
||||
retval.handlers = &date_object_handlers_period;
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -2481,7 +2485,7 @@ static zend_object_value date_object_clone_period(zval *this_ptr TSRMLS_DC)
|
||||
php_period_obj *new_obj = NULL;
|
||||
php_period_obj *old_obj = (php_period_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC);
|
||||
zend_object_value new_ov = date_object_new_period_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
|
||||
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
|
||||
|
||||
/** FIX ME ADD CLONE STUFF **/
|
||||
@@ -2567,7 +2571,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
|
||||
char *new_abbr = NULL;
|
||||
timelib_sll new_offset;
|
||||
|
||||
|
||||
if (dateobj->time) {
|
||||
timelib_time_dtor(dateobj->time);
|
||||
}
|
||||
@@ -2781,7 +2785,7 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
|
||||
php_date_obj *new_obj = NULL;
|
||||
php_date_obj *old_obj = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetime_object, date_ce_date) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2966,7 +2970,7 @@ void php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAMETERS, timelib_time *
|
||||
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(hour, h);
|
||||
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(minute, i);
|
||||
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(second, s);
|
||||
|
||||
|
||||
if (parsed_time->f == -99999) {
|
||||
add_assoc_bool(return_value, "fraction", 0);
|
||||
} else {
|
||||
@@ -3033,7 +3037,7 @@ PHP_FUNCTION(date_parse)
|
||||
int date_len;
|
||||
struct timelib_error_container *error;
|
||||
timelib_time *parsed_time;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &date, &date_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -3052,7 +3056,7 @@ PHP_FUNCTION(date_parse_from_format)
|
||||
int date_len, format_len;
|
||||
struct timelib_error_container *error;
|
||||
timelib_time *parsed_time;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &format, &format_len, &date, &date_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -3536,7 +3540,7 @@ static void php_date_isodate_set(zval *object, long y, long w, long d, zval *ret
|
||||
memset(&dateobj->time->relative, 0, sizeof(dateobj->time->relative));
|
||||
dateobj->time->relative.d = timelib_daynr_from_weeknr(y, w, d);
|
||||
dateobj->time->have_relative = 1;
|
||||
|
||||
|
||||
timelib_update_ts(dateobj->time, NULL);
|
||||
}
|
||||
|
||||
@@ -3678,12 +3682,17 @@ PHP_FUNCTION(date_diff)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz TSRMLS_DC)
|
||||
static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz, size_t tz_len TSRMLS_DC)
|
||||
{
|
||||
timelib_time *dummy_t = ecalloc(1, sizeof(timelib_time));
|
||||
int dst, not_found;
|
||||
char *orig_tz = tz;
|
||||
|
||||
if (strlen(tz) != tz_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timezone must not contain null bytes");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
dummy_t->z = timelib_parse_zone(&tz, &dst, dummy_t, ¬_found, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
if (not_found) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad timezone (%s)", orig_tz);
|
||||
@@ -3710,7 +3719,7 @@ PHP_FUNCTION(timezone_open)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
tzobj = zend_object_store_get_object(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC) TSRMLS_CC);
|
||||
if (SUCCESS != timezone_initialize(tzobj, tz TSRMLS_CC)) {
|
||||
if (SUCCESS != timezone_initialize(tzobj, tz, tz_len TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3725,11 +3734,11 @@ PHP_METHOD(DateTimeZone, __construct)
|
||||
int tz_len;
|
||||
php_timezone_obj *tzobj;
|
||||
zend_error_handling error_handling;
|
||||
|
||||
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) {
|
||||
tzobj = zend_object_store_get_object(getThis() TSRMLS_CC);
|
||||
if (FAILURE == timezone_initialize(tzobj, tz TSRMLS_CC)) {
|
||||
if (FAILURE == timezone_initialize(tzobj, tz, tz_len TSRMLS_CC)) {
|
||||
ZVAL_NULL(getThis());
|
||||
}
|
||||
}
|
||||
@@ -3744,7 +3753,7 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez
|
||||
|
||||
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS && Z_TYPE_PP(z_timezone_type) == IS_LONG) {
|
||||
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS && Z_TYPE_PP(z_timezone) == IS_STRING) {
|
||||
if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_PP(z_timezone) TSRMLS_CC)) {
|
||||
if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_PP(z_timezone), Z_STRLEN_PP(z_timezone) TSRMLS_CC)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -3926,7 +3935,7 @@ PHP_FUNCTION(timezone_transitions_get)
|
||||
add_assoc_string(element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].abbr_idx], 1); \
|
||||
add_next_index_zval(return_value, element);
|
||||
|
||||
#define add_last() add(tzobj->tzi.tz->timecnt - 1, timestamp_begin)
|
||||
#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
@@ -3937,7 +3946,7 @@ PHP_FUNCTION(timezone_transitions_get)
|
||||
} else {
|
||||
begin = 0;
|
||||
found = 0;
|
||||
if (tzobj->tzi.tz->timecnt > 0) {
|
||||
if (tzobj->tzi.tz->bit32.timecnt > 0) {
|
||||
do {
|
||||
if (tzobj->tzi.tz->trans[begin] > timestamp_begin) {
|
||||
if (begin > 0) {
|
||||
@@ -3949,18 +3958,18 @@ PHP_FUNCTION(timezone_transitions_get)
|
||||
break;
|
||||
}
|
||||
begin++;
|
||||
} while (begin < tzobj->tzi.tz->timecnt);
|
||||
} while (begin < tzobj->tzi.tz->bit32.timecnt);
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
if (tzobj->tzi.tz->timecnt > 0) {
|
||||
if (tzobj->tzi.tz->bit32.timecnt > 0) {
|
||||
add_last();
|
||||
} else {
|
||||
add_nominal();
|
||||
}
|
||||
} else {
|
||||
for (i = begin; i < tzobj->tzi.tz->timecnt; ++i) {
|
||||
for (i = begin; i < tzobj->tzi.tz->bit32.timecnt; ++i) {
|
||||
if (tzobj->tzi.tz->trans[i] < timestamp_end) {
|
||||
add(i, tzobj->tzi.tz->trans[i]);
|
||||
}
|
||||
@@ -4003,7 +4012,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma
|
||||
struct timelib_error_container *errors;
|
||||
|
||||
timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors);
|
||||
|
||||
|
||||
if (errors->error_count > 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format);
|
||||
retval = FAILURE;
|
||||
@@ -4162,7 +4171,7 @@ PHP_METHOD(DateInterval, __construct)
|
||||
php_interval_obj *diobj;
|
||||
timelib_rel_time *reltime;
|
||||
zend_error_handling error_handling;
|
||||
|
||||
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &interval_string, &interval_string_length) == SUCCESS) {
|
||||
if (date_interval_initialize(&reltime, interval_string, interval_string_length TSRMLS_CC) == SUCCESS) {
|
||||
@@ -4185,8 +4194,7 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \
|
||||
do { \
|
||||
zval **z_arg = NULL; \
|
||||
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
|
||||
convert_to_long(*z_arg); \
|
||||
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS && Z_TYPE_PP(z_arg) == IS_LONG) { \
|
||||
(*intobj)->diff->member = (itype)Z_LVAL_PP(z_arg); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = (itype)def; \
|
||||
@@ -4197,8 +4205,15 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
do { \
|
||||
zval **z_arg = NULL; \
|
||||
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
|
||||
convert_to_string(*z_arg); \
|
||||
DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \
|
||||
if (Z_TYPE_PP(z_arg) == IS_STRING) { \
|
||||
DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \
|
||||
} else if (Z_TYPE_PP(z_arg) == IS_LONG || Z_TYPE_PP(z_arg) == IS_BOOL) { \
|
||||
(*intobj)->diff->member = (timelib_sll)Z_LVAL_PP(z_arg); \
|
||||
} else if (Z_TYPE_PP(z_arg) == IS_DOUBLE) { \
|
||||
(*intobj)->diff->member = (timelib_sll)Z_DVAL_PP(z_arg); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = -1LL; \
|
||||
} \
|
||||
} else { \
|
||||
(*intobj)->diff->member = -1LL; \
|
||||
} \
|
||||
@@ -4376,7 +4391,7 @@ static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_
|
||||
struct timelib_error_container *errors;
|
||||
|
||||
timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors);
|
||||
|
||||
|
||||
if (errors->error_count > 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format);
|
||||
retval = FAILURE;
|
||||
@@ -4405,7 +4420,7 @@ PHP_METHOD(DatePeriod, __construct)
|
||||
int isostr_len = 0;
|
||||
timelib_time *clone;
|
||||
zend_error_handling error_handling;
|
||||
|
||||
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOl|l", &start, date_ce_interface, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
|
||||
@@ -4595,7 +4610,7 @@ PHP_FUNCTION(timezone_identifiers_list)
|
||||
tzdb = DATE_TIMEZONEDB;
|
||||
item_count = tzdb->index_size;
|
||||
table = tzdb->index;
|
||||
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
for (i = 0; i < item_count; ++i) {
|
||||
@@ -4629,7 +4644,7 @@ PHP_FUNCTION(timezone_abbreviations_list)
|
||||
{
|
||||
const timelib_tz_lookup_table *table, *entry;
|
||||
zval *element, **abbr_array_pp, *abbr_array;
|
||||
|
||||
|
||||
table = timelib_timezone_abbreviations_list();
|
||||
array_init(return_value);
|
||||
entry = table;
|
||||
@@ -4705,11 +4720,11 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
|
||||
timelib_time *t;
|
||||
timelib_tzinfo *tzi;
|
||||
char *retstr;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
switch (ZEND_NUM_ARGS()) {
|
||||
case 1:
|
||||
retformat = SUNFUNCS_RET_STRING;
|
||||
@@ -4753,7 +4768,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
|
||||
timelib_unixtime2local(t, time);
|
||||
rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, 1, &h_rise, &h_set, &rise, &set, &transit);
|
||||
timelib_time_dtor(t);
|
||||
|
||||
|
||||
if (rs != 0) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -4807,7 +4822,7 @@ PHP_FUNCTION(date_sun_info)
|
||||
timelib_sll rise, set, transit;
|
||||
int dummy;
|
||||
double ddummy;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd", &time, &latitude, &longitude) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -4821,7 +4836,7 @@ PHP_FUNCTION(date_sun_info)
|
||||
/* Setup */
|
||||
t2 = timelib_time_ctor();
|
||||
array_init(return_value);
|
||||
|
||||
|
||||
/* Get sun up/down and transit */
|
||||
rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -35.0/60, 1, &ddummy, &ddummy, &rise, &set, &transit);
|
||||
switch (rs) {
|
||||
@@ -4965,7 +4980,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC)
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "interval", sizeof("interval"), &zv, sizeof(zv), NULL);
|
||||
|
||||
|
||||
/* converted to larger type (int->long); must check when unserializing */
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_LONG(zv, (long) period_obj->recurrences);
|
||||
@@ -5048,7 +5063,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
|
||||
}
|
||||
|
||||
period_obj->initialized = 1;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -5065,7 +5080,7 @@ PHP_METHOD(DatePeriod, __set_state)
|
||||
}
|
||||
|
||||
myht = Z_ARRVAL_P(array);
|
||||
|
||||
|
||||
object_init_ex(return_value, date_ce_period);
|
||||
period_obj = zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
|
||||
|
||||
+2
-11
@@ -8,7 +8,7 @@ date_default_timezone_set('UTC');
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(7) {
|
||||
array(6) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
@@ -52,7 +52,7 @@ array(7) {
|
||||
["offset"]=>
|
||||
int(0)
|
||||
["timezone_id"]=>
|
||||
string(3) "GMT"
|
||||
string(3) "UTC"
|
||||
}
|
||||
[5]=>
|
||||
array(3) {
|
||||
@@ -63,14 +63,5 @@ array(7) {
|
||||
["timezone_id"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
[6]=>
|
||||
array(3) {
|
||||
["dst"]=>
|
||||
bool(false)
|
||||
["offset"]=>
|
||||
int(0)
|
||||
["timezone_id"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
}
|
||||
Done
|
||||
@@ -16,7 +16,7 @@ date_default_timezone_set("Europe/London");
|
||||
// Create a DateTimeZone object
|
||||
$tz = new DateTimeZone("Europe/London");
|
||||
|
||||
$tran = $tz->getTransitions();
|
||||
$tran = $tz->getTransitions(-306972000, -37241999);
|
||||
|
||||
if (!is_array($tran)) {
|
||||
echo "TEST FAILED: Expected an array\n";
|
||||
@@ -25,14 +25,14 @@ if (!is_array($tran)) {
|
||||
echo "\n-- Total number of transitions: " . count($tran). " --\n";
|
||||
|
||||
echo "\n-- Format a sample entry for Spring 1963 --\n";
|
||||
var_dump( $tran[97] );
|
||||
var_dump( $tran[6] );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** Testing DateTimeZone::getTransitions() : basic functionality ***
|
||||
|
||||
-- Total number of transitions: 243 --
|
||||
-- Total number of transitions: 18 --
|
||||
|
||||
-- Format a sample entry for Spring 1963 --
|
||||
array(5) {
|
||||
|
||||
@@ -10,6 +10,6 @@ define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-massive.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_massive_positive: ADD: -333333-01-01 16:18:02 EST + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST**
|
||||
test_massive_negative: ADD: 333333-01-01 16:18:02 EST + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST**
|
||||
--EXPECTF--
|
||||
test_massive_positive: ADD: -333333-01-01 16:18:02 %s + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 %s**
|
||||
test_massive_negative: ADD: 333333-01-01 16:18:02 %s + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 %s**
|
||||
@@ -10,6 +10,6 @@ define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DIFF);
|
||||
require 'DateTime_data-massive.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_massive_positive: DIFF: 333333-01-01 16:18:02 EST - -333333-01-01 16:18:02 EST = **P+666666Y0M0DT0H0M0S**
|
||||
test_massive_negative: DIFF: -333333-01-01 16:18:02 EST - 333333-01-01 16:18:02 EST = **P-666666Y0M0DT0H0M0S**
|
||||
--EXPECTF--
|
||||
test_massive_positive: DIFF: 333333-01-01 16:18:02 %s - -333333-01-01 16:18:02 %s = **P+666666Y0M0DT0H%s**
|
||||
test_massive_negative: DIFF: -333333-01-01 16:18:02 %s - 333333-01-01 16:18:02 %s = **P-666666Y0M0DT0H%s**
|
||||
@@ -10,6 +10,6 @@ define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_SUB);
|
||||
require 'DateTime_data-massive.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_massive_positive: SUB: 333333-01-01 16:18:02 EST - P+666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST**
|
||||
test_massive_negative: SUB: -333333-01-01 16:18:02 EST - P-666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST**
|
||||
--EXPECTF--
|
||||
test_massive_positive: SUB: 333333-01-01 16:18:02 %s - P+666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 %s**
|
||||
test_massive_negative: SUB: -333333-01-01 16:18:02 %s - P-666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 %s**
|
||||
@@ -6,8 +6,6 @@ date.timezone=GMT
|
||||
<?php
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 GMT"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 MET"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 MEST"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 EDT"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728-00"))."\n";
|
||||
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728+00"))."\n";
|
||||
@@ -21,8 +19,6 @@ echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728+0330"))."\n";
|
||||
--EXPECT--
|
||||
2002-06-25 14:18:48
|
||||
2002-06-25 14:18:48
|
||||
2002-06-25 13:18:48
|
||||
2002-06-25 12:18:48
|
||||
2002-06-25 18:18:48
|
||||
2002-06-25 14:18:48
|
||||
2002-06-25 14:18:48
|
||||
|
||||
@@ -20,10 +20,10 @@ array(5) {
|
||||
["time"]=>
|
||||
string(%d) "%s"
|
||||
["offset"]=>
|
||||
int(3600)
|
||||
int(%s)
|
||||
["isdst"]=>
|
||||
bool(true)
|
||||
bool(%s)
|
||||
["abbr"]=>
|
||||
string(3) "BST"
|
||||
string(%d) "%s"
|
||||
}
|
||||
10000002008-02-28T12:00:00+0000
|
||||
@@ -14,17 +14,17 @@ var_dump($di);
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(2)
|
||||
int(-1)
|
||||
["m"]=>
|
||||
int(0)
|
||||
int(-1)
|
||||
["d"]=>
|
||||
int(0)
|
||||
int(-1)
|
||||
["h"]=>
|
||||
int(6)
|
||||
int(-1)
|
||||
["i"]=>
|
||||
int(8)
|
||||
int(-1)
|
||||
["s"]=>
|
||||
int(0)
|
||||
int(-1)
|
||||
["weekday"]=>
|
||||
int(10)
|
||||
["weekday_behavior"]=>
|
||||
|
||||
@@ -14,17 +14,17 @@ var_dump($di);
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(2)
|
||||
int(-1)
|
||||
["m"]=>
|
||||
int(0)
|
||||
int(-1)
|
||||
["d"]=>
|
||||
int(0)
|
||||
int(-1)
|
||||
["h"]=>
|
||||
int(6)
|
||||
int(-1)
|
||||
["i"]=>
|
||||
int(8)
|
||||
int(-1)
|
||||
["s"]=>
|
||||
int(0)
|
||||
int(-1)
|
||||
["weekday"]=>
|
||||
int(10)
|
||||
["weekday_behavior"]=>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #66986 (Some timezones are no longer valid in PHP 5.5.10)
|
||||
Bug #66985 (Some timezones are no longer valid in PHP 5.5.10)
|
||||
--FILE--
|
||||
<?php
|
||||
$zones = array(
|
||||
|
||||
@@ -6,4 +6,4 @@ $data = unserialize('a:2:{i:0;O:12:"DateTimeZone":2:{s:13:"timezone_type";a:2:{i
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: DateTimeZone::__wakeup(): Timezone initialization failed in %s/bug68942.php on line %d
|
||||
Fatal error: DateTimeZone::__wakeup(): Timezone initialization failed in %s%ebug68942.php on line %d
|
||||
@@ -6,4 +6,4 @@ $data = unserialize('a:2:{i:0;O:8:"DateTime":3:{s:4:"date";s:26:"2000-01-01 00:0
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Invalid serialization data for DateTime object in %s/bug68942_2.php on line %d
|
||||
Fatal error: Invalid serialization data for DateTime object in %s%ebug68942_2.php on line %d
|
||||
@@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
Bug #70266 (DateInterval::__construct.interval_spec is not supposed to be optional)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump((new ReflectionParameter(['DateInterval', '__construct'], 0))->isOptional());
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #70277 (new DateTimeZone($foo) is ignoring text after null byte)
|
||||
--FILE--
|
||||
<?php
|
||||
$timezone = "Europe/Zurich\0Foo";
|
||||
var_dump(timezone_open($timezone));
|
||||
var_dump(new DateTimeZone($timezone));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: timezone_open(): Timezone must not contain null bytes in %sbug70277.php on line %d
|
||||
bool(false)
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Timezone must not contain null bytes' in %sbug70277.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug70277.php(%d): DateTimeZone->__construct('Europe/Zurich\x00F...')
|
||||
#1 {main}
|
||||
thrown in %sbug70277.php on line %d
|
||||
@@ -27,7 +27,7 @@ var_dump( getdate($timestamp) );
|
||||
-- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp --
|
||||
array\(11\) {
|
||||
\["seconds"\]=>
|
||||
int\((36|0)\)
|
||||
int\((.+)\)
|
||||
\["minutes"\]=>
|
||||
int\((43|0)\)
|
||||
\["hours"\]=>
|
||||
@@ -53,7 +53,7 @@ array\(11\) {
|
||||
-- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp --
|
||||
array\(11\) {
|
||||
\["seconds"\]=>
|
||||
int\((44|12|20)\)
|
||||
int\((.+)\)
|
||||
\["minutes"\]=>
|
||||
int\((39|23)\)
|
||||
\["hours"\]=>
|
||||
@@ -61,7 +61,7 @@ array\(11\) {
|
||||
\["mday"\]=>
|
||||
int\((9|14|23)\)
|
||||
\["wday"\]=>
|
||||
int\(0\)
|
||||
int\((0|6)\)
|
||||
\["mon"\]=>
|
||||
int\((10|12)\)
|
||||
\["year"\]=>
|
||||
@@ -69,7 +69,7 @@ array\(11\) {
|
||||
\["yday"\]=>
|
||||
int\((282|347|295)\)
|
||||
\["weekday"\]=>
|
||||
string\(6\) "Sunday"
|
||||
string\((6|8)\) "(Sunday|Saturday)"
|
||||
\["month"\]=>
|
||||
string\((7|8)\) "(October|December)"
|
||||
\[0\]=>
|
||||
|
||||
@@ -87,7 +87,7 @@ array\(9\) {
|
||||
\[5\]=>
|
||||
int\((104|1|-3843)\)
|
||||
\[6\]=>
|
||||
int\(6\)
|
||||
int\((5|6)\)
|
||||
\[7\]=>
|
||||
int\((281|346|294)\)
|
||||
\[8\]=>
|
||||
@@ -107,7 +107,7 @@ array\(9\) {
|
||||
\["tm_year"\]=>
|
||||
int\((104|1|-3843)\)
|
||||
\["tm_wday"\]=>
|
||||
int\(6\)
|
||||
int\((5|6)\)
|
||||
\["tm_yday"\]=>
|
||||
int\((281|346|294)\)
|
||||
\["tm_isdst"\]=>
|
||||
|
||||
@@ -24,7 +24,7 @@ foreach ($tzs as $tz) {
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
America/Toronto
|
||||
Y: 0 - January 2000-01-01T01:01:01-0500
|
||||
Y: 69 - January 2069-01-01T01:01:01-0500
|
||||
@@ -32,11 +32,11 @@ Y: 70 - January 1970-01-01T01:01:01-0500
|
||||
Y: 71 - January 1971-01-01T01:01:01-0500
|
||||
Y: 99 - January 1999-01-01T01:01:01-0500
|
||||
Y: 100 - January 2000-01-01T01:01:01-0500
|
||||
Y: 101 - January 0101-01-01T01:01:01-0500
|
||||
Y: 105 - January 0105-01-01T01:01:01-0500
|
||||
Y: 110 - January 0110-01-01T01:01:01-0500
|
||||
Y: 1900 - January 1900-01-01T01:01:01-0500
|
||||
Y: 1901 - January 1901-01-01T01:01:01-0500
|
||||
Y: 101 - January 0101-01-01T01:01:01-0%d
|
||||
Y: 105 - January 0105-01-01T01:01:01-0%d
|
||||
Y: 110 - January 0110-01-01T01:01:01-0%d
|
||||
Y: 1900 - January 1900-01-01T01:01:01-0%d
|
||||
Y: 1901 - January 1901-01-01T01:01:01-0%d
|
||||
Y: 1902 - January 1902-01-01T01:01:01-0500
|
||||
Y: 1999 - January 1999-01-01T01:01:01-0500
|
||||
Y: 2000 - January 2000-01-01T01:01:01-0500
|
||||
@@ -49,11 +49,11 @@ Y: 70 - January 1970-01-01T01:01:01+0100
|
||||
Y: 71 - January 1971-01-01T01:01:01+0100
|
||||
Y: 99 - January 1999-01-01T01:01:01+0100
|
||||
Y: 100 - January 2000-01-01T01:01:01+0100
|
||||
Y: 101 - January 0101-01-01T01:01:01+0100
|
||||
Y: 105 - January 0105-01-01T01:01:01+0100
|
||||
Y: 110 - January 0110-01-01T01:01:01+0100
|
||||
Y: 1900 - January 1900-01-01T01:01:01+0100
|
||||
Y: 1901 - January 1901-01-01T01:01:01+0100
|
||||
Y: 101 - January 0101-01-01T01:01:01+0%d
|
||||
Y: 105 - January 0105-01-01T01:01:01+0%d
|
||||
Y: 110 - January 0110-01-01T01:01:01+0%d
|
||||
Y: 1900 - January 1900-01-01T01:01:01+0%d
|
||||
Y: 1901 - January 1901-01-01T01:01:01+0%d
|
||||
Y: 1902 - January 1902-01-01T01:01:01+0100
|
||||
Y: 1999 - January 1999-01-01T01:01:01+0100
|
||||
Y: 2000 - January 2000-01-01T01:01:01+0100
|
||||
|
||||
@@ -18,24 +18,24 @@ $tz = timezone_open("Europe/London");
|
||||
|
||||
$tran = timezone_transitions_get($tz);
|
||||
|
||||
echo "\n-- Get all transitions --\n";
|
||||
$tran = timezone_transitions_get($tz);
|
||||
echo "\n-- Get all 60s transitions --\n";
|
||||
$tran = timezone_transitions_get($tz, -306972000, -37241999);
|
||||
var_dump( gettype($tran) );
|
||||
|
||||
echo "\n-- Total number of transitions: " . count($tran). " --\n";
|
||||
|
||||
echo "\n-- Format a sample entry pfor Spring 1963 --\n";
|
||||
var_dump( $tran[97] );
|
||||
var_dump( $tran[6] );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** Testing timezone_transitions_get() : basic functionality ***
|
||||
|
||||
-- Get all transitions --
|
||||
-- Get all 60s transitions --
|
||||
string(5) "array"
|
||||
|
||||
-- Total number of transitions: 243 --
|
||||
-- Total number of transitions: 18 --
|
||||
|
||||
-- Format a sample entry pfor Spring 1963 --
|
||||
array(5) {
|
||||
|
||||
+5
-1
@@ -320,6 +320,10 @@ if test "$PHP_DB4" != "no"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/db4/db.h
|
||||
break
|
||||
elif test -f "$i/include/db5.3/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db5.3/db.h
|
||||
break
|
||||
elif test -f "$i/include/db5.1/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db5.1/db.h
|
||||
@@ -362,7 +366,7 @@ if test "$PHP_DB4" != "no"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
PHP_DBA_DB_CHECK(4, db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
PHP_DBA_DB_CHECK(4, db-5.3 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
fi
|
||||
PHP_DBA_STD_RESULT(db4,Berkeley DB4)
|
||||
|
||||
|
||||
+1
-1
@@ -914,7 +914,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
RETURN_FALSE;
|
||||
#ifdef F_SETFL
|
||||
} else if (modenr == DBA_CREAT) {
|
||||
int flags = fcntl(info->fd, F_SETFL);
|
||||
int flags = fcntl(info->fd, F_GETFL);
|
||||
fcntl(info->fd, F_SETFL, flags & ~O_APPEND);
|
||||
#endif
|
||||
}
|
||||
|
||||
+17
-5
@@ -1700,7 +1700,7 @@ PHP_FUNCTION(dom_document_save)
|
||||
char *file;
|
||||
long options = 0;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1930,7 +1930,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
int is_valid;
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1943,6 +1943,10 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
|
||||
switch (type) {
|
||||
case DOM_LOAD_FILE:
|
||||
if (CHECK_NULL_PATH(source, source_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
|
||||
if (!valid_file) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source");
|
||||
@@ -2026,7 +2030,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
|
||||
int is_valid;
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2039,6 +2043,10 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
|
||||
|
||||
switch (type) {
|
||||
case DOM_LOAD_FILE:
|
||||
if (CHECK_NULL_PATH(source, source_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
|
||||
if (!valid_file) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source");
|
||||
@@ -2119,7 +2127,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
|
||||
id = getThis();
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &source, &source_len, &options) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2129,6 +2137,10 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
}
|
||||
|
||||
if (mode == DOM_LOAD_FILE) {
|
||||
if (CHECK_NULL_PATH(source, source_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid file source");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ctxt = htmlCreateFileParserCtxt(source, NULL);
|
||||
} else {
|
||||
source_len = xmlStrlen(source);
|
||||
@@ -2217,7 +2229,7 @@ PHP_FUNCTION(dom_document_save_html_file)
|
||||
char *file;
|
||||
const char *encoding;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -930,7 +930,6 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
{
|
||||
xmlNode *nodep = dom_object_get_node(obj);
|
||||
zval value_copy;
|
||||
xmlChar *enc_str;
|
||||
|
||||
if (nodep == NULL) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
|
||||
@@ -938,9 +937,9 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
}
|
||||
|
||||
convert_to_string_copy(newval, value_copy);
|
||||
enc_str = xmlEncodeEntitiesReentrant(nodep->doc, Z_STRVAL_P(newval));
|
||||
xmlNodeSetContent(nodep, enc_str);
|
||||
xmlFree(enc_str);
|
||||
/* we have to use xmlNodeAddContent() to get the same behavior as with xmlNewText() */
|
||||
xmlNodeSetContent(nodep, (xmlChar *) "");
|
||||
xmlNodeAddContent(nodep, Z_STRVAL_P(newval));
|
||||
if (newval == &value_copy) {
|
||||
zval_dtor(newval);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ $result = $doc->loadHTMLFile("");
|
||||
assert('$result === false');
|
||||
$doc = new DOMDocument();
|
||||
$result = $doc->loadHTMLFile("text.html\0something");
|
||||
assert('$result === null');
|
||||
assert('$result === false');
|
||||
?>
|
||||
--EXPECTF--
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s
|
||||
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile() expects parameter 1 to be a valid path, string given %s
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Invalid file source %s
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #69679 (DOMDocument::loadHTML refuses to accept NULL bytes)
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument();
|
||||
$html = "<!DOCTYPE html><html><head><meta charset='UTF-8'></head><body>U+0000 <span>\x0</span></body></html>";
|
||||
$doc->loadHTML($html);
|
||||
print($doc->saveHTML());
|
||||
?>
|
||||
--EXPECT--
|
||||
<!DOCTYPE html>
|
||||
<html><head><meta charset="UTF-8"></head><body>U+0000 <span></span></body></html>
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #70001 (Assigning to DOMNode::textContent does additional entity encoding)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$element = new DOMText('<p>foo & bar</p>');
|
||||
var_dump($element->textContent);
|
||||
$element = (new DOMDocument())->createTextNode('<p>foo & bar</p>');
|
||||
var_dump($element->textContent);
|
||||
$element->textContent = ('<p>foo & bar</p>');
|
||||
var_dump($element->textContent);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(16) "<p>foo & bar</p>"
|
||||
string(16) "<p>foo & bar</p>"
|
||||
string(16) "<p>foo & bar</p>"
|
||||
@@ -1,7 +1,10 @@
|
||||
--TEST--
|
||||
Testing reading and writing to DOMNode::textContent
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (LIBXML_VERSION < 20707) die ('skip requires libxml2-2.7.7 or higher');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -37,6 +37,6 @@ if test "$PHP_ENCHANT" != "no"; then
|
||||
[
|
||||
AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ ])
|
||||
AC_DEFINE(ENCHANT_VERSION_STRING, "1.5.x", [ ])
|
||||
], [], [ -L$ENCHANT_LIB $ENCHANT_SHARED_LIBADD])
|
||||
], [], [ -L$ENCHANT_LIBDIR $ENCHANT_SHARED_LIBADD])
|
||||
|
||||
fi
|
||||
Loaded 100 of 638 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user