Skip to content

Commit fa11c7c

Browse files
author
Yasuo Ohgaki
committed
Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (270 commits) Fixed bug #65939 (Space before ";" breaks php.ini parsing). (brainstorm at nopcode dot org) exif NEWS add tests for bug #62523 Merged PR #293 (Exif crash on unknown encoding was fixed) By: Draal Conflicts: configure.in main/php_version.h fix bug #65936 (dangling context pointer causes crash) remove TRAVIS check in test source Fixed compilation warning Just SKIP that test on travis Fixed issue #115 (path issue when using phar). fix memory leak on error (from Coverity scan) fix argument type & remove warning fix const warnings in intl methods Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag fix possibility of access to *storedType without initialization Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag 5.4.21 release date fix argument type & remove warning fix const warnings in intl methods When src->src is null this doesn't get initialized but it is still used, so the passed in *ze will point to unitialized memory. Hopefully src->src is never null, but just in case this initialization doesn't hurt. Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag ...
2 parents 09ed50f + b3a2b44 commit fa11c7c

File tree

514 files changed

+13887
-7520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

514 files changed

+13887
-7520
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ before_script:
2929
- . ./travis/ext/pdo_pgsql/setup.sh
3030

3131
# Run PHPs run-tests.php
32-
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff
32+
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120

CODING_STANDARDS

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Naming Conventions
151151

152152
7. Classes should be given descriptive names. Avoid using abbreviations where
153153
possible. Each word in the class name should start with a capital letter,
154-
without underscore delimiters (CampelCaps starting with a capital letter).
154+
without underscore delimiters (CamelCaps starting with a capital letter).
155155
The class name should be prefixed with the name of the 'parent set' (e.g.
156156
the name of the extension)::
157157

NEWS

+43-12
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,28 @@ PHP NEWS
66
. Improved IS_VAR operands fetching. (Laruence, Dmitry)
77
. Implemented internal operator overloading
88
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
9+
. Made calls from incompatible context issue an E_DEPRECATED warning instead
10+
of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx).
11+
(Gustavo)
12+
. Uploads equal or greater than 2GB in size are now accepted.
13+
(Ralf Lang, Mike)
14+
. Reduced POST data memory usage by 200-300%. Removed INI setting
15+
always_populate_raw_post_data and the $HTTP_RAW_POST_DATA global
16+
variable. (Mike)
17+
. Implemented dedicated syntax for variadic functions
18+
(RFC: https://wiki.php.net/rfc/variadics). (Nikita)
919

10-
- Session:
11-
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
12-
(Yasuo)
13-
. Implemented Request #54649 (Create session_serializer_name()). (Yasuo)
14-
. Implemented Request #17860 (Session write short circuit). (Yasuo)
15-
. Implemented Request #20421 (session_abort() and session_reset() function).
16-
(Yasuo)
17-
. Implemented Request #11100 (session_gc() function). (Yasuo)
20+
- cURL:
21+
. Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir
22+
or safe_mode). (Adam)
23+
24+
- GMP:
25+
. Moved GMP to use object as the underlying structure and implemented various
26+
improvements based on this.
27+
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
28+
29+
- Hash:
30+
. Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz)
1831

1932
- mysqlnd:
2033
. Disabled flag for SP OUT variables for 5.5+ servers as they are not natively
@@ -27,14 +40,32 @@ PHP NEWS
2740
cache_slots) in op_array->literals table. (Laruence, Dmitry)
2841
. Added script level constant replacement optimization pass. (Dmitry)
2942

43+
- Openssl:
44+
. Added crypto_method option for the ssl stream context. (Martin Jansen)
45+
. Added certificate fingerprint support. (Tjerk Meesters)
46+
. Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey)
47+
. Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters)
48+
3049
- PDO_pgsql:
3150
. Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo)
3251
. Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3
3352
syntax). (Matteo)
3453

35-
- GMP:
36-
. Moved GMP to use object as the underlying structure and implemented various
37-
improvements based on this.
38-
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
54+
- Session:
55+
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
56+
(Yasuo)
57+
. Implemented Request #54649 (Create session_serializer_name()). (Yasuo)
58+
. Implemented Request #17860 (Session write short circuit). (Yasuo)
59+
. Implemented Request #20421 (session_abort() and session_reset() function).
60+
(Yasuo)
61+
. Implemented Request #11100 (session_gc() function). (Yasuo)
62+
63+
- Standard:
64+
. Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
65+
1.1). (Adam)
66+
67+
- XMLReader:
68+
. Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency).
69+
(Mike)
3970

4071
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

README.EXT_SKEL

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ HOW TO USE IT
3131

3232
./buildconf; ./configure --enable-module_name; make
3333

34+
The definition of PHP_MODULE_NAME_VERSION will be present in the
35+
php_module_name.h and injected into the zend_module_entry definition. This
36+
is required by the PECL website for the version string conformity checks
37+
against package.xml
38+
3439
But if you already have planned the overall scheme of your module, what
3540
functions it will contain, their return types and the arguments they take
3641
(a very good idea) and don't want to bother yourself with creating function

