mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 10:25:41 +00:00
Compare commits
671
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
721bcb2b7e | ||
|
|
c8ff491106 | ||
|
|
521838cf6d | ||
|
|
35df4b1ae3 | ||
|
|
a05e84c42b | ||
|
|
bf00354cb7 | ||
|
|
44c55ec138 | ||
|
|
9e1bc792df | ||
|
|
3106f0e746 | ||
|
|
12bb3cd8d2 | ||
|
|
41923c1943 | ||
|
|
7544040469 | ||
|
|
76293254cf | ||
|
|
4f5a755b9d | ||
|
|
89d3e234af | ||
|
|
eca84946a4 | ||
|
|
55d17662cb | ||
|
|
c3361f16c7 | ||
|
|
9e480a1766 | ||
|
|
295377630a | ||
|
|
b754bc797c | ||
|
|
9f2ab75b10 | ||
|
|
b4371a4292 | ||
|
|
8b177f6a2a | ||
|
|
7bd4e7208e | ||
|
|
6558559bcc | ||
|
|
8c74be0c52 | ||
|
|
10a075fbd5 | ||
|
|
48f1a17886 | ||
|
|
0b596f81b8 | ||
|
|
86e603a664 | ||
|
|
f85cc6aead | ||
|
|
39ee3184ee | ||
|
|
5eb84337a6 | ||
|
|
522e4f1174 | ||
|
|
6806a41e7f | ||
|
|
96ed946b2b | ||
|
|
bd6bce888a | ||
|
|
8d6cc00cbd | ||
|
|
8be59a1301 | ||
|
|
d82da7de3a | ||
|
|
e93eaee164 | ||
|
|
6d91772c2f | ||
|
|
f1cf340e19 | ||
|
|
466870e2b0 | ||
|
|
428ef50838 | ||
|
|
e1f5b6d8df | ||
|
|
d0b9d72da7 | ||
|
|
f7bf9650aa | ||
|
|
3b9ba6195d | ||
|
|
5ba9eab436 | ||
|
|
730288ae41 | ||
|
|
d14498a475 | ||
|
|
b8fab503fe | ||
|
|
cc08cbc84d | ||
|
|
ce3e792c2c | ||
|
|
3104882cf8 | ||
|
|
cd8c9b0614 | ||
|
|
2301608736 | ||
|
|
9c50ba42d6 | ||
|
|
0723a226c3 | ||
|
|
26287132c0 | ||
|
|
bcee2fdbec | ||
|
|
fe49fd7dad | ||
|
|
fe378c27cc | ||
|
|
5b429fef42 | ||
|
|
611ab7fe5b | ||
|
|
671d8054f8 | ||
|
|
c4c2cce37d | ||
|
|
58b18892bf | ||
|
|
5aae01104f | ||
|
|
74b5662536 | ||
|
|
f42cbd749c | ||
|
|
efc1f33b58 | ||
|
|
80eb013a92 | ||
|
|
b135ba3fa9 | ||
|
|
7c6cb1282d | ||
|
|
7dc8b5e7ae | ||
|
|
4ef79370a8 | ||
|
|
01280f8deb | ||
|
|
aaa5d07365 | ||
|
|
b26b02b2df | ||
|
|
87a8240b5a | ||
|
|
d1e878f272 | ||
|
|
43ccf23d70 | ||
|
|
4d11a8eedf | ||
|
|
1bdb30a429 | ||
|
|
9c675607e6 | ||
|
|
689a9b8def | ||
|
|
082d1f2375 | ||
|
|
c1112ff323 | ||
|
|
21452a5401 | ||
|
|
85a22a0af0 | ||
|
|
96a8cf8e1b | ||
|
|
8822f7c9f0 | ||
|
|
5899f76a7d | ||
|
|
92c55f1580 | ||
|
|
a5f40e2656 | ||
|
|
8c9f639a1d | ||
|
|
3b5262ec4c | ||
|
|
8259130b6b | ||
|
|
61cdd1255d | ||
|
|
29a089d3c9 | ||
|
|
bf400108d9 | ||
|
|
4165d97606 | ||
|
|
62c68f7483 | ||
|
|
256b150a96 | ||
|
|
c91f652ddb | ||
|
|
fb08216b08 | ||
|
|
fc989fc6e7 | ||
|
|
c930714cbe | ||
|
|
b92216b97d | ||
|
|
6f84ac721b | ||
|
|
3c5742ebd7 | ||
|
|
2a75f5026a | ||
|
|
159de7723e | ||
|
|
b061fa909d | ||
|
|
bc3a0b82b8 | ||
|
|
1c468ee044 | ||
|
|
825e0fd430 | ||
|
|
ea83e504e5 | ||
|
|
5b79e95f7b | ||
|
|
07546496b1 | ||
|
|
4790da5475 | ||
|
|
eaff72f31b | ||
|
|
d946d10293 | ||
|
|
56e19b7c75 | ||
|
|
d3eb58332a | ||
|
|
a10d03ac16 | ||
|
|
085dfca02b | ||
|
|
8ea01d5f19 | ||
|
|
49b45e5af1 | ||
|
|
631173aa5c | ||
|
|
31cbce341c | ||
|
|
8908df690f | ||
|
|
ef801b9bf9 | ||
|
|
40e7baab3c | ||
|
|
417a8ef6b4 | ||
|
|
9d537951c5 | ||
|
|
633b93817e | ||
|
|
f9d4b1a3f1 | ||
|
|
3280a29ee5 | ||
|
|
12967bc346 | ||
|
|
9acfb1a3a5 | ||
|
|
6ad288ee23 | ||
|
|
c0219b323e | ||
|
|
7deb32abc9 | ||
|
|
91fd4bf000 | ||
|
|
dd93712911 | ||
|
|
e72165bb86 | ||
|
|
e60620b974 | ||
|
|
a8d031fbd8 | ||
|
|
81cbbb68af | ||
|
|
62bed405da | ||
|
|
e7f4355d9b | ||
|
|
da7e89cde8 | ||
|
|
29e2a204fb | ||
|
|
581e890483 | ||
|
|
703c247c7d | ||
|
|
83780a6cd2 | ||
|
|
03ac064b2e | ||
|
|
6a544f2d1e | ||
|
|
e520b9e127 | ||
|
|
1f5412982c | ||
|
|
40b8105cca | ||
|
|
437942d972 | ||
|
|
99bf19c177 | ||
|
|
b7cbaa7f43 | ||
|
|
cb29c01ed6 | ||
|
|
fcc232173e | ||
|
|
6887c4a061 | ||
|
|
48b5a1f9b9 | ||
|
|
3a058e3817 | ||
|
|
f36babf643 | ||
|
|
39e5991705 | ||
|
|
5e102d5685 | ||
|
|
4f0960a800 | ||
|
|
eaee65080e | ||
|
|
5dd3ea1567 | ||
|
|
66baefec44 | ||
|
|
d279118422 | ||
|
|
1c0e9126fb | ||
|
|
0e6fe3a4c9 | ||
|
|
1b29e4488e | ||
|
|
e1709b7e58 | ||
|
|
4e7b5ca459 | ||
|
|
fa9d41f66c | ||
|
|
c696bc8cfa | ||
|
|
bc22582cf7 | ||
|
|
c596b02a5b | ||
|
|
8831a12da1 | ||
|
|
5c81298597 | ||
|
|
8f5eda4bf6 | ||
|
|
61722743f4 | ||
|
|
709731797c | ||
|
|
0a4b72fa94 | ||
|
|
c7936ead8f | ||
|
|
7028ba1d32 | ||
|
|
1da79a6c6e | ||
|
|
456be3ec37 | ||
|
|
c240978067 | ||
|
|
4685297f05 | ||
|
|
075aa911ff | ||
|
|
f9936000da | ||
|
|
28887fe41b | ||
|
|
f9a699f6c3 | ||
|
|
be4489d488 | ||
|
|
9a2a45c1df | ||
|
|
410c68788a | ||
|
|
fbf87a8082 | ||
|
|
a22175b06f | ||
|
|
807004a446 | ||
|
|
deda058751 | ||
|
|
726c5999eb | ||
|
|
9ee913a773 | ||
|
|
cf35dae6e2 | ||
|
|
54d8053ac5 | ||
|
|
a95caa29bf | ||
|
|
11ff616d0f | ||
|
|
49c3fa43ad | ||
|
|
c38f88ddb0 | ||
|
|
4397306b32 | ||
|
|
68e602ff0a | ||
|
|
adaf68c3b1 | ||
|
|
579c8669c8 | ||
|
|
d334d319f0 | ||
|
|
4b9810b9bb | ||
|
|
dfd6baee0c | ||
|
|
b29ad29b91 | ||
|
|
56e3ec93a9 | ||
|
|
33a8af0510 | ||
|
|
eeb9113b6c | ||
|
|
3c16384ea2 | ||
|
|
4dd70b6e2f | ||
|
|
ba2d9e1ff1 | ||
|
|
fc2cadca2d | ||
|
|
ca24c58e65 | ||
|
|
56fa36b0a8 | ||
|
|
c4f3ea10e4 | ||
|
|
1ed4b13fb6 | ||
|
|
01759c4346 | ||
|
|
896814e139 | ||
|
|
48cf8dd9c3 | ||
|
|
6682673070 | ||
|
|
0e76cafaf1 | ||
|
|
0ad82e41f2 | ||
|
|
01c7c6b152 | ||
|
|
ac07008bb7 | ||
|
|
c18263e0e0 | ||
|
|
46df064261 | ||
|
|
d2d77c028d | ||
|
|
3c117d4136 | ||
|
|
19e04784ac | ||
|
|
55237fe153 | ||
|
|
44968927d7 | ||
|
|
30b7f72300 | ||
|
|
1d7484077a | ||
|
|
cf9e2fbbf6 | ||
|
|
7bfb7b62b1 | ||
|
|
b424d9f270 | ||
|
|
7a923c3afe | ||
|
|
36df4f8419 | ||
|
|
744d1b3c76 | ||
|
|
f559fb7556 | ||
|
|
bc27ce98ee | ||
|
|
09eb6ed35e | ||
|
|
cfc8522238 | ||
|
|
bcee34c649 | ||
|
|
0de333bd62 | ||
|
|
69eef8c361 | ||
|
|
efadcb0390 | ||
|
|
9fb94f03e7 | ||
|
|
69013f6b26 | ||
|
|
f0a12af65b | ||
|
|
91c49c4ab0 | ||
|
|
9cdf2042bd | ||
|
|
3a739c9f9f | ||
|
|
05baa92727 | ||
|
|
c8a9ad1527 | ||
|
|
c43ecfd798 | ||
|
|
667d8d3522 | ||
|
|
598ed66f82 | ||
|
|
1382e88ac1 | ||
|
|
5163925796 | ||
|
|
248f8c3a91 | ||
|
|
941b56dd4a | ||
|
|
855b8e4f79 | ||
|
|
fc31d6fed4 | ||
|
|
c403b30291 | ||
|
|
01f6a0a860 | ||
|
|
8fd0e0285f | ||
|
|
363c2524dd | ||
|
|
07c6bdb85d | ||
|
|
28f80baf3c | ||
|
|
33d0ef0fef | ||
|
|
c4cca4c20e | ||
|
|
f5a9592ad8 | ||
|
|
6a7cc8ff85 | ||
|
|
7381d4c00e | ||
|
|
ecb7f58a06 | ||
|
|
b88393f08a | ||
|
|
65c8caafa8 | ||
|
|
6d55ba2656 | ||
|
|
ba5ac0d360 | ||
|
|
223266e4e4 | ||
|
|
19866fb76c | ||
|
|
c984661d39 | ||
|
|
32e0b46997 | ||
|
|
fab33740c5 | ||
|
|
2d8ab51576 | ||
|
|
2302eef5c9 | ||
|
|
8cceb012a7 | ||
|
|
39f45e208c | ||
|
|
9528ce7315 | ||
|
|
c5f34c9eca | ||
|
|
27876d22ef | ||
|
|
022e75cba1 | ||
|
|
060ab26cfe | ||
|
|
92db16e456 | ||
|
|
0bfb970f43 | ||
|
|
82fa85fd08 | ||
|
|
0cbf634657 | ||
|
|
c2044e60f3 | ||
|
|
fcdc30b347 | ||
|
|
c02cfd4e25 | ||
|
|
6d0e773292 | ||
|
|
d690014bf3 | ||
|
|
529811cfb0 | ||
|
|
6ef987e012 | ||
|
|
225478bccf | ||
|
|
38455293f7 | ||
|
|
cd16b64f01 | ||
|
|
95e4e6a3ce | ||
|
|
1b2007dada | ||
|
|
0fdf2ffae1 | ||
|
|
65bf5e88c7 | ||
|
|
2970630133 | ||
|
|
874697e30a | ||
|
|
d947d974d5 | ||
|
|
dc09f30933 | ||
|
|
8753356eb0 | ||
|
|
326a4e38fb | ||
|
|
1ed07676e6 | ||
|
|
1c789dba7b | ||
|
|
6c9d37d059 | ||
|
|
e539ea439b | ||
|
|
669fda00b7 | ||
|
|
e3c08de08a | ||
|
|
7a90fc96d8 | ||
|
|
c42a7f2f3f | ||
|
|
bbcf77c309 | ||
|
|
1a30a7a422 | ||
|
|
23e721fc93 | ||
|
|
807c49e6be | ||
|
|
cb91a51b00 | ||
|
|
fb9444e053 | ||
|
|
0e3b30fad1 | ||
|
|
38553e853b | ||
|
|
4fda0a9479 | ||
|
|
b1f33db39f | ||
|
|
963454b93f | ||
|
|
8c700076d7 | ||
|
|
c50ae8fda7 | ||
|
|
fb1c46f013 | ||
|
|
379d9a1cfc | ||
|
|
8bbd0952e5 | ||
|
|
5880428dac | ||
|
|
af3031d755 | ||
|
|
dad793630d | ||
|
|
3a35d43ad9 | ||
|
|
a58e6d4e34 | ||
|
|
6f1a52bfbb | ||
|
|
a25f6f89cd | ||
|
|
81ec843d0e | ||
|
|
8aad3131a1 | ||
|
|
009ee6e503 | ||
|
|
4fa52b42c7 | ||
|
|
dd6da58fac | ||
|
|
0045d16863 | ||
|
|
1cd0c80acf | ||
|
|
b92cb6b238 | ||
|
|
d185c2f13a | ||
|
|
14d754d6fd | ||
|
|
1abbcc8cc5 | ||
|
|
e5047ac2d2 | ||
|
|
9834978a8b | ||
|
|
4e0605044a | ||
|
|
5c38fbe543 | ||
|
|
92db92c620 | ||
|
|
39423e425d | ||
|
|
b5f9427ca9 | ||
|
|
cee363d609 | ||
|
|
54f6c8d6df | ||
|
|
84d495055d | ||
|
|
19350b6b73 | ||
|
|
a2fdf0f413 | ||
|
|
b578580e88 | ||
|
|
c3dfe57c23 | ||
|
|
d1fbc98ff6 | ||
|
|
7f97d63130 | ||
|
|
b7259b71b4 | ||
|
|
1ae2d074f8 | ||
|
|
8cc9570f53 | ||
|
|
d582241368 | ||
|
|
c9040d43a8 | ||
|
|
9513187dee | ||
|
|
0bc7e0c0ce | ||
|
|
bca913d70a | ||
|
|
f3dc00fdfb | ||
|
|
c83bdb8e6a | ||
|
|
7483acf511 | ||
|
|
5efd2a33df | ||
|
|
e14b14d026 | ||
|
|
ccc8d92d3d | ||
|
|
e576714f6b | ||
|
|
fbb81dd755 | ||
|
|
1ee41683dc | ||
|
|
cc797d4fc3 | ||
|
|
f93fd8ce32 | ||
|
|
b2d267d9ee | ||
|
|
8f32d609c5 | ||
|
|
314a9f8553 | ||
|
|
97f2bb894a | ||
|
|
747b61808b | ||
|
|
ed51f34795 | ||
|
|
3317287ce1 | ||
|
|
8e487aefaa | ||
|
|
972302d2f0 | ||
|
|
2f10db36af | ||
|
|
52afd8b744 | ||
|
|
bc7460260b | ||
|
|
2c12a5f0a8 | ||
|
|
af7828a20f | ||
|
|
119744fc22 | ||
|
|
345b96c4a3 | ||
|
|
bfd4277008 | ||
|
|
6adb7e0b7a | ||
|
|
f6d02733fd | ||
|
|
191ff3d995 | ||
|
|
62d5bfb527 | ||
|
|
07cc6a6ba2 | ||
|
|
b5f2f6fbd8 | ||
|
|
65f0c163f9 | ||
|
|
207dab585a | ||
|
|
4b45c0a9a7 | ||
|
|
1b227de970 | ||
|
|
c7b4cd1a51 | ||
|
|
5bcae9d586 | ||
|
|
b6b7696114 | ||
|
|
ae81e8fc32 | ||
|
|
2004585d03 | ||
|
|
d787b0ea13 | ||
|
|
946335ba70 | ||
|
|
295303b590 | ||
|
|
3437dbfa00 | ||
|
|
1a840b9af0 | ||
|
|
1d93086937 | ||
|
|
ca4eeedd36 | ||
|
|
e2609a38d9 | ||
|
|
d80a317c0b | ||
|
|
1d7ec685c1 | ||
|
|
eac7f4b670 | ||
|
|
b66039db33 | ||
|
|
ca1eb585ee | ||
|
|
c73bcbefbd | ||
|
|
986d0f87ec | ||
|
|
8fcfacf746 | ||
|
|
2139918ea6 | ||
|
|
c4c3eb55a7 | ||
|
|
c67fa3c91d | ||
|
|
57509fb969 | ||
|
|
a000bff2c3 | ||
|
|
433976f931 | ||
|
|
84512a1177 | ||
|
|
51d19c12a5 | ||
|
|
5f6a1d1472 | ||
|
|
bd8112afe0 | ||
|
|
d3058a69d8 | ||
|
|
a1ff39ffe5 | ||
|
|
392c5ea472 | ||
|
|
4c13a7f5c4 | ||
|
|
6a232c3604 | ||
|
|
4c68fc5392 | ||
|
|
d65adac2be | ||
|
|
7a36056d6c | ||
|
|
9eb5bbd8bd | ||
|
|
0476bb1de5 | ||
|
|
17e8a3df13 | ||
|
|
226e21b0fe | ||
|
|
b740bb3987 | ||
|
|
39172d44d8 | ||
|
|
52793c14d9 | ||
|
|
078f674212 | ||
|
|
e4a006cd3e | ||
|
|
db1ef5cb00 | ||
|
|
9164dc11e2 | ||
|
|
a556543a3f | ||
|
|
a569b8816b | ||
|
|
f682193609 | ||
|
|
21f08a7488 | ||
|
|
61344c6d66 | ||
|
|
057278b759 | ||
|
|
2d123a916d | ||
|
|
4df85466b6 | ||
|
|
ad76e8a529 | ||
|
|
caf0ad403d | ||
|
|
bc1214f25e | ||
|
|
e6d3221766 | ||
|
|
98d8794eae | ||
|
|
91cd55e32a | ||
|
|
67f8c14c29 | ||
|
|
7ecd4bb0a4 | ||
|
|
761d2f629b | ||
|
|
127b42f9b3 | ||
|
|
f2d5305097 | ||
|
|
cb34882e61 | ||
|
|
b12ac316eb | ||
|
|
52787e902f | ||
|
|
9fa0009702 | ||
|
|
54293d21cb | ||
|
|
1bc9ea4f10 | ||
|
|
a3159d29bb | ||
|
|
1e4cae28b2 | ||
|
|
8a1fbdda43 | ||
|
|
06c0540b90 | ||
|
|
356b586ec1 | ||
|
|
48198e4c25 | ||
|
|
05c8a0771d | ||
|
|
195d7618e7 | ||
|
|
7d4c5a0dc9 | ||
|
|
a5d00fc908 | ||
|
|
1dab8e07f2 | ||
|
|
b172f43caa | ||
|
|
3956deb1b2 | ||
|
|
abe00908af | ||
|
|
ed9d916c28 | ||
|
|
e0f9fbdfa6 | ||
|
|
61f2f5a0f7 | ||
|
|
2135fdef9b | ||
|
|
0d13325b66 | ||
|
|
75d7666968 | ||
|
|
f8a75d4eee | ||
|
|
9e00ad2b09 | ||
|
|
4bf5c3187f | ||
|
|
d8b2de164e | ||
|
|
40bd921cea | ||
|
|
35a8ed2f62 | ||
|
|
b9e81e5844 | ||
|
|
24d741d376 | ||
|
|
5f91f692c3 | ||
|
|
cfdeedd985 | ||
|
|
d6a43a8562 | ||
|
|
1cd6bc6463 | ||
|
|
5a34bd6d1e | ||
|
|
1bd103df00 | ||
|
|
a3598dd7c9 | ||
|
|
6dbb1ee46b | ||
|
|
698a691724 | ||
|
|
e018ff094f | ||
|
|
639f7fde6a | ||
|
|
95d09e4b5e | ||
|
|
426aeb2808 | ||
|
|
f1a0b7d690 | ||
|
|
da316b50bd | ||
|
|
8763c6090d | ||
|
|
448c9be157 | ||
|
|
f3231a7c76 | ||
|
|
0f337e11bc | ||
|
|
6202b47e63 | ||
|
|
20f76efb78 | ||
|
|
6de67244d4 | ||
|
|
1bb92d5212 | ||
|
|
e3829b8869 | ||
|
|
f18f394386 | ||
|
|
5391bb8be0 | ||
|
|
e2230c17d3 | ||
|
|
24fb60ffe9 | ||
|
|
d926a48fd2 | ||
|
|
28022c9b1f | ||
|
|
b735a4419c | ||
|
|
e70069a62f | ||
|
|
f1486f0fd6 | ||
|
|
e5b0952be2 | ||
|
|
a47df5be19 | ||
|
|
4bccb8e94e | ||
|
|
0c8a2a2cd1 | ||
|
|
67d0fe39ee | ||
|
|
ff06588130 | ||
|
|
51c1b64fa9 | ||
|
|
60de74ebda | ||
|
|
c2a13ced42 | ||
|
|
d6b46901b2 | ||
|
|
4a4422740f | ||
|
|
e910b0a8a5 | ||
|
|
9088ef8052 | ||
|
|
5c7f802e7e | ||
|
|
245eaf5187 | ||
|
|
977cbc2fff | ||
|
|
436d50a821 | ||
|
|
9f1d962ed6 | ||
|
|
98787d9002 | ||
|
|
dfadc5a427 | ||
|
|
33508a3d47 | ||
|
|
82df4e2638 | ||
|
|
a93c62aafa | ||
|
|
ae3b2078ea | ||
|
|
175d94b6e5 | ||
|
|
7938ebf6c1 | ||
|
|
92a076a92b | ||
|
|
fe41f87e46 | ||
|
|
e03480bfab | ||
|
|
6304a611cd | ||
|
|
7bf6d98535 | ||
|
|
4f6a97f532 | ||
|
|
ae3782a0db | ||
|
|
f19578ad58 | ||
|
|
5bf14e4699 | ||
|
|
a38bc7b373 | ||
|
|
bb955ec937 | ||
|
|
2b7715b925 | ||
|
|
2ab9a2d4be | ||
|
|
98e4d509f6 | ||
|
|
842e408c67 | ||
|
|
3c5e6b29ce | ||
|
|
797f69ef32 | ||
|
|
e52cb1858d | ||
|
|
ebd21de1e4 | ||
|
|
a74c7cb528 | ||
|
|
3f25c4228a | ||
|
|
5358c7cf5e | ||
|
|
9d03310b23 | ||
|
|
243d5fcb1f | ||
|
|
e616bc8694 | ||
|
|
56d7e98ddf | ||
|
|
40d237df1f | ||
|
|
283ee1f6dc | ||
|
|
dd7cdab8e4 | ||
|
|
944d473eaa | ||
|
|
b601dc5b29 | ||
|
|
3d51b1d544 | ||
|
|
5e2b8349b4 | ||
|
|
a2a2ea18fe | ||
|
|
65056e9d6c | ||
|
|
807e81937b | ||
|
|
62f12a8b86 | ||
|
|
a8515a339d | ||
|
|
4003595d60 | ||
|
|
d3a8e107ac | ||
|
|
2b7a699acd | ||
|
|
78488a54c8 | ||
|
|
06be3c659c | ||
|
|
b57474f23e | ||
|
|
4f861b6071 | ||
|
|
db4211a8fe | ||
|
|
562c17eb4e | ||
|
|
138689ffb7 | ||
|
|
9667ee4f72 | ||
|
|
2bdb34fd40 | ||
|
|
0e82eb48cb | ||
|
|
f15c155363 | ||
|
|
d5796fb298 | ||
|
|
e3dabe448d | ||
|
|
7922e0f0bf | ||
|
|
67c2b0a9e8 | ||
|
|
151c39827a | ||
|
|
fad3f936ac | ||
|
|
72dbb7f416 | ||
|
|
1bcd439cad | ||
|
|
a837b2f6a3 | ||
|
|
f5f94d9c08 | ||
|
|
9f25f736ed |
No files matched your search
@@ -0,0 +1,16 @@
|
||||
; http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h}]
|
||||
charset = UTF-8
|
||||
end_of_line = LF
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
@@ -148,6 +148,7 @@ tests/*/*/*.sh
|
||||
*/tests/*/*/*.sh
|
||||
*/*/tests/*.diff
|
||||
*/*/tests/*.out
|
||||
*/*/tests/*.out.png
|
||||
*/*/tests/*.php
|
||||
*/*/tests/*.exp
|
||||
*/*/tests/*.log
|
||||
|
||||
+3
-3
@@ -108,8 +108,8 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_dblib
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -132,7 +132,7 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_oci
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
|
||||
@@ -1,12 +1,316 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2016 PHP 7.0.11
|
||||
10 Nov 2016 PHP 7.0.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73350 (Exception::__toString() cause circular references).
|
||||
(Laruence)
|
||||
. Fixed bug #73181 (parse_str() without a second argument leads to crash).
|
||||
(Nikita)
|
||||
. Fixed bug #66773 (Autoload with Opcache allows importing conflicting class
|
||||
name to namespace). (Nikita)
|
||||
. Fixed bug #66862 ((Sub-)Namespaces unexpected behaviour). (Nikita)
|
||||
. Fix pthreads detection when cross-compiling (ffontaine)
|
||||
. Fixed bug #73337 (try/catch not working with two exceptions inside a same
|
||||
operation). (Dmitry)
|
||||
. Fixed bug #73338 (Exception thrown from error handler causes valgrind
|
||||
warnings (and crashes)). (Bob, Dmitry)
|
||||
. Fixed bug #73329 ((Float)"Nano" == NAN). (Anatol)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73213 (Integer overflow in imageline() with antialiasing). (cmb)
|
||||
. Fixed bug #73272 (imagescale() is not affected by, but affects
|
||||
imagesetinterpolation()). (cmb)
|
||||
. Fixed bug #73279 (Integer overflow in gdImageScaleBilinearPalette()). (cmb)
|
||||
. Fixed bug #73280 (Stack Buffer Overflow in GD dynamicGetbuf). (cmb)
|
||||
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
|
||||
overflow). (cmb)
|
||||
. Fixed bug #72696 (imagefilltoborder stackoverflow on truecolor images).
|
||||
(cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #73418 (Integer Overflow in "_php_imap_mail" leads to crash).
|
||||
(Anatol)
|
||||
|
||||
- OCI8
|
||||
. Fixed bug #71148 (Bind reference overwritten on PHP 7). (Oracle Corp.)
|
||||
|
||||
- phpdbg:
|
||||
. Properly allow for stdin input from a file. (Bob)
|
||||
. Add -s command line option / stdin command for reading script from stdin.
|
||||
(Bob)
|
||||
. Ignore non-executable opcodes in line mode of phpdbg_end_oplog(). (Bob)
|
||||
. Fixed bug #70776 (Simple SIGINT does not have any effect with -rr). (Bob)
|
||||
. Fixed bug #71234 (INI files are loaded even invoked as -n --version). (Bob)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #73273 (session_unset() empties values from all variables in which
|
||||
is $_session stored). (Nikita)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #73037 (SoapServer reports Bad Request when gzipped). (Anatol)
|
||||
. Fixed bug #73237 (Nested object in "any" element overwrites other fields).
|
||||
(Keith Smiley)
|
||||
. Fixed bug #69137 (Peer verification fails when using a proxy with SoapClient)
|
||||
(Keith Smiley)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #73333 (2147483647 is fetched as string). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #73203 (passing additional_parameters causes mail to fail). (cmb)
|
||||
. Fixed bug #71241 (array_replace_recursive sometimes mutates its parameters).
|
||||
(adsr)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #73331 (NULL Pointer Dereference in WDDX Packet Deserialization
|
||||
with PDORow). (Stas)
|
||||
|
||||
13 Oct 2016 PHP 7.0.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73025 (Heap Buffer Overflow in virtual_popen of
|
||||
zend_virtual_cwd.c). (cmb)
|
||||
. Fixed bug #72703 (Out of bounds global memory read in BF_crypt triggered by
|
||||
password_verify). (Anatol)
|
||||
. Fixed bug #73058 (crypt broken when salt is 'too' long). (Anatol)
|
||||
. Fixed bug #69579 (Invalid free in extension trait). (John Boehr)
|
||||
. Fixed bug #73156 (segfault on undefined function). (Dmitry)
|
||||
. Fixed bug #73163 (PHP hangs if error handler throws while accessing undef
|
||||
const in default value). (Nikita)
|
||||
. Fixed bug #73172 (parse error: Invalid numeric literal). (Nikita, Anatol)
|
||||
. Fixed for #73240 (Write out of bounds at number_format). (Stas)
|
||||
. Fixed bug #73147 (Use After Free in PHP7 unserialize()). (Stas)
|
||||
. Fixed bug #73189 (Memcpy negative size parameter php_resolve_path). (Stas)
|
||||
|
||||
- BCmath:
|
||||
. Fix bug #73190 (memcpy negative parameter _bc_new_num_ex). (Stas)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #73126 (Cannot pass parameter 1 by reference). (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #73091 (Unserializing DateInterval object may lead to __toString
|
||||
invocation). (Stas)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #73150 (missing NULL check in dom_document_save_html). (Stas)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #72972 (Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and
|
||||
FILTER_FLAG_NO_PRIV_RANGE). (julien)
|
||||
. Fixed bug #73054 (default option ignored when object passed to int filter).
|
||||
(cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #67325 (imagetruecolortopalette: white is duplicated in palette).
|
||||
(cmb)
|
||||
. Fixed bug #50194 (imagettftext broken on transparent background w/o
|
||||
alphablending). (cmb)
|
||||
. Fixed bug #73003 (Integer Overflow in gdImageWebpCtx of gd_webp.c). (trylab,
|
||||
cmb)
|
||||
. Fixed bug #53504 (imagettfbbox gives incorrect values for bounding box).
|
||||
(Mark Plomer, cmb)
|
||||
. Fixed bug #73157 (imagegd2() ignores 3rd param if 4 are given). (cmb)
|
||||
. Fixed bug #73155 (imagegd2() writes wrong chunk sizes on boundaries). (cmb)
|
||||
. Fixed bug #73159 (imagegd2(): unrecognized formats may result in corrupted
|
||||
files). (cmb)
|
||||
. Fixed bug #73161 (imagecreatefromgd2() may leak memory). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #73218 (add mitigation for ICU int overflow). (Stas)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb)
|
||||
. Fixed bug #66964 (mb_convert_variables() cannot detect recursion) (Yasuo)
|
||||
. Fixed bug #72992 (mbstring.internal_encoding doesn't inherit default_charset).
|
||||
(Yasuo)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #72489 (PHP Crashes When Modifying Array Containing MySQLi Result
|
||||
Data). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp()
|
||||
function). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #73072 (Invalid path SNI_server_certs causes segfault).
|
||||
(Jakub Zelenka)
|
||||
. Fixed bug #73276 (crash in openssl_random_pseudo_bytes function). (Stas)
|
||||
. Fixed bug #73275 (crash in openssl_encrypt function). (Stas)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #73121 (Bundled PCRE doesn't compile because JIT isn't supported
|
||||
on s390). (Anatol)
|
||||
. Fixed bug #73174 (heap overflow in php_pcre_replace_impl). (Stas)
|
||||
|
||||
- PDO_DBlib:
|
||||
. Fixed bug #72414 (Never quote values as raw binary data). (Adam Baratz)
|
||||
. Allow \PDO::setAttribute() to set query timeouts. (Adam Baratz)
|
||||
. Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions.
|
||||
(Adam Baratz)
|
||||
. Add common PDO test suite. (Adam Baratz)
|
||||
. Free error and message strings when cleaning up PDO instances.
|
||||
(Adam Baratz)
|
||||
. Fixed bug #67130 (\PDOStatement::nextRowset() should succeed when all rows
|
||||
in current rowset haven't been fetched). (Peter LeBrun)
|
||||
. Ignore potentially misleading dberr values. (Chris Kings-Lynne)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #72996 (phpdbg_prompt.c undefined reference to DL_LOAD). (Nikita)
|
||||
. Fixed next command not stopping when leaving function. (Bob)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #68015 (Session does not report invalid uid for files save handler).
|
||||
(Yasuo)
|
||||
. Fixed bug #73100 (session_destroy null dereference in ps_files_path_create).
|
||||
(cmb)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #73293 (NULL pointer dereference in SimpleXMLElement::asXML()).
|
||||
(Stas)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #71711 (Soap Server Member variables reference bug). (Nikita)
|
||||
. Fixed bug #71996 (Using references in arrays doesn't work like expected).
|
||||
(Nikita)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73257, #73258 (SplObjectStorage unserialize allows use of
|
||||
non-object as key). (Stas)
|
||||
|
||||
- SQLite3:
|
||||
. Updated bundled SQLite3 to 3.14.2. (cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #70752 (Depacking with wrong password leaves 0 length files).
|
||||
(cmb)
|
||||
|
||||
15 Sep 2016 PHP 7.0.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72944 (Null pointer deref in zval_delref_p). (Dmitry)
|
||||
. Fixed bug #72943 (assign_dim on string doesn't reset hval). (Laruence)
|
||||
. Fixed bug #72911 (Memleak in zend_binary_assign_op_obj_helper). (Laruence)
|
||||
. Fixed bug #72813 (Segfault with __get returned by ref). (Laruence)
|
||||
. Fixed bug #72767 (PHP Segfaults when trying to expand an infinite operator).
|
||||
(Nikita)
|
||||
. Fixed bug #72854 (PHP Crashes on duplicate destructor call). (Nikita)
|
||||
. Fixed bug #72857 (stream_socket_recvfrom read access violation). (Anatol)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #72922 (COM called from PHP does not return out parameters).
|
||||
(Anatol)
|
||||
|
||||
- Dba:
|
||||
. Fixed bug #70825 (Cannot fetch multiple values with group in ini file).
|
||||
(cmb)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #70195 (Cannot upload file using ftp_put to FTPES with
|
||||
require_ssl_reuse). (Benedict Singer)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #72709 (imagesetstyle() causes OOB read for empty $styles). (cmb)
|
||||
. Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor
|
||||
images). (cmb)
|
||||
. Fixed bug #72913 (imagecopy() loses single-color transparency on palette
|
||||
images). (cmb)
|
||||
. Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #72320 (iconv_substr returns false for empty strings). (cmb)
|
||||
|
||||
?? ??? 2016 PHP 7.0.10
|
||||
- IMAP:
|
||||
. Fixed bug #72852 (imap_mail null dereference). (Anatol)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF
|
||||
sequence). (cmb)
|
||||
. Fixed bug #73007 (add locale length check). (Stas)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #72293 (Heap overflow in mysqlnd related to BIT fields). (Stas)
|
||||
|
||||
- OCI8
|
||||
. Fixed invalid handle error with Implicit Result Sets. (Chris Jones)
|
||||
. Fixed bug #72524 (Binding null values triggers ORA-24816 error). (Chris Jones)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72949 (Typo in opcache error message). (cmb)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #72788 (Invalid memory access when using persistent PDO
|
||||
connection). (Keyur)
|
||||
. Fixed bug #72791 (Memory leak in PDO persistent connection handling). (Keyur)
|
||||
. Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY
|
||||
returns false). (cmb)
|
||||
|
||||
- PDO_DBlib:
|
||||
. Implemented stringify 'uniqueidentifier' fields.
|
||||
(Alexander Zhuravlev, Adam Baratz)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
|
||||
specifying a sequence). (Pablo Santiago Sánchez, Matteo)
|
||||
. Fixed bug #72759 (Regression in pgo_pgsql). (Anatol)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #72928 (Out of bound when verify signature of zip phar in
|
||||
phar_parse_zipfile). (Stas)
|
||||
. Fixed bug #73035 (Out of bound when verify signature of tar phar in
|
||||
phar_parse_tarfile). (Stas)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72846 (getConstant for a array constant with constant values
|
||||
returns NULL/NFC/UKNOWN). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #72724 (PHP7: session-uploadprogress kills httpd). (Nikita)
|
||||
. Fixed bug #72940 (SID always return "name=ID", even if session
|
||||
cookie exist). (Yasuo)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #72971 (SimpleXML isset/unset do not respect namespace). (Nikita)
|
||||
. Fixed bug #72957 (Null coalescing operator doesn't behave as expected with
|
||||
SimpleXMLElement). (Nikita)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73029 (Missing type check when unserializing SplArray). (Stas)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #55451 (substr_compare NULL length interpreted as 0). (Lauri
|
||||
Kenttä)
|
||||
. Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb)
|
||||
. Fixed bug #65550 (get_browser() incorrectly parses entries with "+" sign).
|
||||
(cmb)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence)
|
||||
. Fixed bug #72764 (ftps:// opendir wrapper data channel encryption fails
|
||||
with IIS FTP 7.5, 8.5). (vhuk)
|
||||
. Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory).
|
||||
(cmb)
|
||||
|
||||
- SQLite3:
|
||||
. Downgraded bundled SQLite to 3.8.10.2. (Anatol);
|
||||
|
||||
- Sysvshm:
|
||||
. Fixed bug #72858 (shm_attach null dereference). (Anatol)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #72085 (SEGV on unknown address zif_xml_parse). (cmb)
|
||||
. Fixed bug #72714 (_xml_startElementHandler() segmentation fault). (cmb)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #72860 (wddx_deserialize use-after-free). (Stas)
|
||||
. Fixed bug #73065 (Out-Of-Bounds Read in php_wddx_push_element). (Stas)
|
||||
|
||||
- ZIP:
|
||||
. Fixed bug #68302 (impossible to compile php with zip support). (cmb)
|
||||
|
||||
18 Aug 2016 PHP 7.0.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72629 (Caught exception assignment to variables ignores
|
||||
@@ -28,7 +332,18 @@ PHP NEWS
|
||||
(Yuji Uchiyama)
|
||||
. Fixed potential segfault in object storage freeing in shutdown sequence.
|
||||
(Bob)
|
||||
. Fixed bug #72663 (Create an Unexpected Object and Don't Invoke
|
||||
__wakeup() in Deserialization). (Stas)
|
||||
. Fixed bug #72681 (PHP Session Data Injection Vulnerability). (Stas)
|
||||
. Fixed bug #72683 (getmxrr broken). (Anatol)
|
||||
. Fixed bug #72742 (memory allocator fails to realloc small block to large
|
||||
one). (Stas)
|
||||
. Fixed URL rewriter partially. It would not rewrite '//example.com/' URL
|
||||
unconditionally. Only requested host(HTTP_HOST) is rewritten. (Yasuo)
|
||||
|
||||
- Bz2:
|
||||
. Fixed bug #72837 (integer overflow in bzdecompress caused heap
|
||||
corruption). (Stas)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #67976 (cal_days_month() fails for final month of the French
|
||||
@@ -43,10 +358,15 @@ PHP NEWS
|
||||
. Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER).
|
||||
(Pierrick)
|
||||
. Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick)
|
||||
. Fixed bug #72674 (Heap overflow in curl_escape). (Stas)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi)
|
||||
. Fixed bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF). (Stas)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
|
||||
range). (bugs dot php dot net at majkl578 dot cz)
|
||||
@@ -63,6 +383,8 @@ PHP NEWS
|
||||
blendingmode). (cmb)
|
||||
. Fixed bug #66555 (Always false condition in ext/gd/libgd/gdkanji.c). (cmb)
|
||||
. Fixed bug #68712 (suspicious if-else statements). (cmb)
|
||||
. Fixed bug #72697 (select_colors write out-of-bounds). (Stas)
|
||||
. Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #72639 (Segfault when instantiating class that extends
|
||||
@@ -80,6 +402,9 @@ PHP NEWS
|
||||
. Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error).
|
||||
(ju1ius)
|
||||
|
||||
- Mcrypt:
|
||||
. Fixed bug #72782 (Heap Overflow due to integer overflows). (Stas)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
|
||||
(Keyur)
|
||||
@@ -89,8 +414,6 @@ PHP NEWS
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
|
||||
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
|
||||
specifying a sequence). (Pablo Santiago Sánchez)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72222 (ReflectionClass::export doesn't handle array constants).
|
||||
@@ -100,6 +423,10 @@ PHP NEWS
|
||||
. Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML
|
||||
element). (Laruence)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #72708 (php_snmp_parse_oid integer overflow in memory
|
||||
allocation). (djodjo at gmail dot com)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU)
|
||||
. Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
|
||||
@@ -131,6 +458,8 @@ PHP NEWS
|
||||
. Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk)
|
||||
. Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for
|
||||
non-existent directories). (vhuk)
|
||||
. Fixed bug #72771 (ftps:// wrapper is vulnerable to protocol downgrade
|
||||
attack). (Stas)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
|
||||
@@ -140,7 +469,12 @@ PHP NEWS
|
||||
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
|
||||
. Fixed bug #72142 (WDDX Packet Injection Vulnerability in
|
||||
wddx_serialize_value()). (Taoguang Chen)
|
||||
|
||||
. Fixed bug #72749 (wddx_deserialize allows illegal memory access) (Stas)
|
||||
. Fixed bug #72750 (wddx_deserialize null dereference). (Stas)
|
||||
. Fixed bug #72790 (wddx_deserialize null dereference with invalid xml).
|
||||
(Stas)
|
||||
. Fixed bug #72799 (wddx_deserialize null dereference in
|
||||
php_wddx_pop_element). (Stas)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
|
||||
@@ -1272,6 +1606,8 @@ PHP NEWS
|
||||
|
||||
- Filter:
|
||||
. New FILTER_VALIDATE_DOMAIN and better RFC conformance for FILTER_VALIDATE_URL. (Kevin Dunglas)
|
||||
. Fixed bug #67167 (Wrong return value from FILTER_VALIDATE_BOOLEAN,
|
||||
FILTER_NULL_ON_FAILURE). (levim)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #70538 ("php-fpm -i" crashes). (rainer dot jung at
|
||||
|
||||
+26
-29
@@ -66,7 +66,7 @@ dnl
|
||||
dnl Check whether the current setup can use POSIX threads calls
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_CHECK_COMPILE], [
|
||||
AC_TRY_RUN( [
|
||||
AC_LINK_IFELSE([ AC_LANG_SOURCE([
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -80,18 +80,11 @@ int main() {
|
||||
int data = 1;
|
||||
pthread_mutexattr_init(&mattr);
|
||||
return pthread_create(&thd, NULL, thread_routine, &data);
|
||||
} ], [
|
||||
pthreads_working=yes
|
||||
} ]) ], [
|
||||
pthreads_checked=yes
|
||||
], [
|
||||
pthreads_working=no
|
||||
], [
|
||||
dnl For cross compiling running this test is of no use. NetWare supports pthreads
|
||||
pthreads_working=no
|
||||
case $host_alias in
|
||||
*netware*)
|
||||
pthreads_working=yes
|
||||
esac
|
||||
]
|
||||
pthreads_checked=no
|
||||
]
|
||||
) ] )dnl
|
||||
dnl
|
||||
dnl PTHREADS_CHECK()
|
||||
@@ -129,30 +122,34 @@ else
|
||||
CFLAGS="$CFLAGS $flag"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
CFLAGS=$ac_save
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
ac_cv_pthreads_cflags=$flag
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
|
||||
pthreads_working="yes"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
threads_result="POSIX-Threads found"
|
||||
|
||||
+18
-2
@@ -622,6 +622,12 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
}
|
||||
} else {
|
||||
if (flags & IPC_EXCL) {
|
||||
if (shm_handle) {
|
||||
CloseHandle(shm_handle);
|
||||
}
|
||||
if (info_handle) {
|
||||
CloseHandle(info_handle);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -665,17 +671,27 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
{
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
int err;
|
||||
|
||||
if (!shm->segment) {
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
/* Catch more errors */
|
||||
if (ERROR_NOT_ENOUGH_MEMORY == err) {
|
||||
_set_errno(ENOMEM);
|
||||
}
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->descriptor->shm_atime = time(NULL);
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch++;
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
return shm->addr;
|
||||
}
|
||||
|
||||
|
||||
@@ -517,6 +517,10 @@ Other
|
||||
- Stream:
|
||||
. Removed set_socket_blocking() in favor of its alias stream_set_blocking().
|
||||
|
||||
- XML:
|
||||
. xml_set_object() now requires to manually unset the $parser when finished,
|
||||
to avoid memory leaks.
|
||||
|
||||
- XSL:
|
||||
. Removed xsl.security_prefs ini option. Use XsltProcessor::setSecurityPrefs()
|
||||
instead.
|
||||
@@ -723,6 +727,9 @@ out, that the corresponding SDK isn't available anymore.
|
||||
- Openssl
|
||||
minimum supported OpenSSL version series was raised to 0.9.8
|
||||
|
||||
- Shmop
|
||||
The shmop identifiers have been changed from ints to resources of type shmop.
|
||||
|
||||
========================================
|
||||
10. New Global Constants
|
||||
========================================
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Next free element may overflow in array literals
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = PHP_INT_MAX;
|
||||
$array = [$i => 42, new stdClass];
|
||||
var_dump($array);
|
||||
|
||||
const FOO = [PHP_INT_MAX => 42, "foo"];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #72767: PHP Segfaults when trying to expand an infinite operator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {}
|
||||
$iterator = new LimitIterator(
|
||||
new InfiniteIterator(new ArrayIterator([42])),
|
||||
0, 17000
|
||||
);
|
||||
test(...$iterator);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #72813 (Segfault with __get returned by ref)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
private $props = ['a' => 'text', 'b' => 1];
|
||||
|
||||
public function &__get($prop)
|
||||
{
|
||||
return $this->props[$prop];
|
||||
}
|
||||
|
||||
public function __set($prop, $value)
|
||||
{
|
||||
if ($prop === 'b') $value = [$value];
|
||||
$this->props[$prop] = $value;
|
||||
}
|
||||
|
||||
public function getProperties()
|
||||
{
|
||||
return [$this->props];
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$obj->b = $obj->b;
|
||||
print_r($obj->getProperties());
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[a] => text
|
||||
[b] => Array
|
||||
(
|
||||
[0] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #72854: PHP Crashes on duplicate destructor call
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
|
||||
$i = 42;
|
||||
get()->prop =& $i;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #72911 (Memleak in zend_binary_assign_op_obj_helper)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 0;
|
||||
|
||||
$b = $a->b->i -= 0;
|
||||
|
||||
var_dump($b);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Attempt to modify property of non-object in %sbug72911.php on line %d
|
||||
|
||||
Warning: Attempt to assign property of non-object in %sbug72911.php on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #72943 (assign_dim on string doesn't reset hval)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array("test" => 1);
|
||||
|
||||
$a = "lest";
|
||||
var_dump($array[$a]);
|
||||
$a[0] = "f";
|
||||
var_dump($array[$a]);
|
||||
$a[0] = "t";
|
||||
var_dump($array[$a]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined index: lest in %sbug72943.php on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined index: fest in %sbug72943.php on line %d
|
||||
NULL
|
||||
int(1)
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #72944 (Null pointer deref in zval_delref_p).
|
||||
--FILE--
|
||||
<?php
|
||||
"a"== e & $A = $A? 0 : 0 ?:0;
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2
|
||||
|
||||
Notice: Undefined variable: A in %sbug72944.php on line 2
|
||||
OK
|
||||
@@ -0,0 +1,50 @@
|
||||
--TEST--
|
||||
Bug #73156 (segfault on undefined function)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function __call($name, $args) {
|
||||
eval('$args = array(); var_dump(debug_backtrace());');
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
|
||||
$a->test("test");
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["file"]=>
|
||||
string(%d) "%sbug73156.php"
|
||||
["line"]=>
|
||||
int(4)
|
||||
["function"]=>
|
||||
string(4) "eval"
|
||||
}
|
||||
[1]=>
|
||||
array(7) {
|
||||
["file"]=>
|
||||
string(%d) "%sbug73156.php"
|
||||
["line"]=>
|
||||
int(10)
|
||||
["function"]=>
|
||||
string(6) "__call"
|
||||
["class"]=>
|
||||
string(1) "A"
|
||||
["object"]=>
|
||||
object(A)#%d (0) {
|
||||
}
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(4) "test"
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #73163 (PHP hangs if error handler throws while accessing undef const in default value)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function doSomething(string $value = UNDEFINED) {
|
||||
}
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
throw new Exception($errstr);
|
||||
});
|
||||
|
||||
doSomething();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): {closure}(%s)
|
||||
#1 %s(%d): doSomething()
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73181: parse_str() without a second argument leads to crash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function x() {
|
||||
parse_str("1&x");
|
||||
var_dump(get_defined_vars());
|
||||
}
|
||||
|
||||
x();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(0) ""
|
||||
["x"]=>
|
||||
string(0) ""
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #73337 (try/catch not working with two exceptions inside a same operation)
|
||||
--FILE--
|
||||
<?php
|
||||
class d { function __destruct() { throw new Exception; } }
|
||||
try { new d + new d; } catch (Exception $e) { print "Exception properly caught\n"; }
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
|
||||
|
||||
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
|
||||
Exception properly caught
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #73338: Ensure exceptions in function init opcodes are cleaned properly
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try { call_user_func(new class { function __destruct () { throw new Error; } }); } catch (Error $e) {}
|
||||
|
||||
set_error_handler(function() { throw new Error; });
|
||||
|
||||
try { var_dump(new stdClass, call_user_func("fail")); } catch (Error $e) {}
|
||||
|
||||
try { (function() { call_user_func("fail"); })(); } catch (Error $e) {}
|
||||
|
||||
try { [new class { static function foo() {} function __destruct () { throw new Error; } }, "foo"](); } catch (Error $e) {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in %s on line %d
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #73350 (Exception::__toString() cause circular references)
|
||||
--FILE--
|
||||
<?php
|
||||
$e = new Exception();
|
||||
|
||||
// This line cause problem :(
|
||||
// Comment it to see the difference.
|
||||
(string) $e;
|
||||
|
||||
// This line show the clue (PHP Warning: ...).
|
||||
var_export($e);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Exception::__set_state(array(
|
||||
'message' => '',
|
||||
'string' => 'Exception in %sbug73350.php:%d
|
||||
Stack trace:
|
||||
#0 {main}',
|
||||
'code' => 0,
|
||||
'file' => '%sbug73350.php',
|
||||
'line' => %d,
|
||||
'trace' =>
|
||||
array (
|
||||
),
|
||||
'previous' => NULL,
|
||||
))
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Constexpr arrays should be able to handle resource keys
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const FOO = [STDIN => 42];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #69579 (Internal trait double-free)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!PHP_DEBUG) die("skip only run in debug version");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Bar{
|
||||
use _ZendTestTrait;
|
||||
}
|
||||
|
||||
$bar = new Bar();
|
||||
var_dump($bar->testMethod());
|
||||
// destruction causes a double-free and explodes
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -12,8 +12,8 @@ final class e { }
|
||||
var_dump(get_declared_traits());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -13,8 +13,8 @@ namespace test {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
string(6) "test\c"
|
||||
}
|
||||
@@ -13,13 +13,15 @@ var_dump(get_declared_traits());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%astring(1) "a"
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
string(1) "a"
|
||||
[%d]=>
|
||||
string(1) "d"
|
||||
[%d]=>
|
||||
string(1) "e"
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
"use function" should not conflict with class names
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
|
||||
class Bar {}
|
||||
|
||||
use function bar;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Use conflicts should not occur across files
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/use_no_file_conflict_1.inc';
|
||||
require __DIR__ . '/use_no_file_conflict_2.inc';
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
class A {}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
use A;
|
||||
+19
-3
@@ -197,7 +197,6 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
|
||||
{
|
||||
zend_function *active_function = EG(current_execute_data)->func;
|
||||
@@ -291,7 +290,6 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
|
||||
return 1;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
|
||||
{
|
||||
@@ -1861,7 +1859,7 @@ static int zend_startup_module_zval(zval *zv) /* {{{ */
|
||||
{
|
||||
zend_module_entry *module = Z_PTR_P(zv);
|
||||
|
||||
return zend_startup_module_ex(module);
|
||||
return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3849,6 +3847,24 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
|
||||
{
|
||||
zval property;
|
||||
zend_class_entry *old_scope = EG(scope);
|
||||
|
||||
EG(scope) = scope;
|
||||
|
||||
if (!Z_OBJ_HT_P(object)->unset_property) {
|
||||
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
|
||||
}
|
||||
ZVAL_STRINGL(&property, name, name_length);
|
||||
Z_OBJ_HT_P(object)->unset_property(object, &property, 0);
|
||||
zval_ptr_dtor(&property);
|
||||
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
|
||||
{
|
||||
zval tmp;
|
||||
|
||||
+3
-6
@@ -343,6 +343,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
|
||||
ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value);
|
||||
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value);
|
||||
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
|
||||
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
|
||||
|
||||
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);
|
||||
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length);
|
||||
@@ -665,13 +666,11 @@ END_EXTERN_C()
|
||||
|
||||
/* Fast parameter parsing API */
|
||||
|
||||
/* This API should be used only for really often used functions.
|
||||
* (Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
|
||||
/* Fast ZPP is always enabled now; this define is left in for compatibility
|
||||
* with any existing conditional compilation blocks.
|
||||
*/
|
||||
#define FAST_ZPP 1
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
|
||||
#define Z_EXPECTED_TYPES(_) \
|
||||
_(Z_EXPECTED_LONG, "integer") \
|
||||
_(Z_EXPECTED_BOOL, "boolean") \
|
||||
@@ -1034,8 +1033,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
|
||||
#define Z_PARAM_VARIADIC(spec, dest, dest_num) \
|
||||
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
|
||||
|
||||
#endif /* FAST_ZPP */
|
||||
|
||||
/* End of new parameter parsing API */
|
||||
|
||||
/* Inlined implementations shared by new and old parameter parsing APIs */
|
||||
|
||||
+20
-33
@@ -1472,7 +1472,7 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
#endif
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
@@ -1548,21 +1548,21 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
|
||||
ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
|
||||
if (info & ZEND_MM_IS_SRUN) {
|
||||
int old_bin_num, bin_num;
|
||||
|
||||
old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
|
||||
int old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
|
||||
old_size = bin_data_size[old_bin_num];
|
||||
bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
|
||||
if (old_bin_num == bin_num) {
|
||||
if (size <= ZEND_MM_MAX_SMALL_SIZE) {
|
||||
int bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
|
||||
if (old_bin_num == bin_num) {
|
||||
#if ZEND_DEBUG
|
||||
dbg = zend_mm_get_debug_info(heap, ptr);
|
||||
dbg->size = real_size;
|
||||
dbg->filename = __zend_filename;
|
||||
dbg->orig_filename = __zend_orig_filename;
|
||||
dbg->lineno = __zend_lineno;
|
||||
dbg->orig_lineno = __zend_orig_lineno;
|
||||
dbg = zend_mm_get_debug_info(heap, ptr);
|
||||
dbg->size = real_size;
|
||||
dbg->filename = __zend_filename;
|
||||
dbg->orig_filename = __zend_orig_filename;
|
||||
dbg->lineno = __zend_lineno;
|
||||
dbg->orig_lineno = __zend_orig_lineno;
|
||||
#endif
|
||||
return ptr;
|
||||
return ptr;
|
||||
}
|
||||
}
|
||||
} else /* if (info & ZEND_MM_IS_LARGE_RUN) */ {
|
||||
ZEND_MM_CHECK(ZEND_MM_ALIGNED_OFFSET(page_offset, ZEND_MM_PAGE_SIZE) == 0, "zend_mm_heap corrupted");
|
||||
@@ -1740,7 +1740,7 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
@@ -2500,37 +2500,24 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC Z
|
||||
return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
int overflow;
|
||||
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return emalloc_rel(safe_address(nmemb, size, offset));
|
||||
return emalloc_rel(zend_safe_address_guarded(nmemb, size, offset));
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_malloc(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
return pemalloc(safe_address(nmemb, size, offset), 1);
|
||||
return pemalloc(zend_safe_address_guarded(nmemb, size, offset), 1);
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return erealloc_rel(ptr, safe_address(nmemb, size, offset));
|
||||
return erealloc_rel(ptr, zend_safe_address_guarded(nmemb, size, offset));
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
return perealloc(ptr, safe_address(nmemb, size, offset), 1);
|
||||
return perealloc(ptr, zend_safe_address_guarded(nmemb, size, offset), 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -2646,9 +2633,9 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
|
||||
memset(alloc_globals->mm_heap, 0, sizeof(zend_mm_heap));
|
||||
alloc_globals->mm_heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD;
|
||||
alloc_globals->mm_heap->custom_heap.std._malloc = malloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._malloc = __zend_malloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._free = free;
|
||||
alloc_globals->mm_heap->custom_heap.std._realloc = realloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._realloc = __zend_realloc;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
+9
-1
@@ -181,7 +181,11 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
|
||||
{
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_UNDEF:
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(result), expr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), expr)) {
|
||||
zend_error(E_WARNING,
|
||||
"Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr);
|
||||
}
|
||||
break;
|
||||
case IS_STRING:
|
||||
zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(offset), expr);
|
||||
@@ -202,6 +206,10 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
|
||||
case IS_DOUBLE:
|
||||
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), expr);
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
zend_error(E_NOTICE, "Resource ID#%d used as offset, casting to integer (%d)", Z_RES_HANDLE_P(offset), Z_RES_HANDLE_P(offset));
|
||||
zend_hash_index_update(Z_ARRVAL_P(result), Z_RES_HANDLE_P(offset), expr);
|
||||
break;
|
||||
default:
|
||||
zend_throw_error(NULL, "Illegal offset type");
|
||||
return FAILURE;
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
|
||||
#undef ZEND_TEST_EXCEPTIONS
|
||||
|
||||
#if ZEND_DEBUG
|
||||
static zend_class_entry *zend_test_trait;
|
||||
#endif
|
||||
|
||||
static ZEND_FUNCTION(zend_version);
|
||||
static ZEND_FUNCTION(func_num_args);
|
||||
static ZEND_FUNCTION(func_get_arg);
|
||||
@@ -257,6 +261,18 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
/* }}} */
|
||||
|
||||
#if ZEND_DEBUG
|
||||
static ZEND_METHOD(_ZendTestTrait, testMethod) /* {{{ */ {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_function_entry zend_test_trait_methods[] = {
|
||||
ZEND_ME(_ZendTestTrait, testMethod, arginfo_zend__void, ZEND_ACC_PUBLIC)
|
||||
ZEND_FE_END
|
||||
};
|
||||
#endif
|
||||
|
||||
static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(zend_version, arginfo_zend__void)
|
||||
ZEND_FE(func_num_args, arginfo_zend__void)
|
||||
@@ -339,6 +355,13 @@ ZEND_MINIT_FUNCTION(core) { /* {{{ */
|
||||
|
||||
zend_register_default_classes();
|
||||
|
||||
#if ZEND_DEBUG
|
||||
INIT_CLASS_ENTRY(class_entry, "_ZendTestTrait", zend_test_trait_methods);
|
||||
zend_test_trait = zend_register_internal_class(&class_entry);
|
||||
zend_test_trait->ce_flags |= ZEND_ACC_TRAIT;
|
||||
zend_declare_property_null(zend_test_trait, "testProp", sizeof("testProp")-1, ZEND_ACC_PUBLIC);
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -544,15 +567,9 @@ ZEND_FUNCTION(strlen)
|
||||
{
|
||||
zend_string *s;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &s) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(s)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETVAL_LONG(ZSTR_LEN(s));
|
||||
}
|
||||
@@ -692,16 +709,10 @@ ZEND_FUNCTION(error_reporting)
|
||||
zval *err;
|
||||
int old_error_reporting;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(0, 1)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_ZVAL(err)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
old_error_reporting = EG(error_reporting);
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
@@ -815,18 +826,12 @@ ZEND_FUNCTION(define)
|
||||
int case_sensitive = CONST_CS;
|
||||
zend_constant c;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &name, &val, &non_cs) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_STR(name)
|
||||
Z_PARAM_ZVAL(val)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(non_cs)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (non_cs) {
|
||||
case_sensitive = 0;
|
||||
@@ -907,15 +912,9 @@ ZEND_FUNCTION(defined)
|
||||
{
|
||||
zend_string *name;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (zend_get_constant_ex(name, NULL, ZEND_FETCH_CLASS_SILENT)) {
|
||||
RETURN_TRUE;
|
||||
@@ -1011,18 +1010,12 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
|
||||
zend_bool allow_string = only_subclass;
|
||||
zend_bool retval;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_ZVAL(obj)
|
||||
Z_PARAM_STR(class_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(allow_string)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
/*
|
||||
* allow_string - is_a default is no, is_subclass_of is yes.
|
||||
* if it's allowed, then the autoloader will be called if the class does not exist.
|
||||
@@ -1162,15 +1155,9 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zend_string *key;
|
||||
zend_object *zobj;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_OBJECT(obj)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_OBJ_HT_P(obj)->get_properties == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -1306,16 +1293,11 @@ ZEND_FUNCTION(method_exists)
|
||||
zend_string *lcname;
|
||||
zend_class_entry * ce;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &klass, &method_name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_ZVAL(klass)
|
||||
Z_PARAM_STR(method_name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_TYPE_P(klass) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(klass);
|
||||
} else if (Z_TYPE_P(klass) == IS_STRING) {
|
||||
@@ -1411,17 +1393,11 @@ ZEND_FUNCTION(class_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &class_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(class_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(class_name)[0] == '\\') {
|
||||
@@ -1454,17 +1430,11 @@ ZEND_FUNCTION(interface_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &iface_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(iface_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(iface_name)[0] == '\\') {
|
||||
@@ -1496,17 +1466,11 @@ ZEND_FUNCTION(trait_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &trait_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(trait_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(trait_name)[0] == '\\') {
|
||||
@@ -1539,15 +1503,9 @@ ZEND_FUNCTION(function_exists)
|
||||
zend_function *func;
|
||||
zend_string *lcname;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (ZSTR_VAL(name)[0] == '\\') {
|
||||
/* Ignore leading "\" */
|
||||
@@ -2253,9 +2211,33 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
zend_hash_real_init(Z_ARRVAL_P(arg_array), 1);
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(arg_array)) {
|
||||
if (call->func->type == ZEND_USER_FUNCTION) {
|
||||
uint32_t first_extra_arg = call->func->op_array.num_args;
|
||||
uint32_t first_extra_arg = MIN(num_args, call->func->op_array.num_args);
|
||||
|
||||
if (ZEND_CALL_NUM_ARGS(call) > first_extra_arg) {
|
||||
if (UNEXPECTED(call->symbol_table)) {
|
||||
/* In case of attached symbol_table, values on stack may be invalid
|
||||
* and we have to access them through symbol_table
|
||||
* See: https://bugs.php.net/bug.php?id=73156
|
||||
*/
|
||||
zend_string *arg_name;
|
||||
zval *arg;
|
||||
|
||||
while (i < first_extra_arg) {
|
||||
arg_name = call->func->op_array.vars[i];
|
||||
arg = zend_hash_find_ind(call->symbol_table, arg_name);
|
||||
if (arg) {
|
||||
if (Z_OPT_REFCOUNTED_P(arg)) {
|
||||
Z_ADDREF_P(arg);
|
||||
}
|
||||
n++;
|
||||
ZEND_HASH_FILL_ADD(arg);
|
||||
} else {
|
||||
zval tmp;
|
||||
ZVAL_UNDEF(&tmp);
|
||||
ZEND_HASH_FILL_ADD(&tmp);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
while (i < first_extra_arg) {
|
||||
if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) {
|
||||
if (Z_OPT_REFCOUNTED_P(p)) {
|
||||
@@ -2267,8 +2249,8 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
|
||||
}
|
||||
p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
|
||||
}
|
||||
|
||||
while (i < num_args) {
|
||||
@@ -2620,7 +2602,6 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
} else {
|
||||
zend_string *class_name = object->handlers->get_class_name(object);
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, class_name);
|
||||
zend_string_release(class_name);
|
||||
}
|
||||
if ((options & DEBUG_BACKTRACE_PROVIDE_OBJECT) != 0) {
|
||||
zval zv;
|
||||
|
||||
+75
-36
@@ -1944,10 +1944,42 @@ static inline uint32_t zend_emit_jump(uint32_t opnum_target) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_is_smart_branch(zend_op *opline) /* {{{ */
|
||||
{
|
||||
switch (opline->opcode) {
|
||||
case ZEND_IS_IDENTICAL:
|
||||
case ZEND_IS_NOT_IDENTICAL:
|
||||
case ZEND_IS_EQUAL:
|
||||
case ZEND_IS_NOT_EQUAL:
|
||||
case ZEND_IS_SMALLER:
|
||||
case ZEND_IS_SMALLER_OR_EQUAL:
|
||||
case ZEND_CASE:
|
||||
case ZEND_ISSET_ISEMPTY_VAR:
|
||||
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
|
||||
case ZEND_ISSET_ISEMPTY_PROP_OBJ:
|
||||
case ZEND_INSTANCEOF:
|
||||
case ZEND_TYPE_CHECK:
|
||||
case ZEND_DEFINED:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
|
||||
{
|
||||
uint32_t opnum = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = zend_emit_op(NULL, opcode, cond, NULL);
|
||||
zend_op *opline;
|
||||
|
||||
if ((cond->op_type & (IS_CV|IS_CONST))
|
||||
&& opnum > 0
|
||||
&& zend_is_smart_branch(CG(active_op_array)->opcodes + opnum - 1)) {
|
||||
/* emit extra NOP to avoid incorrect SMART_BRANCH in very rare cases */
|
||||
zend_emit_op(NULL, ZEND_NOP, NULL, NULL);
|
||||
opnum = get_next_op_number(CG(active_op_array));
|
||||
}
|
||||
opline = zend_emit_op(NULL, opcode, cond, NULL);
|
||||
opline->op2.opline_num = opnum_target;
|
||||
return opnum;
|
||||
}
|
||||
@@ -5467,6 +5499,41 @@ static void zend_check_already_in_use(uint32_t type, zend_string *old_name, zend
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_check_use_conflict(
|
||||
uint32_t type, zend_string *old_name, zend_string *new_name, zend_string *lookup_name) {
|
||||
switch (type) {
|
||||
case T_CLASS:
|
||||
{
|
||||
zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lookup_name);
|
||||
if (ce && ce->type == ZEND_USER_CLASS
|
||||
&& ce->info.user.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_FUNCTION:
|
||||
{
|
||||
zend_function *fn = zend_hash_find_ptr(CG(function_table), lookup_name);
|
||||
if (fn && fn->type == ZEND_USER_FUNCTION
|
||||
&& fn->op_array.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_CONST:
|
||||
{
|
||||
zend_string *filename = zend_hash_find_ptr(&CG(const_filenames), lookup_name);
|
||||
if (filename && filename == CG(compiled_filename)) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
|
||||
void zend_compile_use(zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(ast);
|
||||
@@ -5523,43 +5590,11 @@ void zend_compile_use(zend_ast *ast) /* {{{ */
|
||||
ZSTR_VAL(ns_name)[ZSTR_LEN(current_ns)] = '\\';
|
||||
memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name));
|
||||
|
||||
if (zend_hash_exists(CG(class_table), ns_name)) {
|
||||
zend_check_already_in_use(type, old_name, new_name, ns_name);
|
||||
}
|
||||
zend_check_use_conflict(type, old_name, new_name, ns_name);
|
||||
|
||||
zend_string_free(ns_name);
|
||||
} else {
|
||||
switch (type) {
|
||||
case T_CLASS:
|
||||
{
|
||||
zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lookup_name);
|
||||
if (ce && ce->type == ZEND_USER_CLASS
|
||||
&& ce->info.user.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_FUNCTION:
|
||||
{
|
||||
zend_function *fn = zend_hash_find_ptr(CG(function_table), lookup_name);
|
||||
if (fn && fn->type == ZEND_USER_FUNCTION
|
||||
&& fn->op_array.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_CONST:
|
||||
{
|
||||
zend_string *filename = zend_hash_find_ptr(&CG(const_filenames), lookup_name);
|
||||
if (filename && filename == CG(compiled_filename)) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
zend_check_use_conflict(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
|
||||
zend_string_addref(old_name);
|
||||
@@ -5918,7 +5953,11 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(result), value);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), value)) {
|
||||
zval_ptr_dtor_nogc(value);
|
||||
zval_ptr_dtor(result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -761,6 +761,7 @@ ZEND_API char *zend_make_compiled_string_description(const char *name);
|
||||
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
|
||||
uint32_t zend_get_class_fetch_type(zend_string *name);
|
||||
ZEND_API zend_uchar zend_get_call_op(zend_uchar init_op, zend_function *fbc);
|
||||
ZEND_API int zend_is_smart_branch(zend_op *opline);
|
||||
|
||||
typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
|
||||
typedef struct _zend_auto_global {
|
||||
|
||||
+22
-5
@@ -293,10 +293,7 @@ ZEND_METHOD(exception, __construct)
|
||||
#define CHECK_EXC_TYPE(name, type) \
|
||||
pvalue = zend_read_property(i_get_exception_base(object), (object), name, sizeof(name) - 1, 1, &value); \
|
||||
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
|
||||
zval tmp; \
|
||||
ZVAL_STRINGL(&tmp, name, sizeof(name) - 1); \
|
||||
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
|
||||
zval_ptr_dtor(&tmp); \
|
||||
zend_unset_property(i_get_exception_base(object), object, name, sizeof(name)-1); \
|
||||
}
|
||||
|
||||
ZEND_METHOD(exception, __wakeup)
|
||||
@@ -309,7 +306,12 @@ ZEND_METHOD(exception, __wakeup)
|
||||
CHECK_EXC_TYPE("file", IS_STRING);
|
||||
CHECK_EXC_TYPE("line", IS_LONG);
|
||||
CHECK_EXC_TYPE("trace", IS_ARRAY);
|
||||
CHECK_EXC_TYPE("previous", IS_OBJECT);
|
||||
pvalue = zend_read_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1, 1, &value);
|
||||
if (pvalue && Z_TYPE_P(pvalue) != IS_NULL && (Z_TYPE_P(pvalue) != IS_OBJECT ||
|
||||
!instanceof_function(Z_OBJCE_P(pvalue), i_get_exception_base(object)) ||
|
||||
pvalue == object)) {
|
||||
zend_unset_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -771,10 +773,25 @@ ZEND_METHOD(exception, __toString)
|
||||
zend_string_release(file);
|
||||
zval_ptr_dtor(&trace);
|
||||
|
||||
Z_OBJPROP_P(exception)->u.v.nApplyCount++;
|
||||
exception = GET_PROPERTY(exception, "previous");
|
||||
if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_OBJPROP_P(exception)->u.v.nApplyCount > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
zval_dtor(&fname);
|
||||
|
||||
exception = getThis();
|
||||
/* Reset apply counts */
|
||||
while (exception && Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(exception)) && instanceof_function(Z_OBJCE_P(exception), base_ce)) {
|
||||
if (Z_OBJPROP_P(exception)->u.v.nApplyCount) {
|
||||
Z_OBJPROP_P(exception)->u.v.nApplyCount--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
exception = GET_PROPERTY(exception, "previous");
|
||||
}
|
||||
|
||||
exception = getThis();
|
||||
base_ce = i_get_exception_base(exception);
|
||||
|
||||
|
||||
+19
-8
@@ -145,7 +145,8 @@ static const zend_internal_function zend_pass_function = {
|
||||
((ZEND_VM_STACK_PAGE_SLOTS(gen) - ZEND_VM_STACK_HEADER_SLOTS) * sizeof(zval))
|
||||
|
||||
#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(gen, size) \
|
||||
(((size) + (ZEND_VM_STACK_FREE_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
|
||||
(((size) + ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval) \
|
||||
+ (ZEND_VM_STACK_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
|
||||
|
||||
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
|
||||
zend_vm_stack page = (zend_vm_stack)emalloc(size);
|
||||
@@ -584,7 +585,17 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
|
||||
|
||||
ref = Z_REF_P(value_ptr);
|
||||
GC_REFCOUNT(ref)++;
|
||||
zval_ptr_dtor(variable_ptr);
|
||||
if (Z_REFCOUNTED_P(variable_ptr)) {
|
||||
zend_refcounted *garbage = Z_COUNTED_P(variable_ptr);
|
||||
|
||||
if (--GC_REFCOUNT(garbage) == 0) {
|
||||
ZVAL_REF(variable_ptr, ref);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
return;
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
|
||||
}
|
||||
}
|
||||
ZVAL_REF(variable_ptr, ref);
|
||||
}
|
||||
|
||||
@@ -592,7 +603,9 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
|
||||
static inline int make_real_object(zval *object)
|
||||
{
|
||||
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
|
||||
if (EXPECTED(Z_TYPE_P(object) <= IS_FALSE)) {
|
||||
if (UNEXPECTED(object == &EG(error_zval))) {
|
||||
return 0;
|
||||
} else if (EXPECTED(Z_TYPE_P(object) <= IS_FALSE)) {
|
||||
/* nothing to destroy */
|
||||
} else if (EXPECTED((Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
|
||||
zval_ptr_dtor_nogc(object);
|
||||
@@ -822,11 +835,8 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
|
||||
} else {
|
||||
ce = zend_verify_arg_class_kind(cur_arg_info);
|
||||
if (UNEXPECTED(!ce)) {
|
||||
if (Z_TYPE_P(arg) == IS_OBJECT) {
|
||||
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name), arg);
|
||||
} else {
|
||||
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
|
||||
}
|
||||
ZEND_ASSERT(Z_TYPE_P(arg) != IS_OBJECT);
|
||||
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
|
||||
return 0;
|
||||
}
|
||||
*cache_slot = (void*)ce;
|
||||
@@ -1333,6 +1343,7 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu
|
||||
zend_string_release(tmp);
|
||||
} else {
|
||||
Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0];
|
||||
zend_string_forget_hash_val(Z_STR_P(str));
|
||||
}
|
||||
/*
|
||||
* the value of an assignment to a string offset is undefined
|
||||
|
||||
+22
-29
@@ -573,8 +573,6 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
|
||||
ZVAL_EMPTY_STRING(p);
|
||||
}
|
||||
} else if (UNEXPECTED((const_value = zend_get_constant_ex(Z_STR_P(p), scope, Z_CONST_FLAGS_P(p))) == NULL)) {
|
||||
char *actual = Z_STRVAL_P(p);
|
||||
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
@@ -584,46 +582,38 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
|
||||
return FAILURE;
|
||||
} else {
|
||||
zend_string *save = Z_STR_P(p);
|
||||
char *slash;
|
||||
size_t actual_len = Z_STRLEN_P(p);
|
||||
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) {
|
||||
actual = slash + 1;
|
||||
actual_len -= (actual - Z_STRVAL_P(p));
|
||||
if (inline_change) {
|
||||
zend_string *s = zend_string_init(actual, actual_len, 0);
|
||||
Z_STR_P(p) = s;
|
||||
Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE;
|
||||
}
|
||||
}
|
||||
if (actual[0] == '\\') {
|
||||
if (inline_change) {
|
||||
memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p));
|
||||
--Z_STRLEN_P(p);
|
||||
} else {
|
||||
++actual;
|
||||
}
|
||||
--actual_len;
|
||||
}
|
||||
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
|
||||
if (ZSTR_VAL(save)[0] == '\\') {
|
||||
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save) + 1);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save));
|
||||
}
|
||||
if (inline_change) {
|
||||
zend_string_release(save);
|
||||
}
|
||||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
|
||||
char *actual = Z_STRVAL_P(p);
|
||||
size_t actual_len = Z_STRLEN_P(p);
|
||||
char *slash = (char *) zend_memrchr(actual, '\\', actual_len);
|
||||
if (slash) {
|
||||
actual = slash + 1;
|
||||
actual_len -= (actual - Z_STRVAL_P(p));
|
||||
}
|
||||
|
||||
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
|
||||
if (EG(exception)) {
|
||||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (!inline_change) {
|
||||
ZVAL_STRINGL(p, actual, actual_len);
|
||||
} else {
|
||||
Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
|
||||
IS_STRING_EX : IS_INTERNED_STRING_EX;
|
||||
if (save && ZSTR_VAL(save) != actual) {
|
||||
if (slash) {
|
||||
ZVAL_STRINGL(p, actual, actual_len);
|
||||
zend_string_release(save);
|
||||
} else {
|
||||
Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
|
||||
IS_STRING_EX : IS_INTERNED_STRING_EX;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -862,8 +852,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
EG(scope) = func->common.scope;
|
||||
call->symbol_table = fci->symbol_table;
|
||||
if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) {
|
||||
const zend_op *current_opline_before_exception = EG(opline_before_exception);
|
||||
|
||||
zend_init_execute_data(call, &func->op_array, fci->retval);
|
||||
zend_execute_ex(call);
|
||||
EG(opline_before_exception) = current_opline_before_exception;
|
||||
} else {
|
||||
zend_generator_create_zval(call, &func->op_array, fci->retval);
|
||||
}
|
||||
|
||||
+2
-13
@@ -297,6 +297,8 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
|
||||
|
||||
static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
|
||||
{
|
||||
zend_execute_data *original_execute_data = EG(current_execute_data);
|
||||
|
||||
/* if we don't stop an array/iterator yield from, the exception will only reach the generator after the values were all iterated over */
|
||||
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
|
||||
zval_ptr_dtor(&generator->values);
|
||||
@@ -305,7 +307,6 @@ static void zend_generator_throw_exception(zend_generator *generator, zval *exce
|
||||
|
||||
/* Throw the exception in the context of the generator. Decrementing the opline
|
||||
* to pretend the exception happened during the YIELD opcode. */
|
||||
zend_execute_data *original_execute_data = EG(current_execute_data);
|
||||
EG(current_execute_data) = generator->execute_data;
|
||||
generator->execute_data->opline--;
|
||||
if (exception) {
|
||||
@@ -871,15 +872,9 @@ ZEND_METHOD(Generator, send)
|
||||
zval *value;
|
||||
zend_generator *generator, *root;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(value)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
generator = (zend_generator *) Z_OBJ_P(getThis());
|
||||
|
||||
@@ -915,15 +910,9 @@ ZEND_METHOD(Generator, throw)
|
||||
zval *exception, exception_copy;
|
||||
zend_generator *generator;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(exception)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
ZVAL_DUP(&exception_copy, exception);
|
||||
|
||||
|
||||
+6
-3
@@ -1447,13 +1447,17 @@ ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht)
|
||||
} else if (ht->nNumUsed == ht->nNumOfElements) {
|
||||
do {
|
||||
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
|
||||
zend_string_release(p->key);
|
||||
if (EXPECTED(p->key)) {
|
||||
zend_string_release(p->key);
|
||||
}
|
||||
} while (++p != end);
|
||||
} else {
|
||||
do {
|
||||
if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
|
||||
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
|
||||
zend_string_release(p->key);
|
||||
if (EXPECTED(p->key)) {
|
||||
zend_string_release(p->key);
|
||||
}
|
||||
}
|
||||
} while (++p != end);
|
||||
}
|
||||
@@ -2465,7 +2469,6 @@ ZEND_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t l
|
||||
register const char *tmp = key;
|
||||
|
||||
const char *end = key + length;
|
||||
ZEND_ASSERT(*end == '\0');
|
||||
|
||||
if (*tmp == '-') {
|
||||
tmp++;
|
||||
|
||||
@@ -1180,6 +1180,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
|
||||
function_add_ref(fn);
|
||||
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
|
||||
memcpy(new_fn, fn, sizeof(zend_op_array));
|
||||
new_fn->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED;
|
||||
fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
|
||||
zend_add_magic_methods(ce, key, fn);
|
||||
}
|
||||
|
||||
+5310
-5142
File diff suppressed because it is too large.
Load diff
@@ -589,6 +589,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
|
||||
CG(ast) = NULL;
|
||||
CG(ast_arena) = zend_arena_create(1024 * 32);
|
||||
if (!zendparse()) {
|
||||
int last_lineno = CG(zend_lineno);
|
||||
zval retval_zv;
|
||||
zend_file_context original_file_context;
|
||||
zend_oparray_context original_oparray_context;
|
||||
@@ -605,9 +606,10 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
|
||||
zend_file_context_begin(&original_file_context);
|
||||
zend_oparray_context_begin(&original_oparray_context);
|
||||
zend_compile_top_stmt(CG(ast));
|
||||
CG(zend_lineno) = last_lineno;
|
||||
zend_emit_final_return(&retval_zv);
|
||||
op_array->line_start = 1;
|
||||
op_array->line_end = CG(zend_lineno);
|
||||
op_array->line_end = last_lineno;
|
||||
pass_two(op_array);
|
||||
zend_oparray_context_end(&original_oparray_context);
|
||||
zend_file_context_end(&original_file_context);
|
||||
@@ -756,6 +758,7 @@ zend_op_array *compile_string(zval *source_string, char *filename)
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
|
||||
if (!zendparse()) {
|
||||
int last_lineno = CG(zend_lineno);
|
||||
zend_file_context original_file_context;
|
||||
zend_oparray_context original_oparray_context;
|
||||
zend_op_array *original_active_op_array = CG(active_op_array);
|
||||
@@ -770,9 +773,10 @@ zend_op_array *compile_string(zval *source_string, char *filename)
|
||||
zend_file_context_begin(&original_file_context);
|
||||
zend_oparray_context_begin(&original_oparray_context);
|
||||
zend_compile_top_stmt(CG(ast));
|
||||
CG(zend_lineno) = last_lineno;
|
||||
zend_emit_final_return(NULL);
|
||||
op_array->line_start = 1;
|
||||
op_array->line_end = CG(zend_lineno);
|
||||
op_array->line_end = last_lineno;
|
||||
pass_two(op_array);
|
||||
zend_oparray_context_end(&original_oparray_context);
|
||||
zend_file_context_end(&original_file_context);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 */
|
||||
/* Generated by re2c 0.16 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -266,6 +266,18 @@ static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, si
|
||||
}
|
||||
#endif
|
||||
|
||||
static zend_always_inline size_t zend_safe_address_guarded(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
int overflow;
|
||||
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* ZEND_MULTIPLY_H */
|
||||
|
||||
/*
|
||||
|
||||
@@ -197,11 +197,7 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{
|
||||
|
||||
it should return whether the call was successful or not
|
||||
*/
|
||||
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
|
||||
|
||||
zend_call_method_with_1_params(object, ce, &ce->__get, ZEND_GET_FUNC_NAME, retval, member);
|
||||
|
||||
zval_ptr_dtor(member);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -211,9 +207,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
|
||||
int result;
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
|
||||
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
|
||||
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
|
||||
/* __set handler is called with two arguments:
|
||||
property name
|
||||
value to be set
|
||||
@@ -222,9 +215,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
|
||||
*/
|
||||
zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value);
|
||||
|
||||
zval_ptr_dtor(member);
|
||||
zval_ptr_dtor(value);
|
||||
|
||||
if (Z_TYPE(retval) != IS_UNDEF) {
|
||||
result = i_zend_is_true(&retval) ? SUCCESS : FAILURE;
|
||||
zval_ptr_dtor(&retval);
|
||||
|
||||
@@ -510,7 +510,10 @@ static zend_always_inline void fast_long_decrement_function(zval *op1)
|
||||
|
||||
static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
|
||||
#if defined(__GNUC__) && defined(__i386__) \
|
||||
&& !(4 == __GNUC__ && 8 == __GNUC_MINOR__) \
|
||||
&& !(4 == __GNUC__ && 9 == __GNUC_MINOR__ && (defined(__PIC__) || defined(__PIE__)))
|
||||
/* Position-independent builds fail with gcc-4.9.x */
|
||||
__asm__(
|
||||
"movl (%1), %%eax\n\t"
|
||||
"addl (%2), %%eax\n\t"
|
||||
@@ -596,7 +599,10 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
|
||||
|
||||
static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(4 == __GNUC__ && 8 == __GNUC_MINOR__) && \
|
||||
!(4 == __GNUC__ && 9 == __GNUC_MINOR__ && (defined(__PIC__) || defined(__PIE__)))
|
||||
/* Position-independent builds fail with gcc-4.9.x */
|
||||
__asm__(
|
||||
"movl (%1), %%eax\n\t"
|
||||
"subl (%2), %%eax\n\t"
|
||||
|
||||
@@ -64,8 +64,12 @@ typedef unsigned long int uint32_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
#define USE_LOCALE 1
|
||||
#ifdef USE_LOCALE
|
||||
#undef USE_LOCALE
|
||||
#endif
|
||||
|
||||
#ifndef NO_INFNAN_CHECK
|
||||
#define NO_INFNAN_CHECK
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
|
||||
+10
-11
@@ -30,17 +30,20 @@
|
||||
|
||||
ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
|
||||
{
|
||||
if (--GC_REFCOUNT(p)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (GC_TYPE(p)) {
|
||||
case IS_STRING:
|
||||
case IS_CONSTANT: {
|
||||
zend_string *str = (zend_string*)p;
|
||||
CHECK_ZVAL_STRING_REL(str);
|
||||
zend_string_release(str);
|
||||
zend_string_free(str);
|
||||
break;
|
||||
}
|
||||
case IS_ARRAY: {
|
||||
zend_array *arr = (zend_array*)p;
|
||||
ZEND_ASSERT(GC_REFCOUNT(arr) <= 1);
|
||||
zend_array_destroy(arr);
|
||||
break;
|
||||
}
|
||||
@@ -54,25 +57,21 @@ ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC
|
||||
case IS_OBJECT: {
|
||||
zend_object *obj = (zend_object*)p;
|
||||
|
||||
OBJ_RELEASE(obj);
|
||||
zend_objects_store_del(obj);
|
||||
break;
|
||||
}
|
||||
case IS_RESOURCE: {
|
||||
zend_resource *res = (zend_resource*)p;
|
||||
|
||||
if (--GC_REFCOUNT(res) == 0) {
|
||||
/* destroy resource */
|
||||
zend_list_free(res);
|
||||
}
|
||||
/* destroy resource */
|
||||
zend_list_free(res);
|
||||
break;
|
||||
}
|
||||
case IS_REFERENCE: {
|
||||
zend_reference *ref = (zend_reference*)p;
|
||||
if (--GC_REFCOUNT(ref) == 0) {
|
||||
|
||||
i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
|
||||
efree_size(ref, sizeof(zend_reference));
|
||||
}
|
||||
i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
|
||||
efree_size(ref, sizeof(zend_reference));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -1854,7 +1854,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
|
||||
#else /* Unix */
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
|
||||
{
|
||||
int command_length;
|
||||
size_t command_length;
|
||||
int dir_length, extra = 0;
|
||||
char *command_line;
|
||||
char *ptr, *dir;
|
||||
|
||||
+53
-22
@@ -3012,15 +3012,19 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
|
||||
if ((OP1_TYPE & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSED|CV)
|
||||
@@ -3161,7 +3165,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST)
|
||||
@@ -3283,7 +3287,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
}
|
||||
FREE_OP2();
|
||||
} else if (OP2_TYPE != IS_CONST &&
|
||||
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
@@ -3297,7 +3300,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
FREE_OP2();
|
||||
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
|
||||
zval *obj;
|
||||
@@ -3381,7 +3383,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
}
|
||||
FREE_OP2();
|
||||
} else if ((OP2_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
|
||||
function_name = Z_REFVAL_P(function_name);
|
||||
ZEND_VM_C_GOTO(try_function_name);
|
||||
@@ -3396,6 +3397,18 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if ((OP2_TYPE & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
zend_string_release(fbc->common.function_name);
|
||||
zend_free_trampoline(fbc);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, object);
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -3421,6 +3434,19 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
|
||||
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
|
||||
func = fcc.function_handler;
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
}
|
||||
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
if (OP2_TYPE & (IS_VAR|IS_CV)) {
|
||||
@@ -3430,25 +3456,28 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
|
||||
GC_REFCOUNT((zend_object*)func->common.prototype)++;
|
||||
call_info |= ZEND_CALL_CLOSURE;
|
||||
}
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (object) {
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
|
||||
FREE_OP2();
|
||||
if ((OP2_TYPE & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_CLOSURE) {
|
||||
zend_object_release((zend_object*)func->common.prototype);
|
||||
}
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
|
||||
efree(error);
|
||||
FREE_OP2();
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
func = (zend_function*)&zend_pass_function;
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
@@ -3459,8 +3488,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
FREE_OP2();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
|
||||
@@ -4946,7 +4974,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
|
||||
}
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5232,7 +5260,10 @@ ZEND_VM_C_LABEL(num_index):
|
||||
}
|
||||
FREE_OP2();
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
+266
-100
@@ -1995,7 +1995,6 @@ try_function_name:
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
}
|
||||
|
||||
} else if (IS_CONST != IS_CONST &&
|
||||
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
@@ -2009,7 +2008,6 @@ try_function_name:
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
|
||||
zval *obj;
|
||||
@@ -2093,7 +2091,6 @@ try_function_name:
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
}
|
||||
|
||||
} else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
|
||||
function_name = Z_REFVAL_P(function_name);
|
||||
goto try_function_name;
|
||||
@@ -2108,6 +2105,17 @@ try_function_name:
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
zend_string_release(fbc->common.function_name);
|
||||
zend_free_trampoline(fbc);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, object);
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2418,7 +2426,6 @@ try_function_name:
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
}
|
||||
|
||||
} else if (IS_CV != IS_CONST &&
|
||||
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
@@ -2432,7 +2439,6 @@ try_function_name:
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
|
||||
zval *obj;
|
||||
@@ -2516,7 +2522,6 @@ try_function_name:
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
}
|
||||
|
||||
} else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
|
||||
function_name = Z_REFVAL_P(function_name);
|
||||
goto try_function_name;
|
||||
@@ -2531,6 +2536,17 @@ try_function_name:
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
zend_string_release(fbc->common.function_name);
|
||||
zend_free_trampoline(fbc);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, object);
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2674,7 +2690,6 @@ try_function_name:
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
} else if ((IS_TMP_VAR|IS_VAR) != IS_CONST &&
|
||||
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
@@ -2688,7 +2703,6 @@ try_function_name:
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
|
||||
zval *obj;
|
||||
@@ -2772,7 +2786,6 @@ try_function_name:
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
} else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
|
||||
function_name = Z_REFVAL_P(function_name);
|
||||
goto try_function_name;
|
||||
@@ -2787,6 +2800,18 @@ try_function_name:
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
zend_string_release(fbc->common.function_name);
|
||||
zend_free_trampoline(fbc);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, object);
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -3367,7 +3392,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OP
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
|
||||
}
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5594,13 +5619,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
|
||||
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -5741,7 +5770,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -5761,6 +5790,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
|
||||
function_name = EX_CONSTANT(opline->op2);
|
||||
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
|
||||
func = fcc.function_handler;
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
}
|
||||
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
if (IS_CONST & (IS_VAR|IS_CV)) {
|
||||
@@ -5770,25 +5812,27 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
|
||||
GC_REFCOUNT((zend_object*)func->common.prototype)++;
|
||||
call_info |= ZEND_CALL_CLOSURE;
|
||||
}
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (object) {
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
|
||||
if ((IS_CONST & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_CLOSURE) {
|
||||
zend_object_release((zend_object*)func->common.prototype);
|
||||
}
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
|
||||
efree(error);
|
||||
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
func = (zend_function*)&zend_pass_function;
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
@@ -5799,7 +5843,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -6077,7 +6121,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -7737,7 +7784,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -7891,7 +7938,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -9340,13 +9390,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
|
||||
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -9487,7 +9541,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -9507,6 +9561,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
|
||||
function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
|
||||
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
|
||||
func = fcc.function_handler;
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
}
|
||||
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
if (IS_CV & (IS_VAR|IS_CV)) {
|
||||
@@ -9516,25 +9583,27 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
|
||||
GC_REFCOUNT((zend_object*)func->common.prototype)++;
|
||||
call_info |= ZEND_CALL_CLOSURE;
|
||||
}
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (object) {
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
|
||||
if ((IS_CV & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_CLOSURE) {
|
||||
zend_object_release((zend_object*)func->common.prototype);
|
||||
}
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
|
||||
efree(error);
|
||||
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
func = (zend_function*)&zend_pass_function;
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
@@ -9545,7 +9614,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -9771,7 +9840,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -11167,14 +11239,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
|
||||
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -11315,7 +11391,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -11335,6 +11411,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
|
||||
function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
|
||||
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
|
||||
func = fcc.function_handler;
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
}
|
||||
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) {
|
||||
@@ -11344,25 +11433,28 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
|
||||
GC_REFCOUNT((zend_object*)func->common.prototype)++;
|
||||
call_info |= ZEND_CALL_CLOSURE;
|
||||
}
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (object) {
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if (((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_CLOSURE) {
|
||||
zend_object_release((zend_object*)func->common.prototype);
|
||||
}
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
|
||||
efree(error);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
func = (zend_function*)&zend_pass_function;
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
@@ -11373,8 +11465,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -11545,7 +11636,10 @@ num_index:
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -13014,7 +13108,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -13738,7 +13835,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -14287,7 +14387,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -14801,7 +14904,10 @@ num_index:
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -15458,7 +15564,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCO
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
|
||||
}
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17702,7 +17808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -17906,7 +18012,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -19338,7 +19447,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -19492,7 +19601,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -20980,7 +21092,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -21077,7 +21189,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -22569,7 +22684,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -22666,7 +22781,10 @@ num_index:
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -23949,13 +24067,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
|
||||
if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -26376,13 +26498,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
|
||||
if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -27880,14 +28006,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
|
||||
if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -32164,13 +32294,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
|
||||
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -32341,7 +32475,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -34874,7 +35011,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -37262,13 +37402,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
|
||||
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -37439,7 +37583,10 @@ num_index:
|
||||
}
|
||||
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -39854,14 +40001,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
|
||||
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -40032,7 +40183,10 @@ num_index:
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -42093,14 +42247,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -44241,14 +44399,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -45387,15 +45549,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=11
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=13
|
||||
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`
|
||||
|
||||
|
||||
@@ -49,7 +49,10 @@ _bc_new_num_ex (length, scale, persistent)
|
||||
int length, scale, persistent;
|
||||
{
|
||||
bc_num temp;
|
||||
|
||||
/* PHP Change: add length check */
|
||||
if ((size_t)length+(size_t)scale > INT_MAX) {
|
||||
zend_error(E_ERROR, "Result too long, max is %d", INT_MAX);
|
||||
}
|
||||
/* PHP Change: malloc() -> pemalloc(), removed free_list code */
|
||||
temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, persistent);
|
||||
#if 0
|
||||
|
||||
@@ -41,6 +41,5 @@
|
||||
|
||||
void bc_out_of_memory (void)
|
||||
{
|
||||
(void) fprintf (stderr, "bcmath: out of memory!\n");
|
||||
exit (1);
|
||||
zend_error(E_ERROR, "bcmath: out of memory!");
|
||||
}
|
||||
+26
-9
@@ -561,7 +561,8 @@ static PHP_FUNCTION(bzcompress)
|
||||
Decompresses BZip2 compressed data */
|
||||
static PHP_FUNCTION(bzdecompress)
|
||||
{
|
||||
char *source, *dest;
|
||||
char *source;
|
||||
zend_string *dest;
|
||||
size_t source_len;
|
||||
int error;
|
||||
zend_long small = 0;
|
||||
@@ -588,24 +589,40 @@ static PHP_FUNCTION(bzdecompress)
|
||||
|
||||
/* in most cases bz2 offers at least 2:1 compression, so we use that as our base */
|
||||
bzs.avail_out = source_len * 2;
|
||||
bzs.next_out = dest = emalloc(bzs.avail_out + 1);
|
||||
dest = zend_string_alloc(bzs.avail_out + 1, 0);
|
||||
bzs.next_out = ZSTR_VAL(dest);
|
||||
|
||||
while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) {
|
||||
/* compression is better then 2:1, need to allocate more memory */
|
||||
bzs.avail_out = source_len;
|
||||
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
|
||||
dest = safe_erealloc(dest, 1, bzs.avail_out+1, (size_t) size );
|
||||
bzs.next_out = dest + size;
|
||||
#if !ZEND_ENABLE_ZVAL_LONG64
|
||||
if (size > SIZE_MAX) {
|
||||
/* no reason to continue if we're going to drop it anyway */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
dest = zend_string_safe_realloc(dest, 1, bzs.avail_out+1, (size_t) size, 0);
|
||||
bzs.next_out = ZSTR_VAL(dest) + size;
|
||||
}
|
||||
|
||||
if (error == BZ_STREAM_END || error == BZ_OK) {
|
||||
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
|
||||
dest = safe_erealloc(dest, 1, (size_t) size, 1);
|
||||
dest[size] = '\0';
|
||||
RETVAL_STRINGL(dest, (int) size);
|
||||
efree(dest);
|
||||
#if !ZEND_ENABLE_ZVAL_LONG64
|
||||
if (UNEXPECTED(size > SIZE_MAX)) {
|
||||
php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zd", SIZE_MAX);
|
||||
zend_string_free(dest);
|
||||
RETVAL_LONG(BZ_MEM_ERROR);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
dest = zend_string_safe_realloc(dest, 1, (size_t)size, 1, 0);
|
||||
ZSTR_LEN(dest) = (size_t)size;
|
||||
ZSTR_VAL(dest)[(size_t)size] = '\0';
|
||||
RETVAL_STR(dest);
|
||||
}
|
||||
} else { /* real error */
|
||||
efree(dest);
|
||||
zend_string_free(dest);
|
||||
RETVAL_LONG(error);
|
||||
}
|
||||
|
||||
|
||||
@@ -553,7 +553,10 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
|
||||
for (i = 0, j = 0; i < nargs; i++) {
|
||||
/* if this was byref, update the zval */
|
||||
if (f->arg_info[nargs - i - 1].pass_by_reference) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]);
|
||||
zval *arg = &args[nargs - i - 1];
|
||||
|
||||
ZVAL_DEREF(arg);
|
||||
SEPARATE_ZVAL_NOREF(arg);
|
||||
|
||||
/* if the variant is pointing at the byref_vals, we need to map
|
||||
* the pointee value as a zval; otherwise, the value is pointing
|
||||
@@ -561,14 +564,12 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
|
||||
if (V_VT(&vargs[i]) & VT_BYREF) {
|
||||
if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
|
||||
/* copy that value */
|
||||
php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
|
||||
obj->code_page);
|
||||
php_com_zval_from_variant(arg, &byref_vals[j], obj->code_page);
|
||||
}
|
||||
} else {
|
||||
/* not sure if this can ever happen; the variant we marked as BYREF
|
||||
* is no longer BYREF - copy its value */
|
||||
php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
|
||||
obj->code_page);
|
||||
php_com_zval_from_variant(arg, &vargs[i], obj->code_page);
|
||||
}
|
||||
VariantClear(&byref_vals[j]);
|
||||
j++;
|
||||
|
||||
@@ -279,7 +279,6 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
|
||||
f.fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
|
||||
f.function_name = zend_string_copy(name);
|
||||
f.handler = PHP_FN(com_method_handler);
|
||||
zend_set_function_arg_flags((zend_function*)&f);
|
||||
|
||||
fptr = &f;
|
||||
|
||||
@@ -305,7 +304,7 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
|
||||
for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) {
|
||||
f.arg_info[i].allow_null = 1;
|
||||
if (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) {
|
||||
f.arg_info[i].pass_by_reference = 1;
|
||||
f.arg_info[i].pass_by_reference = ZEND_SEND_BY_REF;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,15 +334,14 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
|
||||
}
|
||||
}
|
||||
|
||||
if (fptr) {
|
||||
/* save this method in the cache */
|
||||
if (!obj->method_cache) {
|
||||
ALLOC_HASHTABLE(obj->method_cache);
|
||||
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
|
||||
}
|
||||
|
||||
zend_hash_update_mem(obj->method_cache, name, &f, sizeof(f));
|
||||
zend_set_function_arg_flags((zend_function*)&f);
|
||||
/* save this method in the cache */
|
||||
if (!obj->method_cache) {
|
||||
ALLOC_HASHTABLE(obj->method_cache);
|
||||
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
|
||||
}
|
||||
|
||||
zend_hash_update_mem(obj->method_cache, name, &f, sizeof(f));
|
||||
}
|
||||
|
||||
if (fptr) {
|
||||
|
||||
@@ -137,6 +137,7 @@ ZEND_METHOD(CURLFile, setPostFilename)
|
||||
Unserialization handler */
|
||||
ZEND_METHOD(CURLFile, __wakeup)
|
||||
{
|
||||
zend_unset_property(curl_CURLFile_class, getThis(), "name", sizeof("name")-1);
|
||||
zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "");
|
||||
zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0);
|
||||
}
|
||||
|
||||
+12
-4
@@ -801,6 +801,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
|
||||
#if LIBCURL_VERSION_NUM >= 0x072700 /* Available since 7.39.0 */
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_PINNEDPUBKEYNOTMATCH);
|
||||
#endif
|
||||
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
|
||||
REGISTER_CURL_CONSTANT(CURLE_TOO_MANY_REDIRECTS);
|
||||
REGISTER_CURL_CONSTANT(CURLE_UNKNOWN_TELNET_OPTION);
|
||||
@@ -1893,8 +1896,9 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
|
||||
int len;
|
||||
char s[64];
|
||||
char *tmp;
|
||||
strncpy(s, slist->data, 64);
|
||||
tmp = memchr(s, ':', 64);
|
||||
strncpy(s, slist->data, sizeof(s));
|
||||
s[sizeof(s)-1] = '\0';
|
||||
tmp = memchr(s, ':', sizeof(s));
|
||||
if(tmp) {
|
||||
*tmp = '\0';
|
||||
len = strlen(s);
|
||||
@@ -3517,7 +3521,7 @@ PHP_FUNCTION(curl_reset)
|
||||
PHP_FUNCTION(curl_escape)
|
||||
{
|
||||
char *str = NULL, *res = NULL;
|
||||
size_t str_len = 0;
|
||||
size_t str_len = 0;
|
||||
zval *zid;
|
||||
php_curl *ch;
|
||||
|
||||
@@ -3529,6 +3533,10 @@ PHP_FUNCTION(curl_escape)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ZEND_SIZE_T_INT_OVFL(str_len)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((res = curl_easy_escape(ch->cp, str, str_len))) {
|
||||
RETVAL_STRING(res);
|
||||
curl_free(res);
|
||||
@@ -3556,7 +3564,7 @@ PHP_FUNCTION(curl_unescape)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (str_len > INT_MAX) {
|
||||
if (ZEND_SIZE_T_INT_OVFL(str_len)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73147: Use After Free in PHP7 unserialize()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) {
|
||||
exit("skip curl extension not loaded");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$poc = 'a:1:{i:0;O:8:"CURLFile":1:{s:4:"name";R:1;}}';
|
||||
try {
|
||||
var_dump(unserialize($poc));
|
||||
} catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Unserialization of CURLFile instances is not allowed
|
||||
+104
-100
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.15.3 on Sun Jul 24 14:52:04 2016 */
|
||||
/* Generated by re2c 0.15.3 on Fri Sep 30 20:30:54 2016 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
@@ -396,8 +396,12 @@ static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
|
||||
}
|
||||
++*ptr;
|
||||
if (**ptr == '.') {
|
||||
*ptr += 3;
|
||||
} else {
|
||||
++*ptr;
|
||||
}
|
||||
if (**ptr == 'M' || **ptr == 'm') {
|
||||
++*ptr;
|
||||
}
|
||||
if (**ptr == '.') {
|
||||
++*ptr;
|
||||
}
|
||||
return retval;
|
||||
@@ -820,11 +824,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 946 "ext/date/lib/parse_date.re"
|
||||
#line 950 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 828 "<stdout>"
|
||||
#line 832 "<stdout>"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -959,7 +963,7 @@ yy2:
|
||||
}
|
||||
}
|
||||
yy3:
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
#line 1630 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -972,7 +976,7 @@ yy3:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 976 "<stdout>"
|
||||
#line 980 "<stdout>"
|
||||
yy4:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'E') {
|
||||
@@ -1272,12 +1276,12 @@ yy11:
|
||||
if (yych <= '/') goto yy12;
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy12:
|
||||
#line 1721 "ext/date/lib/parse_date.re"
|
||||
#line 1725 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1281 "<stdout>"
|
||||
#line 1285 "<stdout>"
|
||||
yy13:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'R') {
|
||||
@@ -2291,22 +2295,22 @@ yy48:
|
||||
if (yych <= '/') goto yy49;
|
||||
if (yych <= '9') goto yy54;
|
||||
yy49:
|
||||
#line 1710 "ext/date/lib/parse_date.re"
|
||||
#line 1714 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2299 "<stdout>"
|
||||
#line 2303 "<stdout>"
|
||||
yy50:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy49;
|
||||
yy51:
|
||||
++YYCURSOR;
|
||||
#line 1715 "ext/date/lib/parse_date.re"
|
||||
#line 1719 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2310 "<stdout>"
|
||||
#line 2314 "<stdout>"
|
||||
yy53:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy12;
|
||||
@@ -2673,7 +2677,7 @@ yy71:
|
||||
if (yych == 'S') goto yy73;
|
||||
if (yych == 's') goto yy73;
|
||||
yy72:
|
||||
#line 1694 "ext/date/lib/parse_date.re"
|
||||
#line 1698 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -2688,7 +2692,7 @@ yy72:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2692 "<stdout>"
|
||||
#line 2696 "<stdout>"
|
||||
yy73:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'D') goto yy74;
|
||||
@@ -3356,7 +3360,7 @@ yy165:
|
||||
}
|
||||
}
|
||||
yy166:
|
||||
#line 1557 "ext/date/lib/parse_date.re"
|
||||
#line 1561 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -3373,7 +3377,7 @@ yy166:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3377 "<stdout>"
|
||||
#line 3381 "<stdout>"
|
||||
yy167:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'K') {
|
||||
@@ -3866,7 +3870,7 @@ yy192:
|
||||
}
|
||||
}
|
||||
yy193:
|
||||
#line 1616 "ext/date/lib/parse_date.re"
|
||||
#line 1620 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -3875,7 +3879,7 @@ yy193:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 3879 "<stdout>"
|
||||
#line 3883 "<stdout>"
|
||||
yy194:
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 21) YYFILL(21);
|
||||
@@ -3921,7 +3925,7 @@ yy197:
|
||||
}
|
||||
}
|
||||
yy198:
|
||||
#line 1362 "ext/date/lib/parse_date.re"
|
||||
#line 1366 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
@@ -3934,7 +3938,7 @@ yy198:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 3938 "<stdout>"
|
||||
#line 3942 "<stdout>"
|
||||
yy199:
|
||||
yyaccept = 6;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -4179,7 +4183,7 @@ yy221:
|
||||
if (yych <= ':') goto yy224;
|
||||
}
|
||||
yy222:
|
||||
#line 1664 "ext/date/lib/parse_date.re"
|
||||
#line 1668 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -4208,7 +4212,7 @@ yy222:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4212 "<stdout>"
|
||||
#line 4216 "<stdout>"
|
||||
yy223:
|
||||
yyaccept = 7;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -4850,7 +4854,7 @@ yy276:
|
||||
}
|
||||
yy277:
|
||||
++YYCURSOR;
|
||||
#line 1640 "ext/date/lib/parse_date.re"
|
||||
#line 1644 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -4873,7 +4877,7 @@ yy277:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4877 "<stdout>"
|
||||
#line 4881 "<stdout>"
|
||||
yy279:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 0x1F) {
|
||||
@@ -5035,7 +5039,7 @@ yy292:
|
||||
yy293:
|
||||
++YYCURSOR;
|
||||
yy294:
|
||||
#line 1334 "ext/date/lib/parse_date.re"
|
||||
#line 1338 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
@@ -5048,7 +5052,7 @@ yy294:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5052 "<stdout>"
|
||||
#line 5056 "<stdout>"
|
||||
yy295:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') {
|
||||
@@ -6199,7 +6203,7 @@ yy361:
|
||||
if ((yych = *YYCURSOR) <= '/') goto yy363;
|
||||
if (yych <= '9') goto yy364;
|
||||
yy363:
|
||||
#line 1478 "ext/date/lib/parse_date.re"
|
||||
#line 1482 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
@@ -6212,7 +6216,7 @@ yy363:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6216 "<stdout>"
|
||||
#line 6220 "<stdout>"
|
||||
yy364:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy363;
|
||||
@@ -6821,7 +6825,7 @@ yy391:
|
||||
if (yych <= 'z') goto yy142;
|
||||
}
|
||||
yy392:
|
||||
#line 1536 "ext/date/lib/parse_date.re"
|
||||
#line 1540 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -6841,7 +6845,7 @@ yy392:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 6845 "<stdout>"
|
||||
#line 6849 "<stdout>"
|
||||
yy393:
|
||||
yyaccept = 5;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -8529,7 +8533,7 @@ yy452:
|
||||
yy453:
|
||||
++YYCURSOR;
|
||||
yy454:
|
||||
#line 1239 "ext/date/lib/parse_date.re"
|
||||
#line 1243 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -8540,7 +8544,7 @@ yy454:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 8544 "<stdout>"
|
||||
#line 8548 "<stdout>"
|
||||
yy455:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -9076,7 +9080,7 @@ yy474:
|
||||
}
|
||||
}
|
||||
yy475:
|
||||
#line 1376 "ext/date/lib/parse_date.re"
|
||||
#line 1380 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9087,7 +9091,7 @@ yy475:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9091 "<stdout>"
|
||||
#line 9095 "<stdout>"
|
||||
yy476:
|
||||
yyaccept = 10;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -9215,7 +9219,7 @@ yy485:
|
||||
}
|
||||
yy487:
|
||||
++YYCURSOR;
|
||||
#line 1094 "ext/date/lib/parse_date.re"
|
||||
#line 1098 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9231,7 +9235,7 @@ yy487:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9235 "<stdout>"
|
||||
#line 9239 "<stdout>"
|
||||
yy489:
|
||||
yyaccept = 11;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -9242,7 +9246,7 @@ yy489:
|
||||
if (yych <= ':') goto yy492;
|
||||
}
|
||||
yy490:
|
||||
#line 1131 "ext/date/lib/parse_date.re"
|
||||
#line 1135 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -9267,7 +9271,7 @@ yy490:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9271 "<stdout>"
|
||||
#line 9275 "<stdout>"
|
||||
yy491:
|
||||
yyaccept = 11;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -9544,7 +9548,7 @@ yy520:
|
||||
}
|
||||
yy522:
|
||||
++YYCURSOR;
|
||||
#line 1111 "ext/date/lib/parse_date.re"
|
||||
#line 1115 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -9563,7 +9567,7 @@ yy522:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9567 "<stdout>"
|
||||
#line 9571 "<stdout>"
|
||||
yy524:
|
||||
yyaccept = 11;
|
||||
YYMARKER = ++YYCURSOR;
|
||||
@@ -9658,7 +9662,7 @@ yy533:
|
||||
if ((yych = *YYCURSOR) <= '/') goto yy534;
|
||||
if (yych <= '9') goto yy540;
|
||||
yy534:
|
||||
#line 1293 "ext/date/lib/parse_date.re"
|
||||
#line 1297 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
@@ -9672,7 +9676,7 @@ yy534:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 9676 "<stdout>"
|
||||
#line 9680 "<stdout>"
|
||||
yy535:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'M') goto yy536;
|
||||
@@ -10336,7 +10340,7 @@ yy604:
|
||||
if (yych <= '/') goto yy56;
|
||||
if (yych >= ':') goto yy56;
|
||||
++YYCURSOR;
|
||||
#line 1308 "ext/date/lib/parse_date.re"
|
||||
#line 1312 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -10347,7 +10351,7 @@ yy604:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 10351 "<stdout>"
|
||||
#line 10355 "<stdout>"
|
||||
yy607:
|
||||
yyaccept = 11;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -10378,7 +10382,7 @@ yy610:
|
||||
if (yych <= '/') goto yy611;
|
||||
if (yych <= '9') goto yy604;
|
||||
yy611:
|
||||
#line 1320 "ext/date/lib/parse_date.re"
|
||||
#line 1324 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
@@ -10391,7 +10395,7 @@ yy611:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 10395 "<stdout>"
|
||||
#line 10399 "<stdout>"
|
||||
yy612:
|
||||
yyaccept = 11;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -10987,7 +10991,7 @@ yy655:
|
||||
}
|
||||
}
|
||||
yy656:
|
||||
#line 1279 "ext/date/lib/parse_date.re"
|
||||
#line 1283 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
@@ -11000,7 +11004,7 @@ yy656:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11004 "<stdout>"
|
||||
#line 11008 "<stdout>"
|
||||
yy657:
|
||||
yyaccept = 13;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -11096,7 +11100,7 @@ yy665:
|
||||
}
|
||||
}
|
||||
yy666:
|
||||
#line 1223 "ext/date/lib/parse_date.re"
|
||||
#line 1227 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
@@ -11111,7 +11115,7 @@ yy666:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11115 "<stdout>"
|
||||
#line 11119 "<stdout>"
|
||||
yy667:
|
||||
yyaccept = 14;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -11310,7 +11314,7 @@ yy699:
|
||||
if (yych <= '9') goto yy702;
|
||||
if (yych <= ':') goto yy703;
|
||||
yy700:
|
||||
#line 1506 "ext/date/lib/parse_date.re"
|
||||
#line 1510 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -11330,7 +11334,7 @@ yy700:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 11334 "<stdout>"
|
||||
#line 11338 "<stdout>"
|
||||
yy701:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '5') {
|
||||
@@ -11817,7 +11821,7 @@ yy762:
|
||||
if (yych <= 't') goto yy662;
|
||||
}
|
||||
yy763:
|
||||
#line 1251 "ext/date/lib/parse_date.re"
|
||||
#line 1255 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
@@ -11830,7 +11834,7 @@ yy763:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11834 "<stdout>"
|
||||
#line 11838 "<stdout>"
|
||||
yy764:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'C') goto yy765;
|
||||
@@ -11861,7 +11865,7 @@ yy769:
|
||||
if (yych >= '2') goto yy56;
|
||||
yy770:
|
||||
++YYCURSOR;
|
||||
#line 1492 "ext/date/lib/parse_date.re"
|
||||
#line 1496 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
@@ -11874,7 +11878,7 @@ yy770:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 11878 "<stdout>"
|
||||
#line 11882 "<stdout>"
|
||||
yy772:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'V') goto yy765;
|
||||
@@ -11999,7 +12003,7 @@ yy782:
|
||||
default: goto yy783;
|
||||
}
|
||||
yy783:
|
||||
#line 1527 "ext/date/lib/parse_date.re"
|
||||
#line 1531 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -12007,7 +12011,7 @@ yy783:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12011 "<stdout>"
|
||||
#line 12015 "<stdout>"
|
||||
yy784:
|
||||
yych = *++YYCURSOR;
|
||||
switch (yych) {
|
||||
@@ -12145,7 +12149,7 @@ yy792:
|
||||
if (yych <= 'X') goto yy883;
|
||||
}
|
||||
yy793:
|
||||
#line 1348 "ext/date/lib/parse_date.re"
|
||||
#line 1352 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
@@ -12158,7 +12162,7 @@ yy793:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 12162 "<stdout>"
|
||||
#line 12166 "<stdout>"
|
||||
yy794:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'I') goto yy927;
|
||||
@@ -12352,7 +12356,7 @@ yy813:
|
||||
if (yych <= '/') goto yy814;
|
||||
if (yych <= '7') goto yy816;
|
||||
yy814:
|
||||
#line 1459 "ext/date/lib/parse_date.re"
|
||||
#line 1463 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -12370,14 +12374,14 @@ yy814:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 12374 "<stdout>"
|
||||
#line 12378 "<stdout>"
|
||||
yy815:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy56;
|
||||
if (yych >= '8') goto yy56;
|
||||
yy816:
|
||||
++YYCURSOR;
|
||||
#line 1440 "ext/date/lib/parse_date.re"
|
||||
#line 1444 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -12395,7 +12399,7 @@ yy816:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 12399 "<stdout>"
|
||||
#line 12403 "<stdout>"
|
||||
yy818:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy60;
|
||||
@@ -12455,7 +12459,7 @@ yy820:
|
||||
}
|
||||
}
|
||||
yy821:
|
||||
#line 1426 "ext/date/lib/parse_date.re"
|
||||
#line 1430 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
@@ -12468,7 +12472,7 @@ yy821:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 12472 "<stdout>"
|
||||
#line 12476 "<stdout>"
|
||||
yy822:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy60;
|
||||
@@ -12550,7 +12554,7 @@ yy840:
|
||||
yy841:
|
||||
++YYCURSOR;
|
||||
yy842:
|
||||
#line 1400 "ext/date/lib/parse_date.re"
|
||||
#line 1404 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -12575,7 +12579,7 @@ yy842:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 12579 "<stdout>"
|
||||
#line 12583 "<stdout>"
|
||||
yy843:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '2') {
|
||||
@@ -12831,7 +12835,7 @@ yy847:
|
||||
}
|
||||
}
|
||||
yy848:
|
||||
#line 1388 "ext/date/lib/parse_date.re"
|
||||
#line 1392 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -12842,7 +12846,7 @@ yy848:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 12846 "<stdout>"
|
||||
#line 12850 "<stdout>"
|
||||
yy849:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'H') {
|
||||
@@ -13636,7 +13640,7 @@ yy972:
|
||||
if (yych <= '/') goto yy973;
|
||||
if (yych <= '9') goto yy995;
|
||||
yy973:
|
||||
#line 1265 "ext/date/lib/parse_date.re"
|
||||
#line 1269 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
@@ -13649,7 +13653,7 @@ yy973:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 13653 "<stdout>"
|
||||
#line 13657 "<stdout>"
|
||||
yy974:
|
||||
yyaccept = 22;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -14561,7 +14565,7 @@ yy1065:
|
||||
default: goto yy1067;
|
||||
}
|
||||
yy1067:
|
||||
#line 1157 "ext/date/lib/parse_date.re"
|
||||
#line 1161 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -14583,7 +14587,7 @@ yy1067:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 14587 "<stdout>"
|
||||
#line 14591 "<stdout>"
|
||||
yy1068:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy60;
|
||||
@@ -14667,7 +14671,7 @@ yy1074:
|
||||
}
|
||||
}
|
||||
yy1075:
|
||||
#line 1203 "ext/date/lib/parse_date.re"
|
||||
#line 1207 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -14686,7 +14690,7 @@ yy1075:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 14690 "<stdout>"
|
||||
#line 14694 "<stdout>"
|
||||
yy1076:
|
||||
yyaccept = 25;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -15542,7 +15546,7 @@ yy1116:
|
||||
}
|
||||
}
|
||||
yy1117:
|
||||
#line 1599 "ext/date/lib/parse_date.re"
|
||||
#line 1603 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -15558,7 +15562,7 @@ yy1117:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 15562 "<stdout>"
|
||||
#line 15566 "<stdout>"
|
||||
yy1118:
|
||||
++YYCURSOR;
|
||||
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
||||
@@ -15600,7 +15604,7 @@ yy1124:
|
||||
if (yych != 'f') goto yy56;
|
||||
yy1125:
|
||||
++YYCURSOR;
|
||||
#line 1072 "ext/date/lib/parse_date.re"
|
||||
#line 1076 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -15621,7 +15625,7 @@ yy1125:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 15625 "<stdout>"
|
||||
#line 15629 "<stdout>"
|
||||
yy1127:
|
||||
yyaccept = 26;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -15714,7 +15718,7 @@ yy1140:
|
||||
}
|
||||
}
|
||||
yy1141:
|
||||
#line 1575 "ext/date/lib/parse_date.re"
|
||||
#line 1579 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -15737,7 +15741,7 @@ yy1141:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 15741 "<stdout>"
|
||||
#line 15745 "<stdout>"
|
||||
yy1142:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy1117;
|
||||
@@ -18261,7 +18265,7 @@ yy1293:
|
||||
if (yych <= '9') goto yy1296;
|
||||
goto yy1297;
|
||||
yy1294:
|
||||
#line 1049 "ext/date/lib/parse_date.re"
|
||||
#line 1053 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -18283,7 +18287,7 @@ yy1294:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 18287 "<stdout>"
|
||||
#line 18291 "<stdout>"
|
||||
yy1295:
|
||||
yyaccept = 28;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -18522,7 +18526,7 @@ yy1314:
|
||||
if (yych != 'f') goto yy56;
|
||||
yy1315:
|
||||
++YYCURSOR;
|
||||
#line 1032 "ext/date/lib/parse_date.re"
|
||||
#line 1036 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
@@ -18538,7 +18542,7 @@ yy1315:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 18542 "<stdout>"
|
||||
#line 18546 "<stdout>"
|
||||
yy1317:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -19898,7 +19902,7 @@ yy1385:
|
||||
if (yych <= '/') goto yy1387;
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
#line 1006 "ext/date/lib/parse_date.re"
|
||||
#line 1010 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
@@ -19923,7 +19927,7 @@ yy1387:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 19927 "<stdout>"
|
||||
#line 19931 "<stdout>"
|
||||
yy1388:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'N') {
|
||||
@@ -20329,7 +20333,7 @@ yy1415:
|
||||
yy1416:
|
||||
++YYCURSOR;
|
||||
yy1417:
|
||||
#line 994 "ext/date/lib/parse_date.re"
|
||||
#line 998 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
@@ -20340,7 +20344,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 20344 "<stdout>"
|
||||
#line 20348 "<stdout>"
|
||||
yy1418:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'Y') {
|
||||
@@ -20372,7 +20376,7 @@ yy1419:
|
||||
if (yych <= 'z') goto yy144;
|
||||
}
|
||||
yy1420:
|
||||
#line 984 "ext/date/lib/parse_date.re"
|
||||
#line 988 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
@@ -20381,7 +20385,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 20385 "<stdout>"
|
||||
#line 20389 "<stdout>"
|
||||
yy1421:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'S') {
|
||||
@@ -22313,7 +22317,7 @@ yy1499:
|
||||
if (yych <= 'z') goto yy142;
|
||||
}
|
||||
yy1500:
|
||||
#line 963 "ext/date/lib/parse_date.re"
|
||||
#line 967 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
@@ -22321,7 +22325,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 22325 "<stdout>"
|
||||
#line 22329 "<stdout>"
|
||||
yy1501:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= 'N') {
|
||||
@@ -22452,7 +22456,7 @@ yy1507:
|
||||
if (yych <= 'z') goto yy143;
|
||||
}
|
||||
yy1508:
|
||||
#line 972 "ext/date/lib/parse_date.re"
|
||||
#line 976 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
@@ -22463,7 +22467,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 22467 "<stdout>"
|
||||
#line 22471 "<stdout>"
|
||||
yy1509:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -22973,7 +22977,7 @@ yy1529:
|
||||
yy1530:
|
||||
++YYCURSOR;
|
||||
yy1531:
|
||||
#line 951 "ext/date/lib/parse_date.re"
|
||||
#line 955 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
@@ -22984,7 +22988,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 22988 "<stdout>"
|
||||
#line 22992 "<stdout>"
|
||||
yy1532:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -23149,7 +23153,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1725 "ext/date/lib/parse_date.re"
|
||||
#line 1729 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -394,8 +394,12 @@ static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
|
||||
}
|
||||
++*ptr;
|
||||
if (**ptr == '.') {
|
||||
*ptr += 3;
|
||||
} else {
|
||||
++*ptr;
|
||||
}
|
||||
if (**ptr == 'M' || **ptr == 'm') {
|
||||
++*ptr;
|
||||
}
|
||||
if (**ptr == '.') {
|
||||
++*ptr;
|
||||
}
|
||||
return retval;
|
||||
|
||||
+2138
-2248
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -4113,7 +4113,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 = zend_hash_str_find(myht, element, sizeof(element) - 1); \
|
||||
if (z_arg) { \
|
||||
if (z_arg && Z_TYPE_P(z_arg) <= IS_STRING) { \
|
||||
(*intobj)->diff->member = (itype)zval_get_long(z_arg); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = (itype)def; \
|
||||
@@ -4123,7 +4123,7 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY_I64(element, member) \
|
||||
do { \
|
||||
zval *z_arg = zend_hash_str_find(myht, element, sizeof(element) - 1); \
|
||||
if (z_arg) { \
|
||||
if (z_arg && Z_TYPE_P(z_arg) <= IS_STRING) { \
|
||||
zend_string *str = zval_get_string(z_arg); \
|
||||
DATE_A64I((*intobj)->diff->member, ZSTR_VAL(str)); \
|
||||
zend_string_release(str); \
|
||||
|
||||
@@ -75,8 +75,8 @@ result = Monday 1983-04-18 01:00:00 CEST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Asia/Yerevan
|
||||
ts = Monday 2037-10-19 17:17:17 AMT
|
||||
result = Monday 2037-10-26 00:00:00 AMT
|
||||
ts = Monday 2037-10-19 17:17:17 +04
|
||||
result = Monday 2037-10-26 00:00:00 +04
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
America/Curacao
|
||||
@@ -115,8 +115,8 @@ result = Monday 1971-04-05 00:00:00 AST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Asia/Baku
|
||||
ts = Friday 1971-01-01 17:17:17 BAKT
|
||||
result = Monday 1971-01-04 00:00:00 BAKT
|
||||
ts = Friday 1971-01-01 17:17:17 +04
|
||||
result = Monday 1971-01-04 00:00:00 +04
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Europe/Sarajevo
|
||||
@@ -165,6 +165,6 @@ result = Monday 1980-04-07 00:00:00 CEST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Asia/Baku
|
||||
ts = Monday 1995-12-25 17:17:17 AZT
|
||||
result = Monday 1996-01-01 00:00:00 AZT
|
||||
ts = Monday 1995-12-25 17:17:17 +04
|
||||
result = Monday 1996-01-01 00:00:00 +04
|
||||
wanted = Monday 00:00:00
|
||||
@@ -226,8 +226,8 @@ result=Thursday 1980-04-10 00:00:00 CEST 1
|
||||
wanted=Thursday 00:00:00
|
||||
|
||||
TZ=Asia/Baku - wrong day.
|
||||
tStamp=Sunday 1992-09-20 17:17:17 AZST 1
|
||||
result=Monday 1992-09-28 00:00:00 AZT 0
|
||||
tStamp=Sunday 1992-09-20 17:17:17 +04 1
|
||||
result=Monday 1992-09-28 00:00:00 +04 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=America/Noronha - wrong day.
|
||||
|
||||
@@ -28,6 +28,6 @@ result=Monday 1990-10-22 00:00:00 WART 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?
|
||||
tStamp=Sunday 2005-03-20 17:17:17 GET 0
|
||||
result=Sunday 2005-03-27 00:00:00 GET 0
|
||||
tStamp=Sunday 2005-03-20 17:17:17 +03 0
|
||||
result=Sunday 2005-03-27 00:00:00 +03 0
|
||||
wanted=Sunday 00:00:00
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
Bug #73091 (Unserializing DateInterval object may lead to __toString invocation)
|
||||
--FILE--
|
||||
<?php
|
||||
class foo {
|
||||
function __toString() {
|
||||
var_dump(0);
|
||||
return 'may be a bug';
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(unserialize('O:12:"DateInterval":1:{s:4:"days";O:3:"foo":0:{}}'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
["days"]=>
|
||||
int(-1)
|
||||
["y"]=>
|
||||
int(-1)
|
||||
["m"]=>
|
||||
int(-1)
|
||||
["d"]=>
|
||||
int(-1)
|
||||
["h"]=>
|
||||
int(-1)
|
||||
["i"]=>
|
||||
int(-1)
|
||||
["s"]=>
|
||||
int(-1)
|
||||
["weekday"]=>
|
||||
int(-1)
|
||||
["weekday_behavior"]=>
|
||||
int(-1)
|
||||
["first_last_day_of"]=>
|
||||
int(-1)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -250,6 +250,7 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip) {
|
||||
if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key)) {
|
||||
/* we got position already from last fetch */
|
||||
php_stream_seek(dba->fp, dba->next.pos, SEEK_SET);
|
||||
ln.key.group = estrdup(dba->next.key.group);
|
||||
} else {
|
||||
/* specific instance or not same key -> restart search */
|
||||
/* the slow way: restart and seacrch */
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
--TEST--
|
||||
Bug #70825 (Cannot fetch multiple values with group in ini file)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('dba')) die('skip dba extension not available');
|
||||
if (!in_array('inifile', dba_handlers())) die('skip inifile handler not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70825.ini';
|
||||
|
||||
$db = dba_open($filename, 'n', 'inifile');
|
||||
dba_insert('foo', 23, $db);
|
||||
dba_insert('foo', 42, $db);
|
||||
dba_insert('foo', 1337, $db);
|
||||
var_dump(dba_fetch('foo', -1, $db));
|
||||
var_dump(dba_fetch('foo', -1, $db));
|
||||
var_dump(dba_fetch('foo', -1, $db));
|
||||
dba_close($db);
|
||||
unlink($filename);
|
||||
|
||||
$db = dba_open($filename, 'n', 'inifile');
|
||||
dba_insert(['foo', 'bar'], 23, $db);
|
||||
dba_insert(['foo', 'bar'], 42, $db);
|
||||
dba_insert(['foo', 'bar'], 1337, $db);
|
||||
var_dump(dba_fetch(['foo', 'bar'], -1, $db));
|
||||
var_dump(dba_fetch(['foo', 'bar'], -1, $db));
|
||||
var_dump(dba_fetch(['foo', 'bar'], -1, $db));
|
||||
dba_close($db);
|
||||
unlink($filename);
|
||||
|
||||
$db = dba_open($filename, 'n', 'inifile');
|
||||
dba_insert('[foo]bar', 23, $db);
|
||||
dba_insert('[foo]bar', 42, $db);
|
||||
dba_insert('[foo]bar', 1337, $db);
|
||||
var_dump(dba_fetch('[foo]bar', -1, $db));
|
||||
var_dump(dba_fetch('[foo]bar', -1, $db));
|
||||
var_dump(dba_fetch('[foo]bar', -1, $db));
|
||||
dba_close($db);
|
||||
unlink($filename);
|
||||
|
||||
$db = dba_open($filename, 'n', 'inifile');
|
||||
dba_insert('[foo]bar', 23, $db);
|
||||
dba_insert('[foo]bar', 42, $db);
|
||||
dba_insert('[foo]bar', 1337, $db);
|
||||
var_dump(dba_fetch('[foo]bar', 0, $db));
|
||||
var_dump(dba_fetch('[foo]bar', 1, $db));
|
||||
var_dump(dba_fetch('[foo]bar', 2, $db));
|
||||
dba_close($db);
|
||||
unlink($filename);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(2) "23"
|
||||
string(2) "42"
|
||||
string(4) "1337"
|
||||
string(2) "23"
|
||||
string(2) "42"
|
||||
string(4) "1337"
|
||||
string(2) "23"
|
||||
string(2) "42"
|
||||
string(4) "1337"
|
||||
string(2) "23"
|
||||
string(2) "42"
|
||||
string(4) "1337"
|
||||
==DONE==
|
||||
--CLEAN--
|
||||
<?php
|
||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70825.ini';
|
||||
unlink($filename);
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #71514 (Bad dba_replace condition because of wrong API usage)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('dba')) die('skip dba extension not available');
|
||||
if (!in_array('inifile', dba_handlers())) die('skip inifile handler not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini';
|
||||
|
||||
$db = dba_open($filename, 'c', 'inifile');
|
||||
|
||||
dba_insert('foo', 'value1', $db);
|
||||
dba_replace('foo', 'value2', $db);
|
||||
var_dump(dba_fetch('foo', $db));
|
||||
|
||||
dba_close($db);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(6) "value2"
|
||||
==DONE==
|
||||
--CLEAN--
|
||||
<?php
|
||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini';
|
||||
unlink($filename);
|
||||
?>
|
||||
@@ -40,7 +40,7 @@ do {
|
||||
}
|
||||
if ($handler != 'cdb') {
|
||||
$db_writer = dba_open($db_filename, 'c'.$lock_flag, $handler);
|
||||
if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) {
|
||||
if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.'t', $handler))===false) {
|
||||
echo "Read during write: not allowed\n";
|
||||
} else {
|
||||
echo "Read during write: allowed\n";
|
||||
|
||||
+2
-2
@@ -1663,7 +1663,7 @@ PHP_FUNCTION(dom_document_savexml)
|
||||
if (options & LIBXML_SAVE_NOEMPTYTAG) {
|
||||
xmlSaveNoEmptyTags = saveempty;
|
||||
}
|
||||
if (!size) {
|
||||
if (!size || !mem) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETVAL_STRINGL((char *) mem, size);
|
||||
@@ -2215,7 +2215,7 @@ PHP_FUNCTION(dom_document_save_html)
|
||||
#else
|
||||
htmlDocDumpMemory(docp, &mem, &size);
|
||||
#endif
|
||||
if (!size) {
|
||||
if (!size || !mem) {
|
||||
RETVAL_FALSE;
|
||||
} else {
|
||||
RETVAL_STRINGL((const char*) mem, size);
|
||||
|
||||
+20
-4
@@ -1703,6 +1703,10 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
break;
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, strlen(value));
|
||||
}
|
||||
|
||||
/* do not recompute length here */
|
||||
info_value->s = estrndup(value, length);
|
||||
info_data->length = length;
|
||||
@@ -2712,8 +2716,14 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
char *dir_start;
|
||||
|
||||
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type))
|
||||
return FALSE;
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "No maker note data found. Detected maker: %s (length = %d)", ImageInfo->make, strlen(ImageInfo->make));
|
||||
#endif
|
||||
/* unknown manufacturer, not an error, use it as a string */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
maker_note = maker_note_array+i;
|
||||
|
||||
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/
|
||||
@@ -3713,8 +3723,11 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
|
||||
if (fgot < ImageInfo->Thumbnail.size) {
|
||||
EXIF_ERRLOG_THUMBEOF(ImageInfo)
|
||||
efree(ImageInfo->Thumbnail.data);
|
||||
ImageInfo->Thumbnail.data = NULL;
|
||||
} else {
|
||||
exif_thumbnail_build(ImageInfo);
|
||||
}
|
||||
exif_thumbnail_build(ImageInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3747,8 +3760,11 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
|
||||
if (fgot < ImageInfo->Thumbnail.size) {
|
||||
EXIF_ERRLOG_THUMBEOF(ImageInfo)
|
||||
efree(ImageInfo->Thumbnail.data);
|
||||
ImageInfo->Thumbnail.data = NULL;
|
||||
} else {
|
||||
exif_thumbnail_build(ImageInfo);
|
||||
}
|
||||
exif_thumbnail_build(ImageInfo);
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done");
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
--TEST--
|
||||
Bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$exif = exif_read_data(__DIR__ . '/bug72627.tiff',0,0,true);
|
||||
var_dump($exif);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d
|
||||
|
||||
Warning: exif_read_data(%s): Error in TIFF: filesize(x04E2) less than start of IFD dir(x829A0004) in %sbug72627.php on line %d
|
||||
|
||||
Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d
|
||||
array(11) {
|
||||
["FileName"]=>
|
||||
string(13) "bug72627.tiff"
|
||||
["FileDateTime"]=>
|
||||
int(%d)
|
||||
["FileSize"]=>
|
||||
int(1250)
|
||||
["FileType"]=>
|
||||
int(7)
|
||||
["MimeType"]=>
|
||||
string(10) "image/tiff"
|
||||
["SectionsFound"]=>
|
||||
string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF"
|
||||
["COMPUTED"]=>
|
||||
array(10) {
|
||||
["html"]=>
|
||||
string(24) "width="128" height="132""
|
||||
["Height"]=>
|
||||
int(132)
|
||||
["Width"]=>
|
||||
int(128)
|
||||
["IsColor"]=>
|
||||
int(0)
|
||||
["ByteOrderMotorola"]=>
|
||||
int(0)
|
||||
["ApertureFNumber"]=>
|
||||
string(5) "f/1.0"
|
||||
["Thumbnail.FileType"]=>
|
||||
int(2)
|
||||
["Thumbnail.MimeType"]=>
|
||||
string(10) "image/jpeg"
|
||||
["Thumbnail.Height"]=>
|
||||
int(132)
|
||||
["Thumbnail.Width"]=>
|
||||
int(128)
|
||||
}
|
||||
["XResolution"]=>
|
||||
string(21) "1414812756/1414812756"
|
||||
["THUMBNAIL"]=>
|
||||
array(5) {
|
||||
["ImageWidth"]=>
|
||||
int(128)
|
||||
["ImageLength"]=>
|
||||
int(132)
|
||||
["JPEGInterchangeFormat"]=>
|
||||
int(1280)
|
||||
["JPEGInterchangeFormatLength"]=>
|
||||
int(100)
|
||||
["THUMBNAIL"]=>
|
||||
NULL
|
||||
}
|
||||
["ExposureTime"]=>
|
||||
string(21) "1414812756/1414812756"
|
||||
["FNumber"]=>
|
||||
string(21) "1414812756/1414812756"
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #69107 (finfo no longer detects PHP files)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('fileinfo')) die('skip fileinfo extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$finfo = new finfo(FILEINFO_MIME_TYPE);
|
||||
|
||||
var_dump($finfo->buffer("<?php\nclass A{}"));
|
||||
var_dump($finfo->buffer("<?php class A{}"));
|
||||
var_dump($finfo->buffer("<?php\tclass A{}"));
|
||||
var_dump($finfo->buffer("<?php\n\rclass A{}"));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(10) "text/x-php"
|
||||
string(10) "text/x-php"
|
||||
string(10) "text/x-php"
|
||||
string(10) "text/x-php"
|
||||
===DONE===
|
||||
+2
-1
@@ -395,7 +395,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
|
||||
} else {
|
||||
ZVAL_FALSE(value);
|
||||
}
|
||||
return;
|
||||
goto handle_default;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,6 +404,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
|
||||
|
||||
filter_func.function(value, flags, options, charset);
|
||||
|
||||
handle_default:
|
||||
if (options && (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT) &&
|
||||
((flags & FILTER_NULL_ON_FAILURE && Z_TYPE_P(value) == IS_NULL) ||
|
||||
(!(flags & FILTER_NULL_ON_FAILURE) && Z_TYPE_P(value) == IS_FALSE)) &&
|
||||
|
||||
@@ -779,8 +779,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_PRIV_RANGE) {
|
||||
if (
|
||||
(ip[0] == 10) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
|
||||
(ip[0] == 172 && ip[1] >= 16 && ip[1] <= 31) ||
|
||||
(ip[0] == 192 && ip[1] == 168)
|
||||
) {
|
||||
RETURN_VALIDATION_FAILED
|
||||
@@ -790,19 +789,9 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_RES_RANGE) {
|
||||
if (
|
||||
(ip[0] == 0) ||
|
||||
(ip[0] == 10) ||
|
||||
(ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
|
||||
(ip[0] >= 240) ||
|
||||
(ip[0] == 127) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
|
||||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 0) ||
|
||||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 2) ||
|
||||
(ip[0] == 192 && ip[1] == 88 && ip[2] == 99) ||
|
||||
(ip[0] == 192 && ip[1] == 168) ||
|
||||
(ip[0] == 198 && (ip[1] == 18 || ip[1] == 19)) ||
|
||||
(ip[0] == 198 && ip[1] == 51 && ip[2] == 100) ||
|
||||
(ip[0] == 203 && ip[1] == 0 && ip[2] == 113) ||
|
||||
(ip[0] >= 224 && ip[0] <= 255)
|
||||
(ip[0] == 169 && ip[1] == 254)
|
||||
) {
|
||||
RETURN_VALIDATION_FAILED
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ string(9) "127.0.0.1"
|
||||
bool(false)
|
||||
string(12) "192.0.34.166"
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(9) "192.0.0.1"
|
||||
string(10) "100.64.0.0"
|
||||
string(15) "100.127.255.255"
|
||||
string(12) "192.0.34.166"
|
||||
bool(false)
|
||||
string(15) "255.255.255.255"
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #73054 (default option ignored when object passed to int filter)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('filter')) die('skip filter extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
filter_var(new stdClass, FILTER_VALIDATE_INT, [
|
||||
'options' => ['default' => 2],
|
||||
]),
|
||||
filter_var(new stdClass, FILTER_VALIDATE_INT, [
|
||||
'options' => ['default' => 2],
|
||||
'flags' => FILTER_NULL_ON_FAILURE
|
||||
])
|
||||
);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(2)
|
||||
int(2)
|
||||
===DONE===
|
||||
@@ -85,8 +85,8 @@ string(10) "10.0.0.0/8"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(14) "168.254.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(11) "169.254.0.0"
|
||||
string(15) "169.254.255.255"
|
||||
string(13) "172.16.0.0/12"
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -94,11 +94,11 @@ string(14) "192.168.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(10) "10.0.0.0/8"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(8) "10.0.0.0"
|
||||
string(14) "10.255.255.255"
|
||||
string(12) "10.64.0.0/10"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(10) "100.64.0.0"
|
||||
string(15) "100.127.255.255"
|
||||
string(11) "127.0.0.0/8"
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -106,32 +106,32 @@ string(14) "169.254.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(13) "172.16.0.0/12"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(10) "172.16.0.0"
|
||||
string(10) "172.31.0.0"
|
||||
string(12) "192.0.0.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(9) "192.0.0.0"
|
||||
string(11) "192.0.0.255"
|
||||
string(12) "192.0.0.0/29"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(9) "192.0.0.0"
|
||||
string(9) "192.0.0.7"
|
||||
string(12) "192.0.2.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(9) "192.0.2.0"
|
||||
string(11) "192.0.2.255"
|
||||
string(13) "198.18.0.0/15"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(10) "198.18.0.0"
|
||||
string(14) "198.19.255.255"
|
||||
string(15) "198.51.100.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "198.51.100.0"
|
||||
string(14) "198.51.100.255"
|
||||
string(14) "192.88.99.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(11) "192.88.99.0"
|
||||
string(13) "192.88.99.255"
|
||||
string(14) "192.168.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(11) "192.168.0.0"
|
||||
string(15) "192.168.255.255"
|
||||
string(14) "203.0.113.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(11) "203.0.113.0"
|
||||
string(13) "203.0.113.255"
|
||||
string(11) "240.0.0.0/4"
|
||||
bool(false)
|
||||
string(9) "224.0.0.0"
|
||||
bool(false)
|
||||
+24
-17
@@ -291,6 +291,9 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass)
|
||||
#endif
|
||||
SSL_CTX_set_options(ctx, ssl_ctx_options);
|
||||
|
||||
/* allow SSL to re-use sessions */
|
||||
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH);
|
||||
|
||||
ftp->ssl_handle = SSL_new(ctx);
|
||||
if (ftp->ssl_handle == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "failed to create the SSL handle");
|
||||
@@ -1637,7 +1640,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
|
||||
|
||||
#ifdef HAVE_FTP_SSL
|
||||
SSL_CTX *ctx;
|
||||
zend_long ssl_ctx_options = SSL_OP_ALL;
|
||||
SSL_SESSION *session;
|
||||
int err, res;
|
||||
zend_bool retry;
|
||||
#endif
|
||||
@@ -1660,31 +1663,40 @@ data_accepted:
|
||||
|
||||
/* now enable ssl if we need to */
|
||||
if (ftp->use_ssl && ftp->use_ssl_for_data) {
|
||||
ctx = SSL_CTX_new(SSLv23_client_method());
|
||||
ctx = SSL_get_SSL_CTX(ftp->ssl_handle);
|
||||
if (ctx == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL context");
|
||||
php_error_docref(NULL, E_WARNING, "data_accept: failed to retreive the existing SSL context");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090605fL
|
||||
ssl_ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
|
||||
#endif
|
||||
SSL_CTX_set_options(ctx, ssl_ctx_options);
|
||||
|
||||
data->ssl_handle = SSL_new(ctx);
|
||||
if (data->ssl_handle == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL handle");
|
||||
SSL_CTX_free(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
SSL_set_fd(data->ssl_handle, data->fd);
|
||||
|
||||
if (ftp->old_ssl) {
|
||||
SSL_copy_session_id(data->ssl_handle, ftp->ssl_handle);
|
||||
}
|
||||
|
||||
/* get the session from the control connection so we can re-use it */
|
||||
session = SSL_get_session(ftp->ssl_handle);
|
||||
if (session == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "data_accept: failed to retreive the existing SSL session");
|
||||
SSL_free(data->ssl_handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* and set it on the data connection */
|
||||
res = SSL_set_session(data->ssl_handle, session);
|
||||
if (res == 0) {
|
||||
php_error_docref(NULL, E_WARNING, "data_accept: failed to set the existing SSL session");
|
||||
SSL_free(data->ssl_handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
do {
|
||||
res = SSL_connect(data->ssl_handle);
|
||||
err = SSL_get_error(data->ssl_handle, res);
|
||||
@@ -1745,10 +1757,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
|
||||
if (data->listener != -1) {
|
||||
#ifdef HAVE_FTP_SSL
|
||||
if (data->ssl_active) {
|
||||
|
||||
ctx = SSL_get_SSL_CTX(data->ssl_handle);
|
||||
SSL_CTX_free(ctx);
|
||||
|
||||
/* don't free the data context, it's the same as the control */
|
||||
SSL_shutdown(data->ssl_handle);
|
||||
SSL_free(data->ssl_handle);
|
||||
data->ssl_active = 0;
|
||||
@@ -1759,9 +1768,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
|
||||
if (data->fd != -1) {
|
||||
#ifdef HAVE_FTP_SSL
|
||||
if (data->ssl_active) {
|
||||
ctx = SSL_get_SSL_CTX(data->ssl_handle);
|
||||
SSL_CTX_free(ctx);
|
||||
|
||||
/* don't free the data context, it's the same as the control */
|
||||
SSL_shutdown(data->ssl_handle);
|
||||
SSL_free(data->ssl_handle);
|
||||
data->ssl_active = 0;
|
||||
|
||||
@@ -139,7 +139,10 @@ if ($pid) {
|
||||
$buf = fread($s, 2048);
|
||||
}
|
||||
|
||||
if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) {
|
||||
if ($buf == "AUTH TLS\r\n") {
|
||||
fputs($s, "500 not supported.\r\n");
|
||||
return ;
|
||||
} else if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) {
|
||||
fputs($s, "500 Syntax error, command unrecognized.\r\n");
|
||||
dump_and_exit($buf);
|
||||
}
|
||||
@@ -208,6 +211,10 @@ if ($pid) {
|
||||
$ascii = true;
|
||||
fputs($s, "200 OK\r\n");
|
||||
|
||||
} elseif ($buf === "AUTH SSL\r\n") {
|
||||
$ascii = true;
|
||||
fputs($s, "500 not supported\r\n");
|
||||
|
||||
} elseif ($buf === "TYPE I\r\n") {
|
||||
$ascii = false;
|
||||
fputs($s, "200 OK\r\n");
|
||||
@@ -288,6 +295,10 @@ if ($pid) {
|
||||
}
|
||||
|
||||
|
||||
if ((!empty($ssl)) && (!stream_socket_enable_crypto($pasvs, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER))) {
|
||||
die("SSLv23 handshake failed.\n");
|
||||
}
|
||||
|
||||
if (empty($m[1]) || $m[1] !== 'emptydir') {
|
||||
fputs($fs, "file1\r\nfile1\r\nfile\nb0rk\r\n");
|
||||
}
|
||||
@@ -403,10 +414,6 @@ if ($pid) {
|
||||
|
||||
$pasvs = stream_socket_accept($soc,10);
|
||||
|
||||
if ((!empty($ssl)) && (!stream_socket_enable_crypto($pasvs, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER))) {
|
||||
die("SSLv23 handshake failed.\n");
|
||||
}
|
||||
|
||||
}elseif (preg_match('/^EPSV/', $buf, $matches)) {
|
||||
fputs($s, "550 Extended passsive mode not supported.\r\n");
|
||||
} elseif (preg_match('/^SITE EXEC/', $buf, $matches)) {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ if (PHP_GD != "no") {
|
||||
if (
|
||||
CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) &&
|
||||
CHECK_LIB("freetype_a.lib;freetype.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include" + ";" + PHP_PHP_BUILD + "\\include\\freetype") &&
|
||||
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype") &&
|
||||
CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
|
||||
(CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16") ||
|
||||
|
||||
+41
-14
@@ -1521,7 +1521,7 @@ PHP_FUNCTION(imageistruecolor)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted)
|
||||
Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */
|
||||
Convert a true color image to a palette based image with a number of colors, optionally using dithering. */
|
||||
PHP_FUNCTION(imagetruecolortopalette)
|
||||
{
|
||||
zval *IM;
|
||||
@@ -1537,18 +1537,18 @@ PHP_FUNCTION(imagetruecolortopalette)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ncolors <= 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero");
|
||||
if (ncolors <= 0 || ZEND_LONG_INT_OVFL(ncolors)) {
|
||||
php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero and no more than %d", INT_MAX);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
gdImageTrueColorToPalette(im, dither, ncolors);
|
||||
gdImageTrueColorToPalette(im, dither, (int)ncolors);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted)
|
||||
Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */
|
||||
/* {{{ proto void imagepalettetotruecolor(resource im)
|
||||
Convert a palette based image to a true color image. */
|
||||
PHP_FUNCTION(imagepalettetotruecolor)
|
||||
{
|
||||
zval *IM;
|
||||
@@ -2546,11 +2546,11 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
|
||||
if (argc > 1) {
|
||||
fn = file;
|
||||
if (argc == 3) {
|
||||
if (argc >= 3) {
|
||||
q = quality;
|
||||
}
|
||||
if (argc == 4) {
|
||||
t = type;
|
||||
if (argc == 4) {
|
||||
t = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3039,6 +3039,11 @@ PHP_FUNCTION(imagegammacorrect)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( input <= 0.0 || output <= 0.0 ) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positive");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(IM), "Image", le_gd)) == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -3851,7 +3856,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
|
||||
{
|
||||
zval *IM, *EXT = NULL;
|
||||
gdImagePtr im=NULL;
|
||||
zend_long col = -1, x = -1, y = -1;
|
||||
zend_long col = -1, x = 0, y = 0;
|
||||
size_t str_len, fontname_len;
|
||||
int i, brect[8];
|
||||
double ptsize, angle;
|
||||
@@ -4066,6 +4071,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
dest = VCWD_FOPEN(fn_dest, "wb");
|
||||
if (!dest) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn_dest);
|
||||
fclose(org);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -4074,6 +4080,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
im_org = gdImageCreateFromGif(org);
|
||||
if (im_org == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
|
||||
fclose(org);
|
||||
fclose(dest);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -4084,6 +4092,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
im_org = gdImageCreateFromJpegEx(org, ignore_warning);
|
||||
if (im_org == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
|
||||
fclose(org);
|
||||
fclose(dest);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -4094,6 +4104,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
im_org = gdImageCreateFromPng(org);
|
||||
if (im_org == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
|
||||
fclose(org);
|
||||
fclose(dest);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -4101,10 +4113,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
|
||||
default:
|
||||
php_error_docref(NULL, E_WARNING, "Format not supported");
|
||||
fclose(org);
|
||||
fclose(dest);
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
fclose(org);
|
||||
|
||||
org_width = gdImageSX (im_org);
|
||||
org_height = gdImageSY (im_org);
|
||||
|
||||
@@ -4135,6 +4151,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
im_tmp = gdImageCreate (dest_width, dest_height);
|
||||
if (im_tmp == NULL ) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
|
||||
fclose(dest);
|
||||
gdImageDestroy(im_org);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -4142,23 +4160,29 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
|
||||
gdImageDestroy(im_org);
|
||||
|
||||
fclose(org);
|
||||
|
||||
im_dest = gdImageCreate(dest_width, dest_height);
|
||||
if (im_dest == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to allocate destination buffer");
|
||||
fclose(dest);
|
||||
gdImageDestroy(im_tmp);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
white = gdImageColorAllocate(im_dest, 255, 255, 255);
|
||||
if (white == -1) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
|
||||
fclose(dest);
|
||||
gdImageDestroy(im_tmp);
|
||||
gdImageDestroy(im_dest);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
black = gdImageColorAllocate(im_dest, 0, 0, 0);
|
||||
if (black == -1) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
|
||||
fclose(dest);
|
||||
gdImageDestroy(im_tmp);
|
||||
gdImageDestroy(im_dest);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -4671,7 +4695,7 @@ PHP_FUNCTION(imagescale)
|
||||
gdImagePtr im_scaled = NULL;
|
||||
int new_width, new_height;
|
||||
zend_long tmp_w, tmp_h=-1, tmp_m = GD_BILINEAR_FIXED;
|
||||
gdInterpolationMethod method;
|
||||
gdInterpolationMethod method, old_method;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
|
||||
return;
|
||||
@@ -4700,9 +4724,12 @@ PHP_FUNCTION(imagescale)
|
||||
new_width = tmp_w;
|
||||
new_height = tmp_h;
|
||||
|
||||
/* gdImageGetInterpolationMethod() is only available as of GD 2.1.1 */
|
||||
old_method = im->interpolation_id;
|
||||
if (gdImageSetInterpolationMethod(im, method)) {
|
||||
im_scaled = gdImageScale(im, new_width, new_height);
|
||||
}
|
||||
gdImageSetInterpolationMethod(im, old_method);
|
||||
|
||||
if (im_scaled == NULL) {
|
||||
RETURN_FALSE;
|
||||
|
||||
+36
-87
@@ -1115,7 +1115,7 @@ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
}
|
||||
|
||||
/* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */
|
||||
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im))) {
|
||||
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1296,58 +1296,13 @@ inline static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color
|
||||
void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
|
||||
{
|
||||
/* keep them as 32bits */
|
||||
long x, y, inc;
|
||||
long x, y, inc, frac;
|
||||
long dx, dy,tmp;
|
||||
|
||||
if (y1 < 0 && y2 < 0) {
|
||||
/* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */
|
||||
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) {
|
||||
return;
|
||||
}
|
||||
if (y1 < 0) {
|
||||
x1 += (y1 * (x1 - x2)) / (y2 - y1);
|
||||
y1 = 0;
|
||||
}
|
||||
if (y2 < 0) {
|
||||
x2 += (y2 * (x1 - x2)) / (y2 - y1);
|
||||
y2 = 0;
|
||||
}
|
||||
|
||||
/* bottom edge */
|
||||
if (y1 >= im->sy && y2 >= im->sy) {
|
||||
return;
|
||||
}
|
||||
if (y1 >= im->sy) {
|
||||
x1 -= ((im->sy - y1) * (x1 - x2)) / (y2 - y1);
|
||||
y1 = im->sy - 1;
|
||||
}
|
||||
if (y2 >= im->sy) {
|
||||
x2 -= ((im->sy - y2) * (x1 - x2)) / (y2 - y1);
|
||||
y2 = im->sy - 1;
|
||||
}
|
||||
|
||||
/* left edge */
|
||||
if (x1 < 0 && x2 < 0) {
|
||||
return;
|
||||
}
|
||||
if (x1 < 0) {
|
||||
y1 += (x1 * (y1 - y2)) / (x2 - x1);
|
||||
x1 = 0;
|
||||
}
|
||||
if (x2 < 0) {
|
||||
y2 += (x2 * (y1 - y2)) / (x2 - x1);
|
||||
x2 = 0;
|
||||
}
|
||||
/* right edge */
|
||||
if (x1 >= im->sx && x2 >= im->sx) {
|
||||
return;
|
||||
}
|
||||
if (x1 >= im->sx) {
|
||||
y1 -= ((im->sx - x1) * (y1 - y2)) / (x2 - x1);
|
||||
x1 = im->sx - 1;
|
||||
}
|
||||
if (x2 >= im->sx) {
|
||||
y2 -= ((im->sx - x2) * (y1 - y2)) / (x2 - x1);
|
||||
x2 = im->sx - 1;
|
||||
}
|
||||
|
||||
dx = x2 - x1;
|
||||
dy = y2 - y1;
|
||||
@@ -1366,16 +1321,22 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
|
||||
dx = x2 - x1;
|
||||
dy = y2 - y1;
|
||||
}
|
||||
x = x1 << 16;
|
||||
y = y1 << 16;
|
||||
y = y1;
|
||||
inc = (dy * 65536) / dx;
|
||||
while ((x >> 16) <= x2) {
|
||||
gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF);
|
||||
if ((y >> 16) + 1 < im->sy) {
|
||||
gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);
|
||||
frac = 0;
|
||||
for (x = x1; x <= x2; x++) {
|
||||
gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF);
|
||||
if (y + 1 < im->sy) {
|
||||
gdImageSetAAPixelColor(im, x, y + 1, col, (~frac >> 8) & 0xFF);
|
||||
}
|
||||
frac += inc;
|
||||
if (frac >= 65536) {
|
||||
frac -= 65536;
|
||||
y++;
|
||||
} else if (frac < 0) {
|
||||
frac += 65536;
|
||||
y--;
|
||||
}
|
||||
x += (1 << 16);
|
||||
y += inc;
|
||||
}
|
||||
} else {
|
||||
if (dy < 0) {
|
||||
@@ -1388,16 +1349,22 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
|
||||
dx = x2 - x1;
|
||||
dy = y2 - y1;
|
||||
}
|
||||
x = x1 << 16;
|
||||
y = y1 << 16;
|
||||
x = x1;
|
||||
inc = (dx * 65536) / dy;
|
||||
while ((y>>16) <= y2) {
|
||||
gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF);
|
||||
if ((x >> 16) + 1 < im->sx) {
|
||||
gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);
|
||||
frac = 0;
|
||||
for (y = y1; y <= y2; y++) {
|
||||
gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF);
|
||||
if (x + 1 < im->sx) {
|
||||
gdImageSetAAPixelColor(im, x + 1, y, col, (~frac >> 8) & 0xFF);
|
||||
}
|
||||
frac += inc;
|
||||
if (frac >= 65536) {
|
||||
frac -= 65536;
|
||||
x++;
|
||||
} else if (frac < 0) {
|
||||
frac += 65536;
|
||||
x--;
|
||||
}
|
||||
x += inc;
|
||||
y += (1<<16);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1778,7 +1745,7 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
int leftLimit = -1, rightLimit;
|
||||
int i, restoreAlphaBlending = 0;
|
||||
|
||||
if (border < 0) {
|
||||
if (border < 0 || color < 0) {
|
||||
/* Refuse to fill to a non-solid border */
|
||||
return;
|
||||
}
|
||||
@@ -2245,7 +2212,9 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX,
|
||||
for (y = 0; (y < h); y++) {
|
||||
for (x = 0; (x < w); x++) {
|
||||
int c = gdImageGetTrueColorPixel (src, srcX + x, srcY + y);
|
||||
gdImageSetPixel (dst, dstX + x, dstY + y, c);
|
||||
if (c != src->transparent) {
|
||||
gdImageSetPixel (dst, dstX + x, dstY + y, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -2262,26 +2231,6 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Destination is palette based */
|
||||
if (src->trueColor) { /* But source is truecolor (Ouch!) */
|
||||
toy = dstY;
|
||||
for (y = srcY; (y < (srcY + h)); y++) {
|
||||
tox = dstX;
|
||||
for (x = srcX; x < (srcX + w); x++) {
|
||||
int nc;
|
||||
c = gdImageGetPixel (src, x, y);
|
||||
|
||||
/* Get best match possible. */
|
||||
nc = gdImageColorResolveAlpha(dst, gdTrueColorGetRed(c), gdTrueColorGetGreen(c), gdTrueColorGetBlue(c), gdTrueColorGetAlpha(c));
|
||||
|
||||
gdImageSetPixel(dst, tox, toy, nc);
|
||||
tox++;
|
||||
}
|
||||
toy++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Palette based to palette based */
|
||||
for (i = 0; i < gdMaxColors; i++) {
|
||||
colorMap[i] = (-1);
|
||||
|
||||
@@ -191,21 +191,21 @@ static gdImagePtr _gd2CreateFromFile (gdIOCtxPtr in, int *sx, int *sy, int *cs,
|
||||
}
|
||||
if (im == NULL) {
|
||||
GD2_DBG(php_gd_error("Could not create gdImage"));
|
||||
goto fail1;
|
||||
goto fail2;
|
||||
}
|
||||
|
||||
if (!_gdGetColors(in, im, (*vers) == 2)) {
|
||||
GD2_DBG(php_gd_error("Could not read color palette"));
|
||||
goto fail2;
|
||||
goto fail3;
|
||||
}
|
||||
GD2_DBG(php_gd_error("Image palette completed: %d colours", im->colorsTotal));
|
||||
|
||||
return im;
|
||||
|
||||
fail2:
|
||||
fail3:
|
||||
gdImageDestroy(im);
|
||||
return 0;
|
||||
|
||||
fail2:
|
||||
gdFree(*cidx);
|
||||
fail1:
|
||||
return 0;
|
||||
}
|
||||
@@ -670,7 +670,7 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
|
||||
|
||||
/* Force fmt to a valid value since we don't return anything. */
|
||||
if ((fmt != GD2_FMT_RAW) && (fmt != GD2_FMT_COMPRESSED)) {
|
||||
fmt = im->trueColor ? GD2_FMT_TRUECOLOR_COMPRESSED : GD2_FMT_COMPRESSED;
|
||||
fmt = GD2_FMT_COMPRESSED;
|
||||
}
|
||||
if (im->trueColor) {
|
||||
fmt += 2;
|
||||
@@ -689,8 +689,8 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
|
||||
}
|
||||
|
||||
/* Work out number of chunks. */
|
||||
ncx = im->sx / cs + 1;
|
||||
ncy = im->sy / cs + 1;
|
||||
ncx = (im->sx + cs - 1) / cs;
|
||||
ncy = (im->sy + cs - 1) / cs;
|
||||
|
||||
/* Write the standard header. */
|
||||
_gd2PutHeader (im, out, cs, fmt, ncx, ncy);
|
||||
|
||||
@@ -1331,10 +1331,10 @@ static gdImagePtr gdImageScaleBilinearPalette(gdImagePtr im, const unsigned int
|
||||
f_a4 = gd_itofx(gdTrueColorGetAlpha(pixel4));
|
||||
|
||||
{
|
||||
const char red = (char) gd_fxtoi(gd_mulfx(f_w1, f_r1) + gd_mulfx(f_w2, f_r2) + gd_mulfx(f_w3, f_r3) + gd_mulfx(f_w4, f_r4));
|
||||
const char green = (char) gd_fxtoi(gd_mulfx(f_w1, f_g1) + gd_mulfx(f_w2, f_g2) + gd_mulfx(f_w3, f_g3) + gd_mulfx(f_w4, f_g4));
|
||||
const char blue = (char) gd_fxtoi(gd_mulfx(f_w1, f_b1) + gd_mulfx(f_w2, f_b2) + gd_mulfx(f_w3, f_b3) + gd_mulfx(f_w4, f_b4));
|
||||
const char alpha = (char) gd_fxtoi(gd_mulfx(f_w1, f_a1) + gd_mulfx(f_w2, f_a2) + gd_mulfx(f_w3, f_a3) + gd_mulfx(f_w4, f_a4));
|
||||
const unsigned char red = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_r1) + gd_mulfx(f_w2, f_r2) + gd_mulfx(f_w3, f_r3) + gd_mulfx(f_w4, f_r4));
|
||||
const unsigned char green = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_g1) + gd_mulfx(f_w2, f_g2) + gd_mulfx(f_w3, f_g3) + gd_mulfx(f_w4, f_g4));
|
||||
const unsigned char blue = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_b1) + gd_mulfx(f_w2, f_b2) + gd_mulfx(f_w3, f_b3) + gd_mulfx(f_w4, f_b4));
|
||||
const unsigned char alpha = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_a1) + gd_mulfx(f_w2, f_a2) + gd_mulfx(f_w3, f_a3) + gd_mulfx(f_w4, f_a4));
|
||||
|
||||
new_img->tpixels[dst_offset_v][dst_offset_h] = gdTrueColorAlpha(red, green, blue, alpha);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len)
|
||||
if (remain >= len) {
|
||||
rlen = len;
|
||||
} else {
|
||||
if (remain == 0) {
|
||||
if (remain <= 0) {
|
||||
return EOF;
|
||||
}
|
||||
rlen = remain;
|
||||
|
||||
@@ -760,7 +760,7 @@ LOCAL (void)
|
||||
cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total >> 1)) / total);
|
||||
#else
|
||||
/* 2.0.16: Paul den Dulk found an occasion where total can be 0 */
|
||||
if (count)
|
||||
if (total)
|
||||
{
|
||||
nim->red[icolor] = (int) ((c0total + (total >> 1)) / total);
|
||||
nim->green[icolor] = (int) ((c1total + (total >> 1)) / total);
|
||||
|
||||
@@ -120,6 +120,14 @@ void gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quantization)
|
||||
quantization = 80;
|
||||
}
|
||||
|
||||
if (overflow2(gdImageSX(im), 4)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (overflow2(gdImageSX(im) * 4, gdImageSY(im))) {
|
||||
return;
|
||||
}
|
||||
|
||||
argb = (uint8_t *)gdMalloc(gdImageSX(im) * 4 * gdImageSY(im));
|
||||
if (!argb) {
|
||||
return;
|
||||
|
||||
+71
-64
@@ -658,6 +658,8 @@ static char * gdft_draw_bitmap (gdCache_head_t *tc_cache, gdImage * im, int fg,
|
||||
} else {
|
||||
return "Unsupported ft_pixel_mode";
|
||||
}
|
||||
if (level == 0) /* if background */
|
||||
continue;
|
||||
if ((fg >= 0) && (im->trueColor)) {
|
||||
/* Consider alpha in the foreground color itself to be an
|
||||
* upper bound on how opaque things get, when truecolor is
|
||||
@@ -747,9 +749,9 @@ static char * gdft_draw_bitmap (gdCache_head_t *tc_cache, gdImage * im, int fg,
|
||||
}
|
||||
|
||||
static int
|
||||
gdroundupdown (FT_F26Dot6 v1, int updown)
|
||||
gdroundupdown (FT_F26Dot6 v1, int roundup)
|
||||
{
|
||||
return (!updown) ? (v1 < 0 ? ((v1 - 63) >> 6) : v1 >> 6) : (v1 > 0 ? ((v1 + 63) >> 6) : v1 >> 6);
|
||||
return (!roundup) ? v1 >> 6 : (v1 + 63) >> 6;
|
||||
}
|
||||
|
||||
void gdFontCacheShutdown()
|
||||
@@ -819,8 +821,6 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
double cos_a = cos (angle);
|
||||
int len, i = 0, ch;
|
||||
int x1 = 0, y1 = 0;
|
||||
int xb = x, yb = y;
|
||||
int yd = 0;
|
||||
font_t *font;
|
||||
fontkey_t fontkey;
|
||||
char *next;
|
||||
@@ -981,9 +981,6 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
penf.y = (penf.y - 32) & -64; /* round to next pixel row */
|
||||
x1 = (int)(- penf.y * sin_a + 32) / 64;
|
||||
y1 = (int)(- penf.y * cos_a + 32) / 64;
|
||||
xb = x + x1;
|
||||
yb = y + y1;
|
||||
yd = 0;
|
||||
pen.x = pen.y = 0;
|
||||
previous = 0; /* clear kerning flag */
|
||||
continue;
|
||||
@@ -1073,31 +1070,32 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
/* retrieve kerning distance and move pen position */
|
||||
if (use_kerning && previous && glyph_index) {
|
||||
FT_Get_Kerning(face, previous, glyph_index, ft_kerning_default, &delta);
|
||||
pen.x += delta.x;
|
||||
pen.x += (int)(delta.x * cos_a);
|
||||
pen.y -= (int)(delta.x * sin_a);
|
||||
penf.x += delta.x;
|
||||
}
|
||||
|
||||
/* load glyph image into the slot (erase previous one) */
|
||||
if (FT_Load_Glyph(face, glyph_index, render_mode)) {
|
||||
if (tmpstr) {
|
||||
gdFree(tmpstr);
|
||||
}
|
||||
gdCacheDelete(tc_cache);
|
||||
gdMutexUnlock(gdFontCacheMutex);
|
||||
return "Problem loading glyph";
|
||||
}
|
||||
|
||||
/* transform glyph image */
|
||||
if (FT_Get_Glyph(slot, &image)) {
|
||||
if (tmpstr) {
|
||||
gdFree(tmpstr);
|
||||
}
|
||||
gdCacheDelete(tc_cache);
|
||||
gdMutexUnlock(gdFontCacheMutex);
|
||||
return "Problem loading glyph";
|
||||
}
|
||||
|
||||
if (brect) { /* only if need brect */
|
||||
/* load glyph image into the slot (erase previous one) */
|
||||
if (FT_Load_Glyph(face, glyph_index, render_mode | FT_LOAD_IGNORE_TRANSFORM)) {
|
||||
if (tmpstr) {
|
||||
gdFree(tmpstr);
|
||||
}
|
||||
gdCacheDelete(tc_cache);
|
||||
gdMutexUnlock(gdFontCacheMutex);
|
||||
return "Problem loading glyph";
|
||||
}
|
||||
|
||||
/* transform glyph image */
|
||||
if (FT_Get_Glyph(slot, &image)) {
|
||||
if (tmpstr) {
|
||||
gdFree(tmpstr);
|
||||
}
|
||||
gdCacheDelete(tc_cache);
|
||||
gdMutexUnlock(gdFontCacheMutex);
|
||||
return "Problem loading glyph";
|
||||
}
|
||||
|
||||
FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox);
|
||||
glyph_bbox.xMin += penf.x;
|
||||
glyph_bbox.yMin += penf.y;
|
||||
@@ -1107,17 +1105,11 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
glyph_bbox.xMax += slot->metrics.horiAdvance;
|
||||
}
|
||||
if (!i) { /* if first character, init BB corner values */
|
||||
yd = slot->metrics.height - slot->metrics.horiBearingY;
|
||||
bbox.xMin = glyph_bbox.xMin;
|
||||
bbox.yMin = glyph_bbox.yMin;
|
||||
bbox.xMax = glyph_bbox.xMax;
|
||||
bbox.yMax = glyph_bbox.yMax;
|
||||
} else {
|
||||
FT_Pos desc;
|
||||
|
||||
if ( (desc = (slot->metrics.height - slot->metrics.horiBearingY)) > yd) {
|
||||
yd = desc;
|
||||
}
|
||||
if (bbox.xMin > glyph_bbox.xMin) {
|
||||
bbox.xMin = glyph_bbox.xMin;
|
||||
}
|
||||
@@ -1134,7 +1126,35 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
i++;
|
||||
}
|
||||
|
||||
/* increment (unrotated) pen position */
|
||||
penf.x += slot->metrics.horiAdvance;
|
||||
|
||||
if (render) {
|
||||
if (!brect || angle != 0) {
|
||||
/* reload the rotated glyph (for bbox we needed FT_LOAD_IGNORE_TRANSFORM - bbox is rotated later) */
|
||||
FT_Done_Glyph(image);
|
||||
|
||||
/* load glyph image into the slot (erase previous one) */
|
||||
if (FT_Load_Glyph(face, glyph_index, render_mode)) {
|
||||
if (tmpstr) {
|
||||
gdFree(tmpstr);
|
||||
}
|
||||
gdCacheDelete(tc_cache);
|
||||
gdMutexUnlock(gdFontCacheMutex);
|
||||
return "Problem loading glyph";
|
||||
}
|
||||
|
||||
/* transform glyph image */
|
||||
if (FT_Get_Glyph(slot, &image)) {
|
||||
if (tmpstr) {
|
||||
gdFree(tmpstr);
|
||||
}
|
||||
gdCacheDelete(tc_cache);
|
||||
gdMutexUnlock(gdFontCacheMutex);
|
||||
return "Problem loading glyph";
|
||||
}
|
||||
}
|
||||
|
||||
if (image->format != ft_glyph_format_bitmap && FT_Glyph_To_Bitmap(&image, ft_render_mode_normal, 0, 1)) {
|
||||
FT_Done_Glyph(image);
|
||||
if (tmpstr) {
|
||||
@@ -1157,8 +1177,6 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
pen.x += image->advance.x >> 10;
|
||||
pen.y -= image->advance.y >> 10;
|
||||
|
||||
penf.x += slot->metrics.horiAdvance;
|
||||
|
||||
FT_Done_Glyph(image);
|
||||
}
|
||||
|
||||
@@ -1167,36 +1185,25 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
double d1 = sin (angle + 0.78539816339744830962);
|
||||
double d2 = sin (angle - 0.78539816339744830962);
|
||||
|
||||
/* make the center of rotation at (0, 0) */
|
||||
FT_BBox normbox;
|
||||
|
||||
normbox.xMin = 0;
|
||||
normbox.yMin = 0;
|
||||
normbox.xMax = bbox.xMax - bbox.xMin;
|
||||
normbox.yMax = bbox.yMax - bbox.yMin;
|
||||
|
||||
brect[0] = brect[2] = brect[4] = brect[6] = (int) (yd * sin_a);
|
||||
brect[1] = brect[3] = brect[5] = brect[7] = (int)(- yd * cos_a);
|
||||
|
||||
/* rotate bounding rectangle */
|
||||
brect[0] += (int) (normbox.xMin * cos_a - normbox.yMin * sin_a);
|
||||
brect[1] += (int) (normbox.xMin * sin_a + normbox.yMin * cos_a);
|
||||
brect[2] += (int) (normbox.xMax * cos_a - normbox.yMin * sin_a);
|
||||
brect[3] += (int) (normbox.xMax * sin_a + normbox.yMin * cos_a);
|
||||
brect[4] += (int) (normbox.xMax * cos_a - normbox.yMax * sin_a);
|
||||
brect[5] += (int) (normbox.xMax * sin_a + normbox.yMax * cos_a);
|
||||
brect[6] += (int) (normbox.xMin * cos_a - normbox.yMax * sin_a);
|
||||
brect[7] += (int) (normbox.xMin * sin_a + normbox.yMax * cos_a);
|
||||
/* rotate bounding rectangle (at 0, 0) */
|
||||
brect[0] = (int) (bbox.xMin * cos_a - bbox.yMin * sin_a);
|
||||
brect[1] = (int) (bbox.xMin * sin_a + bbox.yMin * cos_a);
|
||||
brect[2] = (int) (bbox.xMax * cos_a - bbox.yMin * sin_a);
|
||||
brect[3] = (int) (bbox.xMax * sin_a + bbox.yMin * cos_a);
|
||||
brect[4] = (int) (bbox.xMax * cos_a - bbox.yMax * sin_a);
|
||||
brect[5] = (int) (bbox.xMax * sin_a + bbox.yMax * cos_a);
|
||||
brect[6] = (int) (bbox.xMin * cos_a - bbox.yMax * sin_a);
|
||||
brect[7] = (int) (bbox.xMin * sin_a + bbox.yMax * cos_a);
|
||||
|
||||
/* scale, round and offset brect */
|
||||
brect[0] = xb + gdroundupdown(brect[0], d2 > 0);
|
||||
brect[1] = yb - gdroundupdown(brect[1], d1 < 0);
|
||||
brect[2] = xb + gdroundupdown(brect[2], d1 > 0);
|
||||
brect[3] = yb - gdroundupdown(brect[3], d2 > 0);
|
||||
brect[4] = xb + gdroundupdown(brect[4], d2 < 0);
|
||||
brect[5] = yb - gdroundupdown(brect[5], d1 > 0);
|
||||
brect[6] = xb + gdroundupdown(brect[6], d1 < 0);
|
||||
brect[7] = yb - gdroundupdown(brect[7], d2 < 0);
|
||||
brect[0] = x + gdroundupdown(brect[0], d2 > 0);
|
||||
brect[1] = y - gdroundupdown(brect[1], d1 < 0);
|
||||
brect[2] = x + gdroundupdown(brect[2], d1 > 0);
|
||||
brect[3] = y - gdroundupdown(brect[3], d2 > 0);
|
||||
brect[4] = x + gdroundupdown(brect[4], d2 < 0);
|
||||
brect[5] = y - gdroundupdown(brect[5], d1 > 0);
|
||||
brect[6] = x + gdroundupdown(brect[6], d1 < 0);
|
||||
brect[7] = y - gdroundupdown(brect[7], d2 < 0);
|
||||
}
|
||||
|
||||
if (tmpstr) {
|
||||
|
||||
@@ -8,16 +8,13 @@ Bug #22544 (TrueColor transparency in PNG images).
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dest = dirname(realpath(__FILE__)) . '/bug22544.png';
|
||||
@unlink($dest);
|
||||
$image = imageCreateTruecolor(640, 100);
|
||||
$transparent = imageColorAllocate($image, 0, 0, 0);
|
||||
$red = imageColorAllocate($image, 255, 50, 50);
|
||||
imageColorTransparent($image, $transparent);
|
||||
imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
|
||||
imagePng($image, $dest);
|
||||
echo md5_file($dest) . "\n";
|
||||
@unlink($dest);
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug22544.png', $image);
|
||||
?>
|
||||
--EXPECT--
|
||||
10a57d09a2c63fad87b85b38d6b258d6
|
||||
The images are equal.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 284 B |
+48
-24
@@ -1,29 +1,53 @@
|
||||
--TEST--
|
||||
Bug #43073 (TrueType bounding box is wrong for angle<>0) freetype < 2.4.10
|
||||
Bug #43073 (TrueType bounding box is wrong for angle<>0)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
|
||||
if(!function_exists('imagettftext')) die('skip imagettftext() not available');
|
||||
|
||||
include dirname(__FILE__) . '/func.inc';
|
||||
if(version_compare(get_freetype_version(), '2.4.10') >= 0) die('skip for freetype < 2.4.10');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$exp = [
|
||||
[501,400, 611,400, 611,376, 501,376],
|
||||
[492,361, 595,319, 586,296, 483,338],
|
||||
[470,329, 549,251, 531,233, 453,312],
|
||||
[439,307, 481,204, 458,195, 416,297],
|
||||
[400,299, 400,189, 376,189, 376,299],
|
||||
[361,307, 319,204, 296,213, 338,316],
|
||||
[329,329, 251,250, 233,267, 311,346],
|
||||
[307,360, 204,318, 195,341, 297,383],
|
||||
[299,400, 189,400, 189,424, 299,424],
|
||||
[307,438, 204,480, 213,503, 316,461],
|
||||
[329,470, 250,548, 267,566, 346,488],
|
||||
[360,492, 318,595, 341,604, 383,502],
|
||||
[400,501, 400,611, 424,611, 424,501],
|
||||
[438,492, 480,595, 503,586, 461,483],
|
||||
[470,470, 548,549, 566,532, 488,453],
|
||||
[492,439, 595,481, 604,458, 502,416]
|
||||
];
|
||||
$cwd = dirname(__FILE__);
|
||||
$font = "$cwd/Tuffy.ttf";
|
||||
$delta_t = 360.0 / 16; # Make 16 steps around
|
||||
$g = imagecreate(800, 800);
|
||||
$bgnd = imagecolorallocate($g, 255, 255, 255);
|
||||
$black = imagecolorallocate($g, 0, 0, 0);
|
||||
$red = imagecolorallocate($g, 255, 0, 0);
|
||||
$x = 100;
|
||||
$y = 0;
|
||||
$cos_t = cos(deg2rad($delta_t));
|
||||
$sin_t = sin(deg2rad($delta_t));
|
||||
for ($angle = 0.0; $angle < 360.0; $angle += $delta_t) {
|
||||
for ($angle = 0.0, $i = 0; $angle < 360.0; $angle += $delta_t, $i++) {
|
||||
$bbox = imagettftext($g, 24, $angle, 400+$x, 400+$y, $black, $font, 'ABCDEF');
|
||||
$s = vsprintf("(%d, %d), (%d, %d), (%d, %d), (%d, %d)\n", $bbox);
|
||||
echo $s;
|
||||
imagepolygon($g, $bbox, 4, $red);
|
||||
printf("%2d: ", $i);
|
||||
for ($j = 0; $j < 8; $j++) {
|
||||
if ($bbox[$j] >= $exp[$i][$j] - 1 && $bbox[$j] <= $exp[$i][$j] + 1) {
|
||||
echo '.';
|
||||
} else {
|
||||
echo "(expected $exp[$i][$j], got $bbox[$j])";
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
$temp = $cos_t * $x + $sin_t * $y;
|
||||
$y = $cos_t * $y - $sin_t * $x;
|
||||
$x = $temp;
|
||||
@@ -32,20 +56,20 @@ imagepng($g, "$cwd/bug43073.png");
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug43073.png'); ?>
|
||||
--EXPECTF--
|
||||
(500, 40%d), (610, 40%d), (610, 376), (500, 376)
|
||||
(492, 363), (591, 322), (580, 295), (480, 336)
|
||||
(470, 331), (548, 254), (527, 233), (449, 310)
|
||||
(439, 309), (483, 202), (461, 193), (416, 299)
|
||||
(40%d, 300), (40%d, 183), (38%d, 183), (38%d, 300)
|
||||
(362, 307), (316, 195), (291, 205), (337, 318)
|
||||
(330, 329), (246, 244), (224, 265), (308, 350)
|
||||
(308, 360), (202, 316), (190, 344), (296, 388)
|
||||
(300, %d), (18%d, %d), (18%d, 425), (%d, 425)
|
||||
(306, 437), (195, 483), (206, 510), (318, 464)
|
||||
(328, 469), (240, 557), (260, 578), (349, 491)
|
||||
(359, 491), (312, 607), (334, 616), (382, 501)
|
||||
(%d, 500), (%d, 618), (41%d, 618), (41%d, 500)
|
||||
(436, 493), (483, 607), (507, 597), (461, 482)
|
||||
(468, 471), (555, 558), (577, 538), (490, 450)
|
||||
(490, 440), (600, 485), (611, 457), (502, 412)
|
||||
--EXPECT--
|
||||
0: ........
|
||||
1: ........
|
||||
2: ........
|
||||
3: ........
|
||||
4: ........
|
||||
5: ........
|
||||
6: ........
|
||||
7: ........
|
||||
8: ........
|
||||
9: ........
|
||||
10: ........
|
||||
11: ........
|
||||
12: ........
|
||||
13: ........
|
||||
14: ........
|
||||
15: ........
|
||||
@@ -1,51 +0,0 @@
|
||||
--TEST--
|
||||
Bug #43073 (TrueType bounding box is wrong for angle<>0) freetype >= 2.4.10
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
|
||||
if(!function_exists('imagettftext')) die('skip imagettftext() not available');
|
||||
|
||||
include dirname(__FILE__) . '/func.inc';
|
||||
if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
$font = "$cwd/Tuffy.ttf";
|
||||
$delta_t = 360.0 / 16; # Make 16 steps around
|
||||
$g = imagecreate(800, 800);
|
||||
$bgnd = imagecolorallocate($g, 255, 255, 255);
|
||||
$black = imagecolorallocate($g, 0, 0, 0);
|
||||
$x = 100;
|
||||
$y = 0;
|
||||
$cos_t = cos(deg2rad($delta_t));
|
||||
$sin_t = sin(deg2rad($delta_t));
|
||||
for ($angle = 0.0; $angle < 360.0; $angle += $delta_t) {
|
||||
$bbox = imagettftext($g, 24, $angle, 400+$x, 400+$y, $black, $font, 'ABCDEF');
|
||||
$s = vsprintf("(%d, %d), (%d, %d), (%d, %d), (%d, %d)\n", $bbox);
|
||||
echo $s;
|
||||
$temp = $cos_t * $x + $sin_t * $y;
|
||||
$y = $cos_t * $y - $sin_t * $x;
|
||||
$x = $temp;
|
||||
}
|
||||
imagepng($g, "$cwd/bug43073.png");
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug43073.png'); ?>
|
||||
--EXPECTF--
|
||||
(500, 400), (610, 400), (610, 376), (500, 376)
|
||||
(492, 363), (591, 322), (580, 295), (480, 336)
|
||||
(470, 331), (548, 254), (527, 233), (449, 310)
|
||||
(439, 309), (483, 202), (461, 193), (416, 299)
|
||||
(400, 300), (400, 183), (380, 183), (380, 300)
|
||||
(362, 307), (316, 195), (291, 205), (337, 318)
|
||||
(330, 329), (246, 244), (224, 265), (308, 350)
|
||||
(308, 360), (202, 316), (190, 344), (296, 388)
|
||||
(300, 400), (187, 400), (187, 425), (300, 425)
|
||||
(306, 437), (195, 483), (206, 510), (318, 464)
|
||||
(328, 469), (240, 557), (260, 578), (349, 491)
|
||||
(359, 491), (312, 607), (334, 616), (382, 501)
|
||||
(400, 500), (400, 618), (419, 618), (419, 500)
|
||||
(436, 493), (483, 607), (507, 597), (461, 482)
|
||||
(468, 471), (555, 558), (577, 538), (490, 450)
|
||||
(490, 440), (600, 485), (611, 457), (502, 412)
|
||||
@@ -3,6 +3,9 @@ Bug #43121 (gdImageFill with IMG_COLOR_TILED crashes httpd)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) {
|
||||
die("skip test requires GD 2.2.0 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Loaded 100 of 484 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user