Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcc232173e | ||
|
|
6887c4a061 | ||
|
|
48b5a1f9b9 | ||
|
|
3a058e3817 | ||
|
|
f36babf643 | ||
|
|
39e5991705 | ||
|
|
5e102d5685 | ||
|
|
4f0960a800 | ||
|
|
eaee65080e | ||
|
|
5dd3ea1567 | ||
|
|
66baefec44 | ||
|
|
d279118422 | ||
|
|
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 | ||
|
|
eeb9113b6c | ||
|
|
3c16384ea2 | ||
|
|
4dd70b6e2f | ||
|
|
ba2d9e1ff1 | ||
|
|
fc2cadca2d | ||
|
|
ca24c58e65 | ||
|
|
56fa36b0a8 | ||
|
|
c4f3ea10e4 | ||
|
|
1ed4b13fb6 | ||
|
|
01759c4346 | ||
|
|
896814e139 | ||
|
|
48cf8dd9c3 | ||
|
|
6682673070 | ||
|
|
0e76cafaf1 | ||
|
|
0ad82e41f2 | ||
|
|
01c7c6b152 | ||
|
|
ac07008bb7 | ||
|
|
c18263e0e0 | ||
|
|
46df064261 | ||
|
|
d2d77c028d | ||
|
|
3c117d4136 | ||
|
|
19e04784ac | ||
|
|
55237fe153 | ||
|
|
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 | ||
|
|
3a8c027ec3 | ||
|
|
f5622f5c87 | ||
|
|
072af35b5c | ||
|
|
e95625f47e | ||
|
|
40b3a031b2 | ||
|
|
90c6cbd09b | ||
|
|
5c51433e2a | ||
|
|
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
|
||||
|
||||
@@ -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,6 +1,225 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2016 PHP 7.0.10
|
||||
29 Sep 2016 PHP 7.0.12RC1
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73067 (__debugInfo crashes when throwing an exception).
|
||||
(Laruence)
|
||||
. 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)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #73126 (Cannot pass parameter 1 by reference). (Anatol)
|
||||
|
||||
- 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)
|
||||
|
||||
- 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)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #73121 (Bundled PCRE doesn't compile because JIT isn't supported
|
||||
on s390). (Anatol)
|
||||
|
||||
- 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)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #71711 (Soap Server Member variables reference bug). (Nikita)
|
||||
. Fixed bug #71996 (Using references in arrays doesn't work like expected).
|
||||
(Nikita)
|
||||
|
||||
- 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)
|
||||
|
||||
- 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
|
||||
@@ -22,7 +241,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
|
||||
@@ -37,10 +267,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)
|
||||
@@ -57,6 +292,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
|
||||
@@ -74,6 +311,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)
|
||||
@@ -83,8 +323,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).
|
||||
@@ -94,6 +332,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
|
||||
@@ -125,6 +367,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
|
||||
@@ -134,7 +378,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).
|
||||
@@ -1266,6 +1515,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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,21 @@
|
||||
--TEST--
|
||||
Bug #73067 (__debugInfo crashes when throwing an exception)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Debug
|
||||
{
|
||||
public function __debugInfo()
|
||||
{
|
||||
throw new Exception("Test Crash");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(new Debug());
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %sbug73067.php on line %d
|
||||
@@ -0,0 +1,50 @@
|
||||
--TEST--
|
||||
iBug #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 #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"
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -665,13 +665,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 +1032,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 */
|
||||
|
||||
@@ -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");
|
||||
@@ -2646,9 +2646,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
@@ -575,6 +576,7 @@ static inline zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_execu
|
||||
static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *value_ptr)
|
||||
{
|
||||
zend_reference *ref;
|
||||
zval garbage;
|
||||
|
||||
if (EXPECTED(!Z_ISREF_P(value_ptr))) {
|
||||
ZVAL_NEW_REF(value_ptr, value_ptr);
|
||||
@@ -584,15 +586,18 @@ 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);
|
||||
ZVAL_COPY_VALUE(&garbage, variable_ptr);
|
||||
ZVAL_REF(variable_ptr, ref);
|
||||
zval_ptr_dtor(&garbage);
|
||||
}
|
||||
|
||||
/* this should modify object only if it's empty */
|
||||
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 +827,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 +1335,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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -2465,7 +2465,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);
|
||||
}
|
||||
|
||||
@@ -182,6 +182,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp) /* {{{ *
|
||||
return ht;
|
||||
}
|
||||
|
||||
zend_clear_exception();
|
||||
zend_error_noreturn(E_ERROR, ZEND_DEBUGINFO_FUNC_NAME "() must return an array");
|
||||
|
||||
return NULL; /* Compilers are dumb and don't understand that noreturn means that the function does NOT need a return value... */
|
||||
@@ -197,11 +198,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 +208,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 +216,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,8 @@ typedef unsigned long int uint32_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
#define USE_LOCALE 1
|
||||
#ifdef USE_LOCALE
|
||||
#undef USE_LOCALE
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=10
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=12
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
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`
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -1893,8 +1893,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 +3518,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 +3530,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 +3561,7 @@ PHP_FUNCTION(curl_unescape)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (str_len > INT_MAX) {
|
||||
if (ZEND_SIZE_T_INT_OVFL(str_len)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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===
|
||||
@@ -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)
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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") ||
|
||||
|
||||
@@ -1444,6 +1444,7 @@ PHP_FUNCTION(imagesetstyle)
|
||||
gdImagePtr im;
|
||||
int *stylearr;
|
||||
int index = 0;
|
||||
uint32_t num_styles;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &styles) == FAILURE) {
|
||||
return;
|
||||
@@ -1453,8 +1454,14 @@ PHP_FUNCTION(imagesetstyle)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
num_styles = zend_hash_num_elements(Z_ARRVAL_P(styles));
|
||||
if (num_styles == 0) {
|
||||
php_error_docref(NULL, E_WARNING, "styles array must not be empty");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* copy the style values in the stylearr */
|
||||
stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(Z_ARRVAL_P(styles)), 0);
|
||||
stylearr = safe_emalloc(sizeof(int), num_styles, 0);
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(styles), item) {
|
||||
stylearr[index++] = zval_get_long(item);
|
||||
@@ -1514,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;
|
||||
@@ -1530,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;
|
||||
@@ -2539,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3032,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;
|
||||
}
|
||||
@@ -3844,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;
|
||||
@@ -4059,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;
|
||||
}
|
||||
|
||||
@@ -4067,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;
|
||||
@@ -4077,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;
|
||||
@@ -4087,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;
|
||||
@@ -4094,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);
|
||||
|
||||
@@ -4128,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;
|
||||
}
|
||||
|
||||
@@ -4135,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -2245,7 +2245,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 +2264,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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
After Width: | Height: | Size: 284 B |
@@ -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
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #43475 (Thick styled lines have scrambled patterns)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #43828 (broken transparency of imagearc for truecolor in blendingmode)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip ext/gd not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -14,10 +17,10 @@ imagefilledrectangle($im, 0,0, 99,99, $transparent);
|
||||
$color = imagecolorallocatealpha($im, 0, 255, 0, 100);
|
||||
imagefilledarc($im, 49, 49, 99,99, 0 , 360, $color, IMG_ARC_PIE);
|
||||
|
||||
ob_start();
|
||||
imagepng($im);
|
||||
echo md5(ob_get_clean());
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug43828.png', $im);
|
||||
|
||||
imagedestroy($im);
|
||||
?>
|
||||
--EXPECT--
|
||||
3d82e4525f19790ae1055366e2a36917
|
||||
The images are equal.
|
||||
|
After Width: | Height: | Size: 656 B |
@@ -19,4 +19,4 @@ echo 'Left Bottom: (' . $bbox[0] . ', ' . $bbox[1] . ')';
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug48732.png'); ?>
|
||||
--EXPECTF--
|
||||
Left Bottom: (0, 47)
|
||||
Left Bottom: (0, 46)
|
||||
@@ -1,12 +1,9 @@
|
||||
--TEST--
|
||||
Bug #48801 (Problem with imagettfbbox) freetype < 2.4.10
|
||||
Bug #48801 (Problem with imagettfbbox)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
|
||||
if(!function_exists('imageftbbox')) die('skip imageftbbox() 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
|
||||
@@ -18,8 +15,8 @@ echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n";
|
||||
echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
|
||||
echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
(-1, 15)
|
||||
(15%d, 15)
|
||||
(15%d, -48)
|
||||
(-1, -48)
|
||||
--EXPECTREGEX--
|
||||
\(4, 15\)
|
||||
\(16[0-1], 15\)
|
||||
\(16[0-1], -4[7-8]\)
|
||||
\(4, -4[7-8]\)
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
|
||||
if(!function_exists('imageftbbox')) die('skip imageftbbox() 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";
|
||||
$bbox = imageftbbox(50, 0, $font, "image");
|
||||
echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
|
||||
echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n";
|
||||
echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
|
||||
echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
(-1, 15)
|
||||
(15%d, 15)
|
||||
(15%d, -48)
|
||||
(-1, -48)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #50194 (imagettftext broken on transparent background w/o alphablending)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!function_exists('imagettftext')) die('skip imagettftext() not available');
|
||||
//die('skip freetype issues');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
|
||||
|
||||
$im = imagecreatetruecolor(240, 55);
|
||||
$background = imagecolorallocatealpha($im, 60, 60, 60, 0); // no tranparency
|
||||
$black = imagecolorallocate($im, 0, 0, 0);
|
||||
imagealphablending($im, false);
|
||||
imagefilledrectangle($im, 0, 0, 239, 54, $background);
|
||||
$text = 'Testing ... ';
|
||||
$font = __DIR__ . DIRECTORY_SEPARATOR . 'Tuffy.ttf';
|
||||
imagettftext($im, 40, 0, 10, 40, $black, $font, $text);
|
||||
imagesavealpha($im, true);
|
||||
|
||||
ob_start();
|
||||
test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'bug50194.png', $im);
|
||||
$output = ob_get_clean();
|
||||
assert(preg_match('/The images are equal|The images differ in (\d+) pixels/', $output, $matches));
|
||||
if (isset($matches[1]) && $matches[1] > 2000) {
|
||||
echo "The images differ in {$matches[1]} pixels.\n";
|
||||
} else {
|
||||
echo "The images are similar.\n";
|
||||
}
|
||||
|
||||
imagedestroy($im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are similar.
|
||||
===DONE===
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -3,6 +3,9 @@ Bug #53154 (Zero-height rectangle has whiskers)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #53156 (imagerectangle problem with point ordering)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.3', '<')) {
|
||||
die("skip test requires GD 2.3 or newer");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
--TEST--
|
||||
Bug #53504 imagettfbbox/imageftbbox gives incorrect values for bounding box
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
|
||||
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
$font = "$cwd/Tuffy.ttf";
|
||||
|
||||
$g = imagecreate(800, 800);
|
||||
$bgnd = imagecolorallocate($g, 255, 255, 255);
|
||||
$black = imagecolorallocate($g, 0, 0, 0);
|
||||
$red = imagecolorallocate($g, 255, 0, 0);
|
||||
$blue = imagecolorallocate($g, 0, 0, 255);
|
||||
|
||||
$tests = [
|
||||
// Kerning examples (unfortunately not available in "Tuffy" test font):
|
||||
['fontSize' => 50, 'angle' => 0, 'x' => 20, 'y' => 70, 'text' => 'AV Teg', 'exp' => [2,15, 208,15, 208,-48, 2,-48]],
|
||||
['fontSize' => 50, 'angle' => 90, 'x' => 70, 'y' => 350, 'text' => 'AV Teg', 'exp' => [15,-1, 15,-208, -48,-208, -48,-2]],
|
||||
['fontSize' => 50, 'angle' => 40, 'x' => 130, 'y' => 280, 'text' => 'AV Teg', 'exp' => [11,11, 169,-122, 129,-171, -30,-39]],
|
||||
|
||||
// Shift-Test:
|
||||
['fontSize' => 100, 'angle' => 0, 'x' => 350, 'y' => 110, 'text' => 'H-Shift', 'exp' => [8,2, 386,2, 386,-97, 8,-97]],
|
||||
|
||||
// Small/single chars:
|
||||
['fontSize' => 100, 'angle' => 0, 'x' => 350, 'y' => 220, 'text' => '-', 'exp' => [7,-37, 51,-37, 51,-46, 7,-46]],
|
||||
['fontSize' => 100, 'angle' => 0, 'x' => 430, 'y' => 220, 'text' => ',', 'exp' => [7,15, 21,15, 21,-13, 7,-13]],
|
||||
['fontSize' => 100, 'angle' => 0, 'x' => 510, 'y' => 220, 'text' => '.', 'exp' => [7,1, 21,1, 21,-13, 7,-13]],
|
||||
['fontSize' => 100, 'angle' => 0, 'x' => 590, 'y' => 220, 'text' => '|', 'exp' => [8,0, 17,0, 17,-95, 8,-95]],
|
||||
['fontSize' => 100, 'angle' => 0, 'x' => 670, 'y' => 220, 'text' => 'g', 'exp' => [5,29, 60,29, 60,-72, 5,-72]],
|
||||
|
||||
// Multi-Line + rotation:
|
||||
['fontSize' => 30, 'angle' => 0, 'x' => 20, 'y' => 400, 'text' => "Multi\nLine\nTest", 'exp' => [2,107, 80,107, 80,-29, 2,-29]],
|
||||
['fontSize' => 30, 'angle' => 40, 'x' => 150, 'y' => 420, 'text' => "Multi\nLine\nTest", 'exp' => [70,81, 131,31, 43,-74, -18,-24]],
|
||||
['fontSize' => 30, 'angle' => 90, 'x' => 250, 'y' => 340, 'text' => "Multi\nLine\nTest", 'exp' => [107,-1, 107,-80, -29,-80, -29,-2]],
|
||||
|
||||
// Some edge case glyphs:
|
||||
['fontSize' => 50, 'angle' => 90, 'x' => 70, 'y' => 750, 'text' => "iiiiiiiiiiii", 'exp' => [0,-4, 0,-165, -47,-165, -47,-4]],
|
||||
['fontSize' => 50, 'angle' => 90, 'x' => 150, 'y' => 750, 'text' => "~~~~~~~", 'exp' => [-19,-2, -18,-167, -29,-167, -29,-2]],
|
||||
['fontSize' => 50, 'angle' => 50, 'x' => 210, 'y' => 750, 'text' => "iiiiiiiiiiii", 'exp' => [3,-3, 107,-127, 70,-157, -34,-33]],
|
||||
['fontSize' => 50, 'angle' => 50, 'x' => 300, 'y' => 750, 'text' => "~~~~~~~", 'exp' => [-13,-13, 93,-141, 85,-147, -21,-20]],
|
||||
['fontSize' => 50, 'angle' => 0, 'x' => 430, 'y' => 650, 'text' => "iiiiiiiiiiii", 'exp' => [4,0, 165,0, 165,-47, 4,-47]],
|
||||
['fontSize' => 50, 'angle' => 0, 'x' => 430, 'y' => 750, 'text' => "~~~~~~~", 'exp' => [2,-19, 167,-19, 167,-29, 2,-29]],
|
||||
|
||||
// "Big" test:
|
||||
['fontSize' => 200, 'angle' => 0, 'x' => 400, 'y' => 500, 'text' => "Big", 'exp' => [16,59, 329,59, 329,-190, 16,-190]],
|
||||
];
|
||||
|
||||
foreach ($tests as $testnum => $test) {
|
||||
$bbox = imageftbbox($test['fontSize'], $test['angle'], $font, $test['text']);
|
||||
printf('%2d: ', $testnum);
|
||||
for ($i = 0; $i < 8; $i++) {
|
||||
$exp = $test['exp'][$i];
|
||||
if ($bbox[$i] >= $exp - 2 && $bbox[$i] <= $exp + 2) {
|
||||
echo '.';
|
||||
} else {
|
||||
echo "(expected $exp, got $bbox[$i])";
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
$bboxDrawn = imagefttext($g, $test['fontSize'], $test['angle'],
|
||||
$test['x'], $test['y'], $black, $font, $test['text']);
|
||||
|
||||
// check if both bboxes match when adding x/y offset:
|
||||
for ($i = 0; $i < count($bbox); $i += 2) {
|
||||
if ($bbox[$i] + $test['x'] !== $bboxDrawn[$i]) echo "imageftbbox and imagefttext differ!\n";
|
||||
if ($bbox[$i + 1] + $test['y'] !== $bboxDrawn[$i + 1]) echo "imageftbbox and imagefttext differ!\n";
|
||||
}
|
||||
|
||||
// draw bounding box:
|
||||
imagepolygon($g, $bboxDrawn, 4, $red);
|
||||
|
||||
// draw baseline:
|
||||
$width = sqrt(pow($bboxDrawn[2] - $bboxDrawn[0], 2) + pow($bboxDrawn[3] - $bboxDrawn[1], 2));
|
||||
imageline($g, $test['x'], $test['y'],
|
||||
$test['x'] + $width * cos(deg2rad($test['angle'])),
|
||||
$test['y'] - $width * sin(deg2rad($test['angle'])), $blue);
|
||||
}
|
||||
|
||||
imagepng($g, "$cwd/bug53504.png");
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug53504.png'); ?>
|
||||
--EXPECT--
|
||||
0: ........
|
||||
1: ........
|
||||
2: ........
|
||||
3: ........
|
||||
4: ........
|
||||
5: ........
|
||||
6: ........
|
||||
7: ........
|
||||
8: ........
|
||||
9: ........
|
||||
10: ........
|
||||
11: ........
|
||||
12: ........
|
||||
13: ........
|
||||
14: ........
|
||||
15: ........
|
||||
16: ........
|
||||
17: ........
|
||||
18: ........
|
||||
@@ -3,6 +3,9 @@ Bug #53640 (XBM images require width to be multiple of 8)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.3', '<')) {
|
||||
die("skip test requires GD 2.2.3 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #66005 (imagecopy does not support 1bit transparency on truecolor images)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dest = imagecreatetruecolor(150, 50);
|
||||
$transparent = imagecolorallocatealpha($dest, 255, 255, 255, 127);
|
||||
imagealphablending($dest, false);
|
||||
imagefill($dest, 1, 1, $transparent);
|
||||
imagesavealpha($dest, true);
|
||||
|
||||
// Palette image with transparent color
|
||||
$png_palette = imagecreatefromstring(base64_decode('iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAACVBMVEUAAAD/AAD///9nGWQeAAAAAXRSTlMAQObYZgAAAEFJREFUKM9jYBimIASZIxoagOAwhoaGInisQJ4DksJQJKWoPCAnNIQYHsgChBX4eMSbiddlqH5A9R+q39HCZWgDAFxFGyOrmguhAAAAAElFTkSuQmCCPHP'));
|
||||
|
||||
// 24 bit with transparent color
|
||||
$png_24 = imagecreatefromstring(base64_decode('iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABnRSTlMAAAAAAABupgeRAAAAVklEQVRYw+3UQQqAMBAEwf3/p9eTBxEPiWAmWMU8oGFJqgAAuOpzWTX3xQUti+uRJTZ9V5aY1bOTFZLV7yZr9zt6ibv/qPXfrMpsGipbIy7oqQ8AYJED1plDy5PCu2sAAAAASUVORK5CYII='));
|
||||
|
||||
// 32 bit with full alpha channel
|
||||
$png_full = imagecreatefromstring(base64_decode('iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAXklEQVRo3u3XMQrAIBBFwb3/pU2VwiJNIvjdzMD2PlBwqwAAAGajatxz9OGf5viA+KA3EXExXyKiYlqErIiIiBGSFLIyYmuMkO7Xy2MX4ovS/ONoH7Eh/m1nBwCASBe3VYeVaAy8PwAAAABJRU5ErkJggg=='));
|
||||
|
||||
imagecopy($dest, $png_palette, 0, 0, 0, 0, 50, 50);
|
||||
imagecopy($dest, $png_24, 50, 0, 0, 0, 50, 50);
|
||||
imagecopy($dest, $png_full, 100, 0, 0, 0, 50, 50);
|
||||
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug66005.png', $dest);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
==DONE==
|
||||
|
After Width: | Height: | Size: 430 B |
@@ -3,6 +3,9 @@ Bug #66387 (Stack overflow with imagefilltoborder)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available!');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.1', '<')) {
|
||||
die("skip test requires GD 2.2.1 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #66590 (imagewebp() doesn't pad to even length)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) {
|
||||
die("skip test requires GD 2.2.0 or higher");
|
||||
}
|
||||
if (!function_exists('imagewebp')) die('skip WebP support not available');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #67325 (imagetruecolortopalette: white is duplicated in palette)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.3', '<=')) {
|
||||
die("skip test requires newer than GD 2.2.3");
|
||||
}
|
||||
if (!(imagetypes() & IMG_JPG)) die('skip JPEG support not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug67325.jpeg';
|
||||
|
||||
$im = imagecreatefromjpeg($filename);
|
||||
imagetruecolortopalette($im, 0, 256);
|
||||
|
||||
$white = 0;
|
||||
for ($i = 0; $i < 256; $i++) {
|
||||
$components = imagecolorsforindex($im, $i);
|
||||
if ($components['red'] === 255 && $components['green'] === 255 && $components['blue'] === 255) {
|
||||
$white++;
|
||||
}
|
||||
}
|
||||
var_dump($white);
|
||||
|
||||
imagedestroy($im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(0)
|
||||
===DONE===
|
||||
@@ -1,5 +1,11 @@
|
||||
--TEST--
|
||||
Bug #67447 (imagecrop() adds a black line when cropping)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not available\n");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
// true color
|
||||
@@ -17,10 +23,19 @@ imagecolorallocate($image, 0, 0, 255); // first palette color = background
|
||||
$red = imagecolorallocate($image, 255, 0, 0);
|
||||
imagefill($image, 0, 0, $red);
|
||||
$cropped = imagecrop($image, ['x' => 0, 'y' => 0, 'width' => 250, 'height' => 250]);
|
||||
var_dump(imagecolorat($cropped, 249, 249) === $red);
|
||||
var_dump(imagecolorsforindex($cropped, imagecolorat($cropped, 249, 249)));
|
||||
imagedestroy($image);
|
||||
imagedestroy($cropped);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
array(4) {
|
||||
["red"]=>
|
||||
int(255)
|
||||
["green"]=>
|
||||
int(0)
|
||||
["blue"]=>
|
||||
int(0)
|
||||
["alpha"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -3,6 +3,9 @@ Bug #70102 (imagecreatefromwebm() shifts colors)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) {
|
||||
die("skip test requires GD 2.2.0 or higher");
|
||||
}
|
||||
if (!function_exists('imagewebp') || !function_exists('imagecreatefromwebp'))
|
||||
die('skip WebP support not available');
|
||||
?>
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #71912 (libgd: signedness vulnerability)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) {
|
||||
die("skip test requires GD 2.2.0 or higher");
|
||||
}
|
||||
if(!function_exists('imagecreatefromgd2')) die('skip imagecreatefromgd2() not available');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
--TEST--
|
||||
Bug #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
|
||||
--SKIPIF--
|
||||
<?php if (!function_exists("imagecreatefromgd2")) print "skip"; ?>
|
||||
<?php
|
||||
if (!function_exists("imagecreatefromgd2")) print "skip";
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug72339.gd";
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd))
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,6 +3,9 @@ Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
||||
die("skip test requires GD 2.2.2 or higher");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -10,10 +10,9 @@ if (!(imagetypes() & IMG_PNG)) die('skip requires PNG support');
|
||||
$im = imagecreatetruecolor(100, 100);
|
||||
imagesetthickness($im, 5);
|
||||
imagearc($im, 50, 50, 90, 90, 0, 360, 0xffffff);
|
||||
ob_start();
|
||||
imagepng($im);
|
||||
$imagestring = ob_get_clean();
|
||||
echo md5($imagestring);
|
||||
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug72604.png', $im);
|
||||
?>
|
||||
--EXPECT--
|
||||
2ffa6afb915afbdf870cf6459477bc8a
|
||||
The images are equal.
|
||||
|
After Width: | Height: | Size: 700 B |
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #72697: select_colors write out-of-bounds
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists("imagecreatetruecolor")) die("skip");
|
||||
if (PHP_INT_MAX !== 9223372036854775807) die("skip for 64-bit long systems only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$img=imagecreatetruecolor(10, 10);
|
||||
imagetruecolortopalette($img, false, PHP_INT_MAX / 8);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: imagetruecolortopalette(): Number of colors has to be greater than zero and no more than 2147483647 in %sbug72697.php on line %d
|
||||
DONE
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #72709 (imagesetstyle() causes OOB read for empty $styles)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip ext/gd not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatetruecolor(1, 1);
|
||||
var_dump(imagesetstyle($im, array()));
|
||||
imagesetpixel($im, 0, 0, IMG_COLOR_STYLED);
|
||||
imagedestroy($im);
|
||||
?>
|
||||
====DONE====
|
||||
--EXPECTF--
|
||||
Warning: imagesetstyle(): styles array must not be empty in %s%ebug72709.php on line %d
|
||||
bool(false)
|
||||
====DONE====
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #72730: imagegammacorrect allows arbitrary write access
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists("imagecreatetruecolor")) die("skip");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$img = imagecreatetruecolor(1, 1);
|
||||
imagegammacorrect($img, -1, 1337);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: imagegammacorrect(): Gamma values should be positive in %sbug72730.php on line %d
|
||||
DONE
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #72913 (imagecopy() loses single-color transparency on palette images)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$base64 = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABnRSTlMAAAAAAABu'
|
||||
. 'pgeRAAAAVklEQVRYw+3UQQqAMBAEwf3/p9eTBxEPiWAmWMU8oGFJqgAAuOpzWTX3'
|
||||
. 'xQUti+uRJTZ9V5aY1bOTFZLV7yZr9zt6ibv/qPXfrMpsGipbIy7oqQ8AYJED1plD'
|
||||
. 'y5PCu2sAAAAASUVORK5CYII=';
|
||||
$src = imagecreatefromstring(base64_decode($base64));
|
||||
|
||||
$dst = imagecreate(50, 50);
|
||||
$transparent = imagecolorallocatealpha($dst, 255, 255, 255, 127);
|
||||
imagealphablending($dst, false);
|
||||
imagesavealpha($dst, true);
|
||||
|
||||
imagecopy($dst, $src, 0,0, 0,0, 50,50);
|
||||
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug72913.png', $dst);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
==DONE==
|
||||
|
After Width: | Height: | Size: 147 B |