mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-13 12:10:50 +00:00
Compare commits
474
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af88793d6d | ||
|
|
f68da34119 | ||
|
|
25a18c5d73 | ||
|
|
4cbc55adb1 | ||
|
|
a90785e09a | ||
|
|
29eedc7048 | ||
|
|
28eccb918e | ||
|
|
7319298ffe | ||
|
|
7f1239232e | ||
|
|
1a2a8c6d4e | ||
|
|
859913f6d4 | ||
|
|
91d3cd8559 | ||
|
|
46aa2c396b | ||
|
|
0c982798e0 | ||
|
|
ef39f40445 | ||
|
|
fcbe20d357 | ||
|
|
e6105ffb22 | ||
|
|
2711948d14 | ||
|
|
5d299509b4 | ||
|
|
16e2d954fc | ||
|
|
00e99dcafd | ||
|
|
2bfe92c90f | ||
|
|
28ed0119ac | ||
|
|
408b172017 | ||
|
|
bf046d6d66 | ||
|
|
efa7f87de4 | ||
|
|
7958793342 | ||
|
|
e64da8c20d | ||
|
|
5e977e69e1 | ||
|
|
5d9403f56c | ||
|
|
b8470e19e4 | ||
|
|
00525b824a | ||
|
|
ad0b63cad4 | ||
|
|
8cac75969e | ||
|
|
24b41a23b3 | ||
|
|
6dc6daf7e3 | ||
|
|
3411fe33a2 | ||
|
|
2775dc2b44 | ||
|
|
fdfc31a4f7 | ||
|
|
69ea7f9509 | ||
|
|
dff820cea3 | ||
|
|
3b78a24ee9 | ||
|
|
bf2f80b223 | ||
|
|
372844918a | ||
|
|
f86b2193a4 | ||
|
|
b9ac5e23fb | ||
|
|
aca474fa14 | ||
|
|
99f0760bfb | ||
|
|
bdac08bcdd | ||
|
|
d2e1a04b10 | ||
|
|
bc44eb6172 | ||
|
|
b16929ca72 | ||
|
|
bba16dde5d | ||
|
|
582f42b8d4 | ||
|
|
9266227402 | ||
|
|
72c9b0e12b | ||
|
|
592df89027 | ||
|
|
a734acd439 | ||
|
|
5e95b61639 | ||
|
|
70f92aa97e | ||
|
|
fe551c089a | ||
|
|
af85eff5b6 | ||
|
|
53fa6c5b6b | ||
|
|
4b9fcc01d4 | ||
|
|
30aceaf1a7 | ||
|
|
197095c29e | ||
|
|
21446cd7b6 | ||
|
|
e665a07ab9 | ||
|
|
e55c641792 | ||
|
|
b206b0e29d | ||
|
|
ee275e34c8 | ||
|
|
b38ca3adee | ||
|
|
302ccc195b | ||
|
|
30a73658c6 | ||
|
|
32be79dcfa | ||
|
|
7fac56e072 | ||
|
|
1e1b7c74fb | ||
|
|
52f35b984c | ||
|
|
f463523cda | ||
|
|
640214701c | ||
|
|
c8b3bce407 | ||
|
|
bda1cc6946 | ||
|
|
a90d05a430 | ||
|
|
cb41a7bad1 | ||
|
|
437612f656 | ||
|
|
c4fb183b9f | ||
|
|
54fbbded37 | ||
|
|
dbbf1c2a3c | ||
|
|
43ed561222 | ||
|
|
e9166fec62 | ||
|
|
713e9a7eaa | ||
|
|
6da2a977fc | ||
|
|
825ddbb3c6 | ||
|
|
9185cfd539 | ||
|
|
6d19358ae0 | ||
|
|
20941b71aa | ||
|
|
d382d6f3dc | ||
|
|
9360b6eeee | ||
|
|
aa6dc6c108 | ||
|
|
276bead9c4 | ||
|
|
359bc0ee2f | ||
|
|
ac4569621d | ||
|
|
cbe1597b74 | ||
|
|
b278be894f | ||
|
|
5a7039035c | ||
|
|
eb2360602e | ||
|
|
335d89ec4d | ||
|
|
5e9e0a2c74 | ||
|
|
88c48a4b95 | ||
|
|
2fefae4771 | ||
|
|
2b10db8e10 | ||
|
|
706aefb781 | ||
|
|
529da0f74c | ||
|
|
299d8f339f | ||
|
|
05d1612e16 | ||
|
|
36d05d75c8 | ||
|
|
2b9af967fb | ||
|
|
fac08a960b | ||
|
|
1504f7d630 | ||
|
|
be2128c805 | ||
|
|
3f42f2f5d1 | ||
|
|
6279246d2c | ||
|
|
48dc203408 | ||
|
|
7c4b5d9187 | ||
|
|
0407bdf252 | ||
|
|
7bfe9bf951 | ||
|
|
7ba1409a1a | ||
|
|
59c2477bc3 | ||
|
|
3468f03b6f | ||
|
|
35f32637b0 | ||
|
|
49387b31cf | ||
|
|
ff4cf1a838 | ||
|
|
eab42649ab | ||
|
|
008330e5b3 | ||
|
|
b7cd099ae0 | ||
|
|
4185633207 | ||
|
|
ad492ca932 | ||
|
|
481c4715d4 | ||
|
|
4e2c01617f | ||
|
|
c044164a96 | ||
|
|
d1dd71454d | ||
|
|
aeb633543b | ||
|
|
7311087cf0 | ||
|
|
1355ea60cc | ||
|
|
5e338836ff | ||
|
|
32314f6b67 | ||
|
|
babeca356b | ||
|
|
1847cf10c1 | ||
|
|
7fbc99e390 | ||
|
|
e4905b38b7 | ||
|
|
4b85f1d46a | ||
|
|
f6896e4395 | ||
|
|
de18f42047 | ||
|
|
934c35f586 | ||
|
|
8c247af1fc | ||
|
|
daa1fb8ba6 | ||
|
|
7aa776c7b4 | ||
|
|
39dd715382 | ||
|
|
b6ddcf9c71 | ||
|
|
d4df6d0200 | ||
|
|
75991561d6 | ||
|
|
84a4041ba4 | ||
|
|
a04c5536bb | ||
|
|
378ffd3cdf | ||
|
|
1ff30fd88c | ||
|
|
5ac2e5f850 | ||
|
|
6569db8808 | ||
|
|
58088c24eb | ||
|
|
7189039d65 | ||
|
|
0753c22e76 | ||
|
|
7df4087b98 | ||
|
|
637367fc73 | ||
|
|
ce5efa7adc | ||
|
|
41e1ccefd5 | ||
|
|
d72b943262 | ||
|
|
9444bc7997 | ||
|
|
547451796c | ||
|
|
05baed522f | ||
|
|
1e9abea139 | ||
|
|
65cf73c931 | ||
|
|
fd28010e20 | ||
|
|
442629f81d | ||
|
|
fa57c291bb | ||
|
|
e4ff7f2ee3 | ||
|
|
0ab5854863 | ||
|
|
fa27974ec0 | ||
|
|
f59506cd27 | ||
|
|
1158563958 | ||
|
|
a45b8874fb | ||
|
|
d3b5ed0787 | ||
|
|
cf4753691d | ||
|
|
e0c1fa30c4 | ||
|
|
ae74549239 | ||
|
|
9b9aa4b811 | ||
|
|
61ec9b5b0f | ||
|
|
c9e114a451 | ||
|
|
eeaec70758 | ||
|
|
95febf26c6 | ||
|
|
990ecc12fc | ||
|
|
0fe07a0e74 | ||
|
|
c2f2d5c8fc | ||
|
|
bff84d7c18 | ||
|
|
358aedc454 | ||
|
|
b96224625c | ||
|
|
7b60430a8f | ||
|
|
0a29e4731e | ||
|
|
48cadf242d | ||
|
|
6ed9991a6f | ||
|
|
12b2127b72 | ||
|
|
579c9066a0 | ||
|
|
8b9719d8b9 | ||
|
|
52f4587e8a | ||
|
|
e9967292c3 | ||
|
|
b3466f862f | ||
|
|
da3add26cf | ||
|
|
aa3ddda8e5 | ||
|
|
ab4c4c3970 | ||
|
|
ab6c1d21f9 | ||
|
|
65364fe7d0 | ||
|
|
90f99d47c0 | ||
|
|
00546bc9b7 | ||
|
|
f782ea5b42 | ||
|
|
3e167ba990 | ||
|
|
531be9662f | ||
|
|
b4a4db467b | ||
|
|
fedc799344 | ||
|
|
d0a244f1f3 | ||
|
|
51c38a0997 | ||
|
|
61e0f8599d | ||
|
|
4ae1d5d1bd | ||
|
|
acfa8c770c | ||
|
|
432bd117a9 | ||
|
|
d491b2f916 | ||
|
|
899b369e15 | ||
|
|
ffc1d25b37 | ||
|
|
71d3a69425 | ||
|
|
6fcd8e5865 | ||
|
|
dc3a5d783f | ||
|
|
842fde2827 | ||
|
|
0678dc8d91 | ||
|
|
658f7d77f9 | ||
|
|
a051d7264d | ||
|
|
144a083954 | ||
|
|
7b60315672 | ||
|
|
8ff00e6e85 | ||
|
|
9ce1a36af2 | ||
|
|
629c1ecd4f | ||
|
|
f604b61e39 | ||
|
|
9b30b04b32 | ||
|
|
ad744263ca | ||
|
|
f83a6c33b4 | ||
|
|
e946de29d2 | ||
|
|
1ffb7fddc2 | ||
|
|
c74efe1b2e | ||
|
|
b5051ff939 | ||
|
|
e2ba5c7987 | ||
|
|
8e9777a1f1 | ||
|
|
e644aad3f9 | ||
|
|
8ab4e2e90d | ||
|
|
b512adf78d | ||
|
|
2fe5bcbeb5 | ||
|
|
892def5f12 | ||
|
|
8d1d038509 | ||
|
|
6bd5a06894 | ||
|
|
ec002bd837 | ||
|
|
52de149ebc | ||
|
|
2326401fc1 | ||
|
|
7f527897fe | ||
|
|
d4b67896ec | ||
|
|
84605098bc | ||
|
|
ee1ab62763 | ||
|
|
d77ea459bd | ||
|
|
44be7b7f27 | ||
|
|
0335d2ef3e | ||
|
|
a0bb3fd679 | ||
|
|
eca037a51d | ||
|
|
f3230e3522 | ||
|
|
982342b057 | ||
|
|
c5ccaf1d04 | ||
|
|
f304fb848f | ||
|
|
35b077f53e | ||
|
|
8044d0680b | ||
|
|
a8e0a623ec | ||
|
|
920e81b6f1 | ||
|
|
ba1cf321f3 | ||
|
|
de433d4c47 | ||
|
|
54267f40c6 | ||
|
|
3e1b749f5e | ||
|
|
2dff153b23 | ||
|
|
b5324acd35 | ||
|
|
f0a1e410a3 | ||
|
|
1a2c3bd3ad | ||
|
|
b3c6089111 | ||
|
|
21654a671f | ||
|
|
7446c81aed | ||
|
|
ce2ad0df18 | ||
|
|
3b08082600 | ||
|
|
275e41cb12 | ||
|
|
050ef52549 | ||
|
|
55069b4c09 | ||
|
|
79b91e3c5a | ||
|
|
04821a1ee6 | ||
|
|
7a5323778d | ||
|
|
1684ba3c6f | ||
|
|
377750cd8f | ||
|
|
8757e2cab8 | ||
|
|
f25ff02b54 | ||
|
|
4fc0d46ae7 | ||
|
|
a5f2b002b4 | ||
|
|
9f721967a3 | ||
|
|
0baaf9fade | ||
|
|
b10ed89dac | ||
|
|
ae313b6037 | ||
|
|
f3d565f6ac | ||
|
|
9f5cf7d41a | ||
|
|
efcc789ef8 | ||
|
|
02b661ecfc | ||
|
|
cc67cf6322 | ||
|
|
1f90dd3359 | ||
|
|
40d11cc822 | ||
|
|
caceba5973 | ||
|
|
ee0c8f8d6f | ||
|
|
0285720570 | ||
|
|
e7f36ba693 | ||
|
|
01a1c3067c | ||
|
|
1f46bec9ce | ||
|
|
e3df0c5f60 | ||
|
|
ec6b367722 | ||
|
|
e2b0d97950 | ||
|
|
eb7bf5d30a | ||
|
|
a34288fa1a | ||
|
|
41eb63e78f | ||
|
|
393bf0e4bb | ||
|
|
b93ea59665 | ||
|
|
cd1130751d | ||
|
|
0211185548 | ||
|
|
64e4261c9b | ||
|
|
5312c39cfb | ||
|
|
0bf50a8302 | ||
|
|
5cf0084a92 | ||
|
|
857cd18cf4 | ||
|
|
d472434ea0 | ||
|
|
51f79846bf | ||
|
|
e715038920 | ||
|
|
03214a2aef | ||
|
|
7b6757d99a | ||
|
|
0c840ced7c | ||
|
|
494034901e | ||
|
|
f8acf826c3 | ||
|
|
1939b34c78 | ||
|
|
604de67b7d | ||
|
|
5516963633 | ||
|
|
0e1599afe0 | ||
|
|
c402956178 | ||
|
|
a7d1cad4c3 | ||
|
|
96c9cc315d | ||
|
|
8ba240a70b | ||
|
|
897b7b68cc | ||
|
|
8ddf9a2dc4 | ||
|
|
6c8a570a96 | ||
|
|
c291033469 | ||
|
|
716d2a3937 | ||
|
|
c5fec9e09d | ||
|
|
2034ace052 | ||
|
|
533b1df732 | ||
|
|
e17bfb472e | ||
|
|
213e9a0a3c | ||
|
|
18989420b6 | ||
|
|
c66a4e84bb | ||
|
|
37a13d2df7 | ||
|
|
8c4156ed28 | ||
|
|
3cc6bd10ac | ||
|
|
d9ebd0f3d6 | ||
|
|
22882a9d89 | ||
|
|
df78c48354 | ||
|
|
131e60ce56 | ||
|
|
5efda71e54 | ||
|
|
49e175be42 | ||
|
|
1e06c73192 | ||
|
|
34e686c556 | ||
|
|
2e02f18b15 | ||
|
|
899fe3d8af | ||
|
|
5d687afa89 | ||
|
|
f326713e42 | ||
|
|
6081dd781a | ||
|
|
4965d1c2ce | ||
|
|
af5f997a5d | ||
|
|
e5fdb5b3f0 | ||
|
|
af9ce6e650 | ||
|
|
48df4464ea | ||
|
|
9c8b42960d | ||
|
|
803cfe32e6 | ||
|
|
12885ef489 | ||
|
|
a52616b759 | ||
|
|
a7d1656b96 | ||
|
|
293a48cb9d | ||
|
|
cc22f021fe | ||
|
|
6c72ea87fd | ||
|
|
13c5bb9600 | ||
|
|
334758794d | ||
|
|
bf328b1681 | ||
|
|
a0ecb3794f | ||
|
|
b1433d86b2 | ||
|
|
2db96fea2d | ||
|
|
b23460063f | ||
|
|
b5003c3a86 | ||
|
|
d4267ce03a | ||
|
|
ad9ed232e7 | ||
|
|
2ee09835c1 | ||
|
|
9d1d25e625 | ||
|
|
e2ed4874b5 | ||
|
|
3488cf6fd8 | ||
|
|
7ffcb48184 | ||
|
|
08e7252abf | ||
|
|
79457d1964 | ||
|
|
6d97b4b2b3 | ||
|
|
232ab8d795 | ||
|
|
fb0128af2a | ||
|
|
f3dd77714d | ||
|
|
342240fd7f | ||
|
|
c42d5cf5de | ||
|
|
88223c5245 | ||
|
|
6027c56fd7 | ||
|
|
aef6432fbe | ||
|
|
300e0418a4 | ||
|
|
f0639611cf | ||
|
|
680ddabac1 | ||
|
|
21c9a9388f | ||
|
|
728c554f93 | ||
|
|
a3bd2d268c | ||
|
|
d2bdedbcfc | ||
|
|
4106d48d1c | ||
|
|
945938d33c | ||
|
|
c38b73a701 | ||
|
|
6f3bcb0d6e | ||
|
|
2d576c2a99 | ||
|
|
e667d23178 | ||
|
|
e93f8e74d4 | ||
|
|
0a3979e08b | ||
|
|
03ee0ddc5f | ||
|
|
4053dbe29f | ||
|
|
6c9c44905e | ||
|
|
4555779c39 | ||
|
|
a84a2d4ace | ||
|
|
2c327599a3 | ||
|
|
d9432d6a50 | ||
|
|
1d802ad5e5 | ||
|
|
85d3ac5763 | ||
|
|
f5f1c702cd | ||
|
|
ca29063da5 | ||
|
|
b2b3ce717f | ||
|
|
55c2721229 | ||
|
|
21525d0413 | ||
|
|
b053c4f4f6 | ||
|
|
3c328f0984 | ||
|
|
d780c2a673 | ||
|
|
d400b74296 | ||
|
|
08334293f8 | ||
|
|
c06ccf7c70 | ||
|
|
ce70b920e4 | ||
|
|
2546434008 | ||
|
|
b51f82f260 | ||
|
|
e956ba9357 | ||
|
|
fe67674809 | ||
|
|
aa3a5f7681 | ||
|
|
1b9cbab9a7 | ||
|
|
16e0dcea72 | ||
|
|
5f2a30e111 | ||
|
|
ace35a3d3b | ||
|
|
1978f41c8a | ||
|
|
4f73394fdd | ||
|
|
a6e0751079 | ||
|
|
2b04d68972 | ||
|
|
0235a8acdc |
No files matched your search
@@ -22,6 +22,10 @@ sapi/nsapi/nsapi.c ident
|
||||
sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
ext/exif/exif.c ident
|
||||
ext/ldap/ldap.c ident
|
||||
ext/pdo_pgsql/pdo_pgsql.c ident
|
||||
ext/tidy/tidy.c ident
|
||||
NEWS merge=NEWS
|
||||
UPGRADING merge=NEWS
|
||||
UPGRADING.INTERNALS merge=NEWS
|
||||
|
||||
@@ -8,6 +8,9 @@ notifications:
|
||||
email:
|
||||
on_failure: change
|
||||
|
||||
cache:
|
||||
- apt
|
||||
|
||||
env:
|
||||
global:
|
||||
- MYSQL_TEST_HOST=127.0.0.1
|
||||
@@ -21,6 +24,10 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_install:
|
||||
- sudo cp ./travis/de /var/lib/locales/supported.d/de
|
||||
- sudo dpkg-reconfigure locales
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2012 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2014 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,9 +1,180 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2014, PHP 5.5.14
|
||||
02 Oct 2014, PHP 5.5.18RC1
|
||||
|
||||
- Core:
|
||||
. Fixed BC break introduced by patch for bug #67072. (Anatol)
|
||||
. Fixed bug #67985 (Incorrect last used array index copied to new array after
|
||||
unset). (Tjerk)
|
||||
. Fixed bug #67739 (Windows 8.1/Server 2012 R2 OS build number reported
|
||||
as 6.2 (instead of 6.3)). (Christian Wenz)
|
||||
. Fixed bug #67633 (A foreach on an array returned from a function not doing
|
||||
copy-on-write). (Nikita)
|
||||
. Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #65641 (PHP-FPM incorrectly defines the SCRIPT_NAME variable
|
||||
when using Apache, mod_proxy-fcgi and ProxyPass). (Remi)
|
||||
|
||||
- OpenSSL:
|
||||
. Revert regression introduced by fix of bug #41631
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #67972 (SessionHandler Invalid memory read create_sid()). (Adam)
|
||||
|
||||
18 Sep 2014, PHP 5.5.17
|
||||
|
||||
- Core:
|
||||
. Fixed bug #47358 (glob returns error, should be empty array()). (Pierre)
|
||||
. Fixed bug #65463 (SIGSEGV during zend_shutdown()). (Keyur Govande)
|
||||
. Fixed bug #66036 (Crash on SIGTERM in apache process). (Keyur Govande)
|
||||
. Fixed bug #67878 (program_prefix not honoured in man pages). (Remi)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #41577 (DOTNET is successful once per server run)
|
||||
(Aidas Kasparas)
|
||||
|
||||
- FPM:
|
||||
. Fixed #67606 (FPM with mod_fastcgi/apache2.4 is broken). (David Zuelke)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #41631 (socket timeouts not honored in blocking SSL reads).
|
||||
(Daniel Lowrey)
|
||||
. Fixed bug #67850 (extension won't build if openssl compiled without SSLv3)
|
||||
(Daniel Lowrey)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException
|
||||
wrong message). (tim_siebels_aurich at yahoo dot de)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #66091 (memory leaks in DateTime constructor). (Tjerk)
|
||||
. Fixed bug #66985 (Some timezones are no longer valid in PHP 5.5.10).
|
||||
(Derick)
|
||||
. Fixed bug #67109 (First uppercase letter breaks date string parsing).
|
||||
(Derick)
|
||||
|
||||
- GD
|
||||
. Made fontFetch's path parser thread-safe. (Sara).
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #67839 (mysqli does not handle 4-byte floats correctly). (Keyur)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #67724 (chained zlib filters silently fail with large amounts of
|
||||
data). (Mike)
|
||||
. Fixed bug #67865 (internal corruption phar error). Mike
|
||||
|
||||
21 Aug 2014, PHP 5.5.16
|
||||
|
||||
- COM:
|
||||
. Fixed missing type checks in com_event_sink (Yussuf Khalil, Stas).
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #67705 (extensive backtracking in rule regular expression).
|
||||
(CVE-2014-3538) (Remi)
|
||||
. Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587) (Remi)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #67635 (php links to systemd libraries without using pkg-config).
|
||||
(pacho@gentoo.org, Remi)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference).
|
||||
(CVE-2014-2497) (Remi)
|
||||
. Fixed bug #67730 (Null byte injection possible with imagexxx functions).
|
||||
(CVE-2014-5120) (Ryan Mauger)
|
||||
|
||||
- Milter:
|
||||
. Fixed bug #67715 (php-milter does not build and crashes randomly). (Mike)
|
||||
|
||||
- Network:
|
||||
. Fixed bug #67717 (segfault in dns_get_record). (CVE-2014-3597) (Remi)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed missing type checks in OpenSSL options. (Yussuf Khalil, Stas)
|
||||
|
||||
- readline:
|
||||
. Fixed bug #55496 (Interactive mode doesn't force a newline before the
|
||||
prompt). (Bob, Johannes)
|
||||
. Fixed bug #67496 (Save command history when exiting interactive shell
|
||||
with control-c). (Dmitry Saprykin, Johannes)
|
||||
|
||||
- Sessions:
|
||||
. Fixed missing type checks in php_session_create_id (Yussuf Khalil, Stas).
|
||||
|
||||
- Core:
|
||||
. Fixed bug #67693 (incorrect push to the empty array) (Tjerk)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #60616 (odbc_fetch_into returns junk data at end of multi-byte
|
||||
char fields). (Keyur)
|
||||
|
||||
24 Jul 2014, PHP 5.5.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #67428 (header('Location: foo') will override a 308-399 response
|
||||
code). (Adam)
|
||||
. Fixed bug #67436 (Autoloader isn't called if two method definitions don't
|
||||
match). (Bob)
|
||||
. Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0).
|
||||
(Ferenc)
|
||||
. Fixed bug #67497 (eval with parse error causes segmentation fault in
|
||||
generator). (Nikita)
|
||||
. Fixed bug #67151 (strtr with empty array crashes). (Nikita)
|
||||
. Fixed bug #67407 (Windows 8.1/Server 2012 R2 reported as Windows 8/Server
|
||||
2012). (Christian Wenz)
|
||||
. Fixed bug #66608 (Incorrect behavior with nested "finally" blocks).
|
||||
(Laruence, Dmitry)
|
||||
. Implemented FR #34407 (ucwords and Title Case). (Tjerk)
|
||||
|
||||
- CLI server:
|
||||
. Implemented FR #67429 (CLI server is missing some new HTTP response codes).
|
||||
(Adam)
|
||||
. Fixed bug #66830 (Empty header causes PHP built-in web server to hang).
|
||||
(Adam)
|
||||
. Fixed bug #67594 (Unable to access to apache_request_headers() elements).
|
||||
(Tjerk)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #67530 (error_log=syslog ignored). (Remi)
|
||||
. Fixed bug #67531 (syslog cannot be set in pool configuration). (Remi)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #66921 (Wrong argument type hint for function
|
||||
intltz_from_date_time_zone). (Stas)
|
||||
. Fixed bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting).
|
||||
(Stas)
|
||||
|
||||
- OPCache:
|
||||
. Fixed bug #67215 (php-cgi work with opcache, may be segmentation fault
|
||||
happen) (Dmitry, Laruence)
|
||||
|
||||
- pgsql:
|
||||
. Fixed bug #67550 (Error in code "form" instead of "from", pgsql.c, line 756),
|
||||
which affected builds against libpq < 7.3. (Adam)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #67587 (Redirection loop on nginx with FPM). (Christian Weiske)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #67539 (ArrayIterator use-after-free due to object change during
|
||||
sorting). (CVE-2014-4698) (research at insighti dot org, Laruence)
|
||||
. Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670) (Laruence)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #67430 (http:// wrapper doesn't follow 308 redirects). (Adam)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #66827 (Session raises E_NOTICE when session name variable is array).
|
||||
(Yasuo)
|
||||
|
||||
27 Jun 2014, PHP 5.5.14
|
||||
|
||||
- Core:
|
||||
. Fixed BC break introduced by patch for bug #67072. (Anatol, Stas)
|
||||
. Fixed bug #66622 (Closures do not correctly capture the late bound class
|
||||
(static::) in some cases). (Levi Morrison)
|
||||
. Fixed bug #67390 (insecure temporary file use in the configure script).
|
||||
@@ -11,7 +182,7 @@ PHP NEWS
|
||||
. Fixed bug #67399 (putenv with empty variable may lead to crash). (Stas)
|
||||
|
||||
- CLI server:
|
||||
. Fixed Bug #67406i (built-in web-server segfaults on startup). (Remi)
|
||||
. Fixed Bug #67406 (built-in web-server segfaults on startup). (Remi)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #67308 (Serialize of DateTime truncates fractions of second).
|
||||
@@ -30,6 +201,10 @@ PHP NEWS
|
||||
. Fixed bug #67413 (fileinfo: cdf_read_property_info insufficient boundary
|
||||
check). (Francisco Alonso, Jan Kaluza, Remi)
|
||||
|
||||
- Network:
|
||||
. Fixed bug #67432 (Fix potential segfault in dns_get_record()).
|
||||
(CVE-2014-4049). (Sara)
|
||||
|
||||
- OPCache:
|
||||
. Fixed issue #183 (TMP_VAR is not only used once). (Dmitry, Laruence)
|
||||
|
||||
@@ -49,6 +224,8 @@ PHP NEWS
|
||||
. Fixed bug #66127 (Segmentation fault with ArrayObject unset). (Stas)
|
||||
. Fixed bug #67359 (Segfault in recursiveDirectoryIterator). (Laruence)
|
||||
. Fixed bug #67360 (Missing element after ArrayObject::getIterator). (Adam)
|
||||
. Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type
|
||||
Confusion). (CVE-2014-3515) (Stefan Esser)
|
||||
|
||||
29 May 2014, PHP 5.5.13
|
||||
|
||||
|
||||
+8
-4
@@ -45,15 +45,16 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
|
||||
in extended support and open forsecurity fixes only. Triaged
|
||||
via security@php.net
|
||||
PHP-5.3 This branch is closed.
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
|
||||
@@ -61,9 +62,12 @@ Currently we have the following branches in use::
|
||||
|
||||
PHP-4.4 This branch is closed.
|
||||
|
||||
PHP-X.Y.Z These branches are used for the release managers for tagging
|
||||
the releases, hence they are closed to the general public.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.3) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.4) and then
|
||||
get merged up to all other branches. If a change is not needed for
|
||||
later branches (i.e. fixes for features which where dropped from later
|
||||
branches) an empty merge should be done.
|
||||
|
||||
@@ -7,6 +7,7 @@ PHP 5.5 UPGRADE NOTES
|
||||
2. Changes in SAPI modules
|
||||
3. Deprecated Functionality
|
||||
4. Changed Functions
|
||||
a. unserialize() change
|
||||
5. New Functions
|
||||
6. New Classes and Interfaces
|
||||
7. Removed Extensions
|
||||
@@ -193,8 +194,46 @@ PHP 5.5 UPGRADE NOTES
|
||||
- Since 5.5.4, fputcsv() has fifth parameter escape_char, allowing to
|
||||
specify escape char.
|
||||
|
||||
- Manipulated serialization strings for objects implementing Serializable by
|
||||
replacing "C:" with "O:" at the start will now produce an error.
|
||||
4a. unserialize() change
|
||||
------------------------
|
||||
|
||||
- Starting PHP 5.5.13, the bug fix for bug #67072 introduces a change to
|
||||
unserialize() function, detailed below:
|
||||
|
||||
If the string looking like 'O:..:"ClassName":...' is unserialized, and
|
||||
the class named is an internal class that declares custom unserializer
|
||||
function, or extends such class, unserialize would fail.
|
||||
|
||||
Using O: for user classes not extending internal classes (including
|
||||
those implementing Serializable) is still supported in 5.4, though
|
||||
it is deprecated and may not be supported in 5.6 for classes that do not
|
||||
originally serialize to O:. Same for using O: for internal classes
|
||||
implementing Serializable (like ArrayObject) and classes that extend
|
||||
them.
|
||||
|
||||
The reason for that is that O: format is meant to be used with classes
|
||||
that do not define custom handlers, and was never intended for the use
|
||||
with classes that do. When used with the class that relies on custom
|
||||
unserializer, it can leave the object of such internal class in an
|
||||
inconsistent state which has been observed to result in crashes and may
|
||||
also lead to memory corruption and ultimately even arbitrary code
|
||||
execution. This was never the intended use of unserializer, and mere
|
||||
possibility of doing this constitutes a bug, since the data passed to
|
||||
unserialize() is not a valid serialization of any object. Since there
|
||||
are many applications applying unserialize() to untrusted data, this
|
||||
presents a potential security vulnerability. Thus, keeping such bug in
|
||||
the code base was considered too dangerous.
|
||||
|
||||
We are aware that some applications use O: format as a way to
|
||||
instantiate classes. This was never the intended usage of serializer,
|
||||
and ReflectionClass methods such as newInstance or
|
||||
newInstanceWithoutConstructor can be used for that. We're working on
|
||||
providing more comprehensive solution for such use cases in PHP 5.6 and
|
||||
welcome the ideas in this area.
|
||||
|
||||
We note also that using unserialize() on any data that is not the result
|
||||
of serialize() call continues to be an unsupported scenario and should
|
||||
not be relied on to produce any specific result.
|
||||
|
||||
========================================
|
||||
5. New Functions
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
--TEST--
|
||||
Bug #66608 (Incorrect behavior with nested "finally" blocks)
|
||||
--FILE--
|
||||
<?php
|
||||
function bar() {
|
||||
try {
|
||||
echo "1\n";
|
||||
try {
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "2\n";
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception ("");
|
||||
} catch (Exception $ab) {
|
||||
echo "3\n";
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
echo "4\n";
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "5\n";
|
||||
}
|
||||
}
|
||||
echo "6\n";
|
||||
try {
|
||||
} finally {
|
||||
while (1) {
|
||||
try {
|
||||
echo "7\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "8\n";
|
||||
}
|
||||
echo "bad";
|
||||
}
|
||||
echo "9\n";
|
||||
while (1) {
|
||||
try {
|
||||
throw new Exception("");
|
||||
} catch(Exception $e) {
|
||||
echo "10\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "11\n";
|
||||
}
|
||||
echo "bak\n";
|
||||
}
|
||||
}
|
||||
echo "12\n";
|
||||
}
|
||||
echo "13\n";
|
||||
}
|
||||
bar();
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class a {
|
||||
public function test($arg = c::TESTCONSTANT) {
|
||||
echo __METHOD__ . "($arg)\n";
|
||||
}
|
||||
|
||||
static public function staticTest() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
class b extends a {
|
||||
public function test() {
|
||||
echo __METHOD__ . "()\n";
|
||||
parent::test();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
bug67436: Autoloader isn't called if user defined error handler is present
|
||||
|
||||
--INI--
|
||||
error_reporting=
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once ($classname . '.php');
|
||||
}
|
||||
});
|
||||
|
||||
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
|
||||
}, error_reporting());
|
||||
|
||||
a::staticTest();
|
||||
|
||||
$b = new b();
|
||||
$b->test();
|
||||
|
||||
--EXPECT--
|
||||
b::test()
|
||||
a::test(c::TESTCONSTANT)
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
bug67436: E_STRICT instead of custom error handler
|
||||
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once ($classname . '.php');
|
||||
}
|
||||
});
|
||||
|
||||
a::staticTest();
|
||||
|
||||
$b = new b();
|
||||
$b->test();
|
||||
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s/bug67436/b.php on line %d
|
||||
b::test()
|
||||
a::test(c::TESTCONSTANT)
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
class c {
|
||||
const TESTCONSTANT = "c::TESTCONSTANT";
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Bug #67633: A foreach on an array returned from a function not doing copy-on-write
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function id($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function &ref_id(&$x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
$c = 'c';
|
||||
$array = ['a', 'b', $c];
|
||||
|
||||
foreach(id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
foreach(ref_id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
[1]=>
|
||||
string(1) "b"
|
||||
[2]=>
|
||||
string(1) "c"
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(2) "aq"
|
||||
[1]=>
|
||||
string(2) "bq"
|
||||
[2]=>
|
||||
&string(2) "cq"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #67985 - Last used array index not copied to new array at assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = ['zero', 'one', 'two'];
|
||||
unset($a[2]);
|
||||
$b = $a;
|
||||
$a[] = 'three';
|
||||
$b[] = 'three';
|
||||
|
||||
var_dump($a === $b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #67467: eval with parse error causes segmentation fault in generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
$a = 1;
|
||||
yield $a;
|
||||
}
|
||||
|
||||
@eval('abc');
|
||||
|
||||
$values = gen();
|
||||
$values->next();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Try finally (segfault with empty break)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
try {
|
||||
break;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot break/continue 1 level in %stry_finally_011.php on line %d
|
||||
+14
@@ -814,6 +814,20 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
|
||||
zend_shutdown_timeout_thread();
|
||||
#endif
|
||||
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
|
||||
|
||||
if (EG(active))
|
||||
{
|
||||
/*
|
||||
* The order of destruction is important here.
|
||||
* See bugs #65463 and 66036.
|
||||
*/
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data TSRMLS_CC);
|
||||
zend_cleanup_internal_classes(TSRMLS_C);
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
|
||||
}
|
||||
|
||||
zend_destroy_modules();
|
||||
|
||||
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
|
||||
|
||||
+15
-3
@@ -3336,8 +3336,11 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
|
||||
*zv = *precv->op2.zv;
|
||||
zval_copy_ctor(zv);
|
||||
INIT_PZVAL(zv);
|
||||
zval_update_constant_ex(&zv, (void*)1, fptr->common.scope TSRMLS_CC);
|
||||
if (Z_TYPE_P(zv) == IS_BOOL) {
|
||||
if ((Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
|
||||
REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN_P(zv));
|
||||
memcpy(offset, Z_STRVAL_P(zv), Z_STRLEN_P(zv));
|
||||
offset += Z_STRLEN_P(zv);
|
||||
} else if (Z_TYPE_P(zv) == IS_BOOL) {
|
||||
if (Z_LVAL_P(zv)) {
|
||||
memcpy(offset, "true", 4);
|
||||
offset += 4;
|
||||
@@ -3359,7 +3362,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
|
||||
*(offset++) = '.';
|
||||
}
|
||||
*(offset++) = '\'';
|
||||
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
|
||||
} else if (Z_TYPE_P(zv) == IS_ARRAY || (Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) {
|
||||
memcpy(offset, "Array", 5);
|
||||
offset += 5;
|
||||
} else {
|
||||
@@ -6228,6 +6231,15 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
/* save the location of FETCH_W instruction(s) */
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
|
||||
|
||||
if (zend_is_function_or_method_call(array)) {
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_SEPARATE;
|
||||
SET_NODE(opline->op1, array);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->result_type = IS_VAR;
|
||||
opline->result.var = opline->op1.var;
|
||||
}
|
||||
} else {
|
||||
is_variable = 0;
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
|
||||
@@ -666,6 +666,8 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
|
||||
ZEND_API void zend_cleanup_internal_classes(TSRMLS_D);
|
||||
ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
|
||||
ZEND_API void zend_function_dtor(zend_function *function);
|
||||
@@ -843,6 +845,9 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
|
||||
#define ZEND_FAST_RET_TO_CATCH 1
|
||||
#define ZEND_FAST_RET_TO_FINALLY 2
|
||||
|
||||
#define ZEND_FAST_CALL_FROM_CATCH 1
|
||||
#define ZEND_FAST_CALL_FROM_FINALLY 2
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_CLONE_FUNC_NAME "__clone"
|
||||
|
||||
@@ -109,7 +109,7 @@ static int clean_non_persistent_function(zend_function *function TSRMLS_DC) /* {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ static int clean_non_persistent_class(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return ((*ce)->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
/* A fatal error / die occurred during the generator execution. Trying to clean
|
||||
* up the stack may not be safe in this case. */
|
||||
if (CG(unclean_shutdown)) {
|
||||
generator->execute_data = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+72
-13
@@ -509,6 +509,49 @@ static void zend_check_finally_breakout(zend_op_array *op_array, zend_uint op_nu
|
||||
}
|
||||
}
|
||||
|
||||
static void zend_adjust_fast_call(zend_op_array *op_array, zend_uint fast_call, zend_uint start, zend_uint end TSRMLS_DC)
|
||||
{
|
||||
int i;
|
||||
zend_uint op_num = 0;
|
||||
|
||||
for (i = 0; i < op_array->last_try_catch; i++) {
|
||||
if (op_array->try_catch_array[i].finally_op > start
|
||||
&& op_array->try_catch_array[i].finally_end < end) {
|
||||
op_num = op_array->try_catch_array[i].finally_op;
|
||||
start = op_array->try_catch_array[i].finally_end;
|
||||
}
|
||||
}
|
||||
|
||||
if (op_num) {
|
||||
/* Must be ZEND_FAST_CALL */
|
||||
ZEND_ASSERT(op_array->opcodes[op_num - 2].opcode == ZEND_FAST_CALL);
|
||||
op_array->opcodes[op_num - 2].extended_value = ZEND_FAST_CALL_FROM_FINALLY;
|
||||
op_array->opcodes[op_num - 2].op2.opline_num = fast_call;
|
||||
}
|
||||
}
|
||||
|
||||
static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint fast_call, zend_uint op_num TSRMLS_DC)
|
||||
{
|
||||
int i;
|
||||
zend_uint finally_op_num = 0;
|
||||
|
||||
for (i = 0; i < op_array->last_try_catch; i++) {
|
||||
if (op_num >= op_array->try_catch_array[i].finally_op
|
||||
&& op_num < op_array->try_catch_array[i].finally_end) {
|
||||
finally_op_num = op_array->try_catch_array[i].finally_op;
|
||||
}
|
||||
}
|
||||
|
||||
if (finally_op_num) {
|
||||
/* Must be ZEND_FAST_CALL */
|
||||
ZEND_ASSERT(op_array->opcodes[finally_op_num - 2].opcode == ZEND_FAST_CALL);
|
||||
if (op_array->opcodes[fast_call].extended_value == 0) {
|
||||
op_array->opcodes[fast_call].extended_value = ZEND_FAST_CALL_FROM_FINALLY;
|
||||
op_array->opcodes[fast_call].op2.opline_num = finally_op_num - 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num, zend_uint dst_num TSRMLS_DC)
|
||||
{
|
||||
zend_uint start_op;
|
||||
@@ -536,11 +579,23 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num,
|
||||
opline->opcode = ZEND_FAST_CALL;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
|
||||
zend_adjust_fast_call(op_array, start_op,
|
||||
op_array->try_catch_array[i].finally_op,
|
||||
op_array->try_catch_array[i].finally_end TSRMLS_CC);
|
||||
if (op_array->try_catch_array[i].catch_op) {
|
||||
opline->extended_value = 1;
|
||||
opline->extended_value = ZEND_FAST_CALL_FROM_CATCH;
|
||||
opline->op2.opline_num = op_array->try_catch_array[i].catch_op;
|
||||
opline->op1.opline_num = get_next_op_number(op_array);
|
||||
/* generate a FAST_CALL to hole CALL_FROM_FINALLY */
|
||||
opline = get_next_op(op_array TSRMLS_CC);
|
||||
opline->opcode = ZEND_FAST_CALL;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
zend_resolve_fast_call(op_array, start_op + 1, op_array->try_catch_array[i].finally_op - 2 TSRMLS_CC);
|
||||
} else {
|
||||
zend_resolve_fast_call(op_array, start_op, op_array->try_catch_array[i].finally_op - 2 TSRMLS_CC);
|
||||
}
|
||||
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
|
||||
|
||||
/* generate a sequence of FAST_CALL to upward finally block */
|
||||
while (i > 0) {
|
||||
@@ -605,10 +660,10 @@ static void zend_resolve_finally_ret(zend_op_array *op_array, zend_uint op_num T
|
||||
|
||||
static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
|
||||
{
|
||||
zend_uint i;
|
||||
zend_uint i, j;
|
||||
zend_op *opline;
|
||||
|
||||
for (i = 0; i < op_array->last; i++) {
|
||||
for (i = 0, j = op_array->last; i < j; i++) {
|
||||
opline = op_array->opcodes + i;
|
||||
switch (opline->opcode) {
|
||||
case ZEND_RETURN:
|
||||
@@ -623,15 +678,16 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
|
||||
zend_brk_cont_element *jmp_to;
|
||||
|
||||
nest_levels = Z_LVAL(op_array->literals[opline->op2.constant].constant);
|
||||
array_offset = opline->op1.opline_num;
|
||||
do {
|
||||
jmp_to = &op_array->brk_cont_array[array_offset];
|
||||
if (nest_levels > 1) {
|
||||
array_offset = jmp_to->parent;
|
||||
}
|
||||
} while (--nest_levels > 0);
|
||||
zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC);
|
||||
break;
|
||||
if ((array_offset = opline->op1.opline_num) != -1) {
|
||||
do {
|
||||
jmp_to = &op_array->brk_cont_array[array_offset];
|
||||
if (nest_levels > 1) {
|
||||
array_offset = jmp_to->parent;
|
||||
}
|
||||
} while (--nest_levels > 0);
|
||||
zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case ZEND_GOTO:
|
||||
if (Z_TYPE(op_array->literals[opline->op2.constant].constant) != IS_LONG) {
|
||||
@@ -644,6 +700,9 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
|
||||
case ZEND_JMP:
|
||||
zend_resolve_finally_call(op_array, i, opline->op1.opline_num TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FAST_CALL:
|
||||
zend_resolve_fast_call(op_array, i, i TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FAST_RET:
|
||||
zend_resolve_finally_ret(op_array, i TSRMLS_CC);
|
||||
break;
|
||||
|
||||
@@ -136,6 +136,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
ALLOC_HASHTABLE_REL(tmp_ht);
|
||||
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
|
||||
zvalue->value.ht = tmp_ht;
|
||||
}
|
||||
break;
|
||||
|
||||
+6
-3
@@ -5396,13 +5396,13 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value &&
|
||||
if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
|
||||
UNEXPECTED(EG(prev_exception) != NULL)) {
|
||||
/* in case of unhandled exception jump to catch block instead of finally */
|
||||
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
EX(fast_ret) = opline + 1;
|
||||
EX(fast_ret) = opline;
|
||||
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
@@ -5410,7 +5410,10 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
|
||||
ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
|
||||
{
|
||||
if (EX(fast_ret)) {
|
||||
ZEND_VM_SET_OPCODE(EX(fast_ret));
|
||||
ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
|
||||
if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
|
||||
EX(fast_ret) = &EX(op_array)->opcodes[EX(fast_ret)->op2.opline_num];
|
||||
}
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
/* special case for unhandled exceptions */
|
||||
|
||||
@@ -1137,13 +1137,13 @@ static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value &&
|
||||
if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
|
||||
UNEXPECTED(EG(prev_exception) != NULL)) {
|
||||
/* in case of unhandled exception jump to catch block instead of finally */
|
||||
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
EX(fast_ret) = opline + 1;
|
||||
EX(fast_ret) = opline;
|
||||
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
|
||||
ZEND_VM_CONTINUE();
|
||||
}
|
||||
@@ -1151,7 +1151,10 @@ static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
if (EX(fast_ret)) {
|
||||
ZEND_VM_SET_OPCODE(EX(fast_ret));
|
||||
ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
|
||||
if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
|
||||
EX(fast_ret) = &EX(op_array)->opcodes[EX(fast_ret)->op2.opline_num];
|
||||
}
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
/* special case for unhandled exceptions */
|
||||
|
||||
@@ -1189,7 +1189,7 @@ function gen_vm($def, $skel) {
|
||||
fputs($f,"#define $op $code\n");
|
||||
}
|
||||
|
||||
fputs($f, "\n#endif");
|
||||
fputs($f, "\n#endif\n");
|
||||
fclose($f);
|
||||
echo "zend_vm_opcodes.h generated successfully.\n";
|
||||
|
||||
|
||||
@@ -170,4 +170,4 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
|
||||
#define ZEND_FAST_CALL 162
|
||||
#define ZEND_FAST_RET 163
|
||||
|
||||
#endif
|
||||
#endif
|
||||
+1
-1
@@ -2800,7 +2800,7 @@ AC_DEFUN([PHP_DETECT_ICC],
|
||||
|
||||
dnl PHP_DETECT_SUNCC
|
||||
dnl Detect if the systems default compiler is suncc.
|
||||
dnl We also set some usefull CFLAGS if the user didn't set any
|
||||
dnl We also set some useful CFLAGS if the user didn't set any
|
||||
AC_DEFUN([PHP_DETECT_SUNCC],[
|
||||
SUNCC="no"
|
||||
AC_MSG_CHECKING([for suncc])
|
||||
|
||||
Vendored
+9
-11
@@ -615,7 +615,7 @@ ia64-*-hpux*)
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
|
||||
s390*-*linux*|sparc*-*linux*)
|
||||
# Find out which ABI we are using.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
@@ -629,7 +629,10 @@ s390*-*linux*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_i386"
|
||||
;;
|
||||
ppc64-*linux*|powerpc64-*linux*)
|
||||
powerpc64le-*linux*)
|
||||
LD="${LD-ld} -m elf32lppclinux"
|
||||
;;
|
||||
powerpc64-*linux*)
|
||||
LD="${LD-ld} -m elf32ppclinux"
|
||||
;;
|
||||
s390x-*linux*)
|
||||
@@ -648,7 +651,10 @@ s390*-*linux*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_x86_64"
|
||||
;;
|
||||
ppc*-*linux*|powerpc*-*linux*)
|
||||
powerpcle-*linux*)
|
||||
LD="${LD-ld} -m elf64lppc"
|
||||
;;
|
||||
powerpc-*linux*)
|
||||
LD="${LD-ld} -m elf64ppc"
|
||||
;;
|
||||
s390*-*linux*)
|
||||
@@ -1532,10 +1538,6 @@ dgux*)
|
||||
shlibpath_var=LD_LIBRARY_PATH
|
||||
;;
|
||||
|
||||
freebsd1*)
|
||||
dynamic_linker=no
|
||||
;;
|
||||
|
||||
freebsd* | dragonfly*)
|
||||
# DragonFly does not have aout. When/if they implement a new
|
||||
# versioning mechanism, adjust this.
|
||||
@@ -5843,10 +5845,6 @@ _LT_EOF
|
||||
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
|
||||
;;
|
||||
|
||||
freebsd1*)
|
||||
_LT_AC_TAGVAR(ld_shlibs, $1)=no
|
||||
;;
|
||||
|
||||
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
|
||||
# support. Future versions do this automatically, but an explicit c++rt0.o
|
||||
# does not break anything, and helps significantly (at the cost of a little
|
||||
|
||||
Vendored
+6
@@ -982,6 +982,12 @@ EOF
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64le:Linux:*:*)
|
||||
echo powerpc64le-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppcle:Linux:*:*)
|
||||
echo powerpcle-unknown-linux-gnu
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit ;;
|
||||
|
||||
+24
-10
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=5
|
||||
PHP_RELEASE_VERSION=14
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=18
|
||||
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`
|
||||
|
||||
@@ -784,7 +784,12 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
||||
fi
|
||||
|
||||
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
|
||||
dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
|
||||
ltp_version_min="105"
|
||||
dnl non-working versions, e.g. "1.8 1.18";
|
||||
dnl remove "none" when introducing the first incompatible LTP version an
|
||||
dnl separate any following additions by spaces
|
||||
ltp_version_exclude="1.8"
|
||||
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
@@ -794,21 +799,30 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
if test "$LTP"; then
|
||||
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
|
||||
php_cv_ltp_version=invalid
|
||||
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
||||
for ltp_check_version in $ltp_version_list; do
|
||||
if test "$ltp_version" = "$ltp_check_version"; then
|
||||
php_cv_ltp_version="$ltp_check_version (ok)"
|
||||
ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
|
||||
if test -n "$ltp_version_vars"; then
|
||||
set $ltp_version_vars
|
||||
ltp_version="${1}.${2}"
|
||||
ltp_version_num="`expr ${1} \* 100 + ${2}`"
|
||||
if test $ltp_version_num -ge $ltp_version_min; then
|
||||
php_cv_ltp_version="$ltp_version (ok)"
|
||||
for ltp_check_version in $ltp_version_exclude; do
|
||||
if test "$ltp_version" = "$ltp_check_version"; then
|
||||
php_cv_ltp_version=invalid
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
else
|
||||
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
|
||||
ltp_msg="To enable code coverage reporting you must have LTP installed"
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
fi
|
||||
|
||||
case $php_cv_ltp_version in
|
||||
""|invalid[)]
|
||||
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
|
||||
ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
LTP="exit 0;"
|
||||
;;
|
||||
|
||||
@@ -698,9 +698,9 @@ PHP_FUNCTION(com_event_sink)
|
||||
/* 0 => typelibname, 1 => dispname */
|
||||
zval **tmp;
|
||||
|
||||
if (zend_hash_index_find(Z_ARRVAL_P(sink), 0, (void**)&tmp) == SUCCESS)
|
||||
if (zend_hash_index_find(Z_ARRVAL_P(sink), 0, (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING)
|
||||
typelibname = Z_STRVAL_PP(tmp);
|
||||
if (zend_hash_index_find(Z_ARRVAL_P(sink), 1, (void**)&tmp) == SUCCESS)
|
||||
if (zend_hash_index_find(Z_ARRVAL_P(sink), 1, (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING)
|
||||
dispname = Z_STRVAL_PP(tmp);
|
||||
} else if (sink != NULL) {
|
||||
convert_to_string(sink);
|
||||
|
||||
@@ -198,7 +198,8 @@ PHP_FUNCTION(com_dotnet_create_instance)
|
||||
IUnknown *unk = NULL;
|
||||
|
||||
php_com_initialize(TSRMLS_C);
|
||||
if (COMG(dotnet_runtime_stuff) == NULL) {
|
||||
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
|
||||
if (stuff == NULL) {
|
||||
hr = dotnet_init(&where TSRMLS_CC);
|
||||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
@@ -210,9 +211,35 @@ PHP_FUNCTION(com_dotnet_create_instance)
|
||||
ZVAL_NULL(object);
|
||||
return;
|
||||
}
|
||||
}
|
||||
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
|
||||
|
||||
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
|
||||
} else if (stuff->dotnet_domain == NULL) {
|
||||
where = "ICorRuntimeHost_GetDefaultDomain";
|
||||
hr = ICorRuntimeHost_GetDefaultDomain(stuff->dotnet_host, &unk);
|
||||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
|
||||
if (err)
|
||||
LocalFree(err);
|
||||
php_com_throw_exception(hr, buf TSRMLS_CC);
|
||||
ZVAL_NULL(object);
|
||||
return;
|
||||
}
|
||||
|
||||
where = "QI: System._AppDomain";
|
||||
hr = IUnknown_QueryInterface(unk, &IID_mscorlib_System_AppDomain, (LPVOID*)&stuff->dotnet_domain);
|
||||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
|
||||
if (err)
|
||||
LocalFree(err);
|
||||
php_com_throw_exception(hr, buf TSRMLS_CC);
|
||||
ZVAL_NULL(object);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
obj = CDNO_FETCH(object);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Features
|
||||
AsynchDNS => Yes
|
||||
CharConv => No
|
||||
Debug => No
|
||||
GSS-Negotiate => Yes
|
||||
GSS-Negotiate => No
|
||||
IDN => Yes
|
||||
IPv6 => Yes
|
||||
krb4 => No
|
||||
|
||||
+12567
-12595
File diff suppressed because it is too large.
Load diff
+15
-41
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
| Copyright (c) 1997-2014 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -668,7 +668,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
|
||||
}
|
||||
}
|
||||
|
||||
const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
|
||||
const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
|
||||
{
|
||||
int first_found = 0;
|
||||
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
|
||||
@@ -696,25 +696,6 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
if (gmtoffset == -1) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
if (tp->gmtoffset == gmtoffset) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (first_found) {
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
|
||||
/* Still didn't find anything, let's find the zone solely based on
|
||||
* offset/isdst then */
|
||||
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
|
||||
@@ -725,7 +706,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
{
|
||||
char *word;
|
||||
char *begin = *ptr, *end;
|
||||
@@ -739,7 +720,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
|
||||
word = calloc(1, end - begin + 1);
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
if ((tp = zone_search(word, -1, 0))) {
|
||||
if ((tp = abbr_search(word, -1, 0))) {
|
||||
value = -tp->gmtoffset / 60;
|
||||
*dst = tp->type;
|
||||
value += tp->type * 60;
|
||||
@@ -783,33 +764,26 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
|
||||
retval = timelib_parse_tz_cor(ptr);
|
||||
} else {
|
||||
int found = 0;
|
||||
long offset;
|
||||
long offset = 0;
|
||||
char *tz_abbr;
|
||||
|
||||
t->is_localtime = 1;
|
||||
|
||||
offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
|
||||
/* First, we lookup by abbreviation only */
|
||||
offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
|
||||
if (found) {
|
||||
t->zone_type = TIMELIB_ZONETYPE_ABBR;
|
||||
timelib_time_tz_abbr_update(t, tz_abbr);
|
||||
}
|
||||
#if 0
|
||||
/* If we found a TimeZone identifier, use it */
|
||||
if (tz_name) {
|
||||
t->tz_info = timelib_parse_tzfile(tz_name);
|
||||
t->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
}
|
||||
#endif
|
||||
/* If we have a TimeZone identifier to start with, use it */
|
||||
if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
|
||||
|
||||
/* Otherwise, we look if we have a TimeZone identifier */
|
||||
if (!found || strcmp("UTC", tz_abbr) == 0) {
|
||||
if ((res = tz_wrapper(tz_abbr, tzdb)) != NULL) {
|
||||
t->tz_info = res;
|
||||
t->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
found++;
|
||||
}
|
||||
}
|
||||
if (found && t->zone_type != TIMELIB_ZONETYPE_ID) {
|
||||
timelib_time_tz_abbr_update(t, tz_abbr);
|
||||
}
|
||||
free(tz_abbr);
|
||||
*tz_not_found = (found == 0);
|
||||
retval = offset;
|
||||
@@ -931,8 +905,8 @@ mssqltime = hour12 ":" minutelz ":" secondlz [:.] [0-9]+ meridian;
|
||||
isoweekday = year4 "-"? "W" weekofyear "-"? [0-7];
|
||||
isoweek = year4 "-"? "W" weekofyear;
|
||||
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
|
||||
firstdayof = 'first day of'?;
|
||||
lastdayof = 'last day of'?;
|
||||
firstdayof = 'first day of';
|
||||
lastdayof = 'last day of';
|
||||
backof = 'back of ' hour24 space? meridian?;
|
||||
frontof = 'front of ' hour24 space? meridian?;
|
||||
|
||||
@@ -1055,7 +1029,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
TIMELIB_HAVE_RELATIVE();
|
||||
|
||||
/* skip "last day of" or "first day of" */
|
||||
if (*ptr == 'l') {
|
||||
if (*ptr == 'l' || *ptr == 'L') {
|
||||
s->time->relative.first_last_day_of = 2;
|
||||
} else {
|
||||
s->time->relative.first_last_day_of = 1;
|
||||
@@ -2232,7 +2206,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
|
||||
{
|
||||
const timelib_tz_lookup_table *tp;
|
||||
|
||||
tp = zone_search(abbr, gmtoffset, isdst);
|
||||
tp = abbr_search(abbr, gmtoffset, isdst);
|
||||
if (tp) {
|
||||
return (tp->full_tz_name);
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
| Copyright (c) 1997-2014 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1565
-1504
File diff suppressed because it is too large.
Load diff
+36
-16
@@ -50,7 +50,11 @@ static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i;
|
||||
int st = snprintf(s, len, "%lld", i); \
|
||||
s[st] = '\0'; \
|
||||
} while (0);
|
||||
#ifdef HAVE_ATOLL
|
||||
# define DATE_A64I(i, s) i = atoll(s)
|
||||
#else
|
||||
# define DATE_A64I(i, s) i = strtoll(s, NULL, 10)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* {{{ arginfo */
|
||||
@@ -2530,11 +2534,7 @@ static void date_object_free_storage_period(void *object TSRMLS_DC)
|
||||
/* Advanced Interface */
|
||||
PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
|
||||
{
|
||||
Z_TYPE_P(object) = IS_OBJECT;
|
||||
object_init_ex(object, pce);
|
||||
Z_SET_REFCOUNT_P(object, 1);
|
||||
Z_UNSET_ISREF_P(object);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -2642,14 +2642,19 @@ PHP_FUNCTION(date_create)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL;
|
||||
int time_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2662,14 +2667,19 @@ PHP_FUNCTION(date_create_immutable)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL;
|
||||
int time_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2682,14 +2692,19 @@ PHP_FUNCTION(date_create_from_format)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL, *format_str = NULL;
|
||||
int time_str_len = 0, format_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2702,14 +2717,19 @@ PHP_FUNCTION(date_create_immutable_from_format)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL, *format_str = NULL;
|
||||
int time_str_len = 0, format_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2750,7 +2770,7 @@ PHP_METHOD(DateTimeImmutable, __construct)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
|
||||
static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
zval **z_date = NULL;
|
||||
zval **z_timezone = NULL;
|
||||
@@ -2820,7 +2840,7 @@ PHP_METHOD(DateTime, __set_state)
|
||||
|
||||
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
|
||||
dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTime object");
|
||||
}
|
||||
}
|
||||
@@ -2842,7 +2862,7 @@ PHP_METHOD(DateTimeImmutable, __set_state)
|
||||
|
||||
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
|
||||
dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTimeImmutable object");
|
||||
}
|
||||
}
|
||||
@@ -2860,7 +2880,7 @@ PHP_METHOD(DateTime, __wakeup)
|
||||
|
||||
myht = Z_OBJPROP_P(object);
|
||||
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTime object");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,18 +95,18 @@ result = Monday 2037-10-05 00:00:00 NZDT
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Australia/Adelaide
|
||||
ts = Friday 1971-01-01 17:17:17 CST
|
||||
result = Monday 1971-01-04 00:00:00 CST
|
||||
ts = Friday 1971-01-01 17:17:17 ACST
|
||||
result = Monday 1971-01-04 00:00:00 ACST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Australia/Darwin
|
||||
ts = Monday 1971-03-29 17:17:17 CST
|
||||
result = Monday 1971-04-05 00:00:00 CST
|
||||
ts = Monday 1971-03-29 17:17:17 ACST
|
||||
result = Monday 1971-04-05 00:00:00 ACST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Australia/Perth
|
||||
ts = Friday 1971-01-01 17:17:17 WST
|
||||
result = Monday 1971-01-04 00:00:00 WST
|
||||
ts = Friday 1971-01-01 17:17:17 AWST
|
||||
result = Monday 1971-01-04 00:00:00 AWST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
America/Aruba
|
||||
|
||||
@@ -233,8 +233,8 @@ result=Saturday 1970-01-03 00:00:00 CAT 0
|
||||
wanted=Saturday 00:00:00
|
||||
|
||||
TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
|
||||
tStamp=Thursday 1980-04-24 17:17:17 KAST 0
|
||||
result=Thursday 1980-05-01 03:00:00 CST 0
|
||||
tStamp=Thursday 1980-04-24 17:17:17 XJT 0
|
||||
result=Thursday 1980-05-01 00:00:00 XJT 0
|
||||
wanted=Thursday 03:00:00
|
||||
|
||||
TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
|
||||
|
||||
@@ -39,5 +39,5 @@ datestr 10:00:00 AM July 1 2005 UTC
|
||||
|
||||
Setting TZ
|
||||
input 10:00:00 AM July 1 2005
|
||||
strftime 10:00:00 AM July 1 2005 EST +1000
|
||||
datestr 10:00:00 AM July 1 2005 EST
|
||||
strftime 10:00:00 AM July 1 2005 AEST +1000
|
||||
datestr 10:00:00 AM July 1 2005 AEST
|
||||
@@ -44,7 +44,7 @@ array(4) {
|
||||
|
||||
string(6) "Y-m-d+"
|
||||
string(19) "2001-11-29 13:20:01"
|
||||
object(DateTime)#2 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
@@ -70,7 +70,7 @@ array(4) {
|
||||
|
||||
string(7) "Y-m-d +"
|
||||
string(19) "2001-11-29 13:20:01"
|
||||
object(DateTime)#3 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
@@ -96,7 +96,7 @@ array(4) {
|
||||
|
||||
string(6) "Y-m-d+"
|
||||
string(10) "2001-11-29"
|
||||
object(DateTime)#2 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
@@ -139,7 +139,7 @@ array(4) {
|
||||
|
||||
string(7) "Y-m-d +"
|
||||
string(11) "2001-11-29 "
|
||||
object(DateTime)#2 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
--TEST--
|
||||
Bug #66986 (Some timezones are no longer valid in PHP 5.5.10)
|
||||
--FILE--
|
||||
<?php
|
||||
$zones = array(
|
||||
"CST6CDT", "Cuba", "Egypt", "Eire", "EST5EDT", "Factory", "GB-Eire",
|
||||
"GMT0", "Greenwich", "Hongkong", "Iceland", "Iran", "Israel", "Jamaica",
|
||||
"Japan", "Kwajalein", "Libya", "MST7MDT", "Navajo", "NZ-CHAT", "Poland",
|
||||
"Portugal", "PST8PDT", "Singapore", "Turkey", "Universal", "W-SU",
|
||||
|
||||
"UTC", "GMT", "GMT+0100", "-0230",
|
||||
);
|
||||
|
||||
foreach ( $zones as $zone )
|
||||
{
|
||||
$d = new DateTimeZone( $zone );
|
||||
print_r($d);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => CST6CDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Cuba
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Egypt
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Eire
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => EST5EDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Factory
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => GB-Eire
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => GMT0
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Greenwich
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Hongkong
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Iceland
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Iran
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Israel
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Jamaica
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Japan
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Kwajalein
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Libya
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => MST7MDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Navajo
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => NZ-CHAT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Poland
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Portugal
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => PST8PDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Singapore
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Turkey
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Universal
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => W-SU
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => UTC
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 2
|
||||
[timezone] => GMT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 1
|
||||
[timezone] => +01:00
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 1
|
||||
[timezone] => -02:30
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #67109 (First uppercase letter breaks date string parsing)
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(date('d.m.Y',strtotime('last day of april')));
|
||||
var_dump(date('d.m.Y',strtotime('Last day of april')));
|
||||
var_dump(date('d.m.Y',strtotime('lAst Day of April')));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(10) "30.04.%d"
|
||||
string(10) "30.04.%d"
|
||||
string(10) "30.04.%d"
|
||||
+1
-1
@@ -518,7 +518,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
|
||||
value = null_value;
|
||||
} else if (Z_TYPE_P(value) == IS_OBJECT) {
|
||||
/* these are zvalues create on demand, with refcount and is_ref
|
||||
* status left in an uninitalized stated */
|
||||
* status left in an uninitialized stated */
|
||||
zval_dtor(value);
|
||||
efree(value);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Test eregi() function : basic functionality - confirm case insensitivity
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test basic funtionality of eregi()
|
||||
* Test basic functionality of eregi()
|
||||
*/
|
||||
|
||||
echo "*** Testing eregi() : basic functionality ***\n";
|
||||
|
||||
+2
-2
@@ -156,12 +156,12 @@ if test "\$PHP_$EXTNAME" != "no"; then
|
||||
|
||||
dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL,
|
||||
dnl [
|
||||
dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD)
|
||||
dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD)
|
||||
dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ])
|
||||
dnl ],[
|
||||
dnl AC_MSG_ERROR([wrong $extname lib version or lib not found])
|
||||
dnl ],[
|
||||
dnl -L\$${EXTNAME}_DIR/lib -lm
|
||||
dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm
|
||||
dnl ])
|
||||
dnl
|
||||
dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
|
||||
|
||||
@@ -115198,7 +115198,7 @@ const unsigned char php_magic_database[2606480] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0x00, 0x3D, 0x1B, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x5E, 0x5C, 0x73, 0x7B, 0x30, 0x2C, 0x31, 0x30, 0x30, 0x7D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x5C,
|
||||
0x73, 0x7B, 0x30, 0x2C, 0x31, 0x30, 0x30, 0x7D, 0x5B, 0x7B, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
+130
-44
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/apprentice.c Fri Apr 11 12:36:52 2014
|
||||
+++ libmagic/apprentice.c Mon Apr 14 23:42:51 2014
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -833,7 +833,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/ascmagic.c Mon Mar 10 16:40:55 2014
|
||||
+++ libmagic/ascmagic.c Mon Apr 14 23:42:51 2014
|
||||
@@ -139,7 +139,7 @@
|
||||
/* malloc size is a conservative overestimate; could be
|
||||
improved, or at least realloced after conversion. */
|
||||
@@ -872,7 +872,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/cdf.c Tue May 27 22:22:35 2014
|
||||
+++ libmagic/cdf.c Tue Jul 1 09:00:09 2014
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -891,7 +891,25 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
@@ -296,7 +306,10 @@
|
||||
@@ -267,13 +277,15 @@
|
||||
{
|
||||
const char *b = (const char *)sst->sst_tab;
|
||||
const char *e = ((const char *)p) + tail;
|
||||
+ size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
|
||||
+ CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
|
||||
(void)&line;
|
||||
- if (e >= b && (size_t)(e - b) <= CDF_SEC_SIZE(h) * sst->sst_len)
|
||||
+ if (e >= b && (size_t)(e - b) <= ss * sst->sst_len)
|
||||
return 0;
|
||||
DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
|
||||
" > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
|
||||
SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
|
||||
- CDF_SEC_SIZE(h) * sst->sst_len, CDF_SEC_SIZE(h), sst->sst_len));
|
||||
+ ss * sst->sst_len, ss, sst->sst_len));
|
||||
errno = EFTYPE;
|
||||
return -1;
|
||||
}
|
||||
@@ -296,7 +308,10 @@
|
||||
if (info->i_fd == -1)
|
||||
return -1;
|
||||
|
||||
@@ -903,7 +921,54 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
return -1;
|
||||
|
||||
return (ssize_t)len;
|
||||
@@ -810,6 +823,10 @@
|
||||
@@ -352,10 +367,10 @@
|
||||
size_t ss = CDF_SHORT_SEC_SIZE(h);
|
||||
size_t pos = CDF_SHORT_SEC_POS(h, id);
|
||||
assert(ss == len);
|
||||
- if (pos > CDF_SEC_SIZE(h) * sst->sst_len) {
|
||||
+ if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
|
||||
DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
|
||||
SIZE_T_FORMAT "u\n",
|
||||
- pos, CDF_SEC_SIZE(h) * sst->sst_len));
|
||||
+ pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
|
||||
return -1;
|
||||
}
|
||||
(void)memcpy(((char *)buf) + offs,
|
||||
@@ -455,7 +470,8 @@
|
||||
cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size)
|
||||
{
|
||||
size_t i, j;
|
||||
- cdf_secid_t maxsector = (cdf_secid_t)(sat->sat_len * size);
|
||||
+ cdf_secid_t maxsector = (cdf_secid_t)((sat->sat_len * size)
|
||||
+ / sizeof(maxsector));
|
||||
|
||||
DPRINTF(("Chain:"));
|
||||
for (j = i = 0; sid >= 0; i++, j++) {
|
||||
@@ -465,8 +481,8 @@
|
||||
errno = EFTYPE;
|
||||
return (size_t)-1;
|
||||
}
|
||||
- if (sid > maxsector) {
|
||||
- DPRINTF(("Sector %d > %d\n", sid, maxsector));
|
||||
+ if (sid >= maxsector) {
|
||||
+ DPRINTF(("Sector %d >= %d\n", sid, maxsector));
|
||||
errno = EFTYPE;
|
||||
return (size_t)-1;
|
||||
}
|
||||
@@ -796,7 +812,11 @@
|
||||
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
|
||||
goto out;
|
||||
for (i = 0; i < sh.sh_properties; i++) {
|
||||
- size_t ofs = CDF_GETUINT32(p, (i << 1) + 1);
|
||||
+ size_t ofs, tail = (i << 1) + 1;
|
||||
+ if (cdf_check_stream_offset(sst, h, p, tail * sizeof(uint32_t),
|
||||
+ __LINE__) == -1)
|
||||
+ goto out;
|
||||
+ ofs = CDF_GETUINT32(p, tail);
|
||||
q = (const uint8_t *)(const void *)
|
||||
((const char *)(const void *)p + ofs
|
||||
- 2 * sizeof(uint32_t));
|
||||
@@ -810,6 +830,10 @@
|
||||
i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
|
||||
if (inp[i].pi_type & CDF_VECTOR) {
|
||||
nelements = CDF_GETUINT32(q, 1);
|
||||
@@ -914,7 +979,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
o = 2;
|
||||
} else {
|
||||
nelements = 1;
|
||||
@@ -884,7 +901,9 @@
|
||||
@@ -884,7 +908,9 @@
|
||||
}
|
||||
DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
|
||||
nelements));
|
||||
@@ -925,7 +990,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
uint32_t l = CDF_GETUINT32(q, o);
|
||||
inp[i].pi_str.s_len = l;
|
||||
inp[i].pi_str.s_buf = (const char *)
|
||||
@@ -929,7 +948,7 @@
|
||||
@@ -929,7 +955,7 @@
|
||||
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
|
||||
{
|
||||
@@ -934,7 +999,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
const cdf_summary_info_header_t *si =
|
||||
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
|
||||
const cdf_section_declaration_t *sd =
|
||||
@@ -944,21 +963,13 @@
|
||||
@@ -944,21 +970,13 @@
|
||||
ssi->si_os = CDF_TOLE2(si->si_os);
|
||||
ssi->si_class = si->si_class;
|
||||
cdf_swap_class(&ssi->si_class);
|
||||
@@ -959,7 +1024,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1132,7 +1143,7 @@
|
||||
@@ -1132,7 +1150,7 @@
|
||||
cdf_directory_t *d;
|
||||
char name[__arraycount(d->d_name)];
|
||||
cdf_stream_t scn;
|
||||
@@ -968,7 +1033,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
|
||||
static const char *types[] = { "empty", "user storage",
|
||||
"user stream", "lockbytes", "property", "root storage" };
|
||||
@@ -1185,7 +1196,7 @@
|
||||
@@ -1185,7 +1203,7 @@
|
||||
cdf_dump_property_info(const cdf_property_info_t *info, size_t count)
|
||||
{
|
||||
cdf_timestamp_t tp;
|
||||
@@ -977,7 +1042,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
char buf[64];
|
||||
size_t i, j;
|
||||
|
||||
@@ -1229,7 +1240,11 @@
|
||||
@@ -1229,7 +1247,11 @@
|
||||
break;
|
||||
case CDF_FILETIME:
|
||||
tp = info[i].pi_tp;
|
||||
@@ -991,7 +1056,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
} else {
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/cdf.h Mon Dec 2 15:25:29 2013
|
||||
+++ libmagic/cdf.h Mon Apr 14 23:32:55 2014
|
||||
@@ -35,10 +35,12 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -1034,7 +1099,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
void cdf_unpack_header(cdf_header_t *, char *);
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/cdf_time.c Mon Dec 2 15:25:29 2013
|
||||
+++ libmagic/cdf_time.c Mon Apr 14 23:32:55 2014
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
@@ -1094,7 +1159,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
static const char *ref = "Sat Apr 23 01:30:00 1977";
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c Sun Jan 6 21:35:43 2013
|
||||
+++ libmagic/compress.c Mon Dec 2 15:25:29 2013
|
||||
+++ libmagic/compress.c Mon Apr 14 23:42:51 2014
|
||||
@@ -32,6 +32,7 @@
|
||||
* uncompress(method, old, n, newch) - uncompress old into new,
|
||||
* using method, return sizeof new
|
||||
@@ -1257,7 +1322,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h Mon Feb 18 16:40:59 2013
|
||||
+++ libmagic/file.h Mon Mar 10 16:40:55 2014
|
||||
+++ libmagic/file.h Mon Apr 14 23:42:51 2014
|
||||
@@ -33,11 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1467,7 +1532,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#endif /* __file_h__ */
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/fsmagic.c Mon Dec 2 15:25:29 2013
|
||||
+++ libmagic/fsmagic.c Mon Apr 14 23:42:51 2014
|
||||
@@ -59,27 +59,21 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -1834,7 +1899,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/funcs.c Mon Mar 10 16:40:55 2014
|
||||
+++ libmagic/funcs.c Mon Apr 14 23:42:51 2014
|
||||
@@ -41,52 +41,42 @@
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
@@ -2128,7 +2193,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
+
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c Fri Jan 11 17:43:09 2013
|
||||
+++ libmagic/magic.c Mon Dec 2 15:29:02 2013
|
||||
+++ libmagic/magic.c Mon Apr 14 23:42:51 2014
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -2472,7 +2537,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h Thu Mar 21 18:52:42 2013
|
||||
+++ libmagic/magic.h Mon Dec 2 15:25:29 2013
|
||||
+++ libmagic/magic.h Mon Apr 14 23:42:51 2014
|
||||
@@ -87,6 +87,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -2491,14 +2556,14 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/print.c Mon Dec 2 15:29:02 2013
|
||||
@@ -28,13 +28,17 @@
|
||||
/*
|
||||
+++ libmagic/print.c Mon Apr 14 23:42:51 2014
|
||||
@@ -29,12 +29,17 @@
|
||||
* print.c - debugging printout routines
|
||||
*/
|
||||
|
||||
+#define _GNU_SOURCE
|
||||
+#include "php.h"
|
||||
|
||||
+
|
||||
#include "file.h"
|
||||
+#include "cdf.h"
|
||||
|
||||
@@ -2510,7 +2575,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
@@ -43,188 +47,28 @@
|
||||
@@ -43,188 +48,28 @@
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
@@ -2711,7 +2776,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
}
|
||||
|
||||
protected const char *
|
||||
@@ -235,7 +79,7 @@
|
||||
@@ -235,7 +80,7 @@
|
||||
struct tm *tm;
|
||||
|
||||
if (flags & FILE_T_WINDOWS) {
|
||||
@@ -2722,7 +2787,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
}
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/readcdf.c Thu Apr 24 19:54:40 2014
|
||||
+++ libmagic/readcdf.c Tue May 27 22:17:37 2014
|
||||
@@ -30,7 +30,11 @@
|
||||
#endif
|
||||
|
||||
@@ -2798,7 +2863,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
return -1;
|
||||
diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
--- libmagic.orig/readelf.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/readelf.c Mon Dec 2 15:25:29 2013
|
||||
+++ libmagic/readelf.c Mon Apr 14 23:42:51 2014
|
||||
@@ -48,8 +48,8 @@
|
||||
private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t,
|
||||
off_t, int *, int);
|
||||
@@ -3050,7 +3115,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
if (fstat(fd, &st) == -1) {
|
||||
diff -u libmagic.orig/readelf.h libmagic/readelf.h
|
||||
--- libmagic.orig/readelf.h Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/readelf.h Mon Dec 2 15:25:29 2013
|
||||
+++ libmagic/readelf.h Mon Apr 14 23:42:51 2014
|
||||
@@ -44,9 +44,17 @@
|
||||
typedef uint32_t Elf32_Word;
|
||||
typedef uint8_t Elf32_Char;
|
||||
@@ -3071,7 +3136,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h
|
||||
typedef uint8_t Elf64_Char;
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/softmagic.c Mon Mar 10 16:40:55 2014
|
||||
+++ libmagic/softmagic.c Tue Jul 1 09:00:09 2014
|
||||
@@ -41,6 +41,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -3221,7 +3286,29 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
break; \
|
||||
} \
|
||||
|
||||
@@ -1145,9 +1130,6 @@
|
||||
@@ -896,10 +881,18 @@
|
||||
return 1;
|
||||
}
|
||||
case FILE_PSTRING: {
|
||||
- char *ptr1 = p->s, *ptr2 = ptr1 + file_pstring_length_size(m);
|
||||
+ size_t sz = file_pstring_length_size(m);
|
||||
+ char *ptr1 = p->s, *ptr2 = ptr1 + sz;
|
||||
size_t len = file_pstring_get_length(m, ptr1);
|
||||
- if (len >= sizeof(p->s))
|
||||
- len = sizeof(p->s) - 1;
|
||||
+ if (len >= sizeof(p->s)) {
|
||||
+ /*
|
||||
+ * The size of the pascal string length (sz)
|
||||
+ * is 1, 2, or 4. We need at least 1 byte for NUL
|
||||
+ * termination, but we've already truncated the
|
||||
+ * string by p->s, so we need to deduct sz.
|
||||
+ */
|
||||
+ len = sizeof(p->s) - sz;
|
||||
+ }
|
||||
while (len--)
|
||||
*ptr1++ = *ptr2++;
|
||||
*ptr1 = '\0';
|
||||
@@ -1145,9 +1138,6 @@
|
||||
"nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
|
||||
nbytes, count);
|
||||
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
|
||||
@@ -3231,7 +3318,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
|
||||
if (m->flag & INDIR) {
|
||||
@@ -1191,7 +1173,7 @@
|
||||
@@ -1191,7 +1181,7 @@
|
||||
}
|
||||
switch (cvt_flip(m->in_type, flip)) {
|
||||
case FILE_BYTE:
|
||||
@@ -3240,7 +3327,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1226,7 +1208,7 @@
|
||||
@@ -1226,7 +1216,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_BESHORT:
|
||||
@@ -3249,7 +3336,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1278,7 +1260,7 @@
|
||||
@@ -1278,7 +1268,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_LESHORT:
|
||||
@@ -3258,7 +3345,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1330,7 +1312,7 @@
|
||||
@@ -1330,7 +1320,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_SHORT:
|
||||
@@ -3267,7 +3354,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1367,7 +1349,7 @@
|
||||
@@ -1367,7 +1357,7 @@
|
||||
break;
|
||||
case FILE_BELONG:
|
||||
case FILE_BEID3:
|
||||
@@ -3276,7 +3363,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1438,7 +1420,7 @@
|
||||
@@ -1438,7 +1428,7 @@
|
||||
break;
|
||||
case FILE_LELONG:
|
||||
case FILE_LEID3:
|
||||
@@ -3285,7 +3372,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1508,7 +1490,7 @@
|
||||
@@ -1508,7 +1498,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_MELONG:
|
||||
@@ -3294,7 +3381,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1578,7 +1560,7 @@
|
||||
@@ -1578,7 +1568,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_LONG:
|
||||
@@ -3303,7 +3390,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1644,23 +1626,20 @@
|
||||
@@ -1644,23 +1634,20 @@
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0) {
|
||||
mdebug(offset, (char *)(void *)p,
|
||||
sizeof(union VALUETYPE));
|
||||
@@ -3329,7 +3416,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@@ -1679,38 +1658,40 @@
|
||||
@@ -1679,38 +1666,40 @@
|
||||
case FILE_FLOAT:
|
||||
case FILE_BEFLOAT:
|
||||
case FILE_LEFLOAT:
|
||||
@@ -3376,7 +3463,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0)
|
||||
fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
|
||||
rbuf = ms->o.buf;
|
||||
@@ -1718,16 +1699,26 @@
|
||||
@@ -1718,16 +1707,26 @@
|
||||
ms->offset = soffset;
|
||||
if (rv == 1) {
|
||||
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
|
||||
@@ -3407,7 +3494,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
sbuf = m->value.s;
|
||||
if (*sbuf == '^') {
|
||||
@@ -1837,6 +1828,42 @@
|
||||
@@ -1837,6 +1836,42 @@
|
||||
return file_strncmp(a, b, len, flags);
|
||||
}
|
||||
|
||||
@@ -3450,7 +3537,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int
|
||||
magiccheck(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -1996,69 +2023,157 @@
|
||||
@@ -1996,69 +2031,157 @@
|
||||
break;
|
||||
}
|
||||
case FILE_REGEX: {
|
||||
@@ -3663,4 +3750,3 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
default:
|
||||
file_magerror(ms, "invalid type %d in magiccheck()", m->type);
|
||||
return -1;
|
||||
|
||||
@@ -1269,7 +1269,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
|
||||
* the sign extension must have happened.
|
||||
*/
|
||||
case FILE_BYTE:
|
||||
v = (char) v;
|
||||
v = (signed char) v;
|
||||
break;
|
||||
case FILE_SHORT:
|
||||
case FILE_BESHORT:
|
||||
|
||||
@@ -820,7 +820,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
q = (const uint8_t *)(const void *)
|
||||
((const char *)(const void *)p + ofs
|
||||
- 2 * sizeof(uint32_t));
|
||||
if (q > e) {
|
||||
if (q < p || q > e) {
|
||||
DPRINTF(("Ran of the end %p > %p\n", q, e));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ private int32_t mprint(struct magic_set *, struct magic *);
|
||||
private int32_t moffset(struct magic_set *, struct magic *);
|
||||
private void mdebug(uint32_t, const char *, size_t);
|
||||
private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
|
||||
const unsigned char *, uint32_t, size_t, size_t);
|
||||
const unsigned char *, uint32_t, size_t, struct magic *);
|
||||
private int mconvert(struct magic_set *, struct magic *, int);
|
||||
private int print_sep(struct magic_set *, int);
|
||||
private int handle_annotation(struct magic_set *, struct magic *);
|
||||
@@ -1003,7 +1003,7 @@ mdebug(uint32_t offset, const char *str, size_t len)
|
||||
|
||||
private int
|
||||
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|
||||
const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt)
|
||||
const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
|
||||
{
|
||||
/*
|
||||
* Note: FILE_SEARCH and FILE_REGEX do not actually copy
|
||||
@@ -1023,15 +1023,24 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|
||||
const char *last; /* end of search region */
|
||||
const char *buf; /* start of search region */
|
||||
const char *end;
|
||||
size_t lines;
|
||||
size_t lines, linecnt, bytecnt;
|
||||
|
||||
linecnt = m->str_range;
|
||||
bytecnt = linecnt * 80;
|
||||
|
||||
if (bytecnt == 0) {
|
||||
bytecnt = 8192;
|
||||
}
|
||||
if (bytecnt > nbytes) {
|
||||
bytecnt = nbytes;
|
||||
}
|
||||
if (s == NULL) {
|
||||
ms->search.s_len = 0;
|
||||
ms->search.s = NULL;
|
||||
return 0;
|
||||
}
|
||||
buf = RCAST(const char *, s) + offset;
|
||||
end = last = RCAST(const char *, s) + nbytes;
|
||||
end = last = RCAST(const char *, s) + bytecnt;
|
||||
/* mget() guarantees buf <= last */
|
||||
for (lines = linecnt, b = buf; lines && b < end &&
|
||||
((b = CAST(const char *,
|
||||
@@ -1044,7 +1053,7 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|
||||
b++;
|
||||
}
|
||||
if (lines)
|
||||
last = RCAST(const char *, s) + nbytes;
|
||||
last = RCAST(const char *, s) + bytecnt;
|
||||
|
||||
ms->search.s = buf;
|
||||
ms->search.s_len = last - buf;
|
||||
@@ -1118,7 +1127,6 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
|
||||
int *need_separator, int *returnval)
|
||||
{
|
||||
uint32_t soffset, offset = ms->offset;
|
||||
uint32_t count = m->str_range;
|
||||
int rv, oneed_separator;
|
||||
char *sbuf, *rbuf;
|
||||
union VALUETYPE *p = &ms->ms_value;
|
||||
@@ -1130,13 +1138,12 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
|
||||
}
|
||||
|
||||
if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o),
|
||||
(uint32_t)nbytes, count) == -1)
|
||||
(uint32_t)nbytes, m) == -1)
|
||||
return -1;
|
||||
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0) {
|
||||
fprintf(stderr, "mget(type=%d, flag=%x, offset=%u, o=%zu, "
|
||||
"nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
|
||||
nbytes, count);
|
||||
"nbytes=%zu)\n", m->type, m->flag, offset, o, nbytes);
|
||||
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
|
||||
}
|
||||
|
||||
@@ -1627,7 +1634,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0)
|
||||
fprintf(stderr, "indirect +offs=%u\n", offset);
|
||||
}
|
||||
if (mcopy(ms, p, m->type, 0, s, offset, nbytes, count) == -1)
|
||||
if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
|
||||
return -1;
|
||||
ms->offset = offset;
|
||||
|
||||
@@ -2057,7 +2064,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
|
||||
zval *retval;
|
||||
zval *subpats;
|
||||
char *haystack;
|
||||
|
||||
|
||||
MAKE_STD_ZVAL(retval);
|
||||
ALLOC_INIT_ZVAL(subpats);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Patches applied to file sources tree before generating magic.mgc
|
||||
Patches applied to file 5.14 sources tree before generating magic.mgc
|
||||
and before running create_data_file.php to create data_file.c.
|
||||
|
||||
|
||||
@@ -17,14 +17,6 @@ diff --git a/magic/Magdir/commands b/magic/Magdir/commands
|
||||
index 67c3eee..4a7d8dd 100644
|
||||
--- a/magic/Magdir/commands
|
||||
+++ b/magic/Magdir/commands
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
-# $File: commands,v 1.44 2013/02/05 15:20:47 christos Exp $
|
||||
+# $File: commands,v 1.45 2013/02/06 14:18:52 christos Exp $
|
||||
# commands: file(1) magic for various shells and interpreters
|
||||
#
|
||||
#0 string/w : shell archive or script for antique kernel text
|
||||
@@ -49,7 +49,7 @@
|
||||
!:mime text/x-awk
|
||||
0 string/wt #!\ /usr/bin/awk awk script text executable
|
||||
@@ -36,4 +28,56 @@ index 67c3eee..4a7d8dd 100644
|
||||
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
|
||||
--
|
||||
1.8.5.5
|
||||
From 0b478f445b6b7540b58af5d1fe583fa9e48fd745 Mon Sep 17 00:00:00 2001
|
||||
From: Christos Zoulas <christos@zoulas.com>
|
||||
Date: Wed, 28 May 2014 19:52:36 +0000
|
||||
Subject: [PATCH] further optimize awk by not looking for the BEGIN regex until
|
||||
we found the BEGIN (Jan Kaluza)
|
||||
|
||||
---
|
||||
magic/Magdir/commands | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/magic/Magdir/commands b/magic/Magdir/commands
|
||||
index bfffdef..26b2869 100644
|
||||
--- a/magic/Magdir/commands
|
||||
+++ b/magic/Magdir/commands
|
||||
@@ -49,7 +49,8 @@
|
||||
!:mime text/x-awk
|
||||
0 string/wt #!\ /usr/bin/awk awk script text executable
|
||||
!:mime text/x-awk
|
||||
-0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
||||
+0 search/16384 BEGIN
|
||||
+>0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
||||
|
||||
# AT&T Bell Labs' Plan 9 shell
|
||||
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
|
||||
--
|
||||
2.0.3
|
||||
|
||||
From 71a8b6c0d758acb0f73e2e51421a711b5e9d6668 Mon Sep 17 00:00:00 2001
|
||||
From: Christos Zoulas <christos@zoulas.com>
|
||||
Date: Fri, 30 May 2014 16:48:44 +0000
|
||||
Subject: [PATCH] Limit regex search for BEGIN to the first 4K of the file.
|
||||
|
||||
---
|
||||
magic/Magdir/commands | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/magic/Magdir/commands b/magic/Magdir/commands
|
||||
index 26b2869..bcd0f43 100644
|
||||
--- a/magic/Magdir/commands
|
||||
+++ b/magic/Magdir/commands
|
||||
@@ -49,8 +49,7 @@
|
||||
!:mime text/x-awk
|
||||
0 string/wt #!\ /usr/bin/awk awk script text executable
|
||||
!:mime text/x-awk
|
||||
-0 search/16384 BEGIN
|
||||
->0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
||||
+0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
||||
|
||||
# AT&T Bell Labs' Plan 9 shell
|
||||
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
|
||||
--
|
||||
2.0.3
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Bug #66731: file: extensive backtraking
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!class_exists('finfo'))
|
||||
die('skip no fileinfo extension');
|
||||
--FILE--
|
||||
<?php
|
||||
$fd = __DIR__.'/cve-2014-3538.data';
|
||||
|
||||
file_put_contents($fd,
|
||||
'try:' .
|
||||
str_repeat("\n", 1000000));
|
||||
|
||||
$fi = finfo_open(FILEINFO_NONE);
|
||||
$t = microtime(true);
|
||||
var_dump(finfo_file($fi, $fd));
|
||||
$t = microtime(true) - $t;
|
||||
finfo_close($fi);
|
||||
if ($t < 1) {
|
||||
echo "Ok\n";
|
||||
} else {
|
||||
printf("Failed, time=%.2f\n", $t);
|
||||
}
|
||||
|
||||
?>
|
||||
Done
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__.'/cve-2014-3538.data');
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
Ok
|
||||
Done
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #67296 (filter_input doesn't validate variables)
|
||||
--XFAIL--
|
||||
See Bug #49184
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("filter")) die("skip needs filter ext"); ?>
|
||||
--ENV--
|
||||
return <<<END
|
||||
HTTP_X_FORWARDED_FOR=example.com
|
||||
END;
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(filter_input(INPUT_SERVER, "HTTP_X_FORWARDED_FOR", FILTER_UNSAFE_RAW));
|
||||
var_dump($_SERVER["HTTP_X_FORWARDED_FOR"]);
|
||||
var_dump(getenv("HTTP_X_FORWARDED_FOR"));
|
||||
var_dump("done");
|
||||
?>
|
||||
--EXPECT--
|
||||
string(11) "example.com"
|
||||
string(11) "example.com"
|
||||
string(11) "example.com"
|
||||
string(4) "done"
|
||||
@@ -18,5 +18,5 @@ var_dump(ftp_login($ftp, 'user', 'pass'));
|
||||
ftp_close($ftp);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ftp_login(): bogus msg in %sbug37799.php on line 8
|
||||
Warning: ftp_login(): %rdummy|bogus msg%r in %sbug37799.php on line 8
|
||||
bool(false)
|
||||
@@ -124,6 +124,11 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
|
||||
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
stream = php_stream_open_wrapper(Z_STRVAL_P(to_zval), "wb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
|
||||
if (stream == NULL) {
|
||||
RETURN_FALSE;
|
||||
|
||||
+4
-2
@@ -370,9 +370,10 @@ static void *fontFetch (char **error, void *key)
|
||||
fontlist = gdEstrdup(a->fontlist);
|
||||
|
||||
/*
|
||||
* Must use gd_strtok_r else pointer corrupted by strtok in nested loop.
|
||||
* Must use gd_strtok_r becasuse strtok() isn't thread safe
|
||||
*/
|
||||
for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr)) {
|
||||
char *strtok_ptr_path;
|
||||
/* make a fresh copy each time - strtok corrupts it. */
|
||||
path = gdEstrdup (fontsearchpath);
|
||||
|
||||
@@ -388,7 +389,8 @@ static void *fontFetch (char **error, void *key)
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) {
|
||||
for (dir = gd_strtok_r (path, PATHSEPARATOR, &strtok_ptr_path); dir;
|
||||
dir = gd_strtok_r (0, PATHSEPARATOR, &strtok_ptr_path)) {
|
||||
if (!strcmp(dir, ".")) {
|
||||
TSRMLS_FETCH();
|
||||
#if HAVE_GETCWD
|
||||
|
||||
@@ -31,12 +31,17 @@ gdImagePtr gdImageCreateFromXpm (char *filename)
|
||||
if (ret != XpmSuccess) {
|
||||
return 0;
|
||||
}
|
||||
number = image.ncolors;
|
||||
for(i = 0; i < number; i++) {
|
||||
if (!image.colorTable[i].c_color) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(im = gdImageCreate(image.width, image.height))) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
number = image.ncolors;
|
||||
colors = (int *) safe_emalloc(number, sizeof(int), 0);
|
||||
for (i = 0; i < number; i++) {
|
||||
switch (strlen (image.colorTable[i].c_color)) {
|
||||
|
||||
@@ -20,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
(-1, 15)
|
||||
(156, 15)
|
||||
(156, -48)
|
||||
(15%d, 15)
|
||||
(15%d, -48)
|
||||
(-1, -48)
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegd2
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegd2 TEST\n";
|
||||
imagegd2($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegd2 TEST
|
||||
|
||||
Warning: imagegd2() expects parameter 2 to be a valid path, string given in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegd
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegd TEST\n";
|
||||
imagegd($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegd TEST
|
||||
|
||||
Warning: imagegd() expects parameter 2 to be a valid path, string given in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegif
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['GIF Create Support']) || $support['GIF Create Support'] === false) {
|
||||
print 'skip gif support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegif TEST\n";
|
||||
imagegif($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegif TEST
|
||||
|
||||
Warning: imagegif(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagejpeg
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['JPEG Support']) || $support['JPEG Support'] === false) {
|
||||
print 'skip jpeg support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagejpeg TEST\n";
|
||||
imagejpeg($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagejpeg TEST
|
||||
|
||||
Warning: imagejpeg(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagepng
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['PNG Support']) || $support['PNG Support'] === false) {
|
||||
print 'skip png support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagepng TEST\n";
|
||||
imagepng($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagepng TEST
|
||||
|
||||
Warning: imagepng(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagewbmp
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['WBMP Support']) || $support['WBMP Support'] === false) {
|
||||
print 'skip wbmp support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagewbmp TEST\n";
|
||||
imagewbmp($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagewbmp TEST
|
||||
|
||||
Warning: imagewbmp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagewebp
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['WEBP Support']) || $support['WEBP Support'] === false) {
|
||||
print 'skip webp support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagewebp TEST\n";
|
||||
imagewebp($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagewbmp TEST
|
||||
|
||||
Warning: imagewebp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -73,7 +73,9 @@ PHP_FUNCTION( numfmt_parse )
|
||||
}
|
||||
|
||||
#if ICU_LOCALE_BUG && defined(LC_NUMERIC)
|
||||
oldlocale = setlocale(LC_NUMERIC, "C");
|
||||
/* need to copy here since setlocale may change it later */
|
||||
oldlocale = estrdup(setlocale(LC_NUMERIC, NULL));
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
#endif
|
||||
|
||||
switch(type) {
|
||||
@@ -100,6 +102,7 @@ PHP_FUNCTION( numfmt_parse )
|
||||
}
|
||||
#if ICU_LOCALE_BUG && defined(LC_NUMERIC)
|
||||
setlocale(LC_NUMERIC, oldlocale);
|
||||
efree(oldlocale);
|
||||
#endif
|
||||
if(zposition) {
|
||||
zval_dtor(zposition);
|
||||
|
||||
@@ -269,8 +269,7 @@ static char* get_icu_value_internal( const char* loc_name , char* tag_name, int*
|
||||
grOffset = findOffset( LOC_GRANDFATHERED , loc_name );
|
||||
if( grOffset >= 0 ){
|
||||
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
|
||||
tag_value = estrdup(loc_name);
|
||||
return tag_value;
|
||||
return estrdup(loc_name);
|
||||
} else {
|
||||
/* Since Grandfathered , no value , do nothing , retutn NULL */
|
||||
return NULL;
|
||||
@@ -280,8 +279,8 @@ static char* get_icu_value_internal( const char* loc_name , char* tag_name, int*
|
||||
if( fromParseLocale==1 ){
|
||||
/* Handle singletons */
|
||||
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
|
||||
if( strlen(loc_name)>1 && (isIDPrefix(loc_name) ==1 ) ){
|
||||
return (char *)loc_name;
|
||||
if( strlen(loc_name)>1 && (isIDPrefix(loc_name) == 1) ){
|
||||
return estrdup(loc_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,6 +497,14 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
|
||||
/* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
|
||||
spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
|
||||
efree(msg);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if(loc_name_len == 0) {
|
||||
loc_name = intl_locale_get_default(TSRMLS_C);
|
||||
}
|
||||
|
||||
+1
-1
@@ -445,7 +445,7 @@ ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_idarg_static, 0, 0, 1 )
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_from_date_time_zone, 0, 0, 1 )
|
||||
ZEND_ARG_OBJ_INFO( 0, dateTimeZone, IntlDateTimeZone, 0 )
|
||||
ZEND_ARG_OBJ_INFO( 0, dateTimeZone, DateTimeZone, 0 )
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_create_enumeration, 0, 0, 0 )
|
||||
|
||||
@@ -15,6 +15,7 @@ function ut_main()
|
||||
setlocale(LC_ALL, $de_locale);
|
||||
$fmt = new NumberFormatter("de", NumberFormatter::DECIMAL );
|
||||
$numeric = $fmt->parse("1234,56");
|
||||
setlocale(LC_ALL, "C"); // reset for printing
|
||||
$res_str .= "$numeric\n";
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ var_dump(locale_get_display_name(str_repeat("a", 300), null));
|
||||
var_dump(locale_get_display_name(str_repeat("a", 512), null));
|
||||
var_dump(locale_get_display_name(str_repeat("a", 600), null));
|
||||
--EXPECT--
|
||||
string(300) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
string(512) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
string(600) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #66921 - Wrong argument type hint for function intltz_from_date_time_zone
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$f = new ReflectionFunction('intltz_from_date_time_zone');
|
||||
var_dump($f->getParameters()[0]->getClass());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(ReflectionClass)#%d (1) {
|
||||
["name"]=>
|
||||
string(12) "DateTimeZone"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
setlocale(LC_ALL, 'de_DE');
|
||||
$fmt = new NumberFormatter( 'sl_SI.UTF-8', NumberFormatter::DECIMAL);
|
||||
$num = "1.234.567,891";
|
||||
$res_str = $fmt->parse($num)."\n";
|
||||
$res_str .= setlocale(LC_NUMERIC, 0);
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1234567,891
|
||||
de_DE
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1))
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$ret = var_export(ut_loc_get_display_name(str_repeat('*', 256), 'en_us'), true);
|
||||
$ret .= "\n";
|
||||
$ret .= var_export(intl_get_error_message(), true);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECTF--
|
||||
false
|
||||
'locale_get_display_name : name too long: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
@@ -3,6 +3,8 @@ get_locale() icu <= 4.2
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.3', '<') != 1) print 'skip'; ?>
|
||||
--INI--
|
||||
precision=6
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ function ut_main()
|
||||
//Some Invalid Tags:
|
||||
'de-419-DE',
|
||||
'a-DE',
|
||||
'ar-a-aaa-b-bbb-a-ccc'
|
||||
'ar-a-aaa-b-bbb-a-ccc',
|
||||
'x-AAAAAA',
|
||||
);
|
||||
|
||||
|
||||
@@ -201,3 +202,6 @@ No values found from Locale parsing.
|
||||
---------------------
|
||||
ar-a-aaa-b-bbb-a-ccc:
|
||||
language : 'ar' ,
|
||||
---------------------
|
||||
x-AAAAAA:
|
||||
private0 : 'AAAAAA' ,
|
||||
+1
-1
@@ -382,7 +382,7 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Only check if utf8 string is valid, and compute utf16 lenght */
|
||||
/* Only check if utf8 string is valid, and compute utf16 length */
|
||||
for (j=0 ; pos < len ; j++) {
|
||||
us = php_next_utf8_char((const unsigned char *)utf8, len, &pos, &status);
|
||||
if (status != SUCCESS) {
|
||||
|
||||
+21
-2
@@ -385,6 +385,23 @@ static int _get_lderrno(LDAP *ldap)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ _set_lderrno
|
||||
*/
|
||||
static void _set_lderrno(LDAP *ldap, int lderr)
|
||||
{
|
||||
#if !HAVE_NSLDAP
|
||||
#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP
|
||||
/* New versions of OpenLDAP do it this way */
|
||||
ldap_set_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr);
|
||||
#else
|
||||
ldap->ld_errno = lderr;
|
||||
#endif
|
||||
#else
|
||||
ldap_set_lderrno(ldap, lderr, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool ldap_bind(resource link [, string dn [, string password]])
|
||||
Bind to LDAP directory */
|
||||
PHP_FUNCTION(ldap_bind)
|
||||
@@ -399,18 +416,20 @@ PHP_FUNCTION(ldap_bind)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
||||
|
||||
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
|
||||
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
|
||||
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
||||
|
||||
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -260,7 +260,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
|
||||
goto out;
|
||||
}
|
||||
|
||||
num = n; /* make sure to process initilized vars only */
|
||||
num = n; /* make sure to process initialized vars only */
|
||||
|
||||
/* initialize converter */
|
||||
if (info->num_from_encodings <= 0) {
|
||||
|
||||
@@ -31,7 +31,7 @@ require_once("clean_table.inc");
|
||||
--EXPECTF--
|
||||
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
|
||||
I don\'t mind character sets, do I?\n
|
||||
Warning: mysql_query(): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BOGUS_SQL' at line 1 in %s on line %d
|
||||
Warning: mysql_query(): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BOGUS_SQL' at line 1 in %s on line %d
|
||||
done!
|
||||
|
||||
Warning: Unknown: 1 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in %s on line %d
|
||||
@@ -62,18 +62,18 @@ mysqli_close($link);
|
||||
--EXPECT--
|
||||
array(7) {
|
||||
[0]=>
|
||||
float(3.14159274101)
|
||||
float(3.141593)
|
||||
[1]=>
|
||||
float(-9.99999997475E-7)
|
||||
float(-1.0E-6)
|
||||
[2]=>
|
||||
float(0)
|
||||
[3]=>
|
||||
float(999999995904)
|
||||
float(1.0E+12)
|
||||
[4]=>
|
||||
float(0.564642488956)
|
||||
float(0.5646425)
|
||||
[5]=>
|
||||
float(1)
|
||||
[6]=>
|
||||
float(8.88888914608E+14)
|
||||
float(8.888889E+14)
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -67,7 +67,7 @@ array(8) {
|
||||
[3]=>
|
||||
int(4999999)
|
||||
[4]=>
|
||||
float(2345.60009766)
|
||||
float(2345.6)
|
||||
[5]=>
|
||||
float(5678.89563)
|
||||
[6]=>
|
||||
@@ -75,4 +75,4 @@ array(8) {
|
||||
[7]=>
|
||||
%unicode|string%(11) "mysql rulez"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -66,7 +66,7 @@ array(8) {
|
||||
[3]=>
|
||||
int(54)
|
||||
[4]=>
|
||||
float(2.59999990463)
|
||||
float(2.6)
|
||||
[5]=>
|
||||
float(58.89)
|
||||
[6]=>
|
||||
@@ -74,4 +74,4 @@ array(8) {
|
||||
[7]=>
|
||||
%unicode|string%(3) "6.7"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -12,6 +12,9 @@ require_once('skipifconnectfailure.inc');
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($mysql, "SET sql_mode=''"))
|
||||
printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql));
|
||||
|
||||
$mysql->query("DROP TABLE IF EXISTS test_warnings");
|
||||
|
||||
$mysql->query("CREATE TABLE test_warnings (a int not null) ENGINE=myisam");
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
mysqli_float_handling - ensure 4 byte float is handled correctly
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require('connect.inc');
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, "CREATE TABLE test(id INT PRIMARY KEY, fp4 FLOAT, fp8 DOUBLE) ENGINE = InnoDB")) {
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
// Insert via string to make sure the real floating number gets to the DB
|
||||
if (!mysqli_query($link, "INSERT INTO test(id, fp4, fp8) VALUES (1, 9.9999, 9.9999)")) {
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!($stmt = mysqli_prepare($link, "SELECT id, fp4, fp8 FROM test"))) {
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!mysqli_stmt_execute($stmt)) {
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if (!($result = mysqli_stmt_get_result($stmt))) {
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
$data = mysqli_fetch_assoc($result);
|
||||
print $data['id'] . ": " . $data['fp4'] . ": " . $data['fp8'] . "\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECTF--
|
||||
1: 9.9999: 9.9999
|
||||
@@ -41,6 +41,11 @@ require_once('skipifconnectfailure.inc');
|
||||
if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db . '_unknown_really')))
|
||||
printf("[009] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because after 3 failed change_user attempts, the server blocks you off.
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[006] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, 'SET @mysqli_change_user_test_var=1'))
|
||||
printf("[010] Failed to set test variable: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
@@ -109,4 +114,4 @@ require_once('skipifconnectfailure.inc');
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -48,6 +48,14 @@ if (mysqli_get_server_version($link) >= 50600)
|
||||
if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db . '_unknown_really')))
|
||||
printf("[009] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because Percona and MariaDB block any commands after 3 failed
|
||||
// change_user commands
|
||||
mysqli_close($link);
|
||||
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[020] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
}
|
||||
if (!mysqli_query($link, 'SET @mysqli_change_user_test_var=1'))
|
||||
printf("[010] Failed to set test variable: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
@@ -116,4 +124,4 @@ if (mysqli_get_server_version($link) >= 50600)
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -43,6 +43,11 @@ if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_serv
|
||||
if (false !== ($tmp = $mysqli->change_user($user, $passwd, $db . '_unknown_really')))
|
||||
printf("[008] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because after 3 failed change_user attempts, the server blocks you off.
|
||||
if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
if (!$mysqli->query('SET @mysqli_change_user_test_var=1'))
|
||||
printf("[009] Failed to set test variable: [%d] %s\n", $mysqli->errno, $mysqli->error);
|
||||
|
||||
@@ -81,4 +86,4 @@ if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_serv
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -110,5 +110,5 @@ require_once('skipifconnectfailure.inc');
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NO_SQL' at line 1 in %s on line %d
|
||||
Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'NO_SQL' at line 1 in %s on line %d
|
||||
done!
|
||||
@@ -36,7 +36,7 @@ $port, $socket, mysqli_connect_errno(), mysqli_connect_error());
|
||||
mysqli_error($link));
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(3), PRIMARY
|
||||
KEY(id)) ENGINE=' . $engine . " DEFAULT CHARSET=gbk")) {
|
||||
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link),
|
||||
mysqli_error($link));
|
||||
|
||||
@@ -287,21 +287,21 @@ require_once('skipifconnectfailure.inc');
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
|
||||
|
||||
Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
|
||||
Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d
|
||||
|
||||
Warning: mysqli_kill(): processid should have positive value in %s on line %d
|
||||
|
||||
Warning: mysqli_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
|
||||
Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
|
||||
Warning: mysqli_kill(): processid should have positive value in %s on line %d
|
||||
|
||||
Warning: mysqli_stmt_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_stmt_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
[013] Access denied for user '%s'@'%s' (using password: YES)
|
||||
[016] Access denied for user '%s'@'%s' (using password: YES)
|
||||
done!
|
||||
@@ -97,15 +97,15 @@ require_once('skipifconnectfailure.inc');
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
|
||||
|
||||
Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
|
||||
Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d
|
||||
|
||||
Warning: mysqli_kill(): processid should have positive value in %s on line %d
|
||||
|
||||
Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
|
||||
|
||||
Warning: mysqli_kill(): processid should have positive value in %s on line %d
|
||||
[011] Access denied for user '%s'@'%s' (using password: YES)
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
--TEST--
|
||||
Multiple result set with PS
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once("connect.inc");
|
||||
if (!$IS_MYSQLND) {
|
||||
die("skip mysqlnd only test");
|
||||
}
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require('table.inc');
|
||||
|
||||
$stmt = mysqli_stmt_init($link);
|
||||
if (!$link->query('DROP PROCEDURE IF EXISTS p123')) {
|
||||
printf("[001] [%d] %s\n", $link->error, $link->errno);
|
||||
}
|
||||
|
||||
if (!$link->query("CREATE PROCEDURE p123() BEGIN SELECT id+12, CONCAT_WS('-',label,'ahoi') FROM test ORDER BY id LIMIT 1; SELECT id + 42, CONCAT_WS('---',label, label) FROM test ORDER BY id LIMIT 1; END")) {
|
||||
printf("[002] [%d] %s\n", $link->error, $link->errno);
|
||||
}
|
||||
|
||||
if (!($stmt = $link->prepare("CALL p123"))) {
|
||||
printf("[003] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
if (!$stmt->execute()) {
|
||||
printf("[005] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
$c_id = NULL;
|
||||
$c_label = NULL;
|
||||
if (!$stmt->bind_result($c_id, $c_label)) {
|
||||
printf("[004] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
var_dump("pre:",$c_id, $c_label);
|
||||
|
||||
if (!$stmt->fetch()) {
|
||||
printf("[006] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
var_dump("post:",$c_id, $c_label);
|
||||
|
||||
if ($stmt->fetch()) {
|
||||
printf("[007] Shouldn't have fetched anything\n");
|
||||
var_dump($c_id, $c_label);
|
||||
}
|
||||
|
||||
if ($stmt->fetch()) {
|
||||
printf("[008] No more rows expected\n");
|
||||
}
|
||||
|
||||
if (!$stmt->more_results()) {
|
||||
printf("[009] Expected more results\n");
|
||||
} else {
|
||||
var_dump("[009] next_result:", $stmt->next_result());
|
||||
}
|
||||
|
||||
if (!$stmt->bind_result($c_id, $c_label)) {
|
||||
printf("[010] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
var_dump("pre:",$c_id, $c_label);
|
||||
|
||||
if (!$stmt->fetch()) {
|
||||
printf("[011] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
var_dump("post:",$c_id, $c_label);
|
||||
|
||||
if ($stmt->fetch()) {
|
||||
printf("[012] No more rows expected\n");
|
||||
}
|
||||
|
||||
if (!$stmt->more_results()) {
|
||||
printf("[013] Expected more results\n");
|
||||
} else {
|
||||
var_dump("[013] next_result:", $stmt->next_result());
|
||||
}
|
||||
|
||||
if ($stmt->more_results()) {
|
||||
printf("[014] No more results expected\n");
|
||||
} else {
|
||||
printf("[014] No result, as expected\n");
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$link->close();
|
||||
|
||||
|
||||
echo "done";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
if (!$link->query('DROP PROCEDURE IF EXISTS p123')) {
|
||||
printf("[001] [%d] %s\n", $link->error, $link->errno);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(4) "pre:"
|
||||
NULL
|
||||
NULL
|
||||
string(5) "post:"
|
||||
int(13)
|
||||
string(6) "a-ahoi"
|
||||
string(18) "[009] next_result:"
|
||||
bool(true)
|
||||
string(4) "pre:"
|
||||
int(13)
|
||||
string(6) "a-ahoi"
|
||||
string(5) "post:"
|
||||
int(43)
|
||||
string(5) "a---a"
|
||||
string(18) "[013] next_result:"
|
||||
bool(true)
|
||||
[014] No result, as expected
|
||||
done
|
||||
@@ -12,7 +12,12 @@ if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine)) {
|
||||
if (!mysqli_query($link, 'SET SESSION sql_mode=\'\'')) {
|
||||
printf("Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT DEFAULT 0, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine)) {
|
||||
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
exit(1);
|
||||
}
|
||||
@@ -20,4 +25,4 @@ if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(i
|
||||
if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')")) {
|
||||
printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
}
|
||||
?>
|
||||
?>
|
||||
@@ -61,3 +61,29 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes" || test "$
|
||||
#endif
|
||||
])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check if the compiler supports Decimal32/64/128 types from the IEEE-754 2008 version
|
||||
dnl References: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1657.pdf
|
||||
dnl http://speleotrove.com/decimal/
|
||||
dnl
|
||||
AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types], ac_cv_decimal_fp_supported,[
|
||||
AC_TRY_RUN( [
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
typedef float dec32 __attribute__((mode(SD)));
|
||||
dec32 k = 99.49f;
|
||||
double d2 = (double)k;
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=yes
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=no
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=no
|
||||
])])
|
||||
if test "$ac_cv_decimal_fp_supported" = "yes"; then
|
||||
AC_DEFINE(HAVE_DECIMAL_FP_SUPPORT, 1, [Define if the compiler supports Decimal32/64/128 types.])
|
||||
fi
|
||||
@@ -929,7 +929,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
|
||||
DBG_RETURN(PASS);
|
||||
#else
|
||||
DBG_ENTER("mysqlnd_net::enable_ssl");
|
||||
DBG_INFO("MYSQLND_SSL_SUPPORTED is not defined");
|
||||
DBG_INF("MYSQLND_SSL_SUPPORTED is not defined");
|
||||
DBG_RETURN(PASS);
|
||||
#endif
|
||||
}
|
||||
|
||||
+34
-17
@@ -50,6 +50,7 @@ enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES *result, void *param,
|
||||
static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC);
|
||||
static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
|
||||
|
||||
static void MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC);
|
||||
|
||||
/* {{{ mysqlnd_stmt::store_result */
|
||||
static MYSQLND_RES *
|
||||
@@ -226,7 +227,7 @@ MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
|
||||
DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status->server_status, stmt->upsert_status->server_status & SERVER_STATUS_CURSOR_EXISTS);
|
||||
|
||||
/* Free space for next result */
|
||||
s->m->free_stmt_content(s TSRMLS_CC);
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(s TSRMLS_CC);
|
||||
{
|
||||
enum_func_status ret = s->m->parse_execute_response(s TSRMLS_CC);
|
||||
DBG_RETURN(ret);
|
||||
@@ -2061,6 +2062,37 @@ mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_stmt::free_stmt_result */
|
||||
static void
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||
{
|
||||
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
|
||||
DBG_ENTER("mysqlnd_stmt::free_stmt_result");
|
||||
if (!stmt) {
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/*
|
||||
First separate the bound variables, which point to the result set, then
|
||||
destroy the set.
|
||||
*/
|
||||
mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
|
||||
/* Not every statement has a result set attached */
|
||||
if (stmt->result) {
|
||||
stmt->result->m.free_result_internal(stmt->result TSRMLS_CC);
|
||||
stmt->result = NULL;
|
||||
}
|
||||
if (stmt->error_info->error_list) {
|
||||
zend_llist_clean(stmt->error_info->error_list);
|
||||
mnd_pefree(stmt->error_info->error_list, s->persistent);
|
||||
stmt->error_info->error_list = NULL;
|
||||
}
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_stmt::free_stmt_content */
|
||||
static void
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||
@@ -2093,22 +2125,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC
|
||||
stmt->param_bind = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
First separate the bound variables, which point to the result set, then
|
||||
destroy the set.
|
||||
*/
|
||||
mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
|
||||
/* Not every statement has a result set attached */
|
||||
if (stmt->result) {
|
||||
stmt->result->m.free_result_internal(stmt->result TSRMLS_CC);
|
||||
stmt->result = NULL;
|
||||
}
|
||||
if (stmt->error_info->error_list) {
|
||||
zend_llist_clean(stmt->error_info->error_list);
|
||||
mnd_pefree(stmt->error_info->error_list, s->persistent);
|
||||
stmt->error_info->error_list = NULL;
|
||||
}
|
||||
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(s TSRMLS_CC);
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -174,12 +174,63 @@ ps_fetch_int64(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
|
||||
static void
|
||||
ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
|
||||
{
|
||||
float value;
|
||||
float fval;
|
||||
double dval;
|
||||
DBG_ENTER("ps_fetch_float");
|
||||
float4get(value, *row);
|
||||
ZVAL_DOUBLE(zv, value);
|
||||
float4get(fval, *row);
|
||||
(*row)+= 4;
|
||||
DBG_INF_FMT("value=%f", value);
|
||||
DBG_INF_FMT("value=%f", fval);
|
||||
|
||||
/*
|
||||
* The following is needed to correctly support 4-byte floats.
|
||||
* Otherwise, a value of 9.99 in a FLOAT column comes out of mysqli
|
||||
* as 9.9998998641968.
|
||||
*
|
||||
* For GCC, we use the built-in decimal support to "up-convert" a
|
||||
* 4-byte float to a 8-byte double.
|
||||
* When that is not available, we fall back to converting the float
|
||||
* to a string and then converting the string to a double. This mimics
|
||||
* what MySQL does.
|
||||
*/
|
||||
#ifdef HAVE_DECIMAL_FP_SUPPORT
|
||||
{
|
||||
typedef float dec32 __attribute__((mode(SD)));
|
||||
dec32 d32val = fval;
|
||||
|
||||
/* The following cast is guaranteed to do the right thing */
|
||||
dval = (double) d32val;
|
||||
}
|
||||
#elif defined(PHP_WIN32)
|
||||
{
|
||||
/* float datatype on Winows is already 4 byte but has a precision of 7 digits */
|
||||
char num_buf[2048];
|
||||
(void)_gcvt_s(num_buf, 2048, fval, field->decimals >= 31 ? 7 : field->decimals);
|
||||
dval = zend_strtod(num_buf, NULL);
|
||||
}
|
||||
#else
|
||||
{
|
||||
char num_buf[2048]; /* Over allocated */
|
||||
char *s;
|
||||
|
||||
#ifndef FLT_DIG
|
||||
# define FLT_DIG 6
|
||||
#endif
|
||||
/* Convert to string. Ignoring localization, etc.
|
||||
* Following MySQL's rules. If precision is undefined (NOT_FIXED_DEC i.e. 31)
|
||||
* or larger than 31, the value is limited to 6 (FLT_DIG).
|
||||
*/
|
||||
s = php_gcvt(fval,
|
||||
field->decimals >= 31 ? FLT_DIG : field->decimals,
|
||||
'.',
|
||||
'e',
|
||||
num_buf);
|
||||
|
||||
/* And now convert back to double */
|
||||
dval = zend_strtod(s, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
ZVAL_DOUBLE(zv, dval);
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
Loaded 100 of 236 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user