README.SELF-CONTAINED-EXTENSIONS

+15
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,18 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
153153
#ifdef COMPILE_DL_FOO
154154
ZEND_GET_MODULE(foo)
155155
#endif
156+
157+
PECL SITE CONFORMITY
158+
159+
If you plan to release an extension to the PECL website, there are several
160+
points to be regarded.
161+
162+
1. Add LICENSE or COPYING to the package.xml
163+
164+
2. The following should be defined in one of the extension header files
165+
166+
#define PHP_FOO_VERSION "1.2.3"
167+
168+
This macros has to be used within your foo_module_entry to indicate the
169+
extension version.
170+

UPGRADING

+36
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,32 @@ PHP X.Y UPGRADE NOTES
2020
1. Backward Incompatible Changes
2121
========================================
2222

23+
- Core:
24+
Removed $HTTP_RAW_POST_DATA global variable. Restore backwards compatibility
25+
by:
26+
<?php
27+
global $HTTP_RAW_POST_DATA;
28+
if (!isset($HTTP_RAW_POST_DATA)) {
29+
$HTTP_RAW_POST_DATA = file_get_contents("php://input");
30+
}
31+
?>
2332

2433
========================================
2534
2. New Features
2635
========================================
2736

37+
- Added dedicated syntax for variadic functions.
38+
(https://wiki.php.net/rfc/variadics)
39+
40+
- The php://input stream is now re-usable and can be used concurrently with
41+
enable_post_data_reading=0.
42+
43+
- Added gost-crypto (CryptoPro S-box) hash algo.
44+
45+
- Added openssl certificate fingerprint support (inclusive stream context
46+
option).
47+
48+
- Added openssl crypto method stream context option.
2849

2950
========================================
3051
2. Changes in SAPI modules
@@ -35,6 +56,9 @@ PHP X.Y UPGRADE NOTES
3556
3. Deprecated Functionality
3657
========================================
3758

59+
- Incompatible context calls:
60+
Instance calls from an incompatible context are now deprecated and issue
61+
E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx
3862

3963
========================================
4064
4. Changed Functions
@@ -44,10 +68,16 @@ PHP X.Y UPGRADE NOTES
4468
CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
4569
do not work unless it is explicitly set to false.
4670

71+
- XMLReader:
72+
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
73+
the attribute could not be found, just like XMLReader::getAttribute.
74+
4775
========================================
4876
5. New Functions
4977
========================================
5078

79+
- Openssl:
80+
Added string openssl_x509_fingerprint($x509, $type, $binary).
5181

5282
========================================
5383
6. New Classes and Interfaces
@@ -88,10 +118,16 @@ PHP X.Y UPGRADE NOTES
88118
10. Changes to INI File Handling
89119
========================================
90120

121+
- Core:
122+
Removed always_populate_raw_post_data.
91123

92124
========================================
93125
11. Other Changes
94126
========================================
95127

96128
- File upload:
97129
Uploads equal or greater than 2GB in size are now accepted.
130+
131+
- HTTP stream wrapper:
132+
HTTP 1.1 requests now include a Connection: close header unless explicitly
133+
overridden by setting a Connection header via the header context option.

UPGRADING.INTERNALS

+67
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ UPGRADE NOTES - PHP X.Y
44

55
1. Internal API changes
66
a. Addition of do_operation and compare object handlers
7+
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
8+
c. POST data handling
9+
d. Arginfo changes
710

811
2. Build system changes
912
a. Unix build system changes
@@ -43,6 +46,70 @@ UPGRADE NOTES - PHP X.Y
4346

4447
Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp
4548

49+
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
50+
51+
The return_value_ptr argument to internal functions is now always set.
52+
Previously it was only available for functions returning by-reference.
53+
return_value_ptr can now be used to return zvals without copying them.
54+
For this purpose two new macros are provided:
55+
56+
RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */
57+
RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */
58+
59+
The macros behave similarly to the non-FAST variants with copy=1 and
60+
dtor=0, but will try to return the zval without making a copy by utilizing
61+
return_value_ptr.
62+
63+
c. POST data handling
64+
65+
The sapi_request_info's members post_data, post_data_len and raw_post_data as
66+
well as raw_post_data_len have been replaced with a temp PHP stream
67+
request_body.
68+
69+
The recommended way to access raw POST data is to open and use a php://input
70+
stream wrapper. It is safe to be used concurrently and more than once.
71+
72+
d. Arginfo changes
73+
74+
The pass_rest_by_reference argument of the ZEND_BEGIN_ARG_INFO and
75+
ZEND_BEGIN_ARG_INFO_EX() is no longer used. The value passed to it is ignored.
76+
77+
Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO():
78+
79+
ZEND_ARG_VARIADIC_INFO(0, name) /* pass rest by value */
80+
ZEND_ARG_VARIADIC_INFO(1, name) /* pass rest by reference */
81+
ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, name)
82+
/* pass rest by prefer-ref */
83+
84+
ZEND_ARG_VARIADIC_INFO() should only be used for the last argument.
85+
86+
The following changes were applied to the zend_arg_info struct:
87+
88+
typedef struct _zend_arg_info {
89+
const char *class_name;
90+
zend_uint class_name_len;
91+
zend_uchar type_hint;
92+
+ zend_uchar pass_by_reference;
93+
zend_bool allow_null;
94+
- zend_bool pass_by_reference;
95+
+ zend_bool is_variadic;
96+
} zend_arg_info;
97+
98+
The following changes were applied to the zend_internal_function_info struct:
99+
100+
typedef struct _zend_internal_function_info {
101+
zend_uint required_num_args;
102+
zend_uchar _type_hint;
103+
zend_bool return_reference;
104+
- zend_bool pass_rest_by_reference;
105+
+ zend_bool _allow_null;
106+
+ zend_bool _is_variadic;
107+
} zend_internal_function_info;
108+
109+
The CHECK_ARG_SEND_TYPE(), ARG_MUST_BE_SENT_BY_REF(),
110+
ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume
111+
that the argument passed to them is a zend_function* and that it is non-NULL.
112+
46113
========================
47114
2. Build system changes
48115
========================

