mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-13 12:10:50 +00:00
Compare commits
425
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e12013b4d | ||
|
|
b364de85bf | ||
|
|
8e8a8ce648 | ||
|
|
51ae20e829 | ||
|
|
1a25137a69 | ||
|
|
348b5eb434 | ||
|
|
d057d767cc | ||
|
|
8ad44700cf | ||
|
|
ea642026eb | ||
|
|
637e47a5ed | ||
|
|
538ff93876 | ||
|
|
54ca2e7f8c | ||
|
|
b00a5c03e6 | ||
|
|
b0def5bde9 | ||
|
|
6b85926104 | ||
|
|
e01d0387d1 | ||
|
|
f59b201f19 | ||
|
|
3fe2e2a372 | ||
|
|
5b3e1ded35 | ||
|
|
afc3f6e8d5 | ||
|
|
3139be0bea | ||
|
|
7ba70a5fed | ||
|
|
d3ae4fe2d2 | ||
|
|
beab622265 | ||
|
|
35713efa02 | ||
|
|
d990b9316a | ||
|
|
7f090ac16a | ||
|
|
643c9c9b47 | ||
|
|
a0d8cedd2b | ||
|
|
df4d0a73d2 | ||
|
|
f8c1ce18e9 | ||
|
|
c547c1b980 | ||
|
|
c6ce03e45e | ||
|
|
4c083e7a66 | ||
|
|
6738d19fb8 | ||
|
|
2c602be7c8 | ||
|
|
279ba58edb | ||
|
|
972c4869a7 | ||
|
|
2513da4b4c | ||
|
|
b3fff5fc41 | ||
|
|
435e812c09 | ||
|
|
7c852a7961 | ||
|
|
98ef183ed0 | ||
|
|
8677edb2dd | ||
|
|
029a60b2c7 | ||
|
|
127273327b | ||
|
|
5ac5f313bd | ||
|
|
fe3d53f443 | ||
|
|
42344cdc53 | ||
|
|
d8f2e1a511 | ||
|
|
4b42056042 | ||
|
|
090fef553d | ||
|
|
6e5287bb95 | ||
|
|
befdc10c32 | ||
|
|
31c3646757 | ||
|
|
1df43a086f | ||
|
|
919ead1157 | ||
|
|
3070883bcf | ||
|
|
4371af3e19 | ||
|
|
4c06d929c0 | ||
|
|
95ee9efa57 | ||
|
|
5a18d7a0df | ||
|
|
ee76a5ae5a | ||
|
|
58b0003975 | ||
|
|
a4c55eefd0 | ||
|
|
6e64aba47f | ||
|
|
e2dcf3cc54 | ||
|
|
8dca5ae5ec | ||
|
|
49782c5499 | ||
|
|
06d309fd7a | ||
|
|
83e7618f05 | ||
|
|
ff83c00715 | ||
|
|
b4e4788c44 | ||
|
|
98e43a33c8 | ||
|
|
2ef8809ef3 | ||
|
|
ac732d75bd | ||
|
|
9090a21de0 | ||
|
|
b8aec1e725 | ||
|
|
4e407b8777 | ||
|
|
4302c0b542 | ||
|
|
4ea7f3467d | ||
|
|
3770c2e463 | ||
|
|
bb79e5764b | ||
|
|
281a1754b9 | ||
|
|
9f4905fb0d | ||
|
|
5fe6d2134b | ||
|
|
ab68d90057 | ||
|
|
ab200bd660 | ||
|
|
68296c4055 | ||
|
|
9322b43d65 | ||
|
|
0d87a0ba57 | ||
|
|
043ac320a0 | ||
|
|
5b529bbc94 | ||
|
|
22a8ea2a0a | ||
|
|
474895915e | ||
|
|
8cfb648761 | ||
|
|
e01f88df7c | ||
|
|
09d7ffabcd | ||
|
|
7768f5e2de | ||
|
|
ed5aabe8b7 | ||
|
|
1e1695e8de | ||
|
|
37e1d7c776 | ||
|
|
2115878aaa | ||
|
|
821f13fd79 | ||
|
|
062f93c93e | ||
|
|
5cd94db8bb | ||
|
|
c3fa86867b | ||
|
|
22e8a3c347 | ||
|
|
2bd299f731 | ||
|
|
aaae3637e0 | ||
|
|
76f421dd3a | ||
|
|
9c37d95627 | ||
|
|
8b642af484 | ||
|
|
2688023c7f | ||
|
|
0be5b9e6b0 | ||
|
|
008eb1461c | ||
|
|
77bf9245d2 | ||
|
|
35e3d597f5 | ||
|
|
8b104d7893 | ||
|
|
99194d1831 | ||
|
|
e324f82d3c | ||
|
|
9510611cdd | ||
|
|
398f56dbc8 | ||
|
|
87a9fc3b85 | ||
|
|
c8e55a6fd4 | ||
|
|
01f42b836c | ||
|
|
cb981e39c2 | ||
|
|
4e39968e4d | ||
|
|
710284cbc4 | ||
|
|
fc6cbc3eaa | ||
|
|
ac4d9fd055 | ||
|
|
3e267ca91b | ||
|
|
63934ea71e | ||
|
|
a492fe213a | ||
|
|
cdf72523f3 | ||
|
|
c529e9f602 | ||
|
|
6229e42ae5 | ||
|
|
1e4273d881 | ||
|
|
8b2bfaab66 | ||
|
|
04c0497ed7 | ||
|
|
48f835efbf | ||
|
|
8b20e86491 | ||
|
|
d83a75bb00 | ||
|
|
631ed7288c | ||
|
|
ad148c5ac2 | ||
|
|
ca51458081 | ||
|
|
e2b7392b96 | ||
|
|
2885f62816 | ||
|
|
600b6277f8 | ||
|
|
6b39c81957 | ||
|
|
276d19feaa | ||
|
|
eac822e897 | ||
|
|
d20bebfe13 | ||
|
|
35f832a007 | ||
|
|
5b2c30d7e6 | ||
|
|
86aecd8801 | ||
|
|
84f565ec71 | ||
|
|
3306577797 | ||
|
|
c72c4c5271 | ||
|
|
ab5dcc83a1 | ||
|
|
869ca9b733 | ||
|
|
25ba60b147 | ||
|
|
7f4327bc24 | ||
|
|
2842aa2a07 | ||
|
|
17ed2f21cf | ||
|
|
7b8861204e | ||
|
|
6c30014600 | ||
|
|
8f5c34cd39 | ||
|
|
4072b27870 | ||
|
|
cd2912af5e | ||
|
|
47461368ca | ||
|
|
13a33f7c7b | ||
|
|
f46da1da7d | ||
|
|
077b7705af | ||
|
|
f19c94b555 | ||
|
|
615ca3c99d | ||
|
|
dfc07f038b | ||
|
|
4758164ac5 | ||
|
|
84881c654e | ||
|
|
efd0e7222b | ||
|
|
783778b9d3 | ||
|
|
7bcd55c264 | ||
|
|
1e31ac079b | ||
|
|
77c202a2e6 | ||
|
|
975d144027 | ||
|
|
2db6d8e415 | ||
|
|
b6a41ad5ba | ||
|
|
a18a11cf80 | ||
|
|
d2b47e8065 | ||
|
|
7448b03300 | ||
|
|
25f324fad7 | ||
|
|
b2622ed838 | ||
|
|
cab354debd | ||
|
|
d660d6d31b | ||
|
|
5574562f8f | ||
|
|
0643c7ab4d | ||
|
|
575f5002c0 | ||
|
|
44ba557de5 | ||
|
|
98fe858275 | ||
|
|
8e576e5abc | ||
|
|
998a2ddc37 | ||
|
|
e547c9f139 | ||
|
|
4ee9098514 | ||
|
|
c469213e7b | ||
|
|
4cd64aad8a | ||
|
|
16570b8c79 | ||
|
|
8a985403f6 | ||
|
|
eaa5b1f911 | ||
|
|
fc09d7e76f | ||
|
|
4dd1be2079 | ||
|
|
e6fb787c66 | ||
|
|
f31c4d5398 | ||
|
|
2b02e6dff3 | ||
|
|
01ea314e8c | ||
|
|
8489ecefd3 | ||
|
|
d34ab3a53c | ||
|
|
53f227bb2a | ||
|
|
76fc73cbfc | ||
|
|
9d908c70d5 | ||
|
|
cfd0979be5 | ||
|
|
9c6df8a238 | ||
|
|
cf0012dad0 | ||
|
|
8417a23973 | ||
|
|
d4cb4168ba | ||
|
|
d709922979 | ||
|
|
f1b358c9a9 | ||
|
|
d1ed6b1b15 | ||
|
|
34b9f9dedf | ||
|
|
2d660dd630 | ||
|
|
00bfc6eb49 | ||
|
|
22857f1d89 | ||
|
|
281e2f8207 | ||
|
|
7780bfc7b3 | ||
|
|
000e35db81 | ||
|
|
8a57fcdfbd | ||
|
|
020a02ef9d | ||
|
|
50949c9332 | ||
|
|
b48d2f6d10 | ||
|
|
b711a96acb | ||
|
|
033ce8f28c | ||
|
|
b7ebf90221 | ||
|
|
a83581e223 | ||
|
|
b53f326f67 | ||
|
|
60ac255897 | ||
|
|
53baf6fa1d | ||
|
|
87553b0730 | ||
|
|
634a1ff033 | ||
|
|
fd5bd37ab1 | ||
|
|
54212dfbf9 | ||
|
|
27a603e811 | ||
|
|
a8fbb15311 | ||
|
|
350082ed71 | ||
|
|
d83467d70b | ||
|
|
3c58b2c31a | ||
|
|
23ebda3a71 | ||
|
|
a827aefe47 | ||
|
|
07fb188492 | ||
|
|
858ebd9285 | ||
|
|
d5c171311d | ||
|
|
66e3912f3a | ||
|
|
d4387fca0a | ||
|
|
3af5722e11 | ||
|
|
2b033607f3 | ||
|
|
15d611e451 | ||
|
|
3f32bd9f43 | ||
|
|
fe181463a7 | ||
|
|
b53e547d85 | ||
|
|
c28a6253e5 | ||
|
|
3db7427b71 | ||
|
|
9607d15d7d | ||
|
|
97ff815cbb | ||
|
|
1ec4d3698b | ||
|
|
ea4ba9d008 | ||
|
|
c61b56ed00 | ||
|
|
74bdb8fb15 | ||
|
|
ba8818325e | ||
|
|
f6356b435a | ||
|
|
9e1113dee1 | ||
|
|
fed294d2a8 | ||
|
|
1e0499b095 | ||
|
|
4698a412bf | ||
|
|
ab9f9b5d3b | ||
|
|
a6f7760d57 | ||
|
|
dde7a05978 | ||
|
|
523f230c83 | ||
|
|
feef202718 | ||
|
|
6e300bdeae | ||
|
|
8c396e0e88 | ||
|
|
a358211a75 | ||
|
|
c904d380a2 | ||
|
|
ae1f18b69c | ||
|
|
09a19e778b | ||
|
|
1f4b057b63 | ||
|
|
32df2b6617 | ||
|
|
78c1ef2adb | ||
|
|
c6cf3d4ada | ||
|
|
0b8cfa6c78 | ||
|
|
36239fee36 | ||
|
|
2577cdbea2 | ||
|
|
42952a756e | ||
|
|
73cd5fca2c | ||
|
|
74ed42c169 | ||
|
|
1c98955d0f | ||
|
|
e3cf72b829 | ||
|
|
8f3c29aee1 | ||
|
|
6237bcd39e | ||
|
|
656381745a | ||
|
|
e80e38ab7c | ||
|
|
276b57316c | ||
|
|
884697a290 | ||
|
|
c28b03a8e7 | ||
|
|
ea0355632d | ||
|
|
ef04bc4a51 | ||
|
|
1b6a9ea584 | ||
|
|
7b3a2d16aa | ||
|
|
fa7c32040c | ||
|
|
08b4f3c745 | ||
|
|
500632ac13 | ||
|
|
c0abab5fca | ||
|
|
202989edf8 | ||
|
|
40ff001381 | ||
|
|
ae837db8cf | ||
|
|
39974dd65d | ||
|
|
846e8a3ec9 | ||
|
|
fa7c23ba27 | ||
|
|
acb9426a6b | ||
|
|
8bdf9905da | ||
|
|
1a50a50bcf | ||
|
|
fd5644cd0b | ||
|
|
0255c21319 | ||
|
|
a468752e53 | ||
|
|
114e5d0206 | ||
|
|
26dda8999c | ||
|
|
94e9d0a2ae | ||
|
|
0674d677bc | ||
|
|
372bf8a923 | ||
|
|
4800a95e72 | ||
|
|
da0ed5cdb1 | ||
|
|
34ab10ef1b | ||
|
|
da5db1c9b2 | ||
|
|
0b5466c0a6 | ||
|
|
8a3f45f90b | ||
|
|
a93dba4324 | ||
|
|
17164bcf8d | ||
|
|
528bc00d84 | ||
|
|
2cc8cf2994 | ||
|
|
5dd2a4185c | ||
|
|
1f0ea7fa4d | ||
|
|
2235da59af | ||
|
|
8c1147b089 | ||
|
|
070211b3e3 | ||
|
|
7554fd9101 | ||
|
|
f706937120 | ||
|
|
ee3f3a9d75 | ||
|
|
fddd7e38bd | ||
|
|
e87283fa3f | ||
|
|
01f7998db0 | ||
|
|
7aac61ce76 | ||
|
|
f9a16d492e | ||
|
|
5673c641dc | ||
|
|
d803dcba3b | ||
|
|
8000334538 | ||
|
|
44a1271ea0 | ||
|
|
d806d0315f | ||
|
|
4765ba7dc3 | ||
|
|
ab770401e1 | ||
|
|
01eafceea1 | ||
|
|
495508eceb | ||
|
|
1391a0fa0b | ||
|
|
d9e71169e6 | ||
|
|
51a0e051fc | ||
|
|
1368aea352 | ||
|
|
3ef3f74a65 | ||
|
|
42f2ae0572 | ||
|
|
3e15465f31 | ||
|
|
a694433bff | ||
|
|
b7575758a9 | ||
|
|
b1ee215c69 | ||
|
|
138ea7c3fe | ||
|
|
bc584c408c | ||
|
|
88aeb104a2 | ||
|
|
2ae46f8eb6 | ||
|
|
bced074124 | ||
|
|
73eb5a78b9 | ||
|
|
5feb53964f | ||
|
|
3348d40a7b | ||
|
|
aef59537e6 | ||
|
|
fe2ac52d50 | ||
|
|
0f393a6102 | ||
|
|
fb128f6512 | ||
|
|
fa586cee3e | ||
|
|
a99df321f1 | ||
|
|
a8c6b36d62 | ||
|
|
96595a232a | ||
|
|
a882f95e39 | ||
|
|
d7a02844f9 | ||
|
|
4bd7658e1b | ||
|
|
fd255b8878 | ||
|
|
aad76a9b79 | ||
|
|
aad12cb49c | ||
|
|
3fe9e10a1b | ||
|
|
6dbe046154 | ||
|
|
3bdcb6cf3e | ||
|
|
f80e59a566 | ||
|
|
0c22cda951 | ||
|
|
3ffdf6c088 | ||
|
|
0067420049 | ||
|
|
e954bafc28 | ||
|
|
e88e83d3e5 | ||
|
|
871066523e | ||
|
|
d46d53a7bc | ||
|
|
4626c28e9c | ||
|
|
b8f14008eb | ||
|
|
594a4da3e5 | ||
|
|
e403e122cd | ||
|
|
2384ade53c | ||
|
|
2dc1cd1154 | ||
|
|
6184301212 | ||
|
|
fb205020ce | ||
|
|
f0aa379dc1 | ||
|
|
043d53c789 | ||
|
|
13dd12e85f | ||
|
|
ea56fc840e | ||
|
|
9206afc652 | ||
|
|
5a54107879 |
No files matched your search
+1
-1
@@ -23,7 +23,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.13
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.3
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
@@ -171,7 +171,7 @@ define ____printzv_contents
|
||||
printf "UNDEF"
|
||||
end
|
||||
if $type == 1
|
||||
printf "NULL"
|
||||
printf "NULL"
|
||||
end
|
||||
if $type == 2
|
||||
printf "bool: false"
|
||||
@@ -179,15 +179,15 @@ define ____printzv_contents
|
||||
if $type == 3
|
||||
printf "bool: true"
|
||||
end
|
||||
if $type == 4
|
||||
if $type == 4
|
||||
printf "long: %ld", $zvalue->value.lval
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 7
|
||||
printf "array: "
|
||||
if ! $arg1
|
||||
@@ -245,25 +245,31 @@ define ____printzv_contents
|
||||
printf "const: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 12
|
||||
printf "const_ast"
|
||||
printf "CONSTANT_AST"
|
||||
end
|
||||
if $type == 13
|
||||
printf "_IS_BOOL"
|
||||
printf "_BOOL"
|
||||
end
|
||||
if $type == 14
|
||||
printf "IS_CALLABLE"
|
||||
printf "CALLABLE"
|
||||
end
|
||||
if $type == 15
|
||||
printf "indirect: "
|
||||
____printzv $zvalue->value.zv $arg1
|
||||
end
|
||||
if $type == 16
|
||||
printf "string_offset"
|
||||
end
|
||||
if $type == 17
|
||||
printf "pointer: %p", $zvalue->value.ptr
|
||||
end
|
||||
if $type > 17
|
||||
if $type == 18
|
||||
printf "ITERABLE"
|
||||
end
|
||||
if $type == 19
|
||||
printf "VOID"
|
||||
end
|
||||
if $type == 20
|
||||
printf "_ERROR"
|
||||
end
|
||||
if $type == 16 || $type > 20
|
||||
printf "unknown type %d", $type
|
||||
end
|
||||
printf "\n"
|
||||
@@ -283,38 +289,18 @@ define ____printzv
|
||||
end
|
||||
end
|
||||
|
||||
define ____print_const_table
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
|
||||
while $p != 0
|
||||
set $const = (zend_constant *) $p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
____printzv_contents &$const->value 0
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
end
|
||||
|
||||
define print_const_table
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
____print_const_table $arg0
|
||||
____print_ht $arg0 4
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_const_table
|
||||
Dumps elements of Constants HashTable
|
||||
Example: print_const_table executor_globals.zend_constants
|
||||
end
|
||||
|
||||
define ____print_ht
|
||||
set $ht = (HashTable*)$arg0
|
||||
set $n = $ind
|
||||
@@ -361,6 +347,10 @@ define ____print_ht
|
||||
set $func = (zend_function*)$p->val.value.ptr
|
||||
printf "\"%s\"\n", $func->common.function_name->val
|
||||
end
|
||||
if $arg1 == 4
|
||||
set $const = (zend_constant *)$p->val.value.ptr
|
||||
____printzv $const 1
|
||||
end
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
@@ -472,9 +462,12 @@ end
|
||||
|
||||
define print_pi
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
set $initial_offset = ((uint32_t)(zend_uintptr_t)(&((zend_object*)0)->properties_table[(0)]))
|
||||
set $ptr_to_val = (zval*)((char*)$pi->ce->default_properties_table + $pi->offset - $initial_offset)
|
||||
printf "[%p] {\n", $pi
|
||||
printf " offset = %p\n", $pi->offset
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " flags = %d (", $pi->flags
|
||||
printf " flags = 0x%x (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
else
|
||||
@@ -485,7 +478,11 @@ define print_pi
|
||||
printf "ZEND_ACC_PRIVATE"
|
||||
else
|
||||
if $pi->flags & 0x800
|
||||
printf "ZEND_ACC_CHANGED"
|
||||
printf "ZEND_ACC_EARLY_BINDING"
|
||||
else
|
||||
if $pi->flags & 0x20000
|
||||
printf "ZEND_ACC_SHADOW"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -493,6 +490,8 @@ define print_pi
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
print_zstr $pi->name
|
||||
printf " default value: "
|
||||
printzv $ptr_to_val
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fpm
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3.3
|
||||
|
||||
@@ -1,6 +1,190 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.2.2
|
||||
24 May 2018, PHP 7.2.6
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #76164 (exif_read_data zend_mm_heap corrupted). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #76075 --with-fpm-acl wrongly tries to find libacl on FreeBSD.
|
||||
(mgorny)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74385 (Locale::parseLocale() broken with some arguments).
|
||||
(Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76205 (PHP-FPM sporadic crash when running Infinitewp). (Dmitry)
|
||||
. Fixed bug #76275 (Assertion failure in file cache when unserializing empty
|
||||
try_catch_array). (Nikita)
|
||||
. Fixed bug #76281 (Opcache causes incorrect "undefined variable" errors).
|
||||
(Nikita)
|
||||
|
||||
- Reflection:
|
||||
. Fixed arginfo of array_replace(_recursive) and array_merge(_recursive).
|
||||
(carusogabriel)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #74892 (Url Rewriting (trans_sid) not working on urls that start
|
||||
with "#"). (Andrew Nester)
|
||||
|
||||
26 Apr 2018, PHP 7.2.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75722 (Convert valgrind detection to configure option).
|
||||
(Michael Heimpold)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #76131 (mismatch arginfo for date_create). (carusogabriel)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).
|
||||
(Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #68440 (ERROR: failed to reload: execvp() failed: Argument list
|
||||
too long). (Jacob Hipps)
|
||||
. Fixed incorrect write to getenv result in FPM reload. (Jakub Zelenka)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #52070 (imagedashedline() - dashed line sometimes is not visible).
|
||||
(cmb)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #76249 (stream filter convert.iconv leads to infinite loop on
|
||||
invalid sequence). (Stas)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #76153 (Intl compilation fails with icu4c 61.1). (Anatol)
|
||||
|
||||
- ldap:
|
||||
. Fixed bug #76248 (Malicious LDAP-Server Response causes Crash). (Stas)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #75944 (Wrong cp1251 detection). (dmk001)
|
||||
. Fixed bug #76113 (mbstring does not build with Oniguruma 6.8.1).
|
||||
(chrullrich, cmb)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #76088 (ODBC functions are not available by default on Windows).
|
||||
(cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76094 (Access violation when using opcache). (Laruence)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #76129 (fix for CVE-2018-5712 may not be complete). (Stas)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76143 (Memory corruption: arbitrary NUL overwrite). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #76131 (mismatch arginfo for splarray constructor).
|
||||
(carusogabriel)
|
||||
|
||||
- standard:
|
||||
. Fixed bug #74139 (mail.add_x_header default inconsistent with docs). (cmb)
|
||||
. Fixed bug #75996 (incorrect url in header for mt_rand). (tatarbj)
|
||||
|
||||
29 Mar 2018, PHP 7.2.4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76025 (Segfault while throwing exception in error_handler).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #76044 ('date: illegal option -- -' in ./configure on FreeBSD).
|
||||
(Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #75605 (Dumpable FPM child processes allow bypassing opcache
|
||||
access controls). (Jakub Zelenka)
|
||||
|
||||
- FTP:
|
||||
. Fixed ftp_pasv arginfo. (carusogabriel)
|
||||
|
||||
-GD:
|
||||
. Fixed bug #73957 (signed integer conversion in imagescale()). (cmb)
|
||||
. Fixed bug #76041 (null pointer access crashed php). (cmb)
|
||||
. Fixed imagesetinterpolation arginfo. (Gabriel Caruso)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #75867 (Freeing uninitialized pointer). (Philip Prindeville)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #62545 (wrong unicode mapping in some charsets). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75969 (Assertion failure in live range DCE due to block pass
|
||||
misoptimization). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed openssl_* arginfos. (carusogabriel)
|
||||
|
||||
- PCNTL:
|
||||
. Fixed bug #75873 (pcntl_wexitstatus returns incorrect on Big_Endian platform
|
||||
(s390x)). (Sam Ding)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #76085 (Segmentation fault in buildFromIterator when directory
|
||||
name contains a \n). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75961 (Strange references behavior). (Laruence)
|
||||
. Fixed some arginfos. (carusogabriel)
|
||||
. Fixed bug #76068 (parse_ini_string fails to parse "[foo]\nbar=1|>baz" with
|
||||
segfault). (Anatol)
|
||||
|
||||
01 Mar 2018, PHP 7.2.3
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75864 ("stream_isatty" returns wrong value on s390x). (Sam Ding)
|
||||
|
||||
- Apache2Handler:
|
||||
. Fixed bug #75882 (a simple way for segfaults in threadsafe php just with
|
||||
configuration). (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75857 (Timezone gets truncated when formatted). (carusogabriel)
|
||||
. Fixed bug #75928 (Argument 2 for `DateTimeZone::listIdentifiers()` should
|
||||
accept `null`). (Pedro Lacerda)
|
||||
. Fixed bug #68406 (calling var_dump on a DateTimeZone object modifies it).
|
||||
(jhdxr)
|
||||
|
||||
- LDAP:
|
||||
. Fixed bug #49876 (Fix LDAP path lookup on 64-bit distros). (dzuelke)
|
||||
|
||||
- libxml2:
|
||||
. Fixed bug #75871 (use pkg-config where available). (pmmaga)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed bug #75838 (Memory leak in pg_escape_bytea()). (ard_1 at mail dot ru)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #54289 (Phar::extractTo() does not accept specific directories to
|
||||
be extracted). (bishop)
|
||||
. Fixed bug #65414 (deal with leading slash while adding files correctly).
|
||||
(bishopb)
|
||||
. Fixed bug #65414 (deal with leading slash when adding files correctly).
|
||||
(bishopb)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #73725 (Unable to retrieve value of varchar(max) type). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75729 (opcache segfault when installing Bitrix). (Nikita)
|
||||
. Fixed bug #75893 (file_get_contents $http_response_header variable bugged
|
||||
with opcache). (Nikita)
|
||||
. Fixed bug #75938 (Modulus value not stored in variable). (Nikita)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #74519 (strange behavior of AppendIterator). (jhdxr)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75916 (DNS_CAA record results contain garbage). (Mike,
|
||||
Philip Sharp)
|
||||
. Fixed bug #75981 (Prevent reading beyond buffer start in http wrapper).
|
||||
(Stas)
|
||||
|
||||
01 Feb 2018, PHP 7.2.2
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75742 (potential memleak in internal classes's static members).
|
||||
@@ -21,9 +205,12 @@ PHP NEWS
|
||||
. Fixed bug #75774 (imap_append HeapCorruction). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75720 (File cache not populated after SHM runs full). (Dmitry)
|
||||
. Fixed bug #75687 (var 8 (TMP) has array key type but not value type).
|
||||
(Nikita, Laruence)
|
||||
. Fixed bug #75698 (Using @ crashes php7.2-fpm). (Nikita)
|
||||
. Fixed bug #75579 (Interned strings buffer overflow may cause crash).
|
||||
(Dmitry)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #75616 (PDO extension doesn't allow to be built shared on Darwin).
|
||||
@@ -32,11 +219,6 @@ PHP NEWS
|
||||
- PDO MySQL:
|
||||
. Fixed bug #75615 (PDO Mysql module can't be built as module). (jdolecek)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75720 (File cache not populated after SHM runs full). (Dmitry)
|
||||
. Fixed bug #75579 (Interned strings buffer overflow may cause crash).
|
||||
(Dmitry)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed bug #75671 (pg_version() crashes when called on a connection to
|
||||
cockroach). (magicaltux at gmail dot com)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Win32 Build System.
|
||||
|
||||
See http://wiki.php.net/internals/windows/stepbystepbuild
|
||||
See https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
|
||||
|
||||
vim:tw=78:sw=1:ts=1:et
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #43450 (Memory leak on some functions with implicit object __toString() call)
|
||||
--SKIPIF--
|
||||
<?php if (!function_exists('memory_get_usage')) die('memory_get_usage() not installed'); ?>
|
||||
<?php if (!function_exists('memory_get_usage')) die('skip memory_get_usage() not installed'); ?>
|
||||
--INI--
|
||||
opcache.enable_cli=0
|
||||
--FILE--
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #76025 (Segfault while throwing exception in error_handler)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function handleError($errno, $errstr, $errfile, $errline) {
|
||||
$exception = new exception("blah");
|
||||
throw $exception;
|
||||
}
|
||||
set_error_handler('handleError', E_ALL);
|
||||
$c = $b[$a];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: blah in %sbug76025.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug76025.php(%d): handleError(8, 'Undefined varia...', '%s', %d, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug76025.php on line %d
|
||||
@@ -2871,6 +2871,7 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length) /* {
|
||||
key = zend_string_alloc(class_name_length, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(key), class_name, class_name_length);
|
||||
disabled_class = zend_hash_find_ptr(CG(class_table), key);
|
||||
zend_string_release(key);
|
||||
if (!disabled_class) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -733,7 +733,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
|
||||
int _num_args = EX_NUM_ARGS(); \
|
||||
int _i; \
|
||||
zval *_real_arg, *_arg = NULL; \
|
||||
zend_expected_type _expected_type = IS_UNDEF; \
|
||||
zend_expected_type _expected_type = Z_EXPECTED_LONG; \
|
||||
char *_error = NULL; \
|
||||
zend_bool _dummy; \
|
||||
zend_bool _optional = 0; \
|
||||
|
||||
+4
-3
@@ -245,9 +245,10 @@ static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, zend_free_
|
||||
|
||||
static zend_never_inline ZEND_COLD void zval_undefined_cv(uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
|
||||
|
||||
zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
|
||||
zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
|
||||
}
|
||||
}
|
||||
|
||||
static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type EXECUTE_DATA_DC)
|
||||
|
||||
+1
-1
@@ -1764,7 +1764,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
|
||||
GC_TYPE_INFO(target) = IS_ARRAY | (GC_COLLECTABLE << GC_FLAGS_SHIFT);
|
||||
|
||||
target->nTableSize = source->nTableSize;
|
||||
target->pDestructor = source->pDestructor;
|
||||
target->pDestructor = ZVAL_PTR_DTOR;
|
||||
|
||||
if (source->nNumUsed == 0) {
|
||||
target->u.flags = (source->u.flags & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED|HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
|
||||
|
||||
+12
-4
@@ -57,11 +57,19 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
if (IS_LONG == Z_TYPE_P(op1)) {
|
||||
i_op1 = Z_LVAL_P(op1);
|
||||
} else {
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
}
|
||||
if (op2) {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
if (IS_LONG == Z_TYPE_P(op2)) {
|
||||
i_op2 = Z_LVAL_P(op2);
|
||||
} else {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
}
|
||||
} else {
|
||||
i_op2 = 0;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,12 @@ ZEND_API void zend_interned_strings_init(void)
|
||||
int i;
|
||||
zend_string *str;
|
||||
|
||||
interned_string_request_handler = zend_new_interned_string_request;
|
||||
interned_string_copy_storage = NULL;
|
||||
|
||||
zend_empty_string = NULL;
|
||||
zend_known_strings = NULL;
|
||||
|
||||
zend_init_interned_strings_ht(&interned_strings_permanent, 1);
|
||||
|
||||
zend_new_interned_string = zend_new_interned_string_permanent;
|
||||
|
||||
@@ -69301,7 +69301,7 @@ ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)
|
||||
LOAD_OPLINE();
|
||||
#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
|
||||
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
|
||||
handler = (opcode_handler_t)zend_vm_get_opcode_handler_func(opline->opcode, opline);
|
||||
handler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->opcode], opline);
|
||||
handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
if (EXPECTED(opline != &hybrid_halt_op)) {
|
||||
#else
|
||||
|
||||
@@ -2599,7 +2599,7 @@ function gen_vm($def, $skel) {
|
||||
out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
|
||||
if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
|
||||
out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
|
||||
out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(opline->opcode, opline);\n");
|
||||
out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->opcode], opline);\n");
|
||||
out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
|
||||
out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
|
||||
out($f,"#else\n");
|
||||
|
||||
+56
-48
@@ -2237,6 +2237,9 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
|
||||
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -2523,15 +2526,18 @@ dnl
|
||||
dnl Common setup macro for libxml
|
||||
dnl
|
||||
AC_DEFUN([PHP_SETUP_LIBXML], [
|
||||
AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
|
||||
[
|
||||
for i in $PHP_LIBXML_DIR /usr/local /usr; do
|
||||
if test -x "$i/bin/xml2-config"; then
|
||||
ac_cv_php_xml2_config_path="$i/bin/xml2-config"
|
||||
break
|
||||
fi
|
||||
done
|
||||
])
|
||||
found_libxml=no
|
||||
|
||||
dnl First try to find xml2-config
|
||||
AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
|
||||
[
|
||||
for i in $PHP_LIBXML_DIR /usr/local /usr; do
|
||||
if test -x "$i/bin/xml2-config"; then
|
||||
ac_cv_php_xml2_config_path="$i/bin/xml2-config"
|
||||
break
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
if test -x "$ac_cv_php_xml2_config_path"; then
|
||||
XML2_CONFIG="$ac_cv_php_xml2_config_path"
|
||||
@@ -2542,30 +2548,52 @@ AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
|
||||
IFS=$ac_IFS
|
||||
LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
|
||||
if test "$LIBXML_VERSION" -ge "2006011"; then
|
||||
found_libxml=yes
|
||||
LIBXML_LIBS=`$XML2_CONFIG --libs`
|
||||
LIBXML_INCS=`$XML2_CONFIG --cflags`
|
||||
PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($LIBXML_INCS)
|
||||
|
||||
dnl Check that build works with given libs
|
||||
AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [
|
||||
PHP_TEST_BUILD(xmlInitParser,
|
||||
[
|
||||
php_cv_libxml_build_works=yes
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
|
||||
], [
|
||||
[$]$1
|
||||
])
|
||||
])
|
||||
if test "$php_cv_libxml_build_works" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBXML, 1, [ ])
|
||||
fi
|
||||
$2
|
||||
else
|
||||
AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl If xml2-config fails, try pkg-config
|
||||
if test "$found_libxml" = "no"; then
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
dnl If pkg-config is found try using it
|
||||
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libxml-2.0; then
|
||||
if $PKG_CONFIG --atleast-version=2.6.11 libxml-2.0; then
|
||||
found_libxml=yes
|
||||
LIBXML_LIBS=`$PKG_CONFIG --libs libxml-2.0`
|
||||
LIBXML_INCS=`$PKG_CONFIG --cflags-only-I libxml-2.0`
|
||||
else
|
||||
AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$found_libxml" = "yes"; then
|
||||
PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($LIBXML_INCS)
|
||||
|
||||
dnl Check that build works with given libs
|
||||
AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [
|
||||
PHP_TEST_BUILD(xmlInitParser,
|
||||
[
|
||||
php_cv_libxml_build_works=yes
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
|
||||
], [
|
||||
[$]$1
|
||||
])
|
||||
])
|
||||
if test "$php_cv_libxml_build_works" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBXML, 1, [ ])
|
||||
fi
|
||||
$2
|
||||
ifelse([$3],[],,[else $3])
|
||||
fi
|
||||
])
|
||||
@@ -3224,23 +3252,3 @@ AC_DEFUN([PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW], [
|
||||
|
||||
dnl Load the AX_CHECK_COMPILE_FLAG macro from the autoconf archive.
|
||||
m4_include([build/ax_check_compile_flag.m4])
|
||||
|
||||
dnl PHP_CHECK_VALGRIND
|
||||
AC_DEFUN([PHP_CHECK_VALGRIND], [
|
||||
AC_MSG_CHECKING([for valgrind])
|
||||
|
||||
SEARCH_PATH="/usr/local /usr"
|
||||
SEARCH_FOR="/include/valgrind/valgrind.h"
|
||||
for i in $SEARCH_PATH ; do
|
||||
if test -r $i/$SEARCH_FOR; then
|
||||
VALGRIND_DIR=$i
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$VALGRIND_DIR"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
else
|
||||
AC_MSG_RESULT(found in $VALGRIND_DIR)
|
||||
AC_DEFINE(HAVE_VALGRIND, 1, [ ])
|
||||
fi
|
||||
])
|
||||
+34
-3
@@ -107,7 +107,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=1
|
||||
PHP_RELEASE_VERSION=6
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
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`
|
||||
@@ -753,7 +753,35 @@ if test "x$php_crypt_r" = "x1"; then
|
||||
PHP_CRYPT_R_STYLE
|
||||
fi
|
||||
|
||||
PHP_CHECK_VALGRIND
|
||||
dnl Check valgrind support
|
||||
PHP_ARG_WITH(valgrind, [whether to enable valgrind support],
|
||||
[ --with-valgrind=DIR Enable valgrind support], yes, no)
|
||||
|
||||
if test "$PHP_VALGRIND" != "no"; then
|
||||
|
||||
AC_MSG_CHECKING([for valgrind header])
|
||||
|
||||
if test "$PHP_VALGRIND" = "yes"; then
|
||||
SEARCH_PATH="/usr/local /usr"
|
||||
else
|
||||
SEARCH_PATH="$PHP_VALGRIND"
|
||||
fi
|
||||
|
||||
SEARCH_FOR="/include/valgrind/valgrind.h"
|
||||
for i in $SEARCH_PATH ; do
|
||||
if test -r $i/$SEARCH_FOR; then
|
||||
VALGRIND_DIR=$i
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$VALGRIND_DIR"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
else
|
||||
AC_MSG_RESULT(found in $VALGRIND_DIR)
|
||||
AC_DEFINE(HAVE_VALGRIND, 1, [ ])
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
dnl General settings.
|
||||
dnl -------------------------------------------------------------------------
|
||||
@@ -1269,7 +1297,10 @@ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
|
||||
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
|
||||
|
||||
# SOURCE_DATE_EPOCH for reproducible builds https://reproducible-builds.org/specs/source-date-epoch/
|
||||
PHP_BUILD_DATE=`date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d 2>/dev/null`
|
||||
if test $? -ne 0 ; then
|
||||
PHP_BUILD_DATE=`date -u +%Y-%m-%d`
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
|
||||
|
||||
PHP_UNAME=`uname -a | xargs`
|
||||
|
||||
@@ -1012,13 +1012,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
|
||||
tzset();
|
||||
ttstamp = timestamp;
|
||||
tmv = localtime(&ttstamp);
|
||||
#if ZEND_ENABLE_ZVAL_LONG64
|
||||
|
||||
/* Invalid after 23:59:59, December 31, 3000, UTC */
|
||||
if (!tmv) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid timestamp " ZEND_LONG_FMT, timestamp);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(&systime, 0, sizeof(systime));
|
||||
|
||||
systime.wDay = tmv->tm_mday;
|
||||
|
||||
@@ -3,7 +3,6 @@ Bug #72498 variant_date_from_timestamp null dereference
|
||||
--SKIPIF--
|
||||
<?php # vim:ft=php
|
||||
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
|
||||
if (PHP_INT_SIZE != 8) print "skip 64-bit only";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -5,4 +5,5 @@ Timelib is a timezone and date/time library that can calculate local time,
|
||||
convert between timezones and parse textual descriptions of date/time
|
||||
information.
|
||||
|
||||
It is the library supporting PHP's Date/Time extension.
|
||||
It is the library supporting PHP's Date/Time extension and MongoDB's time zone
|
||||
support.
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.15.3 on Tue Oct 24 13:44:48 2017 */
|
||||
/* Generated by re2c 0.15.3 on Wed Jan 31 11:51:51 2018 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
@@ -483,7 +483,7 @@ static void timelib_skip_day_suffix(char **ptr)
|
||||
if (isspace(**ptr)) {
|
||||
return;
|
||||
}
|
||||
if (!strncasecmp(*ptr, "nd", 2) || !strncasecmp(*ptr, "rd", 2) ||!strncasecmp(*ptr, "st", 2) || !strncasecmp(*ptr, "th", 2)) {
|
||||
if (!timelib_strncasecmp(*ptr, "nd", 2) || !timelib_strncasecmp(*ptr, "rd", 2) ||!timelib_strncasecmp(*ptr, "st", 2) || !timelib_strncasecmp(*ptr, "th", 2)) {
|
||||
*ptr += 2;
|
||||
}
|
||||
}
|
||||
@@ -549,7 +549,7 @@ static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_reltext_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
value = tp->value;
|
||||
*behavior = tp->type;
|
||||
}
|
||||
@@ -582,7 +582,7 @@ static timelib_long timelib_lookup_month(char **ptr)
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_month_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
value = tp->value;
|
||||
}
|
||||
}
|
||||
@@ -629,7 +629,7 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_relunit_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
value = tp;
|
||||
break;
|
||||
}
|
||||
@@ -678,12 +678,12 @@ static const timelib_tz_lookup_table* abbr_search(const char *word, timelib_long
|
||||
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
|
||||
const timelib_tz_lookup_table *fmp;
|
||||
|
||||
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
|
||||
if (timelib_strcasecmp("utc", word) == 0 || timelib_strcasecmp("gmt", word) == 0) {
|
||||
return timelib_timezone_utc;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
|
||||
@@ -481,7 +481,7 @@ static void timelib_skip_day_suffix(char **ptr)
|
||||
if (isspace(**ptr)) {
|
||||
return;
|
||||
}
|
||||
if (!strncasecmp(*ptr, "nd", 2) || !strncasecmp(*ptr, "rd", 2) ||!strncasecmp(*ptr, "st", 2) || !strncasecmp(*ptr, "th", 2)) {
|
||||
if (!timelib_strncasecmp(*ptr, "nd", 2) || !timelib_strncasecmp(*ptr, "rd", 2) ||!timelib_strncasecmp(*ptr, "st", 2) || !timelib_strncasecmp(*ptr, "th", 2)) {
|
||||
*ptr += 2;
|
||||
}
|
||||
}
|
||||
@@ -547,7 +547,7 @@ static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_reltext_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
value = tp->value;
|
||||
*behavior = tp->type;
|
||||
}
|
||||
@@ -580,7 +580,7 @@ static timelib_long timelib_lookup_month(char **ptr)
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_month_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
value = tp->value;
|
||||
}
|
||||
}
|
||||
@@ -627,7 +627,7 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
for (tp = timelib_relunit_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
value = tp;
|
||||
break;
|
||||
}
|
||||
@@ -676,12 +676,12 @@ static const timelib_tz_lookup_table* abbr_search(const char *word, timelib_long
|
||||
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
|
||||
const timelib_tz_lookup_table *fmp;
|
||||
|
||||
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
|
||||
if (timelib_strcasecmp("utc", word) == 0 || timelib_strcasecmp("gmt", word) == 0) {
|
||||
return timelib_timezone_utc;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (strcasecmp(word, tp->name) == 0) {
|
||||
if (timelib_strcasecmp(word, tp->name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.15.3 on Mon Sep 4 22:44:07 2017 */
|
||||
/* Generated by re2c 0.15.3 on Wed Jan 31 11:51:44 2018 */
|
||||
#line 1 "ext/date/lib/parse_iso_intervals.re"
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
|
||||
+2
-21
@@ -377,25 +377,14 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
|
||||
static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
|
||||
{
|
||||
int left = 0, right = tzdb->index_size - 1;
|
||||
#ifdef HAVE_SETLOCALE
|
||||
char *cur_locale = NULL, *tmp;
|
||||
#endif
|
||||
|
||||
if (tzdb->index_size == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
tmp = setlocale(LC_CTYPE, NULL);
|
||||
if (tmp) {
|
||||
cur_locale = timelib_strdup(tmp);
|
||||
}
|
||||
setlocale(LC_CTYPE, "C");
|
||||
#endif
|
||||
|
||||
do {
|
||||
int mid = ((unsigned)left + right) >> 1;
|
||||
int cmp = strcasecmp(timezone, tzdb->index[mid].id);
|
||||
int cmp = timelib_strcasecmp(timezone, tzdb->index[mid].id);
|
||||
|
||||
if (cmp < 0) {
|
||||
right = mid - 1;
|
||||
@@ -403,19 +392,11 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
|
||||
left = mid + 1;
|
||||
} else { /* (cmp == 0) */
|
||||
(*tzf) = &(tzdb->data[tzdb->index[mid].pos]);
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale(LC_CTYPE, cur_locale);
|
||||
if (cur_locale) timelib_free(cur_locale);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
} while (left <= right);
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale(LC_CTYPE, cur_locale);
|
||||
if (cur_locale) timelib_free(cur_locale);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -424,7 +405,7 @@ const timelib_tzdb *timelib_builtin_db(void)
|
||||
return &timezonedb_builtin;
|
||||
}
|
||||
|
||||
const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(timelib_tzdb *tzdb, int *count)
|
||||
const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count)
|
||||
{
|
||||
*count = tzdb->index_size;
|
||||
return tzdb->index;
|
||||
|
||||
+80
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Derick Rethans
|
||||
* Copyright (c) 2015-2017 Derick Rethans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -20,6 +20,12 @@
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* Portions copyright (c) 1998-2017 Zend Technologies Ltd.
|
||||
*
|
||||
* The timelib_strcasecmp and timelib_strncasecmp are taken from PHP's
|
||||
* Zend/zend_operators.[hc] source files.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "timelib.h"
|
||||
@@ -198,6 +204,79 @@ void timelib_hms_to_decimal_hour(int hour, int min, int sec, double *h)
|
||||
}
|
||||
}
|
||||
|
||||
static const unsigned char timelib_tolower_map[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
|
||||
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
||||
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
|
||||
};
|
||||
|
||||
#define timelib_tolower(c) (timelib_tolower_map[(unsigned char)(c)])
|
||||
#undef MIN
|
||||
#undef MAX
|
||||
#define MAX(a, b) (((a)>(b))?(a):(b))
|
||||
#define MIN(a, b) (((a)<(b))?(a):(b))
|
||||
|
||||
int timelib_strcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
size_t len;
|
||||
size_t len1 = strlen(s1);
|
||||
size_t len2 = strlen(s2);
|
||||
int c1, c2;
|
||||
|
||||
if (s1 == s2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = MIN(len1, len2);
|
||||
while (len--) {
|
||||
c1 = timelib_tolower(*(unsigned char *)s1++);
|
||||
c2 = timelib_tolower(*(unsigned char *)s2++);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
|
||||
return (int)(len1 - len2);
|
||||
}
|
||||
|
||||
int timelib_strncasecmp(const char *s1, const char *s2, size_t length)
|
||||
{
|
||||
size_t len;
|
||||
size_t len1 = strlen(s1);
|
||||
size_t len2 = strlen(s2);
|
||||
int c1, c2;
|
||||
|
||||
if (s1 == s2) {
|
||||
return 0;
|
||||
}
|
||||
len = MIN(length, MIN(len1, len2));
|
||||
while (len--) {
|
||||
c1 = timelib_tolower(*(unsigned char *)s1++);
|
||||
c2 = timelib_tolower(*(unsigned char *)s2++);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
|
||||
return (int)(MIN(length, len1) - MIN(length, len2));
|
||||
}
|
||||
|
||||
#undef MIN
|
||||
#undef MAX
|
||||
|
||||
void timelib_dump_date(timelib_time *d, int options)
|
||||
{
|
||||
if ((options & 2) == 2) {
|
||||
|
||||
@@ -310,9 +310,9 @@ typedef struct _timelib_tzdb {
|
||||
# define timelib_free free
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201705
|
||||
#define TIMELIB_EXTENDED_VERSION 20170509
|
||||
#define TIMELIB_ASCII_VERSION "2017.05beta9"
|
||||
#define TIMELIB_VERSION 201706
|
||||
#define TIMELIB_EXTENDED_VERSION 20170600
|
||||
#define TIMELIB_ASCII_VERSION "2017.06"
|
||||
|
||||
#define TIMELIB_NONE 0x00
|
||||
#define TIMELIB_OVERRIDE_TIME 0x01
|
||||
@@ -661,7 +661,7 @@ const timelib_tzdb *timelib_builtin_db(void);
|
||||
* Each entry contains the time zone ID ('id' field), and the position within the time zone
|
||||
* information ('pos' field). The pos field should not be used.
|
||||
*/
|
||||
const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(timelib_tzdb *tzdb, int *count);
|
||||
const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count);
|
||||
|
||||
/* From parse_zoneinfo.c */
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
#ifndef __TIMELIB_PRIVATE_H__
|
||||
#define __TIMELIB_PRIVATE_H__
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
# include "locale.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TIMELIB_CONFIG_H
|
||||
# include "timelib_config.h"
|
||||
#endif
|
||||
@@ -140,19 +136,14 @@ struct _tlinfo
|
||||
#define LONG_MIN (- LONG_MAX - 1)
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(strcasecmp)
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(strncasecmp)
|
||||
#define strncasecmp strnicmp
|
||||
#endif
|
||||
|
||||
/* From unixtime2tm.c */
|
||||
int timelib_apply_localtime(timelib_time *t, unsigned int localtime);
|
||||
|
||||
/* From parse_tz.c */
|
||||
void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr);
|
||||
|
||||
/* From timelib.c */
|
||||
int timelib_strcasecmp(const char *s1, const char *s2);
|
||||
int timelib_strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
|
||||
#endif
|
||||
+1577
-1564
File diff suppressed because it is too large.
Load diff
+115
-87
@@ -162,7 +162,7 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, time)
|
||||
ZEND_ARG_INFO(0, object)
|
||||
ZEND_ARG_INFO(0, timezone)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
|
||||
@@ -656,6 +656,8 @@ static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n);
|
||||
static HashTable *date_object_get_properties_period(zval *object);
|
||||
static HashTable *date_object_get_properties_timezone(zval *object);
|
||||
static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n);
|
||||
static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp);
|
||||
static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv);
|
||||
|
||||
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
|
||||
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
|
||||
@@ -1130,38 +1132,38 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
rfc_colon = 0;
|
||||
switch (format[i]) {
|
||||
/* day */
|
||||
case 'd': length = slprintf(buffer, 32, "%02d", (int) t->d); break;
|
||||
case 'D': length = slprintf(buffer, 32, "%s", php_date_short_day_name(t->y, t->m, t->d)); break;
|
||||
case 'j': length = slprintf(buffer, 32, "%d", (int) t->d); break;
|
||||
case 'l': length = slprintf(buffer, 32, "%s", php_date_full_day_name(t->y, t->m, t->d)); break;
|
||||
case 'S': length = slprintf(buffer, 32, "%s", english_suffix(t->d)); break;
|
||||
case 'w': length = slprintf(buffer, 32, "%d", (int) timelib_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'N': length = slprintf(buffer, 32, "%d", (int) timelib_iso_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'z': length = slprintf(buffer, 32, "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break;
|
||||
case 'd': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->d); break;
|
||||
case 'D': length = slprintf(buffer, sizeof(buffer), "%s", php_date_short_day_name(t->y, t->m, t->d)); break;
|
||||
case 'j': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->d); break;
|
||||
case 'l': length = slprintf(buffer, sizeof(buffer), "%s", php_date_full_day_name(t->y, t->m, t->d)); break;
|
||||
case 'S': length = slprintf(buffer, sizeof(buffer), "%s", english_suffix(t->d)); break;
|
||||
case 'w': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'N': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_iso_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'z': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break;
|
||||
|
||||
/* week */
|
||||
case 'W':
|
||||
if(!weekYearSet) { timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); weekYearSet = 1; }
|
||||
length = slprintf(buffer, 32, "%02d", (int) isoweek); break; /* iso weeknr */
|
||||
length = slprintf(buffer, sizeof(buffer), "%02d", (int) isoweek); break; /* iso weeknr */
|
||||
case 'o':
|
||||
if(!weekYearSet) { timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); weekYearSet = 1; }
|
||||
length = slprintf(buffer, 32, "%d", (int) isoyear); break; /* iso year */
|
||||
length = slprintf(buffer, sizeof(buffer), "%d", (int) isoyear); break; /* iso year */
|
||||
|
||||
/* month */
|
||||
case 'F': length = slprintf(buffer, 32, "%s", mon_full_names[t->m - 1]); break;
|
||||
case 'm': length = slprintf(buffer, 32, "%02d", (int) t->m); break;
|
||||
case 'M': length = slprintf(buffer, 32, "%s", mon_short_names[t->m - 1]); break;
|
||||
case 'n': length = slprintf(buffer, 32, "%d", (int) t->m); break;
|
||||
case 't': length = slprintf(buffer, 32, "%d", (int) timelib_days_in_month(t->y, t->m)); break;
|
||||
case 'F': length = slprintf(buffer, sizeof(buffer), "%s", mon_full_names[t->m - 1]); break;
|
||||
case 'm': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->m); break;
|
||||
case 'M': length = slprintf(buffer, sizeof(buffer), "%s", mon_short_names[t->m - 1]); break;
|
||||
case 'n': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->m); break;
|
||||
case 't': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_days_in_month(t->y, t->m)); break;
|
||||
|
||||
/* year */
|
||||
case 'L': length = slprintf(buffer, 32, "%d", timelib_is_leap((int) t->y)); break;
|
||||
case 'y': length = slprintf(buffer, 32, "%02d", (int) t->y % 100); break;
|
||||
case 'Y': length = slprintf(buffer, 32, "%s%04lld", t->y < 0 ? "-" : "", php_date_llabs((timelib_sll) t->y)); break;
|
||||
case 'L': length = slprintf(buffer, sizeof(buffer), "%d", timelib_is_leap((int) t->y)); break;
|
||||
case 'y': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->y % 100); break;
|
||||
case 'Y': length = slprintf(buffer, sizeof(buffer), "%s%04lld", t->y < 0 ? "-" : "", php_date_llabs((timelib_sll) t->y)); break;
|
||||
|
||||
/* time */
|
||||
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
|
||||
case 'A': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break;
|
||||
case 'a': length = slprintf(buffer, sizeof(buffer), "%s", t->h >= 12 ? "pm" : "am"); break;
|
||||
case 'A': length = slprintf(buffer, sizeof(buffer), "%s", t->h >= 12 ? "PM" : "AM"); break;
|
||||
case 'B': {
|
||||
int retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
|
||||
if (retval < 0) {
|
||||
@@ -1169,41 +1171,41 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
}
|
||||
/* Make sure to do this on a positive int to avoid rounding errors */
|
||||
retval = (retval / 864) % 1000;
|
||||
length = slprintf(buffer, 32, "%03d", retval);
|
||||
length = slprintf(buffer, sizeof(buffer), "%03d", retval);
|
||||
break;
|
||||
}
|
||||
case 'g': length = slprintf(buffer, 32, "%d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'G': length = slprintf(buffer, 32, "%d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, 32, "%02d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'H': length = slprintf(buffer, 32, "%02d", (int) t->h); break;
|
||||
case 'i': length = slprintf(buffer, 32, "%02d", (int) t->i); break;
|
||||
case 's': length = slprintf(buffer, 32, "%02d", (int) t->s); break;
|
||||
case 'u': length = slprintf(buffer, 32, "%06d", (int) floor(t->us)); break;
|
||||
case 'v': length = slprintf(buffer, 32, "%03d", (int) floor(t->us / 1000)); break;
|
||||
case 'g': length = slprintf(buffer, sizeof(buffer), "%d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'G': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, sizeof(buffer), "%02d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'H': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->h); break;
|
||||
case 'i': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->i); break;
|
||||
case 's': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->s); break;
|
||||
case 'u': length = slprintf(buffer, sizeof(buffer), "%06d", (int) floor(t->us)); break;
|
||||
case 'v': length = slprintf(buffer, sizeof(buffer), "%03d", (int) floor(t->us / 1000)); break;
|
||||
|
||||
/* timezone */
|
||||
case 'I': length = slprintf(buffer, 32, "%d", localtime ? offset->is_dst : 0); break;
|
||||
case 'I': length = slprintf(buffer, sizeof(buffer), "%d", localtime ? offset->is_dst : 0); break;
|
||||
case 'P': rfc_colon = 1; /* break intentionally missing */
|
||||
case 'O': length = slprintf(buffer, 32, "%c%02d%s%02d",
|
||||
case 'O': length = slprintf(buffer, sizeof(buffer), "%c%02d%s%02d",
|
||||
localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
|
||||
localtime ? abs(offset->offset / 3600) : 0,
|
||||
rfc_colon ? ":" : "",
|
||||
localtime ? abs((offset->offset % 3600) / 60) : 0
|
||||
);
|
||||
break;
|
||||
case 'T': length = slprintf(buffer, 32, "%s", localtime ? offset->abbr : "GMT"); break;
|
||||
case 'T': length = slprintf(buffer, sizeof(buffer), "%s", localtime ? offset->abbr : "GMT"); break;
|
||||
case 'e': if (!localtime) {
|
||||
length = slprintf(buffer, 32, "%s", "UTC");
|
||||
length = slprintf(buffer, sizeof(buffer), "%s", "UTC");
|
||||
} else {
|
||||
switch (t->zone_type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
length = slprintf(buffer, 32, "%s", t->tz_info->name);
|
||||
length = slprintf(buffer, sizeof(buffer), "%s", t->tz_info->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
length = slprintf(buffer, 32, "%s", offset->abbr);
|
||||
length = slprintf(buffer, sizeof(buffer), "%s", offset->abbr);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET:
|
||||
length = slprintf(buffer, 32, "%c%02d:%02d",
|
||||
length = slprintf(buffer, sizeof(buffer), "%c%02d:%02d",
|
||||
((offset->offset < 0) ? '-' : '+'),
|
||||
abs(offset->offset / 3600),
|
||||
abs((offset->offset % 3600) / 60)
|
||||
@@ -1212,10 +1214,10 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'Z': length = slprintf(buffer, 32, "%d", localtime ? offset->offset : 0); break;
|
||||
case 'Z': length = slprintf(buffer, sizeof(buffer), "%d", localtime ? offset->offset : 0); break;
|
||||
|
||||
/* full date/time */
|
||||
case 'c': length = slprintf(buffer, 96, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
||||
case 'c': length = slprintf(buffer, sizeof(buffer), "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
||||
(int) t->y, (int) t->m, (int) t->d,
|
||||
(int) t->h, (int) t->i, (int) t->s,
|
||||
localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
|
||||
@@ -1223,7 +1225,7 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
localtime ? abs((offset->offset % 3600) / 60) : 0
|
||||
);
|
||||
break;
|
||||
case 'r': length = slprintf(buffer, 96, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d",
|
||||
case 'r': length = slprintf(buffer, sizeof(buffer), "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d",
|
||||
php_date_short_day_name(t->y, t->m, t->d),
|
||||
(int) t->d, mon_short_names[t->m - 1],
|
||||
(int) t->y, (int) t->h, (int) t->i, (int) t->s,
|
||||
@@ -1232,7 +1234,7 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
localtime ? abs((offset->offset % 3600) / 60) : 0
|
||||
);
|
||||
break;
|
||||
case 'U': length = slprintf(buffer, 32, "%lld", (timelib_sll) t->sse); break;
|
||||
case 'U': length = slprintf(buffer, sizeof(buffer), "%lld", (timelib_sll) t->sse); break;
|
||||
|
||||
case '\\': if (i < format_len) i++; /* break intentionally missing */
|
||||
|
||||
@@ -2040,9 +2042,9 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
|
||||
|
||||
|
||||
if (prop != &EG(uninitialized_zval)) {
|
||||
if (type == 2) {
|
||||
retval = 1;
|
||||
@@ -2060,7 +2062,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2120,6 +2122,7 @@ static void date_register_classes(void) /* {{{ */
|
||||
date_object_handlers_timezone.clone_obj = date_object_clone_timezone;
|
||||
date_object_handlers_timezone.get_properties = date_object_get_properties_timezone;
|
||||
date_object_handlers_timezone.get_gc = date_object_get_gc_timezone;
|
||||
date_object_handlers_timezone.get_debug_info = date_object_get_debug_info_timezone;
|
||||
|
||||
#define REGISTER_TIMEZONE_CLASS_CONST_STRING(const_name, value) \
|
||||
zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value);
|
||||
@@ -2397,6 +2400,51 @@ static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */
|
||||
return props;
|
||||
} /* }}} */
|
||||
|
||||
static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv)
|
||||
{
|
||||
switch (tzobj->type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
ZVAL_STRING(zv, tzobj->tzi.tz->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
|
||||
timelib_sll utc_offset = tzobj->tzi.utc_offset;
|
||||
|
||||
ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
|
||||
utc_offset < 0 ? '-' : '+',
|
||||
abs(utc_offset / 3600),
|
||||
abs(((utc_offset % 3600) / 60)));
|
||||
|
||||
ZVAL_NEW_STR(zv, tmpstr);
|
||||
}
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
ZVAL_STRING(zv, tzobj->tzi.z.abbr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp) /* {{{ */
|
||||
{
|
||||
HashTable *ht, *props;
|
||||
zval zv;
|
||||
php_timezone_obj *tzobj;
|
||||
|
||||
tzobj = Z_PHPTIMEZONE_P(object);
|
||||
props = zend_std_get_properties(object);
|
||||
|
||||
*is_temp = 1;
|
||||
ht = zend_array_dup(props);
|
||||
|
||||
ZVAL_LONG(&zv, tzobj->type);
|
||||
zend_hash_str_update(ht, "timezone_type", sizeof("timezone_type")-1, &zv);
|
||||
|
||||
php_timezone_to_string(tzobj, &zv);
|
||||
zend_hash_str_update(ht, "timezone", sizeof("timezone")-1, &zv);
|
||||
|
||||
return ht;
|
||||
} /* }}} */
|
||||
|
||||
static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props) /* {{{ */
|
||||
{
|
||||
php_interval_obj *intern;
|
||||
@@ -3901,27 +3949,7 @@ PHP_FUNCTION(timezone_name_get)
|
||||
}
|
||||
tzobj = Z_PHPTIMEZONE_P(object);
|
||||
DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone);
|
||||
|
||||
switch (tzobj->type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
RETURN_STRING(tzobj->tzi.tz->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
|
||||
timelib_sll utc_offset = tzobj->tzi.utc_offset;
|
||||
|
||||
ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
|
||||
utc_offset < 0 ? '-' : '+',
|
||||
abs(utc_offset / 3600),
|
||||
abs(((utc_offset % 3600) / 60)));
|
||||
|
||||
RETURN_NEW_STR(tmpstr);
|
||||
}
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
RETURN_STRING(tzobj->tzi.z.abbr);
|
||||
break;
|
||||
}
|
||||
php_timezone_to_string(tzobj, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4451,38 +4479,38 @@ static zend_string *date_interval_format(char *format, size_t format_len, timeli
|
||||
for (i = 0; i < format_len; i++) {
|
||||
if (have_format_spec) {
|
||||
switch (format[i]) {
|
||||
case 'Y': length = slprintf(buffer, 32, "%02d", (int) t->y); break;
|
||||
case 'y': length = slprintf(buffer, 32, "%d", (int) t->y); break;
|
||||
case 'Y': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->y); break;
|
||||
case 'y': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->y); break;
|
||||
|
||||
case 'M': length = slprintf(buffer, 32, "%02d", (int) t->m); break;
|
||||
case 'm': length = slprintf(buffer, 32, "%d", (int) t->m); break;
|
||||
case 'M': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->m); break;
|
||||
case 'm': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->m); break;
|
||||
|
||||
case 'D': length = slprintf(buffer, 32, "%02d", (int) t->d); break;
|
||||
case 'd': length = slprintf(buffer, 32, "%d", (int) t->d); break;
|
||||
case 'D': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->d); break;
|
||||
case 'd': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->d); break;
|
||||
|
||||
case 'H': length = slprintf(buffer, 32, "%02d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, 32, "%d", (int) t->h); break;
|
||||
case 'H': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->h); break;
|
||||
|
||||
case 'I': length = slprintf(buffer, 32, "%02d", (int) t->i); break;
|
||||
case 'i': length = slprintf(buffer, 32, "%d", (int) t->i); break;
|
||||
case 'I': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->i); break;
|
||||
case 'i': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->i); break;
|
||||
|
||||
case 'S': length = slprintf(buffer, 32, "%02" ZEND_LONG_FMT_SPEC, (zend_long) t->s); break;
|
||||
case 's': length = slprintf(buffer, 32, ZEND_LONG_FMT, (zend_long) t->s); break;
|
||||
case 'S': length = slprintf(buffer, sizeof(buffer), "%02" ZEND_LONG_FMT_SPEC, (zend_long) t->s); break;
|
||||
case 's': length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) t->s); break;
|
||||
|
||||
case 'F': length = slprintf(buffer, 32, "%06" ZEND_LONG_FMT_SPEC, (zend_long) t->us); break;
|
||||
case 'f': length = slprintf(buffer, 32, ZEND_LONG_FMT, (zend_long) t->us); break;
|
||||
case 'F': length = slprintf(buffer, sizeof(buffer), "%06" ZEND_LONG_FMT_SPEC, (zend_long) t->us); break;
|
||||
case 'f': length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) t->us); break;
|
||||
|
||||
case 'a': {
|
||||
if ((int) t->days != -99999) {
|
||||
length = slprintf(buffer, 32, "%d", (int) t->days);
|
||||
length = slprintf(buffer, sizeof(buffer), "%d", (int) t->days);
|
||||
} else {
|
||||
length = slprintf(buffer, 32, "(unknown)");
|
||||
length = slprintf(buffer, sizeof(buffer), "(unknown)");
|
||||
}
|
||||
} break;
|
||||
case 'r': length = slprintf(buffer, 32, "%s", t->invert ? "-" : ""); break;
|
||||
case 'R': length = slprintf(buffer, 32, "%c", t->invert ? '-' : '+'); break;
|
||||
case 'r': length = slprintf(buffer, sizeof(buffer), "%s", t->invert ? "-" : ""); break;
|
||||
case 'R': length = slprintf(buffer, sizeof(buffer), "%c", t->invert ? '-' : '+'); break;
|
||||
|
||||
case '%': length = slprintf(buffer, 32, "%%"); break;
|
||||
case '%': length = slprintf(buffer, sizeof(buffer), "%%"); break;
|
||||
default: buffer[0] = '%'; buffer[1] = format[i]; buffer[2] = '\0'; length = 2; break;
|
||||
}
|
||||
smart_str_appendl(&string, buffer, length);
|
||||
@@ -4741,14 +4769,14 @@ PHP_FUNCTION(timezone_identifiers_list)
|
||||
const timelib_tzdb *tzdb;
|
||||
const timelib_tzdb_index_entry *table;
|
||||
int i, item_count;
|
||||
zend_long what = PHP_DATE_TIMEZONE_GROUP_ALL;
|
||||
zend_long what = PHP_DATE_TIMEZONE_GROUP_ALL;
|
||||
char *option = NULL;
|
||||
size_t option_len = 0;
|
||||
size_t option_len = 0;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(0, 2)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(what)
|
||||
Z_PARAM_STRING(option, option_len)
|
||||
Z_PARAM_STRING_EX(option, option_len, 1, 0)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
|
||||
/* Extra validation */
|
||||
|
||||
@@ -39,34 +39,30 @@ object(DateTimeZone)#%d (2) {
|
||||
|
||||
-- Add some properties --
|
||||
object(DateTimeZone)#%d (4) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
string(5) "Hello"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
|
||||
-- clone it --
|
||||
object(DateTimeZone)#%d (4) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
string(5) "Hello"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
|
||||
-- Add some more properties --
|
||||
object(DateTimeZone)#%d (6) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
@@ -75,14 +71,14 @@ object(DateTimeZone)#%d (6) {
|
||||
bool(true)
|
||||
["property4"]=>
|
||||
float(10.5)
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
|
||||
-- clone it --
|
||||
object(DateTimeZone)#%d (6) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
@@ -91,5 +87,9 @@ object(DateTimeZone)#%d (6) {
|
||||
bool(true)
|
||||
["property4"]=>
|
||||
float(10.5)
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #68406 calling var_dump on a DateTimeZone object modifies it
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$tz1 = new DateTimeZone('Europe/Berlin');
|
||||
$tz2 = new DateTimeZone('Europe/Berlin');
|
||||
|
||||
$d = new DateTime('2014-12-24 13:00:00', $tz1);
|
||||
var_dump($d->getTimezone(), $tz2);
|
||||
|
||||
if($tz2 == $d->getTimezone()) {
|
||||
echo "yes";
|
||||
}
|
||||
else {
|
||||
echo "no";
|
||||
}
|
||||
|
||||
--EXPECT--
|
||||
object(DateTimeZone)#4 (2) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/Berlin"
|
||||
}
|
||||
object(DateTimeZone)#2 (2) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/Berlin"
|
||||
}
|
||||
yes
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Failing test case for #75857: Long timezones truncation
|
||||
--CREDITS--
|
||||
Gabriel Caruso (carusogabriel34@gmail.com)
|
||||
--FILE--
|
||||
<?php
|
||||
$longDate = new DateTime('now', new DateTimeZone('America/Argentina/ComodRivadavia'));
|
||||
$mediumDate = new DateTime('now', new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
$smallDate = new DateTime('now', new DateTimeZone('America/Sao_Paulo'));
|
||||
|
||||
var_dump($longDate->format('e'));
|
||||
var_dump($mediumDate->format('e'));
|
||||
var_dump($smallDate->format('e'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(32) "America/Argentina/ComodRivadavia"
|
||||
string(28) "America/Indiana/Indianapolis"
|
||||
string(17) "America/Sao_Paulo"
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Bug #75928: Argument 2 for `DateTimeZone::listIdentifiers()` should accept `null`
|
||||
--FILE--
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
var_dump(is_array(DateTimeZone::listIdentifiers(\DateTimeZone::ALL, null)));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+1
-1
@@ -33,6 +33,6 @@ if test "$PHP_DOM" != "no"; then
|
||||
PHP_INSTALL_HEADERS([ext/dom/xml_common.h])
|
||||
PHP_ADD_EXTENSION_DEP(dom, libxml)
|
||||
], [
|
||||
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
|
||||
AC_MSG_ERROR([libxml2 not found. Please check your libxml2 installation.])
|
||||
])
|
||||
fi
|
||||
@@ -598,7 +598,6 @@ PHP_MINIT_FUNCTION(dom)
|
||||
memcpy(&dom_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
dom_object_handlers.offset = XtOffsetOf(dom_object, std);
|
||||
dom_object_handlers.free_obj = dom_objects_free_storage;
|
||||
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
|
||||
dom_object_handlers.read_property = dom_read_property;
|
||||
dom_object_handlers.write_property = dom_write_property;
|
||||
dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
|
||||
|
||||
@@ -719,7 +719,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
}
|
||||
|
||||
if (sugg) {
|
||||
zval_dtor(sugg);
|
||||
zval_ptr_dtor(sugg);
|
||||
array_init(sugg);
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -2112,7 +2112,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, (int) strlen(value));
|
||||
length = (int) php_strnlen(value, length);
|
||||
}
|
||||
|
||||
/* do not recompute length here */
|
||||
@@ -4457,13 +4457,11 @@ PHP_FUNCTION(exif_read_data)
|
||||
#ifdef EXIF_DEBUG
|
||||
sections_str = exif_get_sectionlist(sections_needed);
|
||||
if (!sections_str) {
|
||||
zend_string_release(z_sections_needed);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Sections needed: %s", sections_str[0] ? sections_str : "None");
|
||||
EFREE_IF(sections_str);
|
||||
#endif
|
||||
zend_string_release(z_sections_needed);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(stream) == IS_RESOURCE) {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value)
|
||||
--DESCRIPTION--
|
||||
This test is meant to exhibit memory issues with the `-m` option. Since a lot of
|
||||
notices and warnings are to be expected anyway, we suppress these, since the are
|
||||
not relevant for this test.
|
||||
--INI--
|
||||
error_reporting=E_ALL & ~E_WARNING & ~E_NOTICE
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . '/bug76130_1.jpg');
|
||||
exif_read_data(__DIR__ . '/bug76130_2.jpg');
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #76164 (exif_read_data zend_mm_heap corrupted)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$var1 = 'nonexistentfile';
|
||||
$var2 = 2200000000;
|
||||
@exif_read_data($var1, $var2); // we're not interested in the warning, here
|
||||
$var2 = 1;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -127,6 +127,24 @@ dnl [ --enable-$extname Enable $extname support])
|
||||
if test "\$PHP_$EXTNAME" != "no"; then
|
||||
dnl Write more examples of tests here...
|
||||
|
||||
dnl # get library FOO build options from pkg-config output
|
||||
dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
dnl AC_MSG_CHECKING(for libfoo)
|
||||
dnl if test -x "\$PKG_CONFIG" && \$PKG_CONFIG --exists foo; then
|
||||
dnl if \$PKG_CONFIG foo --atleast-version 1.2.3; then
|
||||
dnl LIBFOO_CFLAGS=\`\$PKG_CONFIG foo --cflags\`
|
||||
dnl LIBFOO_LIBDIR=\`\$PKG_CONFIG foo --libs\`
|
||||
dnl LIBFOO_VERSON=\`\$PKG_CONFIG foo --modversion\`
|
||||
dnl AC_MSG_RESULT(from pkgconfig: version \$LIBFOO_VERSON)
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required)
|
||||
dnl fi
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR(pkg-config not found)
|
||||
dnl fi
|
||||
dnl PHP_EVAL_LIBLINE(\$LIBFOO_LIBDIR, ${EXTNAME}_SHARED_LIBADD)
|
||||
dnl PHP_EVAL_INCLINE(\$LIBFOO_CFLAGS)
|
||||
|
||||
dnl # --with-$extname -> check with-path
|
||||
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
|
||||
dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fget, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, resumepos)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_ftp_pasv, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_pasv, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, ftp)
|
||||
ZEND_ARG_INFO(0, pasv)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -7,7 +7,7 @@ if (2147483647 == PHP_INT_MAX) {
|
||||
die('skip ot supported on this system');
|
||||
}
|
||||
if (disk_free_space(__DIR__) < 10*1024*1024*1024) {
|
||||
die('not enough disk space');
|
||||
die('skip Not enough disk space');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
+2
-2
@@ -848,7 +848,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_imageaffinematrixconcat, 0)
|
||||
ZEND_ARG_INFO(0, m2)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_imagesetinterpolation, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagesetinterpolation, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, im)
|
||||
ZEND_ARG_INFO(0, method)
|
||||
ZEND_END_ARG_INFO()
|
||||
@@ -4842,7 +4842,7 @@ PHP_FUNCTION(imagescale)
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp_h <= 0 || tmp_w <= 0) {
|
||||
if (tmp_h <= 0 || tmp_h > INT_MAX || tmp_w <= 0 || tmp_w > INT_MAX) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -1239,6 +1239,12 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
|
||||
long x, y, inc, frac;
|
||||
long dx, dy,tmp;
|
||||
|
||||
if (!im->trueColor) {
|
||||
/* TBB: don't crash when the image is of the wrong type */
|
||||
gdImageLine(im, x1, y1, x2, y2, col);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */
|
||||
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) {
|
||||
return;
|
||||
@@ -1332,7 +1338,6 @@ void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color
|
||||
} else {
|
||||
wid = 1;
|
||||
}
|
||||
wid = (int)(thick * sin(atan2(dy, dx)));
|
||||
vert = 1;
|
||||
|
||||
d = 2 * dy - dx;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(1200, 800);
|
||||
$background_color = imagecolorallocate($im, 40, 40, 40);
|
||||
$color = imagecolorallocate($im, 255, 255, 255);
|
||||
imagedashedline($im, 800, 400, 300, 400, $color);
|
||||
imagedashedline($im, 800, 400, 300, 800, $color);
|
||||
imagedashedline($im, 800, 400, 400, 800, $color);
|
||||
imagedashedline($im, 800, 400, 500, 800, $color);
|
||||
imagedashedline($im, 800, 400, 600, 800, $color);
|
||||
imagedashedline($im, 800, 400, 700, 800, $color);
|
||||
imagedashedline($im, 800, 400, 800, 800, $color);
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug52070.png', $im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
===DONE===
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73957 (signed integer conversion in imagescale())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (PHP_INT_SIZE != 8) die('skip this test is for 64bit platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(8, 8);
|
||||
$im = imagescale($im, 0x100000001, 1);
|
||||
var_dump($im);
|
||||
if ($im) { // which is not supposed to happen
|
||||
var_dump(imagesx($im));
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #76041 (null pointer access crashed php)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im=imagecreate(100, 100);
|
||||
imageantialias($im, true);
|
||||
imageline($im, 0, 0, 10, 10, 0xffffff);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
+2
-2
@@ -1965,8 +1965,8 @@ ZEND_FUNCTION(gmp_setbit)
|
||||
php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (index / GMP_NUMB_BITS >= INT_MAX ) {
|
||||
php_error_docref(NULL, E_WARNING, "Index must be less than %ld * %ld", INT_MAX, GMP_NUMB_BITS);
|
||||
if (index / GMP_NUMB_BITS >= INT_MAX) {
|
||||
php_error_docref(NULL, E_WARNING, "Index must be less than %d * %d", INT_MAX, GMP_NUMB_BITS);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -559,6 +559,8 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
size_t result;
|
||||
zend_string *ret, *out_buffer;
|
||||
|
||||
*out = NULL;
|
||||
|
||||
/*
|
||||
This is not the right way to get output size...
|
||||
This is not space efficient for large text.
|
||||
@@ -2640,6 +2642,9 @@ static int php_iconv_stream_filter_append_bucket(
|
||||
tcnt = 0;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
|
||||
goto out_failure;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fh = fopen('php://memory', 'rw');
|
||||
fwrite($fh, "abc");
|
||||
rewind($fh);
|
||||
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) {
|
||||
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []);
|
||||
}
|
||||
$a = stream_get_contents($fh);
|
||||
var_dump(strlen($a));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
|
||||
int(3)
|
||||
DONE
|
||||
@@ -1082,6 +1082,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
|
||||
}
|
||||
}
|
||||
mail_free_errorlist(&IMAPG(imap_errorstack));
|
||||
IMAPG(imap_errorstack) = NIL;
|
||||
}
|
||||
|
||||
if (IMAPG(imap_alertstack) != NIL) {
|
||||
|
||||
@@ -79,6 +79,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
||||
if (U_FAILURE(status)) {
|
||||
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
|
||||
"create instance from compiled rules", 0);
|
||||
delete rbbi;
|
||||
return;
|
||||
}
|
||||
#else
|
||||
|
||||
+21
-12
@@ -9,6 +9,7 @@ if test "$PHP_INTL" != "no"; then
|
||||
PHP_SETUP_ICU(INTL_SHARED_LIBADD)
|
||||
PHP_SUBST(INTL_SHARED_LIBADD)
|
||||
PHP_REQUIRE_CXX()
|
||||
INTL_COMMON_FLAGS="$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
|
||||
if test "$icu_version" -ge "4002"; then
|
||||
icu_spoof_src=" spoofchecker/spoofchecker_class.c \
|
||||
spoofchecker/spoofchecker.c\
|
||||
@@ -20,7 +21,6 @@ if test "$PHP_INTL" != "no"; then
|
||||
PHP_NEW_EXTENSION(intl, php_intl.c \
|
||||
intl_error.c \
|
||||
intl_convert.c \
|
||||
intl_convertcpp.cpp \
|
||||
collator/collator.c \
|
||||
collator/collator_class.c \
|
||||
collator/collator_sort.c \
|
||||
@@ -32,8 +32,6 @@ if test "$PHP_INTL" != "no"; then
|
||||
collator/collator_is_numeric.c \
|
||||
collator/collator_error.c \
|
||||
common/common_error.c \
|
||||
common/common_enum.cpp \
|
||||
common/common_date.cpp \
|
||||
converter/converter.c \
|
||||
formatter/formatter.c \
|
||||
formatter/formatter_main.c \
|
||||
@@ -53,17 +51,12 @@ if test "$PHP_INTL" != "no"; then
|
||||
dateformat/dateformat_attr.c \
|
||||
dateformat/dateformat_data.c \
|
||||
dateformat/dateformat_format.c \
|
||||
dateformat/dateformat_format_object.cpp \
|
||||
dateformat/dateformat_parse.c \
|
||||
dateformat/dateformat_create.cpp \
|
||||
dateformat/dateformat_attrcpp.cpp \
|
||||
dateformat/dateformat_helpers.cpp \
|
||||
msgformat/msgformat.c \
|
||||
msgformat/msgformat_attr.c \
|
||||
msgformat/msgformat_class.c \
|
||||
msgformat/msgformat_data.c \
|
||||
msgformat/msgformat_format.c \
|
||||
msgformat/msgformat_helpers.cpp \
|
||||
msgformat/msgformat_parse.c \
|
||||
grapheme/grapheme_string.c \
|
||||
grapheme/grapheme_util.c \
|
||||
@@ -73,6 +66,18 @@ if test "$PHP_INTL" != "no"; then
|
||||
transliterator/transliterator.c \
|
||||
transliterator/transliterator_class.c \
|
||||
transliterator/transliterator_methods.c \
|
||||
uchar/uchar.c \
|
||||
idn/idn.c \
|
||||
$icu_spoof_src, $ext_shared,,$INTL_COMMON_FLAGS,cxx)
|
||||
|
||||
PHP_INTL_CXX_SOURCES="intl_convertcpp.cpp \
|
||||
common/common_enum.cpp \
|
||||
common/common_date.cpp \
|
||||
dateformat/dateformat_format_object.cpp \
|
||||
dateformat/dateformat_create.cpp \
|
||||
dateformat/dateformat_attrcpp.cpp \
|
||||
dateformat/dateformat_helpers.cpp \
|
||||
msgformat/msgformat_helpers.cpp \
|
||||
timezone/timezone_class.cpp \
|
||||
timezone/timezone_methods.cpp \
|
||||
calendar/calendar_class.cpp \
|
||||
@@ -83,10 +88,14 @@ if test "$PHP_INTL" != "no"; then
|
||||
breakiterator/breakiterator_methods.cpp \
|
||||
breakiterator/rulebasedbreakiterator_methods.cpp \
|
||||
breakiterator/codepointiterator_internal.cpp \
|
||||
breakiterator/codepointiterator_methods.cpp \
|
||||
uchar/uchar.c \
|
||||
idn/idn.c \
|
||||
$icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,cxx)
|
||||
breakiterator/codepointiterator_methods.cpp"
|
||||
PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $ICU_CXXFLAGS"
|
||||
if test "$ext_shared" = "no"; then
|
||||
PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS)
|
||||
else
|
||||
PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS, shared_objects_intl, yes)
|
||||
fi
|
||||
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/collator)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/converter)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/common)
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ if (PHP_INTL != "no") {
|
||||
ADD_FLAG("LIBS_INTL", "iculx.lib");
|
||||
}
|
||||
|
||||
ADD_FLAG("CFLAGS_INTL", "/EHsc");
|
||||
ADD_FLAG("CFLAGS_INTL", "/EHsc /D U_USING_ICU_NAMESPACE=1");
|
||||
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
|
||||
} else {
|
||||
WARNING("intl not enabled; libraries and/or headers not found");
|
||||
|
||||
@@ -103,19 +103,23 @@ typedef struct _intl_data {
|
||||
RETVAL_NEW_STR(u8str); \
|
||||
}
|
||||
|
||||
#define INTL_MAX_LOCALE_LEN 80
|
||||
#define INTL_MAX_LOCALE_LEN (ULOC_FULLNAME_CAPACITY-1)
|
||||
|
||||
#define INTL_CHECK_LOCALE_LEN(locale_len) \
|
||||
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Locale string too long, should be no longer than 80 characters", 0 ); \
|
||||
char *_msg; \
|
||||
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
|
||||
efree(_msg); \
|
||||
RETURN_NULL(); \
|
||||
}
|
||||
|
||||
#define INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len) \
|
||||
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Locale string too long, should be no longer than 80 characters", 0 ); \
|
||||
char *_msg; \
|
||||
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
|
||||
efree(_msg); \
|
||||
return FAILURE; \
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
*/
|
||||
PHP_METHOD(Spoofchecker, __construct)
|
||||
{
|
||||
#if U_ICU_VERSION_MAJOR_NUM < 58
|
||||
int checks;
|
||||
#endif
|
||||
zend_error_handling error_handling;
|
||||
SPOOFCHECKER_METHOD_INIT_VARS;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -79,4 +79,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -23,7 +23,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -80,4 +80,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -23,7 +23,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -80,4 +80,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -22,7 +22,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -76,4 +76,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -1,7 +1,8 @@
|
||||
--TEST--
|
||||
numfmt_format() icu >= 56.1
|
||||
numfmt_format() icu >= 56.1 && icu < 61.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '56.1') < 0) die('skip for ICU >= 56.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
--TEST--
|
||||
numfmt_format() icu >= 61.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') < 0) die('skip for ICU >= 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Format a number using misc locales/patterns.
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed
|
||||
* currency and percent formatting.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$styles = array(
|
||||
NumberFormatter::PATTERN_DECIMAL => '##.#####################',
|
||||
NumberFormatter::DECIMAL => '',
|
||||
NumberFormatter::CURRENCY => '',
|
||||
NumberFormatter::PERCENT => '',
|
||||
NumberFormatter::SCIENTIFIC => '',
|
||||
NumberFormatter::SPELLOUT => '@@@@@@@',
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
NumberFormatter::PATTERN_RULEBASED => '#####.###',
|
||||
1234999, // bad one
|
||||
);
|
||||
|
||||
$integer = array(
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
);
|
||||
$locales = array(
|
||||
'en_US',
|
||||
'ru_UA',
|
||||
'de',
|
||||
'fr',
|
||||
'en_UK'
|
||||
);
|
||||
|
||||
$str_res = '';
|
||||
$number = 1234567.891234567890000;
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$str_res .= "\nLocale is: $locale\n";
|
||||
foreach( $styles as $style => $pattern )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, $style, $pattern );
|
||||
|
||||
if(!$fmt) {
|
||||
$str_res .= "Bad formatter!\n";
|
||||
continue;
|
||||
}
|
||||
$str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, $number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n";
|
||||
}
|
||||
}
|
||||
return $str_res;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Locale is: en_US
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'\$1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'USD1,234,567.89'
|
||||
|
||||
Locale is: ru_UA
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 ?(грн\.|₴)'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'один миллион двести тридцать четыре тысячи пятьсот шестьдесят семь целых восемьдесят девять миллионов сто двадцать три тысячи четыреста пятьдесят семь стомиллионных'
|
||||
'1 234 567.?'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 UAH'
|
||||
|
||||
Locale is: de
|
||||
'1234567.8912345\d+'
|
||||
'1.234.567,891'
|
||||
'(¤ )?1.234.567,89( ¤)?'
|
||||
'123\.456\.789 %'
|
||||
'1.2345678912345\d+E6'
|
||||
'eine Million zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig Komma acht neun eins zwei drei vier fünf( sechs)? sieben( neun)?'
|
||||
'1.234.567.?'
|
||||
'1.234.567'
|
||||
'#####.###'
|
||||
'1.234.567,89 ¤¤'
|
||||
|
||||
Locale is: fr
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 ¤'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq( six)? sept( neuf)?'
|
||||
'1 234 567e'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 ¤¤'
|
||||
|
||||
Locale is: en_UK
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'¤1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'¤¤1,234,567.89'
|
||||
@@ -24,8 +24,17 @@ $rules = <<<RULES
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump(get_class($rbbi));
|
||||
|
||||
try {
|
||||
$obj = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+', 'aoeu');
|
||||
} catch (IntlException $e) {
|
||||
var_dump(intl_get_error_code(), intl_get_error_message());
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
==DONE==
|
||||
int(1)
|
||||
string(93) "rbbi_create_instance: unable to create instance from compiled rules: U_ILLEGAL_ARGUMENT_ERROR"
|
||||
==DONE==
|
||||
@@ -2,6 +2,7 @@
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '61.1') < 0) print 'skip ICU >= 61.1 only'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rules = <<<RULES
|
||||
\$LN = [[:letter:] [:number:]];
|
||||
\$S = [.;,:];
|
||||
|
||||
!!forward;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!reverse;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');
|
||||
|
||||
$br = $rbbi->getBinaryRules();
|
||||
|
||||
$rbbi2 = new IntlRuleBasedBreakIterator($br, true);
|
||||
|
||||
var_dump($rbbi->getRules(), $rbbi2->getRules());
|
||||
var_dump($rbbi->getRules() == $rbbi2->getRules());
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -1,9 +1,8 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
@@ -29,4 +28,4 @@ var_dump($rbbi->getRules());
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(128) "$LN = [[:letter:] [:number:]];$S = [.;,:];!!forward;$LN+ {1};$S+ {42};!!reverse;$LN+ {1};$S+ {42};!!safe_forward;!!safe_reverse;"
|
||||
==DONE==
|
||||
==DONE==
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') < 0) die('skip for ICU >= 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rules = <<<RULES
|
||||
\$LN = [[:letter:] [:number:]];
|
||||
\$S = [.;,:];
|
||||
|
||||
!!forward;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!reverse;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump($rbbi->getRules());
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
==DONE==
|
||||
+12
-10
@@ -117,14 +117,16 @@ if test "$PHP_LDAP" != "no"; then
|
||||
LDAP_PTHREAD=
|
||||
fi
|
||||
|
||||
if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then
|
||||
MACHINE_INCLUDES=$($CC -dumpmachine)
|
||||
|
||||
if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/libldap.3.dylib; then
|
||||
elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/libldap.3.dylib; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libssldap50.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
@@ -137,7 +139,7 @@ if test "$PHP_LDAP" != "no"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ssl3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldapssl41.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
@@ -147,35 +149,35 @@ if test "$PHP_LDAP" != "no"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldapssl41, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldapssl30.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldap30.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libumich_ldap.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1 || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_ORALDAP,1,[ ])
|
||||
AC_DEFINE(HAVE_ORALDAP_12,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1 || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_ORALDAP,1,[ ])
|
||||
AC_DEFINE(HAVE_ORALDAP_11,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libclntsh.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_ORALDAP,1,[ ])
|
||||
AC_DEFINE(HAVE_ORALDAP_10,1,[ ])
|
||||
|
||||
+5
-1
@@ -1242,7 +1242,11 @@ PHP_FUNCTION(ldap_get_entries)
|
||||
|
||||
add_assoc_long(&tmp1, "count", num_attrib);
|
||||
dn = ldap_get_dn(ldap, ldap_result_entry);
|
||||
add_assoc_string(&tmp1, "dn", dn);
|
||||
if (dn) {
|
||||
add_assoc_string(&tmp1, "dn", dn);
|
||||
} else {
|
||||
add_assoc_null(&tmp1, "dn");
|
||||
}
|
||||
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS
|
||||
ldap_memfree(dn);
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #76248 (Malicious LDAP-Server Response causes Crash)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (!function_exists('pcntl_fork')) die('skip fork not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$pid = pcntl_fork();
|
||||
const PORT = 12345;
|
||||
if ($pid == 0) {
|
||||
// child
|
||||
$server = stream_socket_server("tcp://127.0.0.1:12345");
|
||||
$socket = stream_socket_accept($server, 3);
|
||||
fwrite($socket, base64_decode("MAwCAQFhBwoBAAQABAAweQIBAmR0BJljbj1yb290LGRjPWV4YW1wbGUsZGM9Y29tMFcwIwQLb2JqZWN0Q2xhc3MxFAQSb3JnYW5pemF0aW9uYWxSb2xlMAwEAmNuMQYEBHJvb3QwIgQLZGVzY3JpcHRpb24xEwQRRGlyZWN0b3J5IE1hbmFnZXIwDAIBAmUHCgEABAAEADB5AgEDZHQEmWNuPXJvb3QsZGM9ZXhhbXBsZSxkYz1jb20wVzAjBAtvYmplY3RDbGFzczEUBBJvcmdhbml6YXRpb25hbFJvbGUwDAQCY24xBgQEcm9vdDAiBAtkZXNjcmlwdGlvbjETBBFEaXJlY3RvcnkgTWFuYWdlcjAMAgEDZQcKAQAEAAQA"));
|
||||
fflush($socket);
|
||||
} else {
|
||||
// parent
|
||||
$ds = ldap_connect("127.0.0.1", PORT);
|
||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
$b = ldap_bind($ds, "cn=root,dc=example,dc=com", "secret");
|
||||
|
||||
$s = ldap_search($ds, "dc=example,dc=com", "(cn=root)");
|
||||
$tt = ldap_get_entries($ds, $s);
|
||||
var_dump($tt);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
["dn"]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,6 @@ if test "$PHP_LIBXML" != "no"; then
|
||||
PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
||||
PHP_INSTALL_HEADERS([ext/libxml/php_libxml.h])
|
||||
], [
|
||||
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
|
||||
AC_MSG_ERROR([libxml2 not found. Please check your libxml2 installation.])
|
||||
])
|
||||
fi
|
||||
@@ -142,7 +142,7 @@ mbfl_filt_conv_wchar_cp1251(int c, mbfl_convert_filter *filter)
|
||||
/* all of this is so ugly now! */
|
||||
static int mbfl_filt_ident_cp1251(int c, mbfl_identify_filter *filter)
|
||||
{
|
||||
if (c >= 0x80 && c < 0xff)
|
||||
if (c >= 0x80 && c <= 0xff)
|
||||
filter->flag = 0;
|
||||
else
|
||||
filter->flag = 1; /* not it */
|
||||
|
||||
@@ -30,7 +30,7 @@ static const unsigned short cp1251_ucs_table[] = {
|
||||
0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021,
|
||||
0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f,
|
||||
0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
|
||||
0x003f, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f,
|
||||
0xfffd, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f,
|
||||
0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7,
|
||||
0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407,
|
||||
0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7,
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
* as it only covers this range, while the rest cover 0xa0 onwards */
|
||||
|
||||
static const unsigned short cp1252_ucs_table[] = {
|
||||
0x20ac,0xfffe,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021,
|
||||
0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffe,0x017d,0xfffe,
|
||||
0xfffe,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,
|
||||
0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffe,0x017e,0x0178
|
||||
0x20ac,0xfffd,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021,
|
||||
0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffd,0x017d,0xfffd,
|
||||
0xfffd,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,
|
||||
0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffd,0x017e,0x0178
|
||||
};
|
||||
#endif /* UNICODE_TABLE_CP1252_H */
|
||||
@@ -449,7 +449,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
|
||||
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
|
||||
|
||||
rc = zend_hash_str_find_ptr(&MBREX(ht_rc), (char *)pattern, patlen);
|
||||
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
|
||||
if (!rc || onig_get_options(rc) != options || onig_get_encoding(rc) != enc || onig_get_syntax(rc) != syntax) {
|
||||
if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
|
||||
onig_error_code_to_str(err_str, err_code, &err_info);
|
||||
php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #62545 (wrong unicode mapping in some charsets)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
bin2hex(mb_convert_encoding("\x98", 'UTF-8', 'Windows-1251')),
|
||||
bin2hex(mb_convert_encoding("\x81\x8d\x8f\x90\x9d", 'UTF-8', 'Windows-1252'))
|
||||
);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(6) "efbfbd"
|
||||
string(30) "efbfbdefbfbdefbfbdefbfbdefbfbd"
|
||||
===DONE===
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(mb_detect_encoding(chr(0xfe), array('CP-1251'))); // letter '?'
|
||||
var_dump(mb_detect_encoding(chr(0xff), array('CP-1251'))); // letter '?'
|
||||
?>
|
||||
--EXPECT--
|
||||
string(12) "Windows-1251"
|
||||
string(12) "Windows-1251"
|
||||
|
||||
@@ -8,10 +8,10 @@ mysqli autocommit/commit/rollback
|
||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
if (!$link)
|
||||
die(sprintf("Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
|
||||
if (!have_innodb($link))
|
||||
die(sprintf("Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -94,4 +94,4 @@ array(2) {
|
||||
[1]=>
|
||||
string(4) "egon"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -12,7 +12,7 @@ require_once __DIR__ . '/skipif.inc';
|
||||
require_once __DIR__ . '/skipifconnectfailure.inc';
|
||||
require_once __DIR__ . '/connect.inc';
|
||||
if (!$IS_MYSQLND) {
|
||||
die('mysqlnd only');
|
||||
die('skip mysqlnd only');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -79,11 +79,15 @@ mysqlnd_run_authentication(
|
||||
struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol);
|
||||
|
||||
if (!auth_plugin) {
|
||||
php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
|
||||
goto end;
|
||||
if (first_call) {
|
||||
mnd_pefree(requested_protocol, FALSE);
|
||||
requested_protocol = mnd_pestrdup(MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
DBG_INF("plugin found");
|
||||
|
||||
{
|
||||
zend_uchar * switch_to_auth_protocol_data = NULL;
|
||||
@@ -108,10 +112,13 @@ mysqlnd_run_authentication(
|
||||
|
||||
DBG_INF_FMT("salt(%d)=[%.*s]", plugin_data_len, plugin_data_len, plugin_data);
|
||||
/* The data should be allocated with malloc() */
|
||||
scrambled_data =
|
||||
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
|
||||
plugin_data, plugin_data_len, session_options,
|
||||
conn->protocol_frame_codec->data, mysql_flags);
|
||||
if (auth_plugin) {
|
||||
scrambled_data =
|
||||
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
|
||||
plugin_data, plugin_data_len, session_options,
|
||||
conn->protocol_frame_codec->data, mysql_flags);
|
||||
}
|
||||
|
||||
if (conn->error_info->error_no) {
|
||||
goto end;
|
||||
}
|
||||
@@ -780,7 +787,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
|
||||
DBG_INF_FMT("salt(%d)=[%.*s]", auth_plugin_data_len, auth_plugin_data_len, auth_plugin_data);
|
||||
|
||||
|
||||
if (conn->protocol_frame_codec->data->ssl) {
|
||||
if (conn->vio->data->ssl) {
|
||||
DBG_INF("simple clear text under SSL");
|
||||
/* clear text under SSL */
|
||||
*auth_data_len = passwd_len;
|
||||
|
||||
@@ -514,6 +514,7 @@ MYSQLND_METHOD(mysqlnd_vio, enable_ssl)(MYSQLND_VIO * const net)
|
||||
zval cafile_zval;
|
||||
ZVAL_STRING(&cafile_zval, net->data->options.ssl_ca);
|
||||
php_stream_context_set_option(context, "ssl", "cafile", &cafile_zval);
|
||||
zval_ptr_dtor(&cafile_zval);
|
||||
any_flag = TRUE;
|
||||
}
|
||||
if (net->data->options.ssl_capath) {
|
||||
|
||||
@@ -1027,6 +1027,13 @@ int odbc_bindcols(odbc_result *result)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* Workaround for drivers that report VARCHAR(MAX) columns as SQL_VARCHAR (bug #73725) */
|
||||
if (SQL_VARCHAR == result->values[i].coltype && displaysize == 0) {
|
||||
result->values[i].coltype = SQL_LONGVARCHAR;
|
||||
result->values[i].value = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Workaround for Oracle ODBC Driver bug (#50162) when fetching TIMESTAMP column */
|
||||
if (result->values[i].coltype == SQL_TIMESTAMP) {
|
||||
displaysize += 3;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
--TEST--
|
||||
Bug #73725 Unable to retrieve value of varchar(max) type
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include dirname(__FILE__) . "/config.inc";
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
odbc_do($conn, "CREATE TABLE bug73725(i int, txt varchar(max), k int)");
|
||||
|
||||
odbc_do($conn, "INSERT INTO bug73725 VALUES(101,'Any text', 33)");
|
||||
odbc_do($conn, "INSERT INTO bug73725 VALUES(102,'Müsliriegel', 34)");
|
||||
|
||||
$rc = odbc_do($conn, "SELECT i, txt, k FROM bug73725");
|
||||
|
||||
$r = odbc_fetch_array($rc);
|
||||
var_dump($r);
|
||||
|
||||
$r = odbc_fetch_array($rc);
|
||||
var_dump($r);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
["i"]=>
|
||||
string(3) "101"
|
||||
["txt"]=>
|
||||
string(8) "Any text"
|
||||
["k"]=>
|
||||
string(2) "33"
|
||||
}
|
||||
array(3) {
|
||||
["i"]=>
|
||||
string(3) "102"
|
||||
["txt"]=>
|
||||
string(12) "Müsliriegel"
|
||||
["k"]=>
|
||||
string(2) "34"
|
||||
}
|
||||
==DONE==
|
||||
--CLEAN--
|
||||
<?php
|
||||
include 'config.inc';
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
odbc_exec($conn, 'DROP TABLE bug73725');
|
||||
|
||||
odbc_close($conn);
|
||||
|
||||
?>
|
||||
@@ -870,8 +870,6 @@ optimize_const_unary_op:
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
|
||||
strip_nops(op_array, block);
|
||||
}
|
||||
|
||||
/* Rebuild plain (optimized) op_array from CFG */
|
||||
@@ -1022,6 +1020,11 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
|
||||
}
|
||||
if (i != j) {
|
||||
op_array->last_try_catch = j;
|
||||
if (j == 0) {
|
||||
efree(op_array->try_catch_array);
|
||||
op_array->try_catch_array = NULL;
|
||||
}
|
||||
|
||||
if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) {
|
||||
zend_op *opline = new_opcodes;
|
||||
zend_op *end = opline + len;
|
||||
@@ -1934,6 +1937,13 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
|
||||
zend_optimize_block(b, op_array, usage, &cfg, Tsource);
|
||||
}
|
||||
|
||||
/* Eliminate NOPs */
|
||||
for (b = blocks; b < end; b++) {
|
||||
if (b->flags & ZEND_BB_REACHABLE) {
|
||||
strip_nops(op_array, b);
|
||||
}
|
||||
}
|
||||
|
||||
/* Jump optimization for each block */
|
||||
for (b = blocks; b < end; b++) {
|
||||
if (b->flags & ZEND_BB_REACHABLE) {
|
||||
|
||||
@@ -356,7 +356,8 @@ static zend_bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
|
||||
|
||||
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))&& !is_var_dead(ctx, ssa_op->op1_use)) {
|
||||
if (!try_remove_var_def(ctx, ssa_op->op1_use, ssa_op->op1_use_chain, opline)) {
|
||||
if (ssa->var_info[ssa_op->op1_use].type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) {
|
||||
if (ssa->var_info[ssa_op->op1_use].type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)
|
||||
&& opline->opcode != ZEND_CASE) {
|
||||
free_var = ssa_op->op1_use;
|
||||
free_var_type = opline->op1_type;
|
||||
}
|
||||
|
||||
@@ -171,12 +171,13 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa)
|
||||
while (i < end) {
|
||||
shiftlist[i] = i - target;
|
||||
if (EXPECTED(op_array->opcodes[i].opcode != ZEND_NOP) ||
|
||||
/*keep NOP to support ZEND_VM_SMART_BRANCH */
|
||||
(i > 0 &&
|
||||
/* Keep NOP to support ZEND_VM_SMART_BRANCH. Using "target-1" instead of
|
||||
* "i-1" here to check the last non-NOP instruction. */
|
||||
(target > 0 &&
|
||||
i + 1 < op_array->last &&
|
||||
(op_array->opcodes[i+1].opcode == ZEND_JMPZ ||
|
||||
op_array->opcodes[i+1].opcode == ZEND_JMPNZ) &&
|
||||
zend_is_smart_branch(op_array->opcodes + i - 1))) {
|
||||
zend_is_smart_branch(op_array->opcodes + target - 1))) {
|
||||
if (i != target) {
|
||||
op_array->opcodes[target] = op_array->opcodes[i];
|
||||
ssa->ops[target] = ssa->ops[i];
|
||||
|
||||
@@ -695,7 +695,8 @@ static inline int ct_eval_func_call(
|
||||
} else if (zend_string_equals_literal(name, "strpos")) {
|
||||
if (Z_TYPE_P(args[0]) != IS_STRING
|
||||
|| Z_TYPE_P(args[1]) != IS_STRING
|
||||
|| !Z_STRLEN_P(args[1])) {
|
||||
|| !Z_STRLEN_P(args[1])
|
||||
|| (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
|
||||
return FAILURE;
|
||||
}
|
||||
/* pass */
|
||||
@@ -774,7 +775,8 @@ static inline int ct_eval_func_call(
|
||||
/* pass */
|
||||
} else if (zend_string_equals_literal(name, "substr")) {
|
||||
if (Z_TYPE_P(args[0]) != IS_STRING
|
||||
|| Z_TYPE_P(args[1]) != IS_LONG) {
|
||||
|| Z_TYPE_P(args[1]) != IS_LONG
|
||||
|| (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
|
||||
return FAILURE;
|
||||
}
|
||||
/* pass */
|
||||
@@ -818,7 +820,8 @@ static inline int ct_eval_func_call(
|
||||
} else if (zend_string_equals_literal(name, "substr")) {
|
||||
if (Z_TYPE_P(args[0]) != IS_STRING
|
||||
|| Z_TYPE_P(args[1]) != IS_LONG
|
||||
|| Z_TYPE_P(args[2]) != IS_LONG) {
|
||||
|| Z_TYPE_P(args[2]) != IS_LONG
|
||||
|| (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
|
||||
return FAILURE;
|
||||
}
|
||||
/* pass */
|
||||
|
||||
@@ -240,7 +240,7 @@ static const func_info_t func_infos[] = {
|
||||
F0("is_subclass_of", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
|
||||
F0("is_a", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), // TODO: inline
|
||||
F1("get_class_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
|
||||
FN("get_object_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
|
||||
FN("get_object_vars", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
|
||||
F1("get_class_methods", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
F0("method_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F0("property_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
@@ -268,8 +268,8 @@ static const func_info_t func_infos[] = {
|
||||
FC("extension_loaded", zend_b_s_info),
|
||||
F1("get_extension_funcs", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
|
||||
/* ext/statdard */
|
||||
FN("constant", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_STRING | MAY_BE_RESOURCE),
|
||||
/* ext/standard */
|
||||
FN("constant", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_STRING | MAY_BE_RESOURCE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("bin2hex", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hex2bin", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F0("sleep", MAY_BE_FALSE | MAY_BE_LONG),
|
||||
@@ -696,7 +696,7 @@ static const func_info_t func_infos[] = {
|
||||
F0("fnmatch", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
#endif
|
||||
F1("fsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("pfsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
FN("pfsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("pack", MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("unpack", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("get_browser", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_OBJECT | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
|
||||
@@ -815,8 +815,8 @@ static const func_info_t func_infos[] = {
|
||||
F1("array_merge_recursive", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_replace", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_replace_recursive", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
F1("array_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
FN("array_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
FN("array_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_count_values", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG),
|
||||
F1("array_column", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
F1("array_reverse", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
|
||||
@@ -1032,7 +1032,7 @@ static const func_info_t func_infos[] = {
|
||||
F0("curl_multi_exec", MAY_BE_NULL | MAY_BE_LONG),
|
||||
FN("curl_multi_getcontent", MAY_BE_NULL | MAY_BE_STRING),
|
||||
F1("curl_multi_info_read", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_RESOURCE),
|
||||
F0("curl_multi_close", MAY_BE_NULL),
|
||||
F0("curl_multi_close", MAY_BE_NULL | MAY_BE_FALSE),
|
||||
F0("curl_multi_setopt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F1("curl_share_init", MAY_BE_NULL | MAY_BE_RESOURCE),
|
||||
F0("curl_share_close", MAY_BE_NULL),
|
||||
@@ -1188,12 +1188,12 @@ static const func_info_t func_infos[] = {
|
||||
F1("hash_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hash_hmac", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hash_hmac_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
|
||||
F0("hash_update", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F0("hash_update_stream", MAY_BE_NULL | MAY_BE_LONG),
|
||||
F0("hash_update_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
|
||||
F1("hash_final", MAY_BE_NULL | MAY_BE_STRING),
|
||||
F1("hash_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
|
||||
F1("hash_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
|
||||
F1("hash_algos", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
|
||||
F1("hash_pbkdf2", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
F1("mhash_keygen_s2k", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
#define SYM_RANGE
|
||||
|
||||
/* Whether to handle negative range constraints */
|
||||
#define NEG_RANGE
|
||||
/* Negative range inference is buggy, so disabled for now */
|
||||
#undef NEG_RANGE
|
||||
|
||||
/* Number of warmup passes to use prior to widening */
|
||||
#define RANGE_WARMUP_PASSES 16
|
||||
@@ -157,6 +158,17 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static inline zend_bool add_will_overflow(zend_long a, zend_long b) {
|
||||
return (b > 0 && a > ZEND_LONG_MAX - b)
|
||||
|| (b < 0 && a < ZEND_LONG_MIN - b);
|
||||
}
|
||||
#if 0
|
||||
static inline zend_bool sub_will_overflow(zend_long a, zend_long b) {
|
||||
return (b > 0 && a < ZEND_LONG_MIN + b)
|
||||
|| (b < 0 && a > ZEND_LONG_MAX + b);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void zend_ssa_check_scc_var(const zend_op_array *op_array, zend_ssa *ssa, int var, int *index, int *dfs, int *root, zend_worklist_stack *stack) /* {{{ */
|
||||
{
|
||||
#ifdef SYM_RANGE
|
||||
@@ -501,6 +513,37 @@ static void zend_ssa_range_and(zend_long a, zend_long b, zend_long c, zend_long
|
||||
}
|
||||
}
|
||||
|
||||
static inline zend_bool zend_abs_range(
|
||||
zend_long min, zend_long max, zend_long *abs_min, zend_long *abs_max) {
|
||||
if (min == ZEND_LONG_MIN) {
|
||||
/* Cannot take absolute value of LONG_MIN */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (min >= 0) {
|
||||
*abs_min = min;
|
||||
*abs_max = max;
|
||||
} else if (max <= 0) {
|
||||
*abs_min = -max;
|
||||
*abs_max = -min;
|
||||
} else {
|
||||
/* Range crossing zero */
|
||||
*abs_min = 0;
|
||||
*abs_max = MAX(max, -min);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline zend_bool shift_left_overflows(zend_long n, zend_long s) {
|
||||
/* This considers shifts that shift in the sign bit to be overflowing as well */
|
||||
if (n >= 0) {
|
||||
return s >= SIZEOF_ZEND_LONG * 8 - 1 || (n << s) < n;
|
||||
} else {
|
||||
return s >= SIZEOF_ZEND_LONG * 8 - 1 || (n << s) > n;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the normal op corresponding to a compound assignment op */
|
||||
static inline zend_uchar get_compound_assign_op(zend_uchar opcode) {
|
||||
switch (opcode) {
|
||||
@@ -648,20 +691,35 @@ static int zend_inference_calc_binary_op_range(
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
} else {
|
||||
zend_long op2_abs_min, op2_abs_max;
|
||||
|
||||
op1_min = OP1_MIN_RANGE();
|
||||
op2_min = OP2_MIN_RANGE();
|
||||
op1_max = OP1_MAX_RANGE();
|
||||
op2_max = OP2_MAX_RANGE();
|
||||
if (op2_min == 0 || op2_max == 0) {
|
||||
/* avoid division by zero */
|
||||
if (!zend_abs_range(op2_min, op2_max, &op2_abs_min, &op2_abs_max)) {
|
||||
break;
|
||||
}
|
||||
t1 = (op2_min == -1) ? 0 : (op1_min % op2_min);
|
||||
t2 = (op2_max == -1) ? 0 : (op1_min % op2_max);
|
||||
t3 = (op2_min == -1) ? 0 : (op1_max % op2_min);
|
||||
t4 = (op2_max == -1) ? 0 : (op1_max % op2_max);
|
||||
tmp->min = MIN(MIN(t1, t2), MIN(t3, t4));
|
||||
tmp->max = MAX(MAX(t1, t2), MAX(t3, t4));
|
||||
|
||||
if (op2_abs_max == 0) {
|
||||
/* Always modulus by zero, nothing we can do */
|
||||
break;
|
||||
}
|
||||
if (op2_abs_min == 0) {
|
||||
/* Ignore the modulus by zero case, which will throw */
|
||||
op2_abs_min++;
|
||||
}
|
||||
|
||||
if (op1_min >= 0) {
|
||||
tmp->min = op1_max < op2_abs_min ? op1_min : 0;
|
||||
tmp->max = MIN(op1_max, op2_abs_max - 1);
|
||||
} else if (op1_max <= 0) {
|
||||
tmp->min = MAX(op1_min, -op2_abs_max + 1);
|
||||
tmp->max = op1_min > -op2_abs_min ? op1_max : 0;
|
||||
} else {
|
||||
tmp->min = MAX(op1_min, -op2_abs_max + 1);
|
||||
tmp->max = MIN(op1_max, op2_abs_max - 1);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -679,12 +737,27 @@ static int zend_inference_calc_binary_op_range(
|
||||
op2_min = OP2_MIN_RANGE();
|
||||
op1_max = OP1_MAX_RANGE();
|
||||
op2_max = OP2_MAX_RANGE();
|
||||
t1 = op1_min << op2_min;
|
||||
t2 = op1_min << op2_max;
|
||||
t3 = op1_max << op2_min;
|
||||
t4 = op1_max << op2_max;
|
||||
tmp->min = MIN(MIN(t1, t2), MIN(t3, t4));
|
||||
tmp->max = MAX(MAX(t1, t2), MAX(t3, t4));
|
||||
|
||||
/* Shifts by negative numbers will throw, ignore them */
|
||||
if (op2_min < 0) {
|
||||
op2_min = 0;
|
||||
}
|
||||
if (op2_max < 0) {
|
||||
op2_max = 0;
|
||||
}
|
||||
|
||||
if (shift_left_overflows(op1_min, op2_max)
|
||||
|| shift_left_overflows(op1_max, op2_max)) {
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
} else {
|
||||
t1 = op1_min << op2_min;
|
||||
t2 = op1_min << op2_max;
|
||||
t3 = op1_max << op2_min;
|
||||
t4 = op1_max << op2_max;
|
||||
tmp->min = MIN(MIN(t1, t2), MIN(t3, t4));
|
||||
tmp->max = MAX(MAX(t1, t2), MAX(t3, t4));
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -702,6 +775,23 @@ static int zend_inference_calc_binary_op_range(
|
||||
op2_min = OP2_MIN_RANGE();
|
||||
op1_max = OP1_MAX_RANGE();
|
||||
op2_max = OP2_MAX_RANGE();
|
||||
|
||||
/* Shifts by negative numbers will throw, ignore them */
|
||||
if (op2_min < 0) {
|
||||
op2_min = 0;
|
||||
}
|
||||
if (op2_max < 0) {
|
||||
op2_max = 0;
|
||||
}
|
||||
|
||||
/* Shifts by more than the integer size will be 0 or -1 */
|
||||
if (op2_min >= SIZEOF_ZEND_LONG * 8) {
|
||||
op2_min = SIZEOF_ZEND_LONG * 8 - 1;
|
||||
}
|
||||
if (op2_max >= SIZEOF_ZEND_LONG * 8) {
|
||||
op2_max = SIZEOF_ZEND_LONG * 8 - 1;
|
||||
}
|
||||
|
||||
t1 = op1_min >> op2_min;
|
||||
t2 = op1_min >> op2_max;
|
||||
t3 = op1_max >> op2_min;
|
||||
@@ -815,7 +905,9 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow && tmp->underflow;
|
||||
tmp->min = MAX(ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min, tmp->min);
|
||||
if (!add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) {
|
||||
tmp->min = MAX(ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min, tmp->min);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (constraint->max_ssa_var < 0) {
|
||||
@@ -823,7 +915,9 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->overflow = constraint->range.overflow && tmp->overflow;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) {
|
||||
tmp->max = MIN(ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max, tmp->max);
|
||||
if (!add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) {
|
||||
tmp->max = MIN(ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max, tmp->max);
|
||||
}
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow && tmp->overflow;
|
||||
#endif
|
||||
}
|
||||
@@ -833,8 +927,13 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->min = constraint->range.min;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow;
|
||||
tmp->min = ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min;
|
||||
if (add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) {
|
||||
tmp->underflow = 1;
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
} else {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow;
|
||||
tmp->min = ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
tmp->underflow = 1;
|
||||
@@ -845,8 +944,13 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->overflow = constraint->range.overflow;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) {
|
||||
tmp->max = ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max;
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow;
|
||||
if (add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) {
|
||||
tmp->overflow = 1;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
} else {
|
||||
tmp->max = ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max;
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
@@ -1355,11 +1459,15 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case ZEND_COUNT:
|
||||
case ZEND_FUNC_NUM_ARGS:
|
||||
tmp->min = 0;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
return 1;
|
||||
case ZEND_COUNT:
|
||||
/* count() on Countable objects may return negative numbers */
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
return 1;
|
||||
case ZEND_DO_FCALL:
|
||||
case ZEND_DO_ICALL:
|
||||
case ZEND_DO_UCALL:
|
||||
@@ -1734,6 +1842,16 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) {
|
||||
if (alias == PHP_ERRORMSG_ALIAS) {
|
||||
return MAY_BE_STRING | MAY_BE_RC1 | MAY_BE_RCN;
|
||||
} else if (alias == HTTP_RESPONSE_HEADER_ALIAS) {
|
||||
return MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_RC1 | MAY_BE_RCN;
|
||||
} else {
|
||||
return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
|
||||
}
|
||||
}
|
||||
|
||||
#define UPDATE_SSA_TYPE(_type, _var) \
|
||||
do { \
|
||||
uint32_t __type = (_type); \
|
||||
@@ -1742,7 +1860,8 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
|
||||
__type |= MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; \
|
||||
} \
|
||||
if (__var >= 0) { \
|
||||
if (ssa_vars[__var].var < op_array->last_var) { \
|
||||
zend_ssa_var *__ssa_var = &ssa_vars[__var]; \
|
||||
if (__ssa_var->var < op_array->last_var) { \
|
||||
if (__type & (MAY_BE_REF|MAY_BE_RCN)) { \
|
||||
__type |= MAY_BE_RC1 | MAY_BE_RCN; \
|
||||
} \
|
||||
@@ -1750,6 +1869,9 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
|
||||
/* TODO: support for array keys and ($str . "")*/ \
|
||||
__type |= MAY_BE_RCN; \
|
||||
} \
|
||||
if (__ssa_var->alias) { \
|
||||
__type |= get_ssa_alias_types(__ssa_var->alias); \
|
||||
} \
|
||||
} \
|
||||
if (ssa_var_info[__var].type != __type) { \
|
||||
if (ssa_var_info[__var].type & ~__type) { \
|
||||
@@ -1999,6 +2121,14 @@ static uint32_t binary_op_result_type(
|
||||
uint32_t tmp = 0;
|
||||
uint32_t t1_type = (t1 & MAY_BE_ANY) | (t1 & MAY_BE_UNDEF ? MAY_BE_NULL : 0);
|
||||
uint32_t t2_type = (t2 & MAY_BE_ANY) | (t2 & MAY_BE_UNDEF ? MAY_BE_NULL : 0);
|
||||
|
||||
/* Handle potentially overloaded operators.
|
||||
* This could be made more precise by checking the class type, if known. */
|
||||
if ((t1_type & MAY_BE_OBJECT) || (t2_type & MAY_BE_OBJECT)) {
|
||||
/* This is somewhat GMP specific. */
|
||||
tmp |= MAY_BE_OBJECT | MAY_BE_FALSE | MAY_BE_RC1;
|
||||
}
|
||||
|
||||
switch (opcode) {
|
||||
case ZEND_ADD:
|
||||
if (t1_type == MAY_BE_LONG && t2_type == MAY_BE_LONG) {
|
||||
@@ -2053,7 +2183,7 @@ static uint32_t binary_op_result_type(
|
||||
* handling */
|
||||
break;
|
||||
case ZEND_MOD:
|
||||
tmp = MAY_BE_LONG;
|
||||
tmp |= MAY_BE_LONG;
|
||||
/* Division by zero results in an exception, so it doesn't need any special handling */
|
||||
break;
|
||||
case ZEND_BW_OR:
|
||||
@@ -2068,7 +2198,7 @@ static uint32_t binary_op_result_type(
|
||||
break;
|
||||
case ZEND_SL:
|
||||
case ZEND_SR:
|
||||
tmp = MAY_BE_LONG;
|
||||
tmp |= MAY_BE_LONG;
|
||||
break;
|
||||
case ZEND_CONCAT:
|
||||
case ZEND_FAST_CONCAT:
|
||||
@@ -2196,6 +2326,10 @@ static int zend_update_type_info(const zend_op_array *op_array,
|
||||
if (t1 & (MAY_BE_ANY-MAY_BE_STRING)) {
|
||||
tmp |= MAY_BE_LONG;
|
||||
}
|
||||
if (t1 & MAY_BE_OBJECT) {
|
||||
/* Potentially overloaded operator. */
|
||||
tmp |= MAY_BE_OBJECT | MAY_BE_RC1;
|
||||
}
|
||||
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
|
||||
break;
|
||||
case ZEND_BEGIN_SILENCE:
|
||||
@@ -3648,6 +3782,8 @@ void zend_init_func_return_info(const zend_op_array *op_array,
|
||||
ret->type = zend_fetch_arg_info(script, ret_info, &ret->ce);
|
||||
if (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) {
|
||||
ret->type |= MAY_BE_REF;
|
||||
} else if (ret->type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
|
||||
ret->type |= MAY_BE_RC1|MAY_BE_RCN;
|
||||
}
|
||||
ret->is_instanceof = (ret->ce) ? 1 : 0;
|
||||
ret->range = tmp_range;
|
||||
@@ -3880,18 +4016,6 @@ static int zend_infer_types(const zend_op_array *op_array, const zend_script *sc
|
||||
/* Narrowing integer initialization to doubles */
|
||||
zend_type_narrowing(op_array, script, ssa);
|
||||
|
||||
for (j = 0; j < ssa_vars_count; j++) {
|
||||
if (ssa->vars[j].alias) {
|
||||
if (ssa->vars[j].alias == PHP_ERRORMSG_ALIAS) {
|
||||
ssa_var_info[j].type |= MAY_BE_STRING | MAY_BE_RC1 | MAY_BE_RCN;
|
||||
} else if (ssa->vars[j].alias == HTTP_RESPONSE_HEADER_ALIAS) {
|
||||
ssa_var_info[j].type |= MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_RC1 | MAY_BE_RCN;
|
||||
} else {
|
||||
ssa_var_info[j].type = MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ZEND_FUNC_INFO(op_array)) {
|
||||
zend_func_return_info(op_array, script, 1, 0, &ZEND_FUNC_INFO(op_array)->return_info);
|
||||
}
|
||||
@@ -3919,6 +4043,9 @@ int zend_ssa_inference(zend_arena **arena, const zend_op_array *op_array, const
|
||||
for (i = 0; i < op_array->last_var; i++) {
|
||||
ssa_var_info[i].type = MAY_BE_UNDEF;
|
||||
ssa_var_info[i].has_range = 0;
|
||||
if (ssa->vars[i].alias) {
|
||||
ssa_var_info[i].type |= get_ssa_alias_types(ssa->vars[i].alias);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = op_array->last_var; i < ssa->vars_count; i++) {
|
||||
|
||||
+7
-1
@@ -87,7 +87,13 @@ opcache.max_accelerated_files (default "2000")
|
||||
between 200 and 1000000 are allowed.
|
||||
|
||||
opcache.max_wasted_percentage (default "5")
|
||||
The maximum percentage of "wasted" memory until a restart is scheduled.
|
||||
When the cache fills up this setting decides when to actually reset (dump
|
||||
all entries) it. At the default of 5% it means that if less than 5% of
|
||||
the entries in the now full cache are wasted/orphaned, then you have a good
|
||||
active cache. There is no point emptying a cache full of good entries
|
||||
only to most likely refill it with those same entries. Once more than 5%
|
||||
of the cache consists of wasted entries, the cache will reset in this
|
||||
cache-full scenario. This can be set up to as high as 50%.
|
||||
|
||||
opcache.use_cwd (default "1")
|
||||
When this directive is enabled, the OPcache appends the current working
|
||||
|
||||
@@ -108,6 +108,9 @@ zend_accel_shared_globals *accel_shared_globals = NULL;
|
||||
zend_bool accel_startup_ok = 0;
|
||||
static char *zps_failure_reason = NULL;
|
||||
char *zps_api_failure_reason = NULL;
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
zend_bool file_cache_only = 0; /* process uses file cache only */
|
||||
#endif
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
zend_bool fallback_process = 0; /* process uses file cache fallback */
|
||||
#endif
|
||||
@@ -432,7 +435,7 @@ zend_string *accel_new_interned_string(zend_string *str)
|
||||
Bucket *p;
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
return str;
|
||||
}
|
||||
#endif
|
||||
@@ -1269,8 +1272,8 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
|
||||
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used);
|
||||
#endif
|
||||
|
||||
/* Copy into shared memory */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, NULL, 0);
|
||||
/* Copy into memory block */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, NULL, 0, 0);
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
@@ -1395,7 +1398,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
|
||||
}
|
||||
|
||||
/* Copy into shared memory */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length);
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length, 1);
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
@@ -1743,7 +1746,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
|
||||
/* The Accelerator is disabled, act as if without the Accelerator */
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
} else if (ZCG(accel_directives).file_cache_only) {
|
||||
} else if (file_cache_only) {
|
||||
return file_cache_compile_file(file_handle, type);
|
||||
#endif
|
||||
} else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
|
||||
@@ -2042,6 +2045,9 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
|
||||
static zend_string* persistent_zend_resolve_path(const char *filename, int filename_len)
|
||||
{
|
||||
if (ZCG(enabled) && accel_startup_ok &&
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
!file_cache_only &&
|
||||
#endif
|
||||
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
|
||||
!ZCSG(restart_in_progress)) {
|
||||
|
||||
@@ -2173,7 +2179,7 @@ static void accel_activate(void)
|
||||
ZCG(cwd_check) = 1;
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -2367,6 +2373,8 @@ static inline int accel_find_sapi(void)
|
||||
|
||||
static int zend_accel_init_shm(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
zend_shared_alloc_lock();
|
||||
|
||||
accel_shared_globals = zend_shared_alloc(sizeof(zend_accel_shared_globals));
|
||||
@@ -2414,6 +2422,11 @@ static int zend_accel_init_shm(void)
|
||||
ZCSG(last_restart_time) = 0;
|
||||
ZCSG(restart_in_progress) = 0;
|
||||
|
||||
|
||||
for (i = 0; i < -HT_MIN_MASK; i++) {
|
||||
ZCSG(uninitialized_bucket)[i] = HT_INVALID_IDX;
|
||||
}
|
||||
|
||||
zend_shared_alloc_unlock();
|
||||
|
||||
return SUCCESS;
|
||||
@@ -2632,7 +2645,8 @@ static int accel_startup(zend_extension *extension)
|
||||
/* End of non-SHM dependent initializations */
|
||||
/********************************************/
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (!ZCG(accel_directives).file_cache_only) {
|
||||
file_cache_only = ZCG(accel_directives).file_cache_only;
|
||||
if (!file_cache_only) {
|
||||
#else
|
||||
if (1) {
|
||||
#endif
|
||||
@@ -2664,6 +2678,7 @@ static int accel_startup(zend_extension *extension)
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
case ALLOC_FALLBACK:
|
||||
zend_shared_alloc_lock();
|
||||
file_cache_only = 1;
|
||||
fallback_process = 1;
|
||||
zend_accel_init_auto_globals();
|
||||
zend_shared_alloc_unlock();
|
||||
@@ -2762,7 +2777,7 @@ static void accel_free_ts_resources()
|
||||
void accel_shutdown(void)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
zend_bool file_cache_only = 0;
|
||||
zend_bool _file_cache_only = 0;
|
||||
|
||||
zend_optimizer_shutdown();
|
||||
|
||||
@@ -2774,10 +2789,10 @@ void accel_shutdown(void)
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
file_cache_only = ZCG(accel_directives).file_cache_only;
|
||||
_file_cache_only = file_cache_only;
|
||||
#endif
|
||||
|
||||
if (!file_cache_only && ZCG(accel_directives).interned_strings_buffer) {
|
||||
if (!_file_cache_only && ZCG(accel_directives).interned_strings_buffer) {
|
||||
accel_use_permanent_interned_strings();
|
||||
}
|
||||
|
||||
@@ -2785,7 +2800,7 @@ void accel_shutdown(void)
|
||||
|
||||
accel_free_ts_resources();
|
||||
|
||||
if (!file_cache_only) {
|
||||
if (!_file_cache_only) {
|
||||
zend_shared_alloc_shutdown();
|
||||
}
|
||||
zend_compile_file = accelerator_orig_compile_file;
|
||||
|
||||
@@ -120,6 +120,8 @@ extern int lock_file;
|
||||
|
||||
#if defined(HAVE_OPCACHE_FILE_CACHE) && defined(ZEND_WIN32)
|
||||
# define ENABLE_FILE_CACHE_FALLBACK 1
|
||||
#else
|
||||
# define ENABLE_FILE_CACHE_FALLBACK 0
|
||||
#endif
|
||||
|
||||
#if ZEND_WIN32
|
||||
@@ -280,9 +282,14 @@ typedef struct _zend_accel_shared_globals {
|
||||
char *interned_strings_end;
|
||||
char *interned_strings_saved_top;
|
||||
HashTable interned_strings;
|
||||
/* uninitialized HashTable Support */
|
||||
uint32_t uninitialized_bucket[-HT_MIN_MASK];
|
||||
} zend_accel_shared_globals;
|
||||
|
||||
extern zend_bool accel_startup_ok;
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
extern zend_bool file_cache_only;
|
||||
#endif
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
extern zend_bool fallback_process;
|
||||
#endif
|
||||
|
||||
@@ -71,7 +71,7 @@ static void zend_win_error_message(int type, char *msg, int err)
|
||||
|
||||
LocalFree( lpMsgBuf );
|
||||
|
||||
zend_accel_error(type, msg);
|
||||
zend_accel_error(type, "%s", msg);
|
||||
}
|
||||
|
||||
static char *create_name_with_username(char *name)
|
||||
@@ -182,9 +182,6 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
|
||||
}
|
||||
accel_shared_globals = (zend_accel_shared_globals *)((char *)((zend_smm_shared_globals *)mapping_base)->app_shared_globals + ((char *)mapping_base - (char *)wanted_mb_save));
|
||||
|
||||
/* Make this process to use file-cache only */
|
||||
ZCG(accel_directives).file_cache_only = 1;
|
||||
|
||||
return ALLOC_FALLBACK;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75729: opcache segfault when installing Bitrix
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('mbstring')) die('skip mbstring not loaded'); ?>
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
mbstring.func_overload=2
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(strpos("foo", "o"));
|
||||
var_dump(substr("foo", 1));
|
||||
var_dump(substr("foo", 1, 1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Deprecated: The mbstring.func_overload directive is deprecated in Unknown on line 0
|
||||
int(1)
|
||||
string(2) "oo"
|
||||
string(1) "o"
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #75893: file_get_contents $http_response_header variable bugged with opcache
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
track_errors=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
echo $undef;
|
||||
$foo = $php_errormsg;
|
||||
var_dump($foo[0]);
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
|
||||
|
||||
Notice: Undefined variable: undef in %s on line %d
|
||||
string(1) "U"
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #75938: Modulus value not stored in variable
|
||||
--FILE--
|
||||
<?php
|
||||
function borken($columns) {
|
||||
$columns = (int) $columns;
|
||||
if ($columns < 1) return 0;
|
||||
$count = count([1,2,3,4,5]);
|
||||
var_dump($mod = ($count % $columns));
|
||||
var_dump($mod);
|
||||
}
|
||||
borken(2);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #75969: Assertion failure in live range DCE due to block pass misoptimization
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// This is required for the segfault
|
||||
md5('foo');
|
||||
|
||||
class Extended_Class {};
|
||||
$response = array(
|
||||
'a' => 'b'
|
||||
);
|
||||
new Extended_Class( array(
|
||||
'foo' => $response,
|
||||
'foo2' => 'bar2'
|
||||
) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Loaded 100 of 229 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user