mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 03:00:49 +00:00
Compare commits
341
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e000b401ac | ||
|
|
5c34a30bdb | ||
|
|
8a0c388e11 | ||
|
|
49e9ae1fc1 | ||
|
|
76b2f2ff5d | ||
|
|
d699a81277 | ||
|
|
892f2e5120 | ||
|
|
390134e6c5 | ||
|
|
543141ae3b | ||
|
|
6a8e7d5408 | ||
|
|
7a89dd8067 | ||
|
|
f39cabe610 | ||
|
|
3475c0c035 | ||
|
|
bf0f53270f | ||
|
|
de64adeb1d | ||
|
|
368958b3e4 | ||
|
|
e6bc4f39a2 | ||
|
|
dd227c2b23 | ||
|
|
62938bf088 | ||
|
|
f2c99e201e | ||
|
|
4b1afc829c | ||
|
|
2a5a310446 | ||
|
|
2b7e5468c9 | ||
|
|
1dab39b9aa | ||
|
|
df16579642 | ||
|
|
366f838483 | ||
|
|
2fcf1259c6 | ||
|
|
19fff2ece6 | ||
|
|
c11b2b809d | ||
|
|
b67eb3440b | ||
|
|
bf914ff75a | ||
|
|
a3d3f76827 | ||
|
|
2d339fa4d1 | ||
|
|
f65ae82c55 | ||
|
|
76a7470160 | ||
|
|
e5a6de6b9d | ||
|
|
a15c1990eb | ||
|
|
f6f2855ecd | ||
|
|
721a189742 | ||
|
|
737ee0661c | ||
|
|
519b0dc886 | ||
|
|
d0272ef1ef | ||
|
|
c44efbbbb1 | ||
|
|
ec78507bd4 | ||
|
|
403f352482 | ||
|
|
9aad38038e | ||
|
|
80a851b4dd | ||
|
|
9d7054693e | ||
|
|
5589df128c | ||
|
|
d636467937 | ||
|
|
8bda542064 | ||
|
|
6f912f7c04 | ||
|
|
4af464a0df | ||
|
|
71efe9d8fd | ||
|
|
55393e26a5 | ||
|
|
e56fe7e5e7 | ||
|
|
722375c603 | ||
|
|
42d53f3bc0 | ||
|
|
7a2497b2c5 | ||
|
|
f67d599a01 | ||
|
|
1ff27053f9 | ||
|
|
3020be675a | ||
|
|
8da8756312 | ||
|
|
51e1da6ea1 | ||
|
|
6b6122a957 | ||
|
|
95406c878a | ||
|
|
d6feb2edbd | ||
|
|
21ac79e94b | ||
|
|
d6c9f91e2e | ||
|
|
7ea7d3d829 | ||
|
|
2e3d68ed1b | ||
|
|
f81b7df618 | ||
|
|
631861e1fa | ||
|
|
5e09031144 | ||
|
|
cad2598fcb | ||
|
|
2efb63bf00 | ||
|
|
8c75dbc498 | ||
|
|
cf649f59cb | ||
|
|
fec3a65ba4 | ||
|
|
8ba6d622e5 | ||
|
|
6d89640d55 | ||
|
|
f9226f9bf3 | ||
|
|
bbe21ccf38 | ||
|
|
fb8486f3bd | ||
|
|
bce548d8e6 | ||
|
|
280e9cb28d | ||
|
|
85589ca660 | ||
|
|
d2f07edf71 | ||
|
|
e7e96fe2e0 | ||
|
|
7673c9847b | ||
|
|
2ce8a4cf87 | ||
|
|
6af7753e36 | ||
|
|
6af22d0d3e | ||
|
|
9977bdf9b3 | ||
|
|
43612e9593 | ||
|
|
a22f181736 | ||
|
|
4edaa3f1e7 | ||
|
|
e00c2f335c | ||
|
|
13e6dacb6b | ||
|
|
db894fa6aa | ||
|
|
1e225a6115 | ||
|
|
3f960255f4 | ||
|
|
cea050b8da | ||
|
|
5d07438cb3 | ||
|
|
d2274b01cb | ||
|
|
f1b2afc9d9 | ||
|
|
abe094dde8 | ||
|
|
e180e45a18 | ||
|
|
b28c2e20ca | ||
|
|
05f2f730e6 | ||
|
|
d1d002fc4d | ||
|
|
29433f9fd5 | ||
|
|
590ef15f6a | ||
|
|
e0ca519a8b | ||
|
|
6477bb724e | ||
|
|
34d6b63501 | ||
|
|
6736527aeb | ||
|
|
8c44d07fd4 | ||
|
|
50b38322b9 | ||
|
|
bac4c97602 | ||
|
|
d11bed5909 | ||
|
|
cc9893eb44 | ||
|
|
ca6f679417 | ||
|
|
2c7909697a | ||
|
|
814966ad33 | ||
|
|
19e80ef496 | ||
|
|
43d0f2abc5 | ||
|
|
0ab1af7d3e | ||
|
|
bd0569e287 | ||
|
|
4f19bb7af6 | ||
|
|
6674f81027 | ||
|
|
60aff0bd30 | ||
|
|
e77a1dbe40 | ||
|
|
4bf7ef0806 | ||
|
|
687b02789e | ||
|
|
fbf655afbd | ||
|
|
a4accc0e3e | ||
|
|
d79b82d8ae | ||
|
|
929819aaac | ||
|
|
aaaef22db6 | ||
|
|
a7b20894e5 | ||
|
|
8e993b427c | ||
|
|
2ae5f2d1a5 | ||
|
|
3500262b7d | ||
|
|
e7c3f44958 | ||
|
|
8d1aab2aee | ||
|
|
527bf4d8e6 | ||
|
|
19363de12f | ||
|
|
fd92b91188 | ||
|
|
b25be216c1 | ||
|
|
18f4ff4131 | ||
|
|
04379bcb1d | ||
|
|
e6632ce377 | ||
|
|
aacba43056 | ||
|
|
da5e09ad03 | ||
|
|
bd75f9e613 | ||
|
|
af2de536d3 | ||
|
|
4f7b498d12 | ||
|
|
e65760f878 | ||
|
|
1ee1f79e27 | ||
|
|
6fbd61a819 | ||
|
|
ef42f49470 | ||
|
|
b2782c6dc5 | ||
|
|
6d797630ab | ||
|
|
d5553b97d2 | ||
|
|
51d487786c | ||
|
|
5999874886 | ||
|
|
d9cd2876d9 | ||
|
|
5cee9dfe9a | ||
|
|
908ad3cc80 | ||
|
|
13edec75a3 | ||
|
|
79c0cef8ca | ||
|
|
07340553a5 | ||
|
|
d1bb306530 | ||
|
|
291e3f0762 | ||
|
|
ad9c552b12 | ||
|
|
c7ef178e86 | ||
|
|
fc46003666 | ||
|
|
15837bab8c | ||
|
|
9fce263f3b | ||
|
|
08c7ff0df4 | ||
|
|
ffd870f63d | ||
|
|
47fcb75a90 | ||
|
|
3c23d1b6d5 | ||
|
|
6a9efa2d3e | ||
|
|
dcaed51ba0 | ||
|
|
4cddc85c1f | ||
|
|
1bdffee820 | ||
|
|
aadc84f6f7 | ||
|
|
125ee6a68e | ||
|
|
005ba2001d | ||
|
|
69fbe3a9ad | ||
|
|
9cc34c4e3e | ||
|
|
69058f35f8 | ||
|
|
aab3f784d0 | ||
|
|
14c72cc582 | ||
|
|
61af3ed38a | ||
|
|
9ad3413190 | ||
|
|
4d18591e59 | ||
|
|
9a159f37e1 | ||
|
|
7e49e8e797 | ||
|
|
28f2959b83 | ||
|
|
c2f25bd188 | ||
|
|
f1ad170a15 | ||
|
|
c6ba284496 | ||
|
|
add4f43f0e | ||
|
|
2992f4164d | ||
|
|
ef7e5e0d69 | ||
|
|
5753a753c7 | ||
|
|
4f1b24d974 | ||
|
|
71fe529afc | ||
|
|
9727e37cae | ||
|
|
63e08cbef7 | ||
|
|
b655f2d632 | ||
|
|
697809d425 | ||
|
|
f7cb79431f | ||
|
|
bf6eb65673 | ||
|
|
8dd523a216 | ||
|
|
0738a78c59 | ||
|
|
8c653c163a | ||
|
|
6166a0d68d | ||
|
|
c39f71ba9f | ||
|
|
b8215c0817 | ||
|
|
3b8dc330bf | ||
|
|
47007455dc | ||
|
|
d454730407 | ||
|
|
c846daef28 | ||
|
|
5b5483dc8e | ||
|
|
230b387e8a | ||
|
|
7f1247004e | ||
|
|
9a4a023771 | ||
|
|
1aa792b44b | ||
|
|
c75287dc85 | ||
|
|
8961c78524 | ||
|
|
eb02876e74 | ||
|
|
1f22daeb0f | ||
|
|
5df97b339e | ||
|
|
b38e6a54cf | ||
|
|
b36f4ac708 | ||
|
|
329d487e68 | ||
|
|
43b92ed5a8 | ||
|
|
bf14ecc0d8 | ||
|
|
df1e1fdcb9 | ||
|
|
ac46909162 | ||
|
|
ec1b7b933d | ||
|
|
d48ff0f3f5 | ||
|
|
5146d9f8ac | ||
|
|
bb2ab75555 | ||
|
|
a46bbdda2e | ||
|
|
f346bd6ee6 | ||
|
|
201e56cd04 | ||
|
|
2cb8950cc2 | ||
|
|
fc777296bf | ||
|
|
901a551bda | ||
|
|
486fc0424a | ||
|
|
2fed175780 | ||
|
|
9845155aa2 | ||
|
|
80a5ae4f53 | ||
|
|
49a0c166f3 | ||
|
|
bba09d56e5 | ||
|
|
d0279242ce | ||
|
|
5ae45ef993 | ||
|
|
b351ec8baf | ||
|
|
21f287915c | ||
|
|
58273f631b | ||
|
|
574f7bc3d4 | ||
|
|
98c2cd4311 | ||
|
|
f60ebd13b3 | ||
|
|
41c1d0291c | ||
|
|
3401f553b9 | ||
|
|
22ed374c9a | ||
|
|
f98d8f6c15 | ||
|
|
f7bb3b5cbd | ||
|
|
4568618030 | ||
|
|
b716a1fbef | ||
|
|
0f410f8087 | ||
|
|
f8518ba1a1 | ||
|
|
043d10c345 | ||
|
|
71e84e2c36 | ||
|
|
dccfd8ee18 | ||
|
|
841689cafe | ||
|
|
1516132167 | ||
|
|
847e1f97da | ||
|
|
826122fa8e | ||
|
|
c50f61b9b0 | ||
|
|
e55e93a1e3 | ||
|
|
699ab98f9d | ||
|
|
46c800948e | ||
|
|
91cf3269c2 | ||
|
|
e114e94c5f | ||
|
|
62e9e1fecd | ||
|
|
9a0dac124e | ||
|
|
053b966134 | ||
|
|
cc75e8bca5 | ||
|
|
ad08aa3956 | ||
|
|
ec0daf7913 | ||
|
|
ba0751a915 | ||
|
|
3d50172e9e | ||
|
|
2d42423953 | ||
|
|
0884cffb67 | ||
|
|
1c40eaaee4 | ||
|
|
3a79f35fdc | ||
|
|
e86d355c4c | ||
|
|
ff6b309c6f | ||
|
|
811dfaa57b | ||
|
|
b0ff9ee688 | ||
|
|
de3649e2a3 | ||
|
|
6a03b43e5f | ||
|
|
3f89aec716 | ||
|
|
a49aaf9ab0 | ||
|
|
a1ff6e7201 | ||
|
|
12bbeaa45e | ||
|
|
d5a1c5a96b | ||
|
|
8e39a27b76 | ||
|
|
d18d3e7825 | ||
|
|
4f1335cd4c | ||
|
|
bebfdec0a2 | ||
|
|
49b2cbf763 | ||
|
|
81fb61f97c | ||
|
|
782b84c6d5 | ||
|
|
66b698c3cf | ||
|
|
db890956ec | ||
|
|
1f6a9060f9 | ||
|
|
a7c444b939 | ||
|
|
1ed188011a | ||
|
|
a43a3798d3 | ||
|
|
3b14d7b84b | ||
|
|
460247c742 | ||
|
|
372144508c | ||
|
|
e7ce861def | ||
|
|
183a34a5cf | ||
|
|
4cce1e9a94 | ||
|
|
3b741353e1 | ||
|
|
e627aa9841 | ||
|
|
995ecffbb2 | ||
|
|
e7f23e164b | ||
|
|
c36ce04dd3 | ||
|
|
650e073f7a | ||
|
|
2edf296a92 | ||
|
|
a2c461d58a | ||
|
|
2ece3ea699 |
No files matched your search
@@ -29,22 +29,33 @@ document ____executor_globals
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
if $argc == 0
|
||||
____executor_globals
|
||||
set $cv_ex_ptr = $eg.current_execute_data
|
||||
else
|
||||
set $cv_ex_ptr = (zend_execute_data *)$arg0
|
||||
end
|
||||
set $cv_count = $cv_ex_ptr.func.op_array.last_var
|
||||
set $cv = $cv_ex_ptr.func.op_array.vars
|
||||
set $cv_idx = 0
|
||||
set $callFrameSize = (sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval)
|
||||
|
||||
printf "Compiled variables count: %d\n\n", $cv_count
|
||||
while $cv_idx < $cv_count
|
||||
printf "[%d] '%s'\n", $cv_idx, $cv[$cv_idx].val
|
||||
set $zvalue = ((zval *) $cv_ex_ptr) + $callFrameSize + $cv_idx
|
||||
printzv $zvalue
|
||||
set $cv_idx = $cv_idx + 1
|
||||
end
|
||||
end
|
||||
|
||||
document print_cvs
|
||||
Prints the compiled variables and their values.
|
||||
If a zend_execute_data pointer is set this will print the compiled
|
||||
variables of that scope. If no parameter is used it will use
|
||||
current_execute_data for scope.
|
||||
|
||||
usage: print_cvs [zend_execute_data *]
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
@@ -196,12 +207,17 @@ define ____printzv_contents
|
||||
____executor_globals
|
||||
set $handle = $zvalue->value.obj.handle
|
||||
set $handlers = $zvalue->value.obj.handlers
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
printf "(%s) #%d", $cname, $handle
|
||||
if ! $arg1
|
||||
if $handlers->get_properties == &zend_std_get_properties
|
||||
set $ht = $zobj->properties
|
||||
if $zobj->properties
|
||||
set $ht = $zobj->properties
|
||||
else
|
||||
set $ht = &$zobj->ce->properties_info
|
||||
end
|
||||
printf "\nProperties "
|
||||
if $ht
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
@@ -212,7 +228,7 @@ define ____printzv_contents
|
||||
set $i = $i - 1
|
||||
end
|
||||
else
|
||||
echo "no properties found"
|
||||
echo "not found"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -455,9 +471,9 @@ define print_inh
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = $arg0
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
printf "[%p] {\n", $pi
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
@@ -476,16 +492,27 @@ define print_pi
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
print_zstr $pi->name
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_pi
|
||||
Takes a pointer to an object's property and prints the property information
|
||||
usage: print_pi <ptr>
|
||||
end
|
||||
|
||||
define ____print_str
|
||||
set $tmp = 0
|
||||
set $str = $arg0
|
||||
if $argc > 2
|
||||
set $maxlen = $arg2
|
||||
else
|
||||
set $maxlen = 256
|
||||
end
|
||||
|
||||
printf "\""
|
||||
while $tmp < $arg1 && $tmp < 256
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
while $tmp < $arg1 && $tmp < $maxlen
|
||||
if $str[$tmp] > 31 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
@@ -554,6 +581,23 @@ document printzops
|
||||
dump operands of the current opline
|
||||
end
|
||||
|
||||
define print_zstr
|
||||
set $zstr = (zend_string *)$arg0
|
||||
if $argc == 2
|
||||
set $maxlen = $arg1
|
||||
else
|
||||
set $maxlen = $zstr->len
|
||||
end
|
||||
printf "string(%d) ", $zstr->len
|
||||
____print_str $zstr->val $zstr->len $maxlen
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
document print_zstr
|
||||
print the length and contents of a zend string
|
||||
usage: print_zstr <ptr> [max length]
|
||||
end
|
||||
|
||||
define zbacktrace
|
||||
____executor_globals
|
||||
dump_bt $eg.current_execute_data
|
||||
@@ -566,79 +610,6 @@ document zbacktrace
|
||||
> (gdb) dump_bt $eg.current_execute_data
|
||||
end
|
||||
|
||||
define zmemcheck
|
||||
set $p = alloc_globals.head
|
||||
set $stat = "?"
|
||||
set $total_size = 0
|
||||
if $arg0 != 0
|
||||
set $not_found = 1
|
||||
else
|
||||
set $not_found = 0
|
||||
end
|
||||
printf " block size status file:line\n"
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
while $p
|
||||
set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test)
|
||||
if $arg0 == 0 || (void *)$aptr == (void *)$arg0
|
||||
if $p->magic == 0x7312f8dc
|
||||
set $stat = "OK"
|
||||
end
|
||||
if $p->magic == 0x99954317
|
||||
set $stat = "FREED"
|
||||
end
|
||||
if $p->magic == 0xfb8277dc
|
||||
set $stat = "CACHED"
|
||||
end
|
||||
set $filename = strrchr($p->filename->val, '/')
|
||||
if !$filename
|
||||
set $filename = $p->filename->val
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " %p ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
printf "%-9d ", $p->size
|
||||
end
|
||||
set $total_size = $total_size + $p->size
|
||||
printf "%-06s %s:%d", $stat, $filename, $p->lineno
|
||||
if $p->orig_filename
|
||||
set $orig_filename = strrchr($p->orig_filename, '/')
|
||||
if !$orig_filename
|
||||
set $orig_filename = $p->orig_filename
|
||||
else
|
||||
set $orig_filename = $orig_filename + 1
|
||||
end
|
||||
printf " <= %s:%d\n", $orig_filename, $p->orig_lineno
|
||||
else
|
||||
printf "\n"
|
||||
end
|
||||
if $arg0 != 0
|
||||
set $p = 0
|
||||
set $not_found = 0
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
printf " total: %d bytes\n", $total_size
|
||||
end
|
||||
end
|
||||
|
||||
document zmemcheck
|
||||
show status of a memory block.
|
||||
usage: zmemcheck [ptr].
|
||||
if ptr is 0, all blocks will be listed.
|
||||
end
|
||||
|
||||
define lookup_root
|
||||
set $found = 0
|
||||
if gc_globals->roots
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,101 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
05 Jan 2017, PHP 7.1.1RC1
|
||||
16 Feb 2017, PHP 7.1.2
|
||||
|
||||
- Core:
|
||||
. Improved GENERATOR_CREATE opcode handler. (Bob, Dmitry)
|
||||
. Fixed bug #73877 (readlink() returns garbage for UTF-8 paths). (Anatol)
|
||||
. Fixed bug #73876 (Crash when exporting **= in expansion of assign op).
|
||||
(Sara)
|
||||
. Fixed bug #73962 (bug with symlink related to cyrillic directory). (Anatol)
|
||||
. Fixed bug #73969 (segfault in debug_print_backtrace). (andrewnester)
|
||||
. Fixed bug #73994 (arginfo incorrect for unpack). (krakjoe)
|
||||
. Fixed bug #73973 (assertion error in debug_zval_dump). (andrewnester)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes).
|
||||
(aboks)
|
||||
|
||||
- DTrace:
|
||||
. Fixed bug #73965 (DTrace reported as enabled when disabled). (Remi)
|
||||
|
||||
- FCGI:
|
||||
. Fixed bug #73904 (php-cgi fails to load -c specified php.ini file). (Anatol)
|
||||
. Fixed bug #72898 (PHP_FCGI_CHILDREN is not included in phpinfo()). (Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #69865 (php-fpm does not close stderr when using syslog).
|
||||
(m6w6)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73968 (Premature failing of XBM reading). (cmb)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #69993 (test for gmp.h needs to test machine includes).
|
||||
(Jordan Gigov)
|
||||
|
||||
- Hash:
|
||||
. Added hash_hkdf() function. (Andrey Andreev)
|
||||
. Fixed bug #73961 (environmental build dependency in hash sha3 source).
|
||||
(krakjoe)
|
||||
|
||||
- Intl:
|
||||
. Fix bug #73956 (Link use CC instead of CXX). (Remi)
|
||||
|
||||
- LDAP:
|
||||
. Fixed bug #73933 (error/segfault with ldap_mod_replace and opcache).
|
||||
(Laruence)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #73949 (leak in mysqli_fetch_object). (krakjoe)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #69899 (segfault on close() after free_result() with mysqlnd).
|
||||
(Richard Fussenegger)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #73983 (crash on finish work with phar in cli + opcache).
|
||||
(Anatol)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #71519 (add serial hex to return value array). (xrobau)
|
||||
. Fixed bug #73692 (Compile ext/openssl with openssl 1.1.0 on Win). (Anatol)
|
||||
. Fixed bug #73978 (openssl_decrypt triggers bug in PDO). (Jakub Zelenka)
|
||||
|
||||
- PDO_Firebird:
|
||||
. Implemented FR #72583 (All data are fetched as strings). (Dorin Marcoci)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #73959 (lastInsertId fails to throw an exception for wrong
|
||||
sequence name). (andrewnester)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #70417 (PharData::compress() doesn't close temp file). (cmb)
|
||||
|
||||
- posix:
|
||||
. Fixed bug #71219 (configure script incorrectly checks for ttyname_r). (atoh)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #69582 (session not readable by root in CLI). (EvgeniySpinov)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73896 (spl_autoload() crashes when calls magic _call()). (Dmitry)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #69442 (closing of fd incorrect when PTS enabled). (jaytaph)
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Rowan Collins)
|
||||
. Fixed bug #72974 (imap is undefined service on AIX). (matthieu.sarter)
|
||||
. Fixed bug #72979 (money_format stores wrong length AIX). (matthieu.sarter)
|
||||
. Fixed bug #73374 (intval() with base 0 should detect binary). (Leigh)
|
||||
. Fixed bug #69061 (mail.log = syslog contains double information).
|
||||
(Tom Sommer)
|
||||
|
||||
- ZIP:
|
||||
. Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb,
|
||||
Mitch Hagstrand)
|
||||
|
||||
19 Jan 2017, PHP 7.1.1
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73792 (invalid foreach loop hangs script). (Dmitry)
|
||||
|
||||
+12
-9
@@ -93,24 +93,27 @@ Commit the changes to the main branch.
|
||||
12. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
|
||||
13. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
13. run ``scripts/dev/gen_verify_stub <version> [identity]``, this will sign the tarballs
|
||||
and output verification information to be included in announcement email
|
||||
|
||||
14. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, talk to Derick or Dan.
|
||||
|
||||
14. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
15. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
f.e. http://downloads.php.net/derick/
|
||||
|
||||
15. Once the release has been tagged, contact the PHP Windows development team
|
||||
16. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be placed into the same directory as the source snapshots.
|
||||
|
||||
Getting the non stable release (alpha/beta/RC) announced
|
||||
--------------------------------------------------------
|
||||
|
||||
1. Send an email (see example here: http://news.php.net/php.internals/19486)
|
||||
**To** ``internals@lists.php.net`` and ``php-general@lists.php.net`` lists
|
||||
pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release".
|
||||
1. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
|
||||
lists pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release". Include in this information the verification
|
||||
information output by ``gen_verify_stub``.
|
||||
|
||||
2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
|
||||
@@ -190,8 +193,8 @@ Check if the pear files are updated (phar).
|
||||
This is to fetch the last commit id from php-distributions.git and commit this
|
||||
last commit id to web/php.git, then, mirrors will now sync
|
||||
|
||||
12. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created.
|
||||
12. Once the release has been tagged, contact release managers, windows builders, and package maintainers
|
||||
so that they can build releases. Do not send this announcement to any public lists.
|
||||
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
|
||||
@@ -239,6 +239,10 @@ PHP 7.1 UPGRADE NOTES
|
||||
- output_reset_rewrite_vars() no longer reset session URL rewrite vars.
|
||||
- the lasinsertid() in pdo_pgsql extension triggers an error, when no nextval()
|
||||
were called in in the current session.
|
||||
- fopen()
|
||||
Since 7.1.2, mode 'e' was added, which sets the close-on-exec flag
|
||||
on the opened file descriptor. This mode is only available in PHP compiled on
|
||||
POSIX.1-2008 conform systems.
|
||||
|
||||
|
||||
========================================
|
||||
@@ -254,6 +258,11 @@ PHP 7.1 UPGRADE NOTES
|
||||
. Added curl_share_strerror() to convert error code to error message text
|
||||
describing the error.
|
||||
|
||||
- Hash:
|
||||
. In PHP 7.1.2: Added hash_hkdf() function, which implements the HMAC-based
|
||||
Key Derivation Function (HKDF) algorithm according to RFC 5869. The
|
||||
implementation combines the Extract and Expand steps.
|
||||
|
||||
- pcntl:
|
||||
. Added pcntl_signal_get_handler() that returns the current signal handler
|
||||
for a particular signal.
|
||||
@@ -339,6 +348,13 @@ PHP 7.1 UPGRADE NOTES
|
||||
. Attempting to read an invalid or write to a readonly property will throw
|
||||
an instance of Error instead of resulting in a fatal error.
|
||||
|
||||
- PDO_Firebird
|
||||
As of PHP 7.1.2, the fetched data for integer fields is aware of the Firebird
|
||||
datatypes. Previously all integers was fetched as strings, starting with
|
||||
aforementioned PHP version integer fields are translated to the PHP integer
|
||||
datatype. The 64-bit integers are still fetched as strings in 32-bit PHP
|
||||
builds.
|
||||
|
||||
- Reflection:
|
||||
. Failure to retrieve a reflection object or retrieve an object property
|
||||
will now throw an instance of Error instead of resulting in a fatal error.
|
||||
@@ -415,6 +431,9 @@ PHP 7.1 UPGRADE NOTES
|
||||
. If the value is set to -1, then the dtoa mode 0 is used. No changes
|
||||
in default value which is still 14.
|
||||
|
||||
- realpath_cache_size
|
||||
. Set to 4096k by default
|
||||
|
||||
========================================
|
||||
12. Windows Support
|
||||
========================================
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
ZEND_POW_ASSIGN
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert_options(ASSERT_WARNING);
|
||||
assert(false && ($a **= 2));
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #63734 (Garbage collector can free zvals that are still referenced)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #69446 (GC leak relating to removal of nested data after dtors run)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #69446 (GC leak relating to removal of nested data after dtors run)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #69534 (Cycle leaks through declared properties on internal classes)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class Node extends SplObjectStorage {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #71818 (Memory leak when array altered in destructor)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class MemoryLeak
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #73916 (zend_print_flat_zval_r doesn't consider reference)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array('a');
|
||||
class b{};
|
||||
$b = new b;
|
||||
$test[] =& $a;
|
||||
$test[] =& $b;
|
||||
test($test);
|
||||
function test() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 test(Array ([0] => Array ([0] => a),[1] => b Object ())) called at [%sbug73916.php:%d]
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
GC 033: Crash in GC while run with phpspec
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
GC 035: Lost inner-cycles garbage
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Verify yield from on generators being properly cycle collected
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
+2
-1
@@ -152,6 +152,7 @@ ZEND_TSRMLS_CACHE_DEFINE()
|
||||
#endif
|
||||
|
||||
ZEND_API zend_utility_values zend_uv;
|
||||
ZEND_API zend_bool zend_dtrace_enabled;
|
||||
|
||||
/* version information */
|
||||
static char *zend_version_info;
|
||||
@@ -312,7 +313,6 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
|
||||
|
||||
static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /* {{{ */
|
||||
{
|
||||
ZVAL_DEREF(expr);
|
||||
switch (Z_TYPE_P(expr)) {
|
||||
case IS_ARRAY:
|
||||
smart_str_appends(buf, "Array\n");
|
||||
@@ -697,6 +697,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
char *tmp = getenv("USE_ZEND_DTRACE");
|
||||
|
||||
if (tmp && zend_atoi(tmp, 0)) {
|
||||
zend_dtrace_enabled = 1;
|
||||
zend_compile_file = dtrace_compile_file;
|
||||
zend_execute_ex = dtrace_execute_ex;
|
||||
zend_execute_internal = dtrace_execute_internal;
|
||||
|
||||
@@ -281,6 +281,8 @@ extern ZEND_API zend_class_entry *zend_standard_class_def;
|
||||
extern ZEND_API zend_utility_values zend_uv;
|
||||
extern ZEND_API zval zval_used_for_init;
|
||||
|
||||
/* If DTrace is available and enabled */
|
||||
extern ZEND_API zend_bool zend_dtrace_enabled;
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_UV(name) (zend_uv.name)
|
||||
|
||||
+1
-1
@@ -1342,7 +1342,7 @@ simple_list:
|
||||
case ZEND_ASSIGN_BW_OR: BINARY_OP(" |= ", 90, 91, 90);
|
||||
case ZEND_ASSIGN_BW_AND: BINARY_OP(" &= ", 90, 91, 90);
|
||||
case ZEND_ASSIGN_BW_XOR: BINARY_OP(" ^= ", 90, 91, 90);
|
||||
case ZEND_POW: BINARY_OP(" **= ", 90, 91, 90);
|
||||
case ZEND_ASSIGN_POW: BINARY_OP(" **= ", 90, 91, 90);
|
||||
EMPTY_SWITCH_DEFAULT_CASE();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -879,9 +879,6 @@ static void copy_constant_array(zval *dst, zval *src) /* {{{ */
|
||||
}
|
||||
} else if (Z_REFCOUNTED_P(val)) {
|
||||
Z_ADDREF_P(val);
|
||||
if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_RESOURCE_EX)) {
|
||||
Z_TYPE_INFO_P(new_val) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
@@ -924,12 +921,7 @@ repeat:
|
||||
case IS_FALSE:
|
||||
case IS_TRUE:
|
||||
case IS_NULL:
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
ZVAL_COPY(&val_free, val);
|
||||
/* TODO: better solution than this tricky disable dtor on resource? */
|
||||
Z_TYPE_INFO(val_free) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
|
||||
val = &val_free;
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
if (!Z_IMMUTABLE_P(val)) {
|
||||
@@ -2446,13 +2438,19 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
object = (Z_TYPE(call->This) == IS_OBJECT) ? Z_OBJ(call->This) : NULL;
|
||||
|
||||
if (call->func) {
|
||||
zend_string *zend_function_name;
|
||||
|
||||
func = call->func;
|
||||
function_name = (func->common.scope &&
|
||||
func->common.scope->trait_aliases) ?
|
||||
ZSTR_VAL(zend_resolve_method_name(
|
||||
(object ? object->ce : func->common.scope), func)) :
|
||||
(func->common.function_name ?
|
||||
ZSTR_VAL(func->common.function_name) : NULL);
|
||||
if (func->common.scope && func->common.scope->trait_aliases) {
|
||||
zend_function_name = zend_resolve_method_name(object ? object->ce : func->common.scope, func);
|
||||
} else {
|
||||
zend_function_name = func->common.function_name;
|
||||
}
|
||||
if (zend_function_name != NULL) {
|
||||
function_name = ZSTR_VAL(zend_function_name);
|
||||
} else {
|
||||
function_name = NULL;
|
||||
}
|
||||
} else {
|
||||
func = NULL;
|
||||
function_name = NULL;
|
||||
|
||||
@@ -345,6 +345,10 @@ void shutdown_executor(void) /* {{{ */
|
||||
zend_llist_destroy(&CG(open_files));
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
clean_non_persistent_constants();
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
zend_close_rsrc_list(&EG(regular_list));
|
||||
} zend_end_try();
|
||||
@@ -376,10 +380,6 @@ void shutdown_executor(void) /* {{{ */
|
||||
}
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
clean_non_persistent_constants();
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
#if 0&&ZEND_DEBUG
|
||||
signal(SIGSEGV, original_sigsegv_handler);
|
||||
|
||||
+62
-39
@@ -219,10 +219,9 @@ static inline time_t FileTimeToUnixTime(const FILETIME *FileTime)
|
||||
|
||||
CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){ /* {{{ */
|
||||
HANDLE hFile;
|
||||
DWORD dwRet;
|
||||
wchar_t *linkw = php_win32_ioutil_any_to_w(link), targetw[MAXPATHLEN];
|
||||
size_t _tmp_len;
|
||||
char *_tmp;
|
||||
size_t ret_len, targetw_len, offset = 0;
|
||||
char *ret;
|
||||
|
||||
if (!linkw) {
|
||||
return -1;
|
||||
@@ -251,46 +250,40 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){
|
||||
with VS2012 and earlier, and seems not to be fixed till
|
||||
now. Thus, correcting target_len so it's suddenly don't
|
||||
overflown. */
|
||||
dwRet = GetFinalPathNameByHandleW(hFile, targetw, MAXPATHLEN, VOLUME_NAME_DOS);
|
||||
if(dwRet >= target_len || dwRet >= MAXPATHLEN || dwRet == 0) {
|
||||
targetw_len = GetFinalPathNameByHandleW(hFile, targetw, MAXPATHLEN, VOLUME_NAME_DOS);
|
||||
if(targetw_len >= target_len || targetw_len >= MAXPATHLEN || targetw_len == 0) {
|
||||
free(linkw);
|
||||
CloseHandle(hFile);
|
||||
return -1;
|
||||
}
|
||||
|
||||
_tmp = php_win32_ioutil_conv_w_to_any(targetw, dwRet, &_tmp_len);
|
||||
if (!_tmp || _tmp_len >= MAXPATHLEN) {
|
||||
CloseHandle(hFile);
|
||||
free(linkw);
|
||||
return -1;
|
||||
}
|
||||
memcpy(target, _tmp, _tmp_len);
|
||||
free(_tmp);
|
||||
if(targetw_len > 4) {
|
||||
/* Skip first 4 characters if they are "\\?\" */
|
||||
if(targetw[0] == L'\\' && targetw[1] == L'\\' && targetw[2] == L'?' && targetw[3] == L'\\') {
|
||||
offset = 4;
|
||||
|
||||
CloseHandle(hFile);
|
||||
free(linkw);
|
||||
|
||||
if(dwRet > 4) {
|
||||
/* Skip first 4 characters if they are "\??\" */
|
||||
if(target[0] == '\\' && target[1] == '\\' && target[2] == '?' && target[3] == '\\') {
|
||||
char tmp[MAXPATHLEN];
|
||||
unsigned int offset = 4;
|
||||
dwRet -= 4;
|
||||
|
||||
/* \??\UNC\ */
|
||||
if (dwRet > 7 && target[4] == 'U' && target[5] == 'N' && target[6] == 'C') {
|
||||
/* \\?\UNC\ */
|
||||
if (targetw_len > 7 && targetw[4] == L'U' && targetw[5] == L'N' && targetw[6] == L'C') {
|
||||
offset += 2;
|
||||
dwRet -= 2;
|
||||
target[offset] = '\\';
|
||||
targetw[offset] = L'\\';
|
||||
}
|
||||
|
||||
memcpy(tmp, target + offset, dwRet);
|
||||
memcpy(target, tmp, dwRet);
|
||||
}
|
||||
}
|
||||
|
||||
target[dwRet] = '\0';
|
||||
return dwRet;
|
||||
ret = php_win32_ioutil_conv_w_to_any(targetw + offset, targetw_len - offset, &ret_len);
|
||||
if (!ret || ret_len >= MAXPATHLEN) {
|
||||
CloseHandle(hFile);
|
||||
free(linkw);
|
||||
free(ret);
|
||||
return -1;
|
||||
}
|
||||
memcpy(target, ret, ret_len + 1);
|
||||
|
||||
free(ret);
|
||||
CloseHandle(hFile);
|
||||
free(linkw);
|
||||
|
||||
return ret_len;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -920,9 +913,13 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
int bufindex = 0, isabsolute = 0;
|
||||
wchar_t * reparsetarget;
|
||||
BOOL isVolume = FALSE;
|
||||
char *printname = NULL, *substitutename = NULL;
|
||||
int substitutename_len;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
char *printname = NULL;
|
||||
#endif
|
||||
char *substitutename = NULL;
|
||||
size_t substitutename_len;
|
||||
int substitutename_off = 0;
|
||||
wchar_t tmpsubstname[MAXPATHLEN];
|
||||
|
||||
if(++(*ll) > LINK_MAX) {
|
||||
free_alloca(tmp, use_heap);
|
||||
@@ -957,6 +954,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
|
||||
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
|
||||
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
|
||||
if (!printname) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
@@ -964,13 +962,25 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
FREE_PATHW()
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
|
||||
substitutename = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR));
|
||||
if (!substitutename) {
|
||||
if (substitutename_len >= MAXPATHLEN) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free_alloca(tmp, use_heap);
|
||||
FREE_PATHW()
|
||||
return -1;
|
||||
}
|
||||
memmove(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength);
|
||||
tmpsubstname[substitutename_len] = L'\0';
|
||||
substitutename = php_win32_cp_conv_w_to_any(tmpsubstname, substitutename_len, &substitutename_len);
|
||||
if (!substitutename || substitutename_len >= MAXPATHLEN) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free_alloca(tmp, use_heap);
|
||||
free(substitutename);
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
free(printname);
|
||||
#endif
|
||||
FREE_PATHW()
|
||||
return -1;
|
||||
}
|
||||
@@ -978,6 +988,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
|
||||
isabsolute = 1;
|
||||
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
|
||||
if (!printname) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
@@ -985,14 +996,26 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
FREE_PATHW()
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
|
||||
substitutename = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR));
|
||||
if (!substitutename) {
|
||||
if (substitutename_len >= MAXPATHLEN) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free_alloca(tmp, use_heap);
|
||||
FREE_PATHW()
|
||||
return -1;
|
||||
}
|
||||
memmove(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength);
|
||||
tmpsubstname[substitutename_len] = L'\0';
|
||||
substitutename = php_win32_cp_conv_w_to_any(tmpsubstname, substitutename_len, &substitutename_len);
|
||||
if (!substitutename || substitutename_len >= MAXPATHLEN) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free_alloca(tmp, use_heap);
|
||||
free(substitutename);
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
free(printname);
|
||||
#endif
|
||||
FREE_PATHW()
|
||||
return -1;
|
||||
}
|
||||
@@ -1055,9 +1078,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
fprintf(stderr, "reparse: print: %s ", printname);
|
||||
fprintf(stderr, "sub: %s ", substitutename);
|
||||
fprintf(stderr, "resolved: %s ", path);
|
||||
free(printname);
|
||||
#endif
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free(printname);
|
||||
free(substitutename);
|
||||
|
||||
if(isabsolute == 1) {
|
||||
|
||||
+8
-2
@@ -4093,8 +4093,14 @@ ZEND_VM_HANDLER(41, ZEND_GENERATOR_CREATE, ANY, ANY)
|
||||
* is allocated on heap.
|
||||
*/
|
||||
num_args = EX_NUM_ARGS();
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - MIN(EX(func)->op_array.num_args, num_args)) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);
|
||||
} else {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - EX(func)->op_array.num_args) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
}
|
||||
memcpy(gen_execute_data, execute_data, used_stack);
|
||||
|
||||
/* Save execution context in generator object. */
|
||||
|
||||
@@ -1179,8 +1179,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
|
||||
* is allocated on heap.
|
||||
*/
|
||||
num_args = EX_NUM_ARGS();
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - MIN(EX(func)->op_array.num_args, num_args)) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);
|
||||
} else {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - EX(func)->op_array.num_args) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
}
|
||||
memcpy(gen_execute_data, execute_data, used_stack);
|
||||
|
||||
/* Save execution context in generator object. */
|
||||
|
||||
+7
-1
@@ -1376,8 +1376,11 @@ main() {
|
||||
dir = opendir("/");
|
||||
if (!dir)
|
||||
exit(1);
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
|
||||
close(dir);
|
||||
exit(0);
|
||||
}
|
||||
close(dir);
|
||||
exit(1);
|
||||
}
|
||||
],[
|
||||
@@ -3109,3 +3112,6 @@ AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
|
||||
|
||||
])
|
||||
|
||||
dnl Load the AX_CHECK_COMPILE_FLAG macro from the autoconf archive.
|
||||
m4_include([build/ax_check_compile_flag.m4])
|
||||
@@ -17,9 +17,9 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
|
||||
set BRANCH=master
|
||||
set STABILITY=staging
|
||||
)
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%APPVEYOR_REPO_BRANCH%
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%BRANCH%
|
||||
rem SDK is cached, deps info is cached as well
|
||||
echo Updating dependencies
|
||||
echo Updating dependencies in %DEPS_DIR%
|
||||
call phpsdk_deps --update --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
|
||||
@@ -4,7 +4,14 @@ set NO_INTERACTION=1
|
||||
set REPORT_EXIT_STATUS=1
|
||||
set SKIP_IO_CAPTURE_TESTS=1
|
||||
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%APPVEYOR_REPO_BRANCH%
|
||||
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
|
||||
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
|
||||
set STABILITY=stable
|
||||
) else (
|
||||
set BRANCH=master
|
||||
set STABILITY=staging
|
||||
)
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%BRANCH%
|
||||
|
||||
rem setup MySQL related exts
|
||||
set MYSQL_PWD=Password12!
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 4
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=1
|
||||
PHP_RELEASE_VERSION=1
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_RELEASE_VERSION=2
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
+5
-6
@@ -5,12 +5,11 @@ ARG_WITH("curl", "cURL support", "no");
|
||||
|
||||
if (PHP_CURL != "no") {
|
||||
if (CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
|
||||
CHECK_LIB("ssleay32.lib", "curl", PHP_CURL) &&
|
||||
CHECK_LIB("libeay32.lib", "curl", PHP_CURL)
|
||||
&& CHECK_LIB("winmm.lib", "curl", PHP_CURL)
|
||||
&& CHECK_LIB("wldap32.lib", "curl", PHP_CURL)
|
||||
&& (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) ||
|
||||
CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
|
||||
SETUP_OPENSSL("curl", PHP_CURL) > 0 &&
|
||||
CHECK_LIB("winmm.lib", "curl", PHP_CURL) &&
|
||||
CHECK_LIB("wldap32.lib", "curl", PHP_CURL) &&
|
||||
(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) ||
|
||||
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
|
||||
) {
|
||||
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
|
||||
|
||||
@@ -35,7 +35,7 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
size_t fname_len, mime_len, postname_len;
|
||||
zval *cf = return_value;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ var_dump(curl_setopt_array($c, [
|
||||
CURLOPT_UPLOAD => true,
|
||||
CURLOPT_INFILE => $f,
|
||||
CURLOPT_INFILESIZE => filesize(__FILE__),
|
||||
CURLOPT_CONNECTTIMEOUT => 1,
|
||||
CURLOPT_TIMEOUT => 1,
|
||||
CURLOPT_CONNECTTIMEOUT => 3,
|
||||
CURLOPT_TIMEOUT => 3,
|
||||
]));
|
||||
fclose($f);
|
||||
var_dump(curl_setopt_array($c, [
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
array curl_multi_info_read ( resource $mh [, int &$msgs_in_queue = NULL ] );
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("SKIP_ONLINE_TESTS")) { die('skip: online test'); }
|
||||
if (!extension_loaded('curl')) { print("skip"); }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$urls = array(
|
||||
"bugs.php.net",
|
||||
"pear.php.net"
|
||||
);
|
||||
|
||||
$mh = curl_multi_init();
|
||||
foreach ($urls as $i => $url) {
|
||||
$conn[$i] = curl_init($url);
|
||||
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_multi_add_handle($mh, $conn[$i]);
|
||||
}
|
||||
|
||||
do {
|
||||
$status = curl_multi_exec($mh, $active);
|
||||
$info = curl_multi_info_read($mh);
|
||||
if (false !== $info) {
|
||||
var_dump(is_array($info));
|
||||
}
|
||||
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
|
||||
|
||||
foreach ($urls as $i => $url) {
|
||||
curl_close($conn[$i]);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -33,9 +33,9 @@ function curl_cli_server_start() {
|
||||
|
||||
// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
|
||||
// it might not be listening yet...need to wait until fsockopen() call returns
|
||||
$error = "Unable to connect to servers\n";
|
||||
$error = "Unable to connect to server\n";
|
||||
for ($i=0; $i < 60; $i++) {
|
||||
usleep(25000); // 25ms per try
|
||||
usleep(50000); // 50ms per try
|
||||
$status = proc_get_status($handle);
|
||||
$fp = @fsockopen(PHP_CURL_SERVER_HOSTNAME, PHP_CURL_SERVER_PORT);
|
||||
// Failure, the server is no longer running
|
||||
@@ -63,6 +63,14 @@ function curl_cli_server_start() {
|
||||
register_shutdown_function(
|
||||
function($handle) use($router) {
|
||||
proc_terminate($handle);
|
||||
/* Wait for server to shutdown */
|
||||
for ($i = 0; $i < 60; $i++) {
|
||||
$status = proc_get_status($handle);
|
||||
if (!($status && $status['running'])) {
|
||||
break;
|
||||
}
|
||||
usleep(50000);
|
||||
}
|
||||
},
|
||||
$handle
|
||||
);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Test invalid time zone passed to ini_set
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
ini_set("date.timezone", "Incorrect/Zone");
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ini_set(): Invalid date.timezone value 'Incorrect/Zone', we selected the timezone 'UTC' for now. in %sini_set_incorrect.php on line %d
|
||||
+1
-1
@@ -213,7 +213,7 @@ Since: DOM Level 3
|
||||
*/
|
||||
int dom_attr_schema_type_info_read(dom_object *obj, zval *retval)
|
||||
{
|
||||
php_error_docref(NULL, E_WARNING, "Not yet implemented");
|
||||
/* TODO */
|
||||
ZVAL_NULL(retval);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+28
-4
@@ -921,7 +921,7 @@ Since: DOM Level 2
|
||||
PHP_FUNCTION(dom_element_get_attribute_node_ns)
|
||||
{
|
||||
zval *id;
|
||||
xmlNodePtr elemp;
|
||||
xmlNodePtr elemp, fakeAttrp;
|
||||
xmlAttrPtr attrp;
|
||||
dom_object *intern;
|
||||
size_t uri_len, name_len;
|
||||
@@ -937,10 +937,34 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
|
||||
attrp = xmlHasNsProp(elemp, (xmlChar *)name, (xmlChar *)uri);
|
||||
|
||||
if (attrp == NULL) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
if (xmlStrEqual((xmlChar *) uri, (xmlChar *)DOM_XMLNS_NAMESPACE)) {
|
||||
xmlNsPtr nsptr;
|
||||
nsptr = dom_get_nsdecl(elemp, (xmlChar *)name);
|
||||
if (nsptr != NULL) {
|
||||
xmlNsPtr curns;
|
||||
curns = xmlNewNs(NULL, nsptr->href, NULL);
|
||||
if (nsptr->prefix) {
|
||||
curns->prefix = xmlStrdup((xmlChar *) nsptr->prefix);
|
||||
}
|
||||
if (nsptr->prefix) {
|
||||
fakeAttrp = xmlNewDocNode(elemp->doc, NULL, (xmlChar *) nsptr->prefix, nsptr->href);
|
||||
} else {
|
||||
fakeAttrp = xmlNewDocNode(elemp->doc, NULL, (xmlChar *)"xmlns", nsptr->href);
|
||||
}
|
||||
fakeAttrp->type = XML_NAMESPACE_DECL;
|
||||
fakeAttrp->parent = elemp;
|
||||
fakeAttrp->ns = curns;
|
||||
|
||||
DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern);
|
||||
DOM_RET_OBJ(fakeAttrp, &ret, intern);
|
||||
} else {
|
||||
RETURN_NULL();
|
||||
}
|
||||
} else {
|
||||
RETURN_NULL();
|
||||
}
|
||||
} else {
|
||||
DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern);
|
||||
}
|
||||
|
||||
}
|
||||
/* }}} end dom_element_get_attribute_node_ns */
|
||||
|
||||
+2
-1
@@ -549,7 +549,8 @@ int dom_node_next_sibling_read(dom_object *obj, zval *retval)
|
||||
|
||||
nextsib = nodep->next;
|
||||
if (!nextsib) {
|
||||
return FAILURE;
|
||||
ZVAL_NULL(retval);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
php_dom_create_object(nextsib, retval, obj);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #54382 DOMNode::getAttributeNodeNS doesn't get xmlns* attributes
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xmlString = '<?xml version="1.0" encoding="utf-8" ?>
|
||||
<root xmlns="http://ns" xmlns:ns2="http://ns2">
|
||||
<ns2:child />
|
||||
</root>';
|
||||
|
||||
$xml=new DOMDocument();
|
||||
$xml->loadXML($xmlString);
|
||||
$de = $xml->documentElement;
|
||||
|
||||
$ns2 = $de->getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "ns2");
|
||||
if ($ns2 == NULL) {
|
||||
echo 'namespace node does not exist.' . "\n";
|
||||
} else {
|
||||
echo 'namespace node prefix=' . $ns2->prefix . "\n";
|
||||
echo 'namespace node namespaceURI=' . $ns2->namespaceURI . "\n";
|
||||
}
|
||||
--EXPECT--
|
||||
namespace node prefix=ns2
|
||||
namespace node namespaceURI=http://ns2
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #61858 DOMAttr debug info generates E_WARNING
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML('<example a="b">Test</example>');
|
||||
|
||||
$example = $doc->getElementsByTagName('example')->item(0);
|
||||
$attr = $example->getAttributeNode('a');
|
||||
|
||||
var_dump($attr);
|
||||
print_r($attr);
|
||||
--EXPECTF--
|
||||
object(DOMAttr)#%d (%d) {
|
||||
%A
|
||||
}
|
||||
DOMAttr Object
|
||||
(
|
||||
%A
|
||||
)
|
||||
@@ -31,7 +31,7 @@ foreach ($dataNodes AS $node) {
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
int(3)
|
||||
object(DOMText)#%d (18) {
|
||||
object(DOMText)#%d (19) {
|
||||
["wholeText"]=>
|
||||
string(3) "
|
||||
"
|
||||
@@ -57,6 +57,8 @@ object(DOMText)#%d (18) {
|
||||
NULL
|
||||
["previousSibling"]=>
|
||||
NULL
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
["attributes"]=>
|
||||
NULL
|
||||
["ownerDocument"]=>
|
||||
@@ -73,7 +75,7 @@ object(DOMText)#%d (18) {
|
||||
string(3) "
|
||||
"
|
||||
}
|
||||
object(DOMElement)#%d (17) {
|
||||
object(DOMElement)#%d (18) {
|
||||
["tagName"]=>
|
||||
string(5) "form1"
|
||||
["schemaTypeInfo"]=>
|
||||
@@ -98,6 +100,8 @@ object(DOMElement)#%d (17) {
|
||||
string(22) "(object value omitted)"
|
||||
["previousSibling"]=>
|
||||
NULL
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
["attributes"]=>
|
||||
string(22) "(object value omitted)"
|
||||
["ownerDocument"]=>
|
||||
@@ -117,7 +121,7 @@ object(DOMElement)#%d (17) {
|
||||
Value C
|
||||
"
|
||||
}
|
||||
object(DOMText)#%d (18) {
|
||||
object(DOMText)#%d (19) {
|
||||
["wholeText"]=>
|
||||
string(1) "
|
||||
"
|
||||
@@ -143,6 +147,8 @@ object(DOMText)#%d (18) {
|
||||
NULL
|
||||
["previousSibling"]=>
|
||||
NULL
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
["attributes"]=>
|
||||
NULL
|
||||
["ownerDocument"]=>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73907 nextSibling property not included in var_dump of DOMNode
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xmlString = '<?xml version="1.0" encoding="utf-8" ?>
|
||||
<root>
|
||||
</root>';
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($xmlString);
|
||||
$attr = $doc->documentElement;
|
||||
|
||||
var_dump($attr);
|
||||
--EXPECTF--
|
||||
object(DOMElement)#%d (%d) {%A
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
%A}
|
||||
@@ -2,8 +2,6 @@
|
||||
Test: setAttributeNode()
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--INI--
|
||||
error_reporting = E_ALL & ~E_WARNING
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ DOMDocument Object
|
||||
[firstChild] => (object value omitted)
|
||||
[lastChild] => (object value omitted)
|
||||
[previousSibling] =>
|
||||
[nextSibling] =>
|
||||
[attributes] =>
|
||||
[ownerDocument] =>
|
||||
[namespaceURI] =>
|
||||
|
||||
+1
-1
@@ -4204,7 +4204,7 @@ PHP_FUNCTION(exif_imagetype)
|
||||
php_stream * stream;
|
||||
int itype = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &imagefile, &imagefile_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &imagefile, &imagefile_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,23 +142,23 @@ Warning: exif_imagetype(0.5): failed to open stream: No such file or directory i
|
||||
bool(false)
|
||||
-- Iteration 10 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 11 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 12 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 13 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 14 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 15 --
|
||||
|
||||
@@ -198,7 +198,7 @@ Warning: exif_imagetype(obj'ct): failed to open stream: No such file or director
|
||||
bool(false)
|
||||
-- Iteration 24 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, resource given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, resource given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 25 --
|
||||
|
||||
|
||||
+3
-3
@@ -7,9 +7,9 @@ if (PHP_FTP != "no") {
|
||||
|
||||
EXTENSION("ftp", "php_ftp.c ftp.c");
|
||||
|
||||
if (CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_FTP") &&
|
||||
CHECK_LIB("ssleay32.lib", "ftp", PHP_FTP) &&
|
||||
CHECK_LIB("libeay32.lib", "ftp", PHP_FTP)) {
|
||||
var ret = SETUP_OPENSSL("ftp", PHP_FTP);
|
||||
|
||||
if (ret > 0) {
|
||||
MESSAGE("Enabling SSL support for ext\\ftp");
|
||||
AC_DEFINE('HAVE_FTP_SSL', 1, 'Have FTP over SSL support');
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ $context = stream_context_create(array('ssl' => array('local_cert' => dirname(__
|
||||
for ($i=0; $i<10 && !$socket; ++$i) {
|
||||
$port = rand(50000, 65535);
|
||||
|
||||
$socket = stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
|
||||
@$socket = stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
|
||||
}
|
||||
//set anther random port that is not the same as $port
|
||||
do{
|
||||
@@ -15,6 +15,7 @@ do{
|
||||
}while($pasv_port == $port);
|
||||
|
||||
if (!$socket) {
|
||||
echo "$errstr ($errno)\n";
|
||||
die("could not start/bind the ftp server\n");
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -152,7 +152,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
ctx = emalloc(sizeof(gdIOCtx));
|
||||
ctx = ecalloc(1, sizeof(gdIOCtx));
|
||||
ctx->putC = _php_image_output_putc;
|
||||
ctx->putBuf = _php_image_output_putbuf;
|
||||
ctx->gd_free = _php_image_output_ctxfree;
|
||||
@@ -165,7 +165,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
}
|
||||
|
||||
if (!ctx) {
|
||||
ctx = emalloc(sizeof(gdIOCtx));
|
||||
ctx = ecalloc(1, sizeof(gdIOCtx));
|
||||
ctx->putC = _php_image_stream_putc;
|
||||
ctx->putBuf = _php_image_stream_putbuf;
|
||||
if (close_stream) {
|
||||
|
||||
@@ -693,8 +693,6 @@ void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, in
|
||||
gdImagePtr gdImageRotate90(gdImagePtr src, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate180(gdImagePtr src, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate270(gdImagePtr src, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent);
|
||||
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor);
|
||||
|
||||
void gdImageSetBrush(gdImagePtr im, gdImagePtr brush);
|
||||
|
||||
+10
-2
@@ -136,6 +136,10 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
|
||||
GD2_DBG(php_gd_error("%d Chunks vertically", *ncy));
|
||||
|
||||
if (gd2_compressed(*fmt)) {
|
||||
if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) {
|
||||
GD2_DBG(printf ("Illegal chunk counts: %d * %d\n", *ncx, *ncy));
|
||||
goto fail1;
|
||||
}
|
||||
nc = (*ncx) * (*ncy);
|
||||
GD2_DBG(php_gd_error("Reading %d chunk index entries", nc));
|
||||
if (overflow2(sizeof(t_chunk_info), nc)) {
|
||||
@@ -340,12 +344,16 @@ gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
|
||||
for (x = xlo; x < xhi; x++) {
|
||||
if (im->trueColor) {
|
||||
if (!gdGetInt(&im->tpixels[y][x], in)) {
|
||||
im->tpixels[y][x] = 0;
|
||||
php_gd_error("gd2: EOF while reading\n");
|
||||
gdImageDestroy(im);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
int ch;
|
||||
if (!gdGetByte(&ch, in)) {
|
||||
ch = 0;
|
||||
php_gd_error("gd2: EOF while reading\n");
|
||||
gdImageDestroy(im);
|
||||
return NULL;
|
||||
}
|
||||
im->pixels[y][x] = ch;
|
||||
}
|
||||
|
||||
@@ -343,218 +343,3 @@ gdImagePtr gdImageRotate270 (gdImagePtr src, int ignoretransparent)
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent)
|
||||
{
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
gdImagePtr dst1,dst2,dst3;
|
||||
FuncPtr f;
|
||||
double dRadAngle, dSinE, dTan, dShear;
|
||||
double dOffset; /* Variable skew offset */
|
||||
int u, iShear, newx, newy;
|
||||
int clrBackR, clrBackG, clrBackB, clrBackA;
|
||||
|
||||
/* See GEMS I for the algorithm details */
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
dSinE = sin (dRadAngle);
|
||||
dTan = tan (dRadAngle / 2.0);
|
||||
|
||||
newx = (int)(src->sx + src->sy * fabs(dTan));
|
||||
newy = src->sy;
|
||||
|
||||
/* 1st shear */
|
||||
if (src->trueColor) {
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
dst1 = gdImageCreateTrueColor(newx, newy);
|
||||
/******* Perform 1st shear (horizontal) ******/
|
||||
if (dst1 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
#ifdef HAVE_GD_BUNDLED
|
||||
dst1->alphaBlendingFlag = gdEffectReplace;
|
||||
#else
|
||||
gdImageAlphaBlending(dst1, 0);
|
||||
#endif
|
||||
if (dAngle == 0.0) {
|
||||
/* Returns copy of src */
|
||||
gdImageCopy (dst1, src,0,0,0,0,src->sx,src->sy);
|
||||
return dst1;
|
||||
}
|
||||
|
||||
gdImagePaletteCopy (dst1, src);
|
||||
|
||||
if (ignoretransparent) {
|
||||
if (gdImageTrueColor(src)) {
|
||||
dst1->transparent = src->transparent;
|
||||
} else {
|
||||
|
||||
dst1->transparent = gdTrueColorAlpha(gdImageRed(src, src->transparent), gdImageBlue(src, src->transparent), gdImageGreen(src, src->transparent), 127);
|
||||
}
|
||||
}
|
||||
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
dSinE = sin (dRadAngle);
|
||||
dTan = tan (dRadAngle / 2.0);
|
||||
|
||||
for (u = 0; u < dst1->sy; u++) {
|
||||
if (dTan >= 0.0) {
|
||||
dShear = ((double)(u + 0.5)) * dTan;
|
||||
} else {
|
||||
dShear = ((double)(u - dst1->sy) + 0.5) * dTan;
|
||||
}
|
||||
|
||||
iShear = (int)floor(dShear);
|
||||
gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
/*
|
||||
The 1st shear may use the original clrBack as color index
|
||||
Convert it once here
|
||||
*/
|
||||
if(!src->trueColor) {
|
||||
clrBackR = gdImageRed(src, clrBack);
|
||||
clrBackG = gdImageGreen(src, clrBack);
|
||||
clrBackB = gdImageBlue(src, clrBack);
|
||||
clrBackA = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
|
||||
}
|
||||
/* 2nd shear */
|
||||
newx = dst1->sx;
|
||||
|
||||
if (dSinE > 0.0) {
|
||||
dOffset = (src->sx-1) * dSinE;
|
||||
} else {
|
||||
dOffset = -dSinE * (src->sx - newx);
|
||||
}
|
||||
|
||||
newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle))+1;
|
||||
|
||||
if (src->trueColor) {
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst2 = gdImageCreateTrueColor(newx, newy);
|
||||
if (dst2 == NULL) {
|
||||
gdImageDestroy(dst1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GD_BUNDLED
|
||||
dst2->alphaBlendingFlag = gdEffectReplace;
|
||||
#else
|
||||
gdImageAlphaBlending(dst2, 0);
|
||||
#endif
|
||||
|
||||
if (ignoretransparent) {
|
||||
dst2->transparent = dst1->transparent;
|
||||
}
|
||||
|
||||
for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) {
|
||||
iShear = (int)floor (dOffset);
|
||||
gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
/* 3rd shear */
|
||||
gdImageDestroy(dst1);
|
||||
|
||||
newx = (int) ((double)src->sy * fabs (dSinE) + (double)src->sx * cos (dRadAngle)) + 1;
|
||||
newy = dst2->sy;
|
||||
|
||||
if (src->trueColor) {
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst3 = gdImageCreateTrueColor(newx, newy);
|
||||
if (dst3 == NULL) {
|
||||
gdImageDestroy(dst2);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GD_BUNDLED
|
||||
dst3->alphaBlendingFlag = gdEffectReplace;
|
||||
#else
|
||||
gdImageAlphaBlending(dst3, 0);
|
||||
#endif
|
||||
|
||||
if (ignoretransparent) {
|
||||
dst3->transparent = dst2->transparent;
|
||||
}
|
||||
|
||||
if (dSinE >= 0.0) {
|
||||
dOffset = (double)(src->sx - 1) * dSinE * -dTan;
|
||||
} else {
|
||||
dOffset = dTan * ((double)(src->sx - 1) * -dSinE + (double)(1 - newy));
|
||||
}
|
||||
|
||||
for (u = 0; u < dst3->sy; u++, dOffset += dTan) {
|
||||
int iShear = (int)floor(dOffset);
|
||||
gdImageSkewX(dst3, dst2, u, iShear, (dOffset - iShear), clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
gdImageDestroy(dst2);
|
||||
|
||||
return dst3;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent)
|
||||
{
|
||||
gdImagePtr pMidImg;
|
||||
gdImagePtr rotatedImg;
|
||||
|
||||
if (src == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!gdImageTrueColor(src) && (clrBack < 0 || clrBack>=gdImageColorsTotal(src))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (dAngle >= 360.0) {
|
||||
dAngle -= 360.0;
|
||||
}
|
||||
|
||||
while (dAngle < 0) {
|
||||
dAngle += 360.0;
|
||||
}
|
||||
|
||||
if (dAngle == 90.00) {
|
||||
return gdImageRotate90(src, ignoretransparent);
|
||||
}
|
||||
if (dAngle == 180.00) {
|
||||
return gdImageRotate180(src, ignoretransparent);
|
||||
}
|
||||
if(dAngle == 270.00) {
|
||||
return gdImageRotate270 (src, ignoretransparent);
|
||||
}
|
||||
|
||||
if ((dAngle > 45.0) && (dAngle <= 135.0)) {
|
||||
pMidImg = gdImageRotate90 (src, ignoretransparent);
|
||||
dAngle -= 90.0;
|
||||
} else if ((dAngle > 135.0) && (dAngle <= 225.0)) {
|
||||
pMidImg = gdImageRotate180 (src, ignoretransparent);
|
||||
dAngle -= 180.0;
|
||||
} else if ((dAngle > 225.0) && (dAngle <= 315.0)) {
|
||||
pMidImg = gdImageRotate270 (src, ignoretransparent);
|
||||
dAngle -= 270.0;
|
||||
} else {
|
||||
return gdImageRotate45 (src, dAngle, clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
if (pMidImg == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack, ignoretransparent);
|
||||
gdImageDestroy(pMidImg);
|
||||
|
||||
return rotatedImg;
|
||||
}
|
||||
/* End Rotate function */
|
||||
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ gdImagePtr gdImageCreateFromXbm(FILE * fd)
|
||||
max_bit = 32768;
|
||||
}
|
||||
if (max_bit) {
|
||||
bytes = (width * height / 8) + 1;
|
||||
bytes = (width + 7) / 8 * height;
|
||||
if (!bytes) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
--TEST--
|
||||
Bug #47946 (ImageConvolution overwrites background)
|
||||
--DESCRIPTION--
|
||||
The expected image has black pixel artifacts, what is another issue, though
|
||||
(perhaps #40158).
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
function array_flatten($array)
|
||||
{
|
||||
$tempArray = array();
|
||||
|
||||
foreach ($array as $value) {
|
||||
if (is_array($value)) {
|
||||
$tempArray = array_merge($tempArray, array_flatten($value));
|
||||
} else {
|
||||
$tempArray[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $tempArray;
|
||||
}
|
||||
|
||||
function makeFilter($resource, $matrix, $offset = 1.0)
|
||||
{
|
||||
$divisor = array_sum(array_flatten($matrix));
|
||||
if ($divisor == 0) {
|
||||
$divisor = .01;
|
||||
}
|
||||
return imageconvolution($resource, $matrix, $divisor, $offset);
|
||||
}
|
||||
|
||||
$edgeMatrix = array(array(1, 0, 1), array(0, 5, 0), array(1, 0, 1));
|
||||
|
||||
$im = imagecreatetruecolor(40, 40);
|
||||
imagealphablending($im, false);
|
||||
imagefilledrectangle($im, 0, 0, 39, 39, 0x7fffffff);
|
||||
imagefilledellipse($im, 19, 19, 20, 20, 0x00ff00);
|
||||
imagesavealpha($im, true);
|
||||
makeFilter($im, $edgeMatrix);
|
||||
|
||||
require_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug47946_exp.png', $im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
===DONE===
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 396 B |
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug 73868 (DOS vulnerability in gdImageCreateFromGd2Ctx())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73868.gd2'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgd2(): gd2: EOF while reading
|
||||
in %s on line %d
|
||||
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #73869 (Signed Integer Overflow gd_io.c)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73869a.gd2'));
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73869b.gd2'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #73968 (Premature failing of XBM reading)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatefromxbm(__DIR__ . DIRECTORY_SEPARATOR . 'bug73968.xbm');
|
||||
var_dump($im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (gd)
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
#define test_width 10
|
||||
#define test_height 10
|
||||
static unsigned char test_bits[] = {
|
||||
0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00,
|
||||
0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
|
||||
@@ -11,9 +11,6 @@ $im = imagecreatefromxbm(dirname(__FILE__) . '/libgd00094私はガラスを食
|
||||
var_dump($im);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromxbm(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
|
||||
in %slibgd00094-mb.php on line %d
|
||||
|
||||
Warning: imagecreatefromxbm(): '%slibgd00094私はガラスを食べられます.xbm' is not a valid XBM file in %slibgd00094-mb.php on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -11,9 +11,6 @@ $im = imagecreatefromxbm(dirname(__FILE__) . '/libgd00094.xbm');
|
||||
var_dump($im);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromxbm(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
|
||||
in %slibgd00094.php on line %d
|
||||
|
||||
Warning: imagecreatefromxbm(): '%slibgd00094.xbm' is not a valid XBM file in %slibgd00094.php on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -3,8 +3,11 @@ PHP_ARG_WITH(gmp, for GNU MP support,
|
||||
|
||||
if test "$PHP_GMP" != "no"; then
|
||||
|
||||
MACHINE_INCLUDES=$($CC -dumpmachine)
|
||||
|
||||
for i in $PHP_GMP /usr/local /usr; do
|
||||
test -f $i/include/gmp.h && GMP_DIR=$i && break
|
||||
test -f $i/include/$MACHINE_INCLUDES/gmp.h && GMP_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GMP_DIR"; then
|
||||
|
||||
+126
-1
@@ -597,6 +597,122 @@ PHP_FUNCTION(hash_algos)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline zend_bool php_hash_is_crypto(const char *algo, size_t algo_len) {
|
||||
|
||||
char *blacklist[] = { "adler32", "crc32", "crc32b", "fnv132", "fnv1a32", "fnv164", "fnv1a64", "joaat", NULL };
|
||||
char *lower = zend_str_tolower_dup(algo, algo_len);
|
||||
int i = 0;
|
||||
|
||||
while (blacklist[i]) {
|
||||
if (strcmp(lower, blacklist[i]) == 0) {
|
||||
efree(lower);
|
||||
return 0;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
efree(lower);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* {{{ proto string hash_hkdf(string algo, string ikm [, int length = 0, string info = '', string salt = ''])
|
||||
RFC5869 HMAC-based key derivation function */
|
||||
PHP_FUNCTION(hash_hkdf)
|
||||
{
|
||||
zend_string *returnval, *ikm, *algo, *info = NULL, *salt = NULL;
|
||||
zend_long length = 0;
|
||||
unsigned char *prk, *digest, *K;
|
||||
int i, rounds;
|
||||
const php_hash_ops *ops;
|
||||
void *context;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|lSS", &algo, &ikm, &length, &info, &salt) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
ops = php_hash_fetch_ops(ZSTR_VAL(algo), ZSTR_LEN(algo));
|
||||
if (!ops) {
|
||||
php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", ZSTR_VAL(algo));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!php_hash_is_crypto(ZSTR_VAL(algo), ZSTR_LEN(algo))) {
|
||||
php_error_docref(NULL, E_WARNING, "Non-cryptographic hashing algorithm: %s", ZSTR_VAL(algo));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ZSTR_LEN(ikm) == 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Input keying material cannot be empty");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (length < 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
|
||||
RETURN_FALSE;
|
||||
} else if (length == 0) {
|
||||
length = ops->digest_size;
|
||||
} else if (length > ops->digest_size * 255) {
|
||||
php_error_docref(NULL, E_WARNING, "Length must be less than or equal to %d: " ZEND_LONG_FMT, ops->digest_size * 255, length);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
context = emalloc(ops->context_size);
|
||||
|
||||
// Extract
|
||||
ops->hash_init(context);
|
||||
K = emalloc(ops->block_size);
|
||||
php_hash_hmac_prep_key(K, ops, context,
|
||||
(unsigned char *) (salt ? ZSTR_VAL(salt) : ""), salt ? ZSTR_LEN(salt) : 0);
|
||||
|
||||
prk = emalloc(ops->digest_size);
|
||||
php_hash_hmac_round(prk, ops, context, K, (unsigned char *) ZSTR_VAL(ikm), ZSTR_LEN(ikm));
|
||||
php_hash_string_xor_char(K, K, 0x6A, ops->block_size);
|
||||
php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size);
|
||||
ZEND_SECURE_ZERO(K, ops->block_size);
|
||||
|
||||
// Expand
|
||||
returnval = zend_string_alloc(length, 0);
|
||||
digest = emalloc(ops->digest_size);
|
||||
for (i = 1, rounds = (length - 1) / ops->digest_size + 1; i <= rounds; i++) {
|
||||
// chr(i)
|
||||
unsigned char c[1];
|
||||
c[0] = (i & 0xFF);
|
||||
|
||||
php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size);
|
||||
ops->hash_init(context);
|
||||
ops->hash_update(context, K, ops->block_size);
|
||||
|
||||
if (i > 1) {
|
||||
ops->hash_update(context, digest, ops->digest_size);
|
||||
}
|
||||
|
||||
if (info != NULL && ZSTR_LEN(info) > 0) {
|
||||
ops->hash_update(context, (unsigned char *) ZSTR_VAL(info), ZSTR_LEN(info));
|
||||
}
|
||||
|
||||
ops->hash_update(context, c, 1);
|
||||
ops->hash_final(digest, context);
|
||||
php_hash_string_xor_char(K, K, 0x6A, ops->block_size);
|
||||
php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size);
|
||||
memcpy(
|
||||
ZSTR_VAL(returnval) + ((i - 1) * ops->digest_size),
|
||||
digest,
|
||||
(i == rounds ? length - ((i - 1) * ops->digest_size) : ops->digest_size)
|
||||
);
|
||||
}
|
||||
|
||||
ZEND_SECURE_ZERO(K, ops->block_size);
|
||||
ZEND_SECURE_ZERO(digest, ops->digest_size);
|
||||
ZEND_SECURE_ZERO(prk, ops->digest_size);
|
||||
efree(K);
|
||||
efree(context);
|
||||
efree(prk);
|
||||
efree(digest);
|
||||
ZSTR_VAL(returnval)[length] = 0;
|
||||
RETURN_STR(returnval);
|
||||
}
|
||||
|
||||
/* {{{ proto string hash_pbkdf2(string algo, string password, string salt, int iterations [, int length = 0, bool raw_output = false])
|
||||
Generate a PBKDF2 hash of the given password and salt
|
||||
Returns lowercase hexits by default */
|
||||
@@ -778,7 +894,7 @@ static void php_hash_dtor(zend_resource *rsrc) /* {{{ */
|
||||
}
|
||||
|
||||
if (hash->key) {
|
||||
memset(hash->key, 0, hash->ops->block_size);
|
||||
ZEND_SECURE_ZERO(hash->key, hash->ops->block_size);
|
||||
efree(hash->key);
|
||||
}
|
||||
efree(hash);
|
||||
@@ -1205,6 +1321,14 @@ ZEND_BEGIN_ARG_INFO(arginfo_hash_equals, 0)
|
||||
ZEND_ARG_INFO(0, user_string)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hkdf, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, ikm)
|
||||
ZEND_ARG_INFO(0, algo)
|
||||
ZEND_ARG_INFO(0, length)
|
||||
ZEND_ARG_INFO(0, string)
|
||||
ZEND_ARG_INFO(0, salt)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
/* BC Land */
|
||||
#ifdef PHP_MHASH_BC
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_mhash_get_block_size, 0)
|
||||
@@ -1253,6 +1377,7 @@ const zend_function_entry hash_functions[] = {
|
||||
PHP_FE(hash_algos, arginfo_hash_algos)
|
||||
PHP_FE(hash_pbkdf2, arginfo_hash_pbkdf2)
|
||||
PHP_FE(hash_equals, arginfo_hash_equals)
|
||||
PHP_FE(hash_hkdf, arginfo_hash_hkdf)
|
||||
|
||||
/* BC Land */
|
||||
#ifdef PHP_HASH_MD5_NOT_IN_CORE
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "php_hash.h"
|
||||
#include "php_hash_sha3.h"
|
||||
|
||||
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && \
|
||||
|
||||
@@ -130,6 +130,7 @@ extern zend_module_entry hash_module_entry;
|
||||
|
||||
PHP_FUNCTION(hash);
|
||||
PHP_FUNCTION(hash_file);
|
||||
PHP_FUNCTION(hash_hkdf);
|
||||
PHP_FUNCTION(hash_hmac);
|
||||
PHP_FUNCTION(hash_hmac_file);
|
||||
PHP_FUNCTION(hash_init);
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#define PHP_HASH_SHA3_H
|
||||
|
||||
#include "php.h"
|
||||
#include "ext/hash/php_hash.h"
|
||||
|
||||
typedef struct {
|
||||
unsigned char state[200]; // 5 * 5 * sizeof(uint64)
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
--TEST--
|
||||
Test hash_hkdf() function: basic functionality
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
|
||||
* Description: HMAC-based Key Derivation Function
|
||||
* Source code: ext/hash/hash.c
|
||||
*/
|
||||
|
||||
echo "*** Testing hash_hkdf(): basic functionality ***\n";
|
||||
|
||||
$ikm = 'input key material';
|
||||
|
||||
echo 'md2: ', bin2hex(hash_hkdf('md2', $ikm)), "\n";
|
||||
echo 'md4: ', bin2hex(hash_hkdf('md4', $ikm)), "\n";
|
||||
echo 'md5: ', bin2hex(hash_hkdf('md5', $ikm)), "\n";
|
||||
echo 'sha1: ', bin2hex(hash_hkdf('sha1', $ikm)), "\n";
|
||||
echo 'sha224: ', bin2hex(hash_hkdf('sha224', $ikm)), "\n";
|
||||
echo 'sha256: ', bin2hex(hash_hkdf('sha256', $ikm)), "\n";
|
||||
echo 'sha384: ', bin2hex(hash_hkdf('sha384', $ikm)), "\n";
|
||||
echo 'sha512: ', bin2hex(hash_hkdf('sha512', $ikm)), "\n";
|
||||
echo 'ripemd128: ', bin2hex(hash_hkdf('ripemd128', $ikm)), "\n";
|
||||
echo 'ripemd160: ', bin2hex(hash_hkdf('ripemd160', $ikm)), "\n";
|
||||
echo 'ripemd256: ', bin2hex(hash_hkdf('ripemd256', $ikm)), "\n";
|
||||
echo 'ripemd320: ', bin2hex(hash_hkdf('ripemd320', $ikm)), "\n";
|
||||
echo 'whirlpool: ', bin2hex(hash_hkdf('whirlpool', $ikm)), "\n";
|
||||
echo 'tiger128,3: ', bin2hex(hash_hkdf('tiger128,3', $ikm)), "\n";
|
||||
echo 'tiger160,3: ', bin2hex(hash_hkdf('tiger160,3', $ikm)), "\n";
|
||||
echo 'tiger192,3: ', bin2hex(hash_hkdf('tiger192,3', $ikm)), "\n";
|
||||
echo 'tiger128,4: ', bin2hex(hash_hkdf('tiger128,4', $ikm)), "\n";
|
||||
echo 'tiger160,4: ', bin2hex(hash_hkdf('tiger160,4', $ikm)), "\n";
|
||||
echo 'tiger192,4: ', bin2hex(hash_hkdf('tiger192,4', $ikm)), "\n";
|
||||
echo 'haval128,3: ', bin2hex(hash_hkdf('haval128,3', $ikm)), "\n";
|
||||
echo 'haval160,3: ', bin2hex(hash_hkdf('haval160,3', $ikm)), "\n";
|
||||
echo 'haval192,3: ', bin2hex(hash_hkdf('haval192,3', $ikm)), "\n";
|
||||
echo 'haval224,3: ', bin2hex(hash_hkdf('haval224,3', $ikm)), "\n";
|
||||
echo 'haval256,3: ', bin2hex(hash_hkdf('haval256,3', $ikm)), "\n";
|
||||
echo 'haval128,4: ', bin2hex(hash_hkdf('haval128,4', $ikm)), "\n";
|
||||
echo 'haval160,4: ', bin2hex(hash_hkdf('haval160,4', $ikm)), "\n";
|
||||
echo 'haval192,4: ', bin2hex(hash_hkdf('haval192,4', $ikm)), "\n";
|
||||
echo 'haval224,4: ', bin2hex(hash_hkdf('haval224,4', $ikm)), "\n";
|
||||
echo 'haval256,4: ', bin2hex(hash_hkdf('haval256,4', $ikm)), "\n";
|
||||
echo 'haval128,5: ', bin2hex(hash_hkdf('haval128,5', $ikm)), "\n";
|
||||
echo 'haval160,5: ', bin2hex(hash_hkdf('haval160,5', $ikm)), "\n";
|
||||
echo 'haval192,5: ', bin2hex(hash_hkdf('haval192,5', $ikm)), "\n";
|
||||
echo 'haval224,5: ', bin2hex(hash_hkdf('haval224,5', $ikm)), "\n";
|
||||
echo 'haval256,5: ', bin2hex(hash_hkdf('haval256,5', $ikm)), "\n";
|
||||
echo 'snefru: ', bin2hex(hash_hkdf('snefru', $ikm)), "\n";
|
||||
echo 'snefru256: ', bin2hex(hash_hkdf('snefru256', $ikm)), "\n";
|
||||
echo 'gost: ', bin2hex(hash_hkdf('gost', $ikm)), "\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing hash_hkdf(): basic functionality ***
|
||||
md2: 87779851d2377dab25da16fd7aadfdf5
|
||||
md4: 422c6bd8dd2a6baae8abadef618c3ede
|
||||
md5: 98b16391063ecee006a3ca8ee5776b1e
|
||||
sha1: a71863230e3782240265126a53e137af6667e988
|
||||
sha224: 51678ceb17e803505187b2cf6451c30fbc572fda165bb69bbd117c7a
|
||||
sha256: d8f0bede4b652933c32a92eccf7723f7eeb4701744c81325dc3f0fa9fda24499
|
||||
sha384: f600680e677bb417a7a22a4da8b167c0d91823a7a5d56a49aeb1838bb2320c05068d15d6d980824fee542a279d310c3a
|
||||
sha512: fb1b86549e941b81821a89ac6ba7c4f93465077b3f2af94352ebf1d041efcd3c5694469c1ae31bb10db4c1d2ab84f07e4518ba33a3eadd4a149425750285c640
|
||||
ripemd128: cb6418fc0dc9efaeb7e9654390fa7f14
|
||||
ripemd160: ba42dbb34f08e9337ace15295f218754a41d6c39
|
||||
ripemd256: f2e96b292935e2395b59833ed89d928ac1197ff62c8031ebc06a3f5bad19513f
|
||||
ripemd320: a13a682072525ceb4c4a5fef59096e682096e1096e6e7e238c7bd48a6f6c6a9ba3d7d9fbee6b68c4
|
||||
whirlpool: 497c717e04d896c3d582742c614435b7d0963b39de12dcf532540d39164b3b85214014620dfdff4a089a06b06aff43c39a3b4d9b806913cf6309de58ff1151f5
|
||||
tiger128,3: e13c2e7262892c6bd8dfc24121e7cb34
|
||||
tiger160,3: 48cc5a9f5e5d7029eb0544662222c0ba13822b7b
|
||||
tiger192,3: 5a665d23b6cbb405668160e58b01aebef74eba979f4bc70b
|
||||
tiger128,4: 8acf517ecf58cccbd65c1186d71e4116
|
||||
tiger160,4: cc0e33ee26700a2eb9a994bbb0e6cef29b429441
|
||||
tiger192,4: 97fa02d42331321fdc05c7f8dbc756d751ca36ce1aee69b0
|
||||
haval128,3: 2accab8029d42fb15fdbe9d3e2a470ca
|
||||
haval160,3: 496fd29e7fc8351d2971b96a3733a7b3de000064
|
||||
haval192,3: 238a731801439b1f195e1a1568ce75251e1dd719d904a8a2
|
||||
haval224,3: d863e596ff6b2bdba1ed7b313df1c3d177176312e81b47e9290f7566
|
||||
haval256,3: 96f555fe41255c34fe57b275f1ae40bbb8f07c6a2a6d68c849748fbb393ff443
|
||||
haval128,4: 9822af229cc59527a72e231a690fad3b
|
||||
haval160,4: 1bbbc4d632daaf94d5ba167efaa70af5b753effe
|
||||
haval192,4: dd12a8f8919cbf5632497f0918b30236371dd1b55f71e824
|
||||
haval224,4: 8af449fb4eb627eb8887507c1279a116ac4325b5806dd22e2f2af410
|
||||
haval256,4: bd74a6d5fa1ec23a92ce1fd76c36bc8be36f5eddbea821545a91810e1f8d6fc5
|
||||
haval128,5: 84564f3450a6ccf6041162207dc8acba
|
||||
haval160,5: b55cd1b3c514457b9e61c51ad22f302f6ec7cca1
|
||||
haval192,5: d1db7a8e69b327455d530d1ac60f774023b8b4bdd6bbbf92
|
||||
haval224,5: c5a2576511f1143c6e29f63d82d6e0be8f67d0bea448e27238be5000
|
||||
haval256,5: 9dbab73d13f1fd3a1b41398fe90ba1f298329681d861b023373c33f1051bd4d3
|
||||
snefru: 798eac954e5ece38e9acb63b50c1c2ecb799d34356358cec5a80eeeea91c8de9
|
||||
snefru256: 798eac954e5ece38e9acb63b50c1c2ecb799d34356358cec5a80eeeea91c8de9
|
||||
gost: 64edd584b87a2dfdd1f2b44ed2db8bd27af8386aafe751c2aebaed32dfa3852e
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Test hash_hkdf() function: edge cases
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
|
||||
* Description: HMAC-based Key Derivation Function
|
||||
* Source code: ext/hash/hash.c
|
||||
*/
|
||||
|
||||
echo "*** Testing hash_hkdf(): edge cases ***\n";
|
||||
|
||||
$ikm = 'input key material';
|
||||
|
||||
echo 'Length < digestSize: ', bin2hex(hash_hkdf('md5', $ikm, 7)), "\n";
|
||||
echo 'Length % digestSize != 0: ', bin2hex(hash_hkdf('md5', $ikm, 17)), "\n";
|
||||
echo 'Algo name case-sensitivity: ', (bin2hex(hash_hkdf('Md5', $ikm, 7)) === '98b16391063ece' ? 'true' : 'false'), "\n";
|
||||
echo "Non-crypto algo name case-sensitivity:\n";
|
||||
var_dump(hash_hkdf('jOaAt', $ikm));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing hash_hkdf(): edge cases ***
|
||||
Length < digestSize: 98b16391063ece
|
||||
Length % digestSize != 0: 98b16391063ecee006a3ca8ee5776b1e5f
|
||||
Algo name case-sensitivity: true
|
||||
Non-crypto algo name case-sensitivity:
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: jOaAt in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,100 @@
|
||||
--TEST--
|
||||
Test hash_hkdf() function: error conditions
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
|
||||
* Description: HMAC-based Key Derivation Function
|
||||
* Source code: ext/hash/hash.c
|
||||
*/
|
||||
|
||||
$ikm = 'input key material';
|
||||
|
||||
echo "*** Testing hash_hkdf(): error conditions ***\n";
|
||||
|
||||
echo "\n-- Testing hash_hkdf() function with less than expected no. of arguments --\n";
|
||||
var_dump(hash_hkdf());
|
||||
var_dump(hash_hkdf('sha1'));
|
||||
|
||||
echo "\n-- Testing hash_hkdf() function with more than expected no. of arguments --\n";
|
||||
var_dump(hash_hkdf('sha1', $ikm, 20, '', '', 'extra parameter'));
|
||||
|
||||
echo "\n-- Testing hash_hkdf() function with invalid hash algorithm --\n";
|
||||
var_dump(hash_hkdf('foo', $ikm));
|
||||
|
||||
echo "\n-- Testing hash_hkdf() function with non-cryptographic hash algorithm --\n";
|
||||
var_dump(hash_hkdf('adler32', $ikm));
|
||||
var_dump(hash_hkdf('crc32', $ikm));
|
||||
var_dump(hash_hkdf('crc32b', $ikm));
|
||||
var_dump(hash_hkdf('fnv132', $ikm));
|
||||
var_dump(hash_hkdf('fnv1a32', $ikm));
|
||||
var_dump(hash_hkdf('fnv164', $ikm));
|
||||
var_dump(hash_hkdf('fnv1a64', $ikm));
|
||||
var_dump(hash_hkdf('joaat', $ikm));
|
||||
|
||||
echo "\n-- Testing hash_hkdf() function with invalid parameters --\n";
|
||||
var_dump(hash_hkdf('sha1', ''));
|
||||
var_dump(hash_hkdf('sha1', $ikm, -1));
|
||||
var_dump(hash_hkdf('sha1', $ikm, 20 * 255 + 1)); // Length can't be more than 255 times the hash digest size
|
||||
?>
|
||||
===Done===
|
||||
--EXPECTF--
|
||||
*** Testing hash_hkdf(): error conditions ***
|
||||
|
||||
-- Testing hash_hkdf() function with less than expected no. of arguments --
|
||||
|
||||
Warning: hash_hkdf() expects at least 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: hash_hkdf() expects at least 2 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing hash_hkdf() function with more than expected no. of arguments --
|
||||
|
||||
Warning: hash_hkdf() expects at most 5 parameters, 6 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing hash_hkdf() function with invalid hash algorithm --
|
||||
|
||||
Warning: hash_hkdf(): Unknown hashing algorithm: foo in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing hash_hkdf() function with non-cryptographic hash algorithm --
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: adler32 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: crc32 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: crc32b in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv132 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv1a32 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv164 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv1a64 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Non-cryptographic hashing algorithm: joaat in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing hash_hkdf() function with invalid parameters --
|
||||
|
||||
Warning: hash_hkdf(): Input keying material cannot be empty in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Length must be greater than or equal to 0: -1 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: hash_hkdf(): Length must be less than or equal to 5100: 5101 in %s on line %d
|
||||
bool(false)
|
||||
===Done===
|
||||
@@ -0,0 +1,80 @@
|
||||
--TEST--
|
||||
Test hash_hkdf() function: RFC 5869 test vectors
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
|
||||
* Description: HMAC-based Key Derivation Function
|
||||
* Source code: ext/hash/hash.c
|
||||
*/
|
||||
|
||||
echo "*** Testing hash_hkdf(): RFC 5869 test vectors ***\n";
|
||||
echo "Test case 1 (SHA-256): ",
|
||||
bin2hex(hash_hkdf(
|
||||
'sha256',
|
||||
"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
|
||||
42,
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9",
|
||||
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c"
|
||||
)), "\n";
|
||||
echo "Test case 2 (SHA-256 with longer inputs/outputs): ",
|
||||
bin2hex(hash_hkdf(
|
||||
'sha256',
|
||||
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
|
||||
82,
|
||||
"\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
"\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
|
||||
)), "\n";
|
||||
echo "Test case 3 (SHA-256 with zero-length salt, info): ",
|
||||
bin2hex(hash_hkdf(
|
||||
'sha256',
|
||||
"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
|
||||
42,
|
||||
'',
|
||||
''
|
||||
)), "\n";
|
||||
echo "Test case 4 (SHA-1): ",
|
||||
bin2hex(hash_hkdf(
|
||||
'sha1',
|
||||
"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
|
||||
42,
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9",
|
||||
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c"
|
||||
)), "\n";
|
||||
echo "Test case 5 (SHA-1 with longer inputs/outputs): ",
|
||||
bin2hex(hash_hkdf(
|
||||
'sha1',
|
||||
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
|
||||
82,
|
||||
"\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
"\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
|
||||
)), "\n";
|
||||
echo "Test case 6 (SHA-1 with zero-length salt, info): ",
|
||||
bin2hex(hash_hkdf(
|
||||
'sha1',
|
||||
"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
|
||||
42,
|
||||
'',
|
||||
''
|
||||
)), "\n";
|
||||
echo "Test case 7 (SHA-1 with zero-length info, salt not provided): ",
|
||||
bin2hex(hash_hkdf(
|
||||
'sha1',
|
||||
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
|
||||
42,
|
||||
''
|
||||
)), "\n";
|
||||
?>
|
||||
===Done===
|
||||
--EXPECTF--
|
||||
*** Testing hash_hkdf(): RFC 5869 test vectors ***
|
||||
Test case 1 (SHA-256): 3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865
|
||||
Test case 2 (SHA-256 with longer inputs/outputs): b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87
|
||||
Test case 3 (SHA-256 with zero-length salt, info): 8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8
|
||||
Test case 4 (SHA-1): 085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2c22e422478d305f3f896
|
||||
Test case 5 (SHA-1 with longer inputs/outputs): 0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4
|
||||
Test case 6 (SHA-1 with zero-length salt, info): 0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918
|
||||
Test case 7 (SHA-1 with zero-length info, salt not provided): 2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48
|
||||
===Done===
|
||||
+1
-1
@@ -86,7 +86,7 @@ if test "$PHP_INTL" != "no"; then
|
||||
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)
|
||||
$icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,cxx)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/collator)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/converter)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/common)
|
||||
|
||||
@@ -110,7 +110,8 @@ PHP_FUNCTION(grapheme_strpos)
|
||||
size_t haystack_len, needle_len;
|
||||
const char *found;
|
||||
zend_long loffset = 0;
|
||||
int32_t offset = 0, noffset = 0;
|
||||
int32_t offset = 0;
|
||||
size_t noffset = 0;
|
||||
zend_long ret_pos;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) {
|
||||
|
||||
+2
-4
@@ -6,10 +6,8 @@ ARG_WITH("ldap", "LDAP support", "no");
|
||||
if (PHP_LDAP != "no") {
|
||||
|
||||
if (CHECK_HEADER_ADD_INCLUDE("ldap.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("lber.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP)
|
||||
&&
|
||||
CHECK_LIB("ssleay32.lib", "ldap", PHP_LDAP) &&
|
||||
CHECK_LIB("libeay32.lib", "ldap", PHP_LDAP) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("lber.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) &&
|
||||
SETUP_OPENSSL("ldap", PHP_LDAP) > 0 &&
|
||||
CHECK_LIB("oldap32_a.lib", "ldap", PHP_LDAP) &&
|
||||
CHECK_LIB("olber32_a.lib", "ldap", PHP_LDAP)&&
|
||||
CHECK_LIB("libsasl.lib", "ldap", PHP_LDAP)) {
|
||||
|
||||
+5
-2
@@ -1476,7 +1476,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
|
||||
zend_ulong index;
|
||||
int is_full_add=0; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &entry) != SUCCESS) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &link, &dn, &dn_len, &entry) != SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1524,6 +1524,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
|
||||
if (Z_TYPE_P(value) != IS_ARRAY) {
|
||||
num_values = 1;
|
||||
} else {
|
||||
SEPARATE_ARRAY(value);
|
||||
num_values = zend_hash_num_elements(Z_ARRVAL_P(value));
|
||||
}
|
||||
|
||||
@@ -1729,7 +1730,7 @@ PHP_FUNCTION(ldap_modify_batch)
|
||||
);
|
||||
*/
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &link, &dn, &dn_len, &mods) != SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1774,6 +1775,7 @@ PHP_FUNCTION(ldap_modify_batch)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
SEPARATE_ARRAY(mod);
|
||||
/* for the modification hashtable... */
|
||||
zend_hash_internal_pointer_reset(Z_ARRVAL_P(mod));
|
||||
num_modprops = zend_hash_num_elements(Z_ARRVAL_P(mod));
|
||||
@@ -1848,6 +1850,7 @@ PHP_FUNCTION(ldap_modify_batch)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
SEPARATE_ARRAY(modinfo);
|
||||
/* is the array not empty? */
|
||||
zend_hash_internal_pointer_reset(Z_ARRVAL_P(modinfo));
|
||||
num_modvals = zend_hash_num_elements(Z_ARRVAL_P(modinfo));
|
||||
|
||||
@@ -1,3 +1,74 @@
|
||||
To ease testing LDAP-Setups we've created a vagrant-setup.
|
||||
|
||||
Prerequisits:
|
||||
=============
|
||||
|
||||
You will need vagrant on your box. Get it from https://www.vagrantup.com
|
||||
|
||||
Usage:
|
||||
======
|
||||
|
||||
To use it follow these steps:
|
||||
|
||||
* Create a Vagrant-file with the following content.
|
||||
* Go to that directory and run "vagrant up"
|
||||
|
||||
```
|
||||
$setup = <<<SETUP
|
||||
apt-get update
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive aptitude install -q -y slapd ldap-utils
|
||||
|
||||
export SLAPPASS=`slappasswd -s password`
|
||||
|
||||
echo "dn: olcDatabase={1}hdb,cn=config
|
||||
changetype: modify
|
||||
replace: olcSuffix
|
||||
olcSuffix: dc=nodomain
|
||||
-
|
||||
replace: olcRootDN
|
||||
olcRootDN: dc=admin,dc=nodomain
|
||||
-
|
||||
replace: olcRootPW
|
||||
olcRootPW: ${SLAPPASS}" | ldapmodify -Y EXTERNAL -H ldapi:///
|
||||
|
||||
echo "dn: dc=nodomain
|
||||
objectClass: dcObject
|
||||
objectClass: organization
|
||||
o: Example
|
||||
dc: example
|
||||
|
||||
dn: ou=extldap,dc=nodomain
|
||||
objectClass: organizationalUnit
|
||||
ou: extldap" | ldapadd -c -x -H ldap://localhost:389 -D "dc=admin,dc=nodomain" -w password
|
||||
SETUP
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = "ubuntu/trusty64"
|
||||
config.vm.network "private_network", ip: "192.168.33.10"
|
||||
config.vm.provision "shell", inline: $setup
|
||||
end
|
||||
```
|
||||
|
||||
Now you will have a virtual machine up and running on IP-Address 192.168.10.33 listening on port 369 for incomming LDAP-connections. The machine is already configured to execute the LDAP-Tests
|
||||
|
||||
The next step is to go into the PHP-Source-directory. Configure and make the source as appropriate.
|
||||
|
||||
Before running the LDAP-Tests you need to set some environment-variables:
|
||||
|
||||
export LDAP_TEST_PASSWD="password"
|
||||
export LDAP_TEST_BASE="ou=extldap,dc=nodomain"
|
||||
export LDAP_TEST_USER="dc=admin,dc=nodomain"
|
||||
export LDAP_TEST_HOST=192.168.33.10
|
||||
|
||||
Now you can run the test-suite by calling "make test". To test only the LDAP-Tests, run "make test TESTS=ext/ldap"
|
||||
|
||||
CAVEAT: The current setup does not (yet) test secure connections.
|
||||
|
||||
|
||||
========
|
||||
OLD README
|
||||
|
||||
Most tests here relies on the availability of an LDAP server configured with TLS.
|
||||
|
||||
Client/Server configuration:
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #73933 (error/segfault with ldap_mod_replace and opcache)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* We are assuming 3333 is not connectable */
|
||||
$ldap = ldap_connect('127.0.0.1', 3333);
|
||||
|
||||
ldap_mod_replace($ldap, null, array(
|
||||
'lockoutTime' => array(0),
|
||||
));
|
||||
|
||||
ldap_modify_batch($ldap, null, array( [
|
||||
"attrib" => "mail",
|
||||
"modtype" => LDAP_MODIFY_BATCH_ADD,
|
||||
"values" => [
|
||||
"test@example.com",
|
||||
"test-2@example.com", ]]));
|
||||
|
||||
|
||||
ldap_close($ldap);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ldap_mod_replace(): Modify: Can't contact LDAP server in %sbug73933.php on line %d
|
||||
|
||||
Warning: ldap_modify_batch(): Batch Modify: Can't contact LDAP server in %sbug73933.php on line %d
|
||||
+3
-1
@@ -572,7 +572,9 @@ PHP_FUNCTION(mcrypt_generic_init)
|
||||
memcpy(key_s, key, key_len);
|
||||
|
||||
if (iv_len != (size_t)iv_size) {
|
||||
php_error_docref(NULL, E_WARNING, "Iv size incorrect; supplied length: %zd, needed: %d", iv_len, iv_size);
|
||||
if (mcrypt_enc_mode_has_iv(pm->td)) {
|
||||
php_error_docref(NULL, E_WARNING, "Iv size incorrect; supplied length: %zd, needed: %d", iv_len, iv_size);
|
||||
}
|
||||
if (iv_len > (size_t)iv_size) {
|
||||
iv_len = iv_size;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #67707 IV not needed for ECB encryption mode, but it returns a warning
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$td = mcrypt_module_open('rijndael-256', '', 'ecb', '');
|
||||
mcrypt_generic_init($td, 'secret key', NULL);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Function mcrypt_module_open() is deprecated in %s on line %d
|
||||
|
||||
Deprecated: Function mcrypt_generic_init() is deprecated in %s on line %d
|
||||
+1
-3
@@ -1315,9 +1315,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
|
||||
} else {
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
if (fci.params) {
|
||||
efree(fci.params);
|
||||
}
|
||||
zend_fcall_info_args_clear(&fci, 1);
|
||||
} else if (ctor_params) {
|
||||
zend_throw_exception_ex(zend_ce_exception, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #69899: Segfault on stmt close after free_result with mysqlnd.
|
||||
--DESCRIPTION--
|
||||
The segfault happens only if the database connection was already closed and
|
||||
free_result is called on a prepared statement followed by closing that
|
||||
statement. This is due to mysqlnd_stmt::free_result (mysqlnd_ps.c) which
|
||||
unconditionally sets the connection of the statement to ready, despite the fact
|
||||
that it might already be closed.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once __DIR__ . '/skipif.inc';
|
||||
require_once __DIR__ . '/skipifconnectfailure.inc';
|
||||
require_once __DIR__ . '/connect.inc';
|
||||
if (!$IS_MYSQLND) {
|
||||
die('mysqlnd only');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/connect.inc';
|
||||
|
||||
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
|
||||
|
||||
$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$stmt = $mysqli->prepare('SELECT 1');
|
||||
|
||||
var_dump(
|
||||
$mysqli->close(),
|
||||
$stmt->free_result(),
|
||||
$stmt->close()
|
||||
);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
NULL
|
||||
bool(true)
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #73949 (leak in mysqli_fetch_object)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
|
||||
class cc{
|
||||
function __construct($c=null){
|
||||
}
|
||||
};
|
||||
$i=mysqli_connect('p:'.$host, $user, $passwd, $db);
|
||||
$res=mysqli_query($i, "SHOW STATUS LIKE 'Connections'");
|
||||
$t=array(new stdClass);
|
||||
while($db= mysqli_fetch_object($res,'cc',$t)){}
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
@@ -2032,8 +2032,9 @@ MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s)
|
||||
stmt->state = MYSQLND_STMT_PREPARED;
|
||||
}
|
||||
|
||||
/* Line is free! */
|
||||
SET_CONNECTION_STATE(&conn->state, CONN_READY);
|
||||
if (GET_CONNECTION_STATE(&conn->state) != CONN_QUIT_SENT) {
|
||||
SET_CONNECTION_STATE(&conn->state, CONN_READY);
|
||||
}
|
||||
|
||||
DBG_RETURN(PASS);
|
||||
}
|
||||
|
||||
@@ -118,6 +118,8 @@ static zend_string *(*accelerator_orig_zend_resolve_path)(const char *filename,
|
||||
static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
|
||||
static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
|
||||
|
||||
static void accel_gen_system_id(void);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
# define INCREMENT(v) InterlockedIncrement64(&ZCSG(v))
|
||||
# define DECREMENT(v) InterlockedDecrement64(&ZCSG(v))
|
||||
@@ -2557,6 +2559,9 @@ static void accel_globals_ctor(zend_accel_globals *accel_globals)
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
#endif
|
||||
memset(accel_globals, 0, sizeof(zend_accel_globals));
|
||||
|
||||
/* TODO refactor to init this just once. */
|
||||
accel_gen_system_id();
|
||||
}
|
||||
|
||||
static void accel_globals_internal_func_dtor(zval *zv)
|
||||
@@ -2941,11 +2946,18 @@ void accel_shutdown(void)
|
||||
|
||||
void zend_accel_schedule_restart(zend_accel_restart_reason reason)
|
||||
{
|
||||
const char *zend_accel_restart_reason_text[ACCEL_RESTART_USER + 1] = {
|
||||
"out of memory",
|
||||
"hash overflow",
|
||||
"user",
|
||||
};
|
||||
|
||||
if (ZCSG(restart_pending)) {
|
||||
/* don't schedule twice */
|
||||
return;
|
||||
}
|
||||
zend_accel_error(ACCEL_LOG_DEBUG, "Restart Scheduled!");
|
||||
zend_accel_error(ACCEL_LOG_DEBUG, "Restart Scheduled! Reason: %s",
|
||||
zend_accel_restart_reason_text[reason]);
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
SHM_UNPROTECT();
|
||||
|
||||
@@ -102,6 +102,9 @@ static char *get_mmap_base_file(void)
|
||||
}
|
||||
GetTempPath(MAXPATHLEN, windir);
|
||||
l = strlen(windir);
|
||||
if ('\\' == windir[l-1]) {
|
||||
l--;
|
||||
}
|
||||
snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s@%.32s", ACCEL_FILEMAP_BASE, uname, ZCG(system_id));
|
||||
|
||||
free(uname);
|
||||
|
||||
@@ -18,7 +18,7 @@ $conf[4] = preg_replace("!^\\Q".dirname(__FILE__)."\\E!", "__DIR__", $conf[4]);
|
||||
print_r($conf);
|
||||
include("blacklist.inc");
|
||||
$status = opcache_get_status();
|
||||
print_r(count($status['scripts']));
|
||||
print_r(count($status['scripts']) > 0);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
|
||||
@@ -23,9 +23,9 @@ function php_cli_server_start($ini = "") {
|
||||
|
||||
// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
|
||||
// it might not be listening yet...need to wait until fsockopen() call returns
|
||||
$error = "Unable to connect to servers\n";
|
||||
$error = "Unable to connect to server\n";
|
||||
for ($i=0; $i < 60; $i++) {
|
||||
usleep(25000); // 25ms per try
|
||||
usleep(50000); // 50ms per try
|
||||
$status = proc_get_status($handle);
|
||||
$fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT);
|
||||
// Failure, the server is no longer running
|
||||
@@ -53,6 +53,14 @@ function php_cli_server_start($ini = "") {
|
||||
register_shutdown_function(
|
||||
function($handle) {
|
||||
proc_terminate($handle);
|
||||
/* Wait for server to shutdown */
|
||||
for ($i = 0; $i < 60; $i++) {
|
||||
$status = proc_get_status($handle);
|
||||
if (!($status && $status['running'])) {
|
||||
break;
|
||||
}
|
||||
usleep(50000);
|
||||
}
|
||||
},
|
||||
$handle
|
||||
);
|
||||
|
||||
@@ -14,7 +14,11 @@ opcache.log_verbosity_level=4
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Foo Bar\n";
|
||||
opcache_reset();
|
||||
echo "Opcache reset";
|
||||
?>
|
||||
--EXPECTF--
|
||||
%s Message Cached script '%sbasic_logging%s'
|
||||
Foo Bar
|
||||
%s Debug Restart Scheduled! Reason: user
|
||||
Opcache reset
|
||||
@@ -285,9 +285,9 @@ ZEND_INI_BEGIN()
|
||||
STD_PHP_INI_BOOLEAN("opcache.revalidate_path" , "0", PHP_INI_ALL , OnUpdateBool, accel_directives.revalidate_path , zend_accel_globals, accel_globals)
|
||||
|
||||
STD_PHP_INI_ENTRY("opcache.log_verbosity_level" , "1" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.log_verbosity_level, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.memory_consumption" , "64" , PHP_INI_SYSTEM, OnUpdateMemoryConsumption, accel_directives.memory_consumption, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.interned_strings_buffer", "4" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.interned_strings_buffer, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.max_accelerated_files" , "2000", PHP_INI_SYSTEM, OnUpdateMaxAcceleratedFiles, accel_directives.max_accelerated_files, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.memory_consumption" , "128" , PHP_INI_SYSTEM, OnUpdateMemoryConsumption, accel_directives.memory_consumption, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.interned_strings_buffer", "8" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.interned_strings_buffer, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.max_accelerated_files" , "10000", PHP_INI_SYSTEM, OnUpdateMaxAcceleratedFiles, accel_directives.max_accelerated_files, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.max_wasted_percentage" , "5" , PHP_INI_SYSTEM, OnUpdateMaxWastedPercentage, accel_directives.max_wasted_percentage, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.consistency_checks" , "0" , PHP_INI_ALL , OnUpdateLong, accel_directives.consistency_checks, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.force_restart_timeout" , "180" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.force_restart_timeout, zend_accel_globals, accel_globals)
|
||||
@@ -304,7 +304,7 @@ ZEND_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("opcache.optimization_level" , DEFAULT_OPTIMIZATION_LEVEL , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.optimization_level, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.opt_debug_level" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.opt_debug_level, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_BOOLEAN("opcache.enable_file_override" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_override_enabled, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "1" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.error_log" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.error_log, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.restrict_api" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.restrict_api, zend_accel_globals, accel_globals)
|
||||
|
||||
|
||||
@@ -33,6 +33,18 @@
|
||||
#define zend_accel_memdup(p, size) \
|
||||
_zend_shared_memdup((void*)p, size, 0)
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
#define zend_set_str_gc_flags(str) do { \
|
||||
if (ZCG(accel_directives).file_cache_only) { \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED; \
|
||||
} else { \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define zend_set_str_gc_flags(str) GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT
|
||||
#endif
|
||||
|
||||
#define zend_accel_store_string(str) do { \
|
||||
zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
|
||||
if (new_str) { \
|
||||
@@ -43,13 +55,13 @@
|
||||
zend_string_release(str); \
|
||||
str = new_str; \
|
||||
zend_string_hash_val(str); \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
|
||||
zend_set_str_gc_flags(str); \
|
||||
} \
|
||||
} while (0)
|
||||
#define zend_accel_memdup_string(str) do { \
|
||||
str = zend_accel_memdup(str, _ZSTR_STRUCT_SIZE(ZSTR_LEN(str))); \
|
||||
zend_string_hash_val(str); \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
|
||||
zend_set_str_gc_flags(str); \
|
||||
} while (0)
|
||||
#define zend_accel_store_interned_string(str) do { \
|
||||
if (!IS_ACCEL_INTERNED(str)) { \
|
||||
|
||||
+13
-6
@@ -4,15 +4,22 @@
|
||||
ARG_WITH("openssl", "OpenSSL support", "no");
|
||||
|
||||
if (PHP_OPENSSL != "no") {
|
||||
if (CHECK_LIB("ssleay32.lib", "openssl", PHP_OPENSSL) &&
|
||||
CHECK_LIB("libeay32.lib", "openssl", PHP_OPENSSL) &&
|
||||
CHECK_LIB("crypt32.lib", "openssl") &&
|
||||
CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_OPENSSL")) {
|
||||
EXTENSION("openssl", "openssl.c xp_ssl.c");
|
||||
var ret = SETUP_OPENSSL("openssl", PHP_OPENSSL);
|
||||
|
||||
if (ret > 0) {
|
||||
EXTENSION("openssl", "openssl.c xp_ssl.c");
|
||||
AC_DEFINE("HAVE_OPENSSL_EXT", PHP_OPENSSL_SHARED ? 0 : 1, "Have openssl");
|
||||
AC_DEFINE("HAVE_OPENSSL", 1);
|
||||
AC_DEFINE("HAVE_DSA_DEFAULT_METHOD", 1);
|
||||
|
||||
switch (ret) {
|
||||
/* Openssl 1.0.x and lower */
|
||||
case 1:
|
||||
AC_DEFINE("HAVE_DSA_DEFAULT_METHOD", 1);
|
||||
break;
|
||||
/* Openssl 1.1.x */
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+48
-8
@@ -836,9 +836,9 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
|
||||
}
|
||||
|
||||
for (i = 0; i < X509_NAME_entry_count(name); i++) {
|
||||
unsigned char *to_add;
|
||||
unsigned char *to_add = NULL;
|
||||
int to_add_len = 0;
|
||||
|
||||
int needs_free = 0;
|
||||
|
||||
ne = X509_NAME_get_entry(name, i);
|
||||
obj = X509_NAME_ENTRY_get_object(ne);
|
||||
@@ -852,8 +852,11 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
|
||||
|
||||
str = X509_NAME_ENTRY_get_data(ne);
|
||||
if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) {
|
||||
/* ASN1_STRING_to_UTF8(3): The converted data is copied into a newly allocated buffer */
|
||||
to_add_len = ASN1_STRING_to_UTF8(&to_add, str);
|
||||
needs_free = 1;
|
||||
} else {
|
||||
/* ASN1_STRING_data(3): Since this is an internal pointer it should not be freed or modified in any way */
|
||||
to_add = ASN1_STRING_data(str);
|
||||
to_add_len = ASN1_STRING_length(str);
|
||||
}
|
||||
@@ -874,7 +877,13 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
|
||||
} else {
|
||||
php_openssl_store_errors();
|
||||
}
|
||||
|
||||
if (needs_free) {
|
||||
/* ASN1_STRING_to_UTF8(3): The buffer out should be freed using free(3) */
|
||||
OPENSSL_free(to_add);
|
||||
}
|
||||
}
|
||||
|
||||
if (key != NULL) {
|
||||
zend_hash_str_update(Z_ARRVAL_P(val), key, strlen(key), &subitem);
|
||||
}
|
||||
@@ -1171,7 +1180,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
|
||||
&& Z_TYPE_P(item) == IS_STRING) {
|
||||
req->curve_name = OBJ_sn2nid(Z_STRVAL_P(item));
|
||||
if (req->curve_name == NID_undef) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown elliptic curve (short) name %s", Z_STRVAL_P(item));
|
||||
php_error_docref(NULL, E_WARNING, "Unknown elliptic curve (short) name %s", Z_STRVAL_P(item));
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
@@ -2266,6 +2275,10 @@ PHP_FUNCTION(openssl_x509_parse)
|
||||
char *extname;
|
||||
BIO *bio_out;
|
||||
BUF_MEM *bio_buf;
|
||||
ASN1_INTEGER *asn1_serial;
|
||||
BIGNUM *bn_serial;
|
||||
char *str_serial;
|
||||
char *hex_serial;
|
||||
char buf[256];
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcert, &useshortnames) == FAILURE) {
|
||||
@@ -2293,7 +2306,30 @@ PHP_FUNCTION(openssl_x509_parse)
|
||||
add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames);
|
||||
add_assoc_long(return_value, "version", X509_get_version(cert));
|
||||
|
||||
add_assoc_string(return_value, "serialNumber", i2s_ASN1_INTEGER(NULL, X509_get_serialNumber(cert)));
|
||||
asn1_serial = X509_get_serialNumber(cert);
|
||||
|
||||
bn_serial = ASN1_INTEGER_to_BN(asn1_serial, NULL);
|
||||
/* Can return NULL on error or memory allocation failure */
|
||||
if (!bn_serial) {
|
||||
php_openssl_store_errors();
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
hex_serial = BN_bn2hex(bn_serial);
|
||||
BN_free(bn_serial);
|
||||
/* Can return NULL on error or memory allocation failure */
|
||||
if (!hex_serial) {
|
||||
php_openssl_store_errors();
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
str_serial = i2s_ASN1_INTEGER(NULL, asn1_serial);
|
||||
add_assoc_string(return_value, "serialNumber", str_serial);
|
||||
OPENSSL_free(str_serial);
|
||||
|
||||
/* Return the hex representation of the serial number, as defined by OpenSSL */
|
||||
add_assoc_string(return_value, "serialNumberHex", hex_serial);
|
||||
OPENSSL_free(hex_serial);
|
||||
|
||||
add_assoc_asn1_string(return_value, "validFrom", X509_get_notBefore(cert));
|
||||
add_assoc_asn1_string(return_value, "validTo", X509_get_notAfter(cert));
|
||||
@@ -3883,7 +3919,7 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
|
||||
case OPENSSL_KEYTYPE_EC:
|
||||
{
|
||||
if (req->curve_name == NID_undef) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing configuration value: 'curve_name' not set");
|
||||
php_error_docref(NULL, E_WARNING, "Missing configuration value: 'curve_name' not set");
|
||||
return NULL;
|
||||
}
|
||||
EC_KEY *eckey = EC_KEY_new_by_curve_name(req->curve_name);
|
||||
@@ -6220,6 +6256,7 @@ static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
|
||||
}
|
||||
|
||||
if (!EVP_CipherInit_ex(cipher_ctx, cipher_type, NULL, NULL, NULL, enc)) {
|
||||
php_openssl_store_errors();
|
||||
return FAILURE;
|
||||
}
|
||||
if (php_openssl_validate_iv(piv, piv_len, max_iv_len, free_iv, cipher_ctx, mode) == FAILURE) {
|
||||
@@ -6235,10 +6272,11 @@ static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
if (password_len > key_len) {
|
||||
EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len);
|
||||
if (password_len > key_len && !EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len)) {
|
||||
php_openssl_store_errors();
|
||||
}
|
||||
if (!EVP_CipherInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)*piv, enc)) {
|
||||
php_openssl_store_errors();
|
||||
return FAILURE;
|
||||
}
|
||||
if (options & OPENSSL_ZERO_PADDING) {
|
||||
@@ -6257,11 +6295,13 @@ static int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
|
||||
int i = 0;
|
||||
|
||||
if (mode->is_single_run_aead && !EVP_EncryptUpdate(cipher_ctx, NULL, &i, NULL, (int)data_len)) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "Setting of data length failed");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (mode->is_aead && !EVP_CipherUpdate(cipher_ctx, NULL, &i, (unsigned char *)aad, (int)aad_len)) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "Setting of additional application data failed");
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -6278,6 +6318,7 @@ static int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
|
||||
php_error_docref(NULL, E_WARNING, enc ? "Encryption failed" : "Decryption failed");
|
||||
}
|
||||
*/
|
||||
php_openssl_store_errors();
|
||||
zend_string_release(*poutbuf);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -6327,7 +6368,6 @@ PHP_FUNCTION(openssl_encrypt)
|
||||
|
||||
php_openssl_load_cipher_mode(&mode, cipher_type);
|
||||
|
||||
|
||||
if (php_openssl_cipher_init(cipher_type, cipher_ctx, &mode,
|
||||
&password, &password_len, &free_password,
|
||||
&iv, &iv_len, &free_iv, NULL, tag_len, options, 1) == FAILURE ||
|
||||
|
||||
@@ -20,7 +20,7 @@ var_dump(openssl_x509_parse($cert));
|
||||
var_dump(openssl_x509_parse($cert, false));
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(15) {
|
||||
array(16) {
|
||||
["name"]=>
|
||||
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
|
||||
["subject"]=>
|
||||
@@ -55,6 +55,8 @@ array(15) {
|
||||
int(2)
|
||||
["serialNumber"]=>
|
||||
string(20) "12593567369101004962"
|
||||
["serialNumberHex"]=>
|
||||
string(16) "AEC556CC723750A2"
|
||||
["validFrom"]=>
|
||||
string(13) "080630102843Z"
|
||||
["validTo"]=>
|
||||
@@ -166,7 +168,7 @@ serial:AE:C5:56:CC:72:37:50:A2
|
||||
string(7) "CA:TRUE"
|
||||
}
|
||||
}
|
||||
array(15) {
|
||||
array(16) {
|
||||
["name"]=>
|
||||
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
|
||||
["subject"]=>
|
||||
@@ -201,6 +203,8 @@ array(15) {
|
||||
int(2)
|
||||
["serialNumber"]=>
|
||||
string(20) "12593567369101004962"
|
||||
["serialNumberHex"]=>
|
||||
string(16) "AEC556CC723750A2"
|
||||
["validFrom"]=>
|
||||
string(13) "080630102843Z"
|
||||
["validTo"]=>
|
||||
|
||||
@@ -585,6 +585,11 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
|
||||
{
|
||||
PCCERT_CONTEXT cert_ctx = NULL;
|
||||
PCCERT_CHAIN_CONTEXT cert_chain_ctx = NULL;
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
X509 *cert = x509_store_ctx->cert;
|
||||
#else
|
||||
X509 *cert = X509_STORE_CTX_get0_cert(x509_store_ctx);
|
||||
#endif
|
||||
|
||||
php_stream *stream;
|
||||
php_openssl_netstream_data_t *sslsock;
|
||||
@@ -599,7 +604,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
|
||||
unsigned char *der_buf = NULL;
|
||||
int der_len;
|
||||
|
||||
der_len = i2d_X509(x509_store_ctx->cert, &der_buf);
|
||||
der_len = i2d_X509(cert, &der_buf);
|
||||
if (der_len < 0) {
|
||||
unsigned long err_code, e;
|
||||
char err_buf[512];
|
||||
@@ -676,7 +681,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
|
||||
int index, cert_name_utf8_len;
|
||||
DWORD num_wchars;
|
||||
|
||||
cert_name = X509_get_subject_name(x509_store_ctx->cert);
|
||||
cert_name = X509_get_subject_name(cert);
|
||||
index = X509_NAME_get_index_by_NID(cert_name, NID_commonName, -1);
|
||||
if (index < 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to locate certificate CN");
|
||||
@@ -1916,7 +1921,7 @@ static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, siz
|
||||
}
|
||||
|
||||
/* never use a timeout with non-blocking sockets */
|
||||
if (began_blocked && &sslsock->s.timeout) {
|
||||
if (began_blocked) {
|
||||
timeout = &sslsock->s.timeout;
|
||||
}
|
||||
|
||||
|
||||
+3
-12
@@ -560,11 +560,6 @@ PHP_RSHUTDOWN_FUNCTION(pcntl)
|
||||
while (PCNTL_G(head)) {
|
||||
sig = PCNTL_G(head);
|
||||
PCNTL_G(head) = sig->next;
|
||||
#ifdef HAVE_STRUCT_SIGINFO_T
|
||||
if (sig->siginfo) {
|
||||
zend_array_destroy(sig->siginfo);
|
||||
}
|
||||
#endif
|
||||
efree(sig);
|
||||
}
|
||||
while (PCNTL_G(spares)) {
|
||||
@@ -1379,11 +1374,7 @@ static void pcntl_signal_handler(int signo)
|
||||
psig->next = NULL;
|
||||
|
||||
#ifdef HAVE_STRUCT_SIGINFO_T
|
||||
zval user_siginfo;
|
||||
array_init(&user_siginfo);
|
||||
pcntl_siginfo_to_zval(signo, siginfo, &user_siginfo);
|
||||
psig->siginfo = zend_array_dup(Z_ARRVAL(user_siginfo));
|
||||
zval_ptr_dtor(&user_siginfo);
|
||||
psig->siginfo = *siginfo;
|
||||
#endif
|
||||
|
||||
/* the head check is important, as the tick handler cannot atomically clear both
|
||||
@@ -1428,14 +1419,14 @@ void pcntl_signal_dispatch()
|
||||
PCNTL_G(head) = NULL; /* simple stores are atomic */
|
||||
|
||||
/* Allocate */
|
||||
|
||||
while (queue) {
|
||||
if ((handle = zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo)) != NULL) {
|
||||
if (Z_TYPE_P(handle) != IS_LONG) {
|
||||
ZVAL_NULL(&retval);
|
||||
ZVAL_LONG(¶ms[0], queue->signo);
|
||||
#ifdef HAVE_STRUCT_SIGINFO_T
|
||||
ZVAL_ARR(¶ms[1], queue->siginfo);
|
||||
array_init(¶ms[1]);
|
||||
pcntl_siginfo_to_zval(queue->signo, &queue->siginfo, ¶ms[1]);
|
||||
#else
|
||||
ZVAL_NULL(¶ms[1]);
|
||||
#endif
|
||||
|
||||
@@ -77,7 +77,7 @@ struct php_pcntl_pending_signal {
|
||||
struct php_pcntl_pending_signal *next;
|
||||
zend_long signo;
|
||||
#ifdef HAVE_STRUCT_SIGINFO_T
|
||||
zend_array *siginfo;
|
||||
siginfo_t siginfo;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -217,7 +217,23 @@ static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
|
||||
}
|
||||
memmove(cp, var->aliasname, var->aliasname_length);
|
||||
*(cp+var->aliasname_length) = '\0';
|
||||
col->param_type = PDO_PARAM_STR;
|
||||
|
||||
if (var->sqlscale < 0) {
|
||||
col->param_type = PDO_PARAM_STR;
|
||||
} else {
|
||||
switch (var->sqltype & ~1) {
|
||||
case SQL_SHORT:
|
||||
case SQL_LONG:
|
||||
#if SIZEOF_ZEND_LONG >= 8
|
||||
case SQL_INT64:
|
||||
#endif
|
||||
col->param_type = PDO_PARAM_INT;
|
||||
break;
|
||||
default:
|
||||
col->param_type = PDO_PARAM_STR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -373,16 +389,24 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{
|
||||
*len = var->sqllen;
|
||||
break;
|
||||
case SQL_SHORT:
|
||||
*ptr = FETCH_BUF(S->fetch_buf[colno], char, CHAR_BUF_LEN, NULL);
|
||||
*len = slprintf(*ptr, CHAR_BUF_LEN, "%d", *(short*)var->sqldata);
|
||||
*len = sizeof(zend_long);
|
||||
*ptr = FETCH_BUF(S->fetch_buf[colno], zend_long, 1, NULL);
|
||||
*(zend_long *)*ptr = *(short*)var->sqldata;
|
||||
break;
|
||||
case SQL_LONG:
|
||||
*ptr = FETCH_BUF(S->fetch_buf[colno], char, CHAR_BUF_LEN, NULL);
|
||||
*len = slprintf(*ptr, CHAR_BUF_LEN, "%d", *(ISC_LONG*)var->sqldata);
|
||||
*len = sizeof(zend_long);
|
||||
*ptr = FETCH_BUF(S->fetch_buf[colno], zend_long, 1, NULL);
|
||||
*(zend_long *)*ptr = *(ISC_LONG*)var->sqldata;
|
||||
break;
|
||||
case SQL_INT64:
|
||||
#if SIZEOF_ZEND_LONG >= 8
|
||||
*len = sizeof(zend_long);
|
||||
*ptr = FETCH_BUF(S->fetch_buf[colno], zend_long, 1, NULL);
|
||||
*(zend_long *)*ptr = *(ISC_INT64*)var->sqldata;
|
||||
#else
|
||||
*ptr = FETCH_BUF(S->fetch_buf[colno], char, CHAR_BUF_LEN, NULL);
|
||||
*len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata);
|
||||
#endif
|
||||
break;
|
||||
case SQL_FLOAT:
|
||||
*ptr = FETCH_BUF(S->fetch_buf[colno], char, CHAR_BUF_LEN, NULL);
|
||||
|
||||
Loaded 100 of 197 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user