Zend/RFCs/003.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Modified: 2001-09-17
99
1. Background/Need
1010
==================
1111

12-
Many internal function of PHP will reject parameters because of their
12+
Many internal functions of PHP will reject parameters because of their
1313
type (the array and variable function come to mind). For userland
1414
this is not an easy task as there is no uniform way to do it. An
1515
addition to the engine for requiring loose types would allow
16-
delevopers to know that the data passed to their functions is of the
16+
developers to know that the data passed to their functions are of the
1717
correct type and reduce the need for duplicating the same code in
1818
every function to check for the type of data.
1919

@@ -57,7 +57,7 @@ function foo (array $var){
5757
===========
5858

5959
Mis-matches in type should be reported as fatal errors and should halt
60-
the execution of a script as that function can not be run and code
60+
the execution of a script as that function cannot be run and code
6161
following could not reliably run.
6262

6363

Zend/acinclude.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
99
# non-working versions, e.g. "3.0 3.2";
1010
# remove "none" when introducing the first incompatible bison version an
1111
# separate any following additions by spaces
12-
bison_version_exclude="none"
12+
bison_version_exclude="3.0"
1313
1414
# for standalone build of Zend Engine
1515
test -z "$SED" && SED=sed

Zend/tests/bug60598.phpt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Bug #60598 (cli/apache sapi segfault on objects manipulation)
3+
--FILE--
4+
<?php
5+
define('OBJECT_COUNT', 10000);
6+
7+
$containers = array();
8+
9+
class Object {
10+
protected $_guid = 0;
11+
public function __construct() {
12+
global $containers;
13+
$this->guid = 1;
14+
$containers[spl_object_hash($this)] = $this;
15+
}
16+
public function __destruct() {
17+
global $containers;
18+
$containers[spl_object_hash($this)] = NULL;
19+
}
20+
}
21+
22+
for ($i = 0; $i < OBJECT_COUNT; ++$i) {
23+
new Object();
24+
}
25+
26+
// You probably won't see this because of the "zend_mm_heap corrupted"
27+
?>
28+
If you see this, try to increase OBJECT_COUNT to 100,000
29+
--EXPECT--
30+
If you see this, try to increase OBJECT_COUNT to 100,000

Zend/tests/bug64896.phpt

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--TEST--
2+
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
3+
--XFAIL--
4+
We can not fix this bug without a significant (performace slow down) change to gc
5+
--FILE--
6+
<?php
7+
$bar = NULL;
8+
class bad
9+
{
10+
private $_private = array();
11+
12+
public function __construct()
13+
{
14+
$this->_private[] = 'php';
15+
}
16+
17+
public function __destruct()
18+
{
19+
global $bar;
20+
$bar = $this;
21+
}
22+
}
23+
24+
$foo = new stdclass;
25+
$foo->foo = $foo;
26+
$foo->bad = new bad;
27+
28+
gc_disable();
29+
30+
unserialize(serialize($foo));
31+
gc_collect_cycles();
32+
var_dump($bar);
33+
/* will output:
34+
object(bad)#4 (1) {
35+
["_private":"bad":private]=>
36+
&UNKNOWN:0
37+
}
38+
*/
39+
?>
40+
--EXPECTF--
41+
bject(bad)#%d (1) {
42+
["_private":"bad":private]=>
43+
array(1) {
44+
[0]=>
45+
string(3) "php"
46+
}
47+
}

0 commit comments

Comments
 (0)