From: Xinchen Hui Date: Sun, 30 Aug 2015 12:31:36 +0000 (-0700) Subject: Merge branch 'PHP-5.6' X-Git-Tag: php-7.0.0RC2~2^2~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=014abbc84050a52a49b62395c7fdf752c142b843;p=php Merge branch 'PHP-5.6' Conflicts: ext/pdo/pdo_dbh.c ext/pdo/php_pdo_driver.h --- 014abbc84050a52a49b62395c7fdf752c142b843 diff --cc NEWS index edf0cef49f,8f68c45df9..959ad68f05 --- a/NEWS +++ b/NEWS @@@ -1,61 -1,25 +1,64 @@@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 2015, PHP 5.6.14 +03 Sep 2015, PHP 7.0.0 RC 2 - Core: + . Fixed bug #70332 (Wrong behavior while returning reference on object). + (Laruence, Dmitry) + . Fixed bug #70300 (Syntactical inconsistency with new group use syntax). + (marcio dot web2 at gmail dot com) + . Fixed bug #70321 (Magic getter breaks reference to array property). + (Laruence) + . Fixed bug #70187 (Notice: unserialize(): Unexpected end of serialized data) + (Dmitry) + . Fixed bug #70145 (From field incorrectly parsed from headers). (Anatol) . Fixed bug #70370 (Bundled libtool.m4 doesn't handle FreeBSD 10 when building extensions). (Adam) + . Fixed bug causing exception traces with anon classes to be truncated. (Bob) -- OpenSSL: - . Fixed bug #55259 (openssl extension does not get the DH parameters from - DH key resource). (Jakub Zelenka) +- Curl: + . Fixed bug #70330 (Segmentation Fault with multiple "curl_copy_handle"). + (Laruence) + +- Pcntl: + . Fixed bug #70386 (Can't compile on NetBSD because of missing WCONTINUED + and WIFCONTINUED). (Matteo) + - PDO: + - Fixed bug #70389 (PDO constructor changes unrelated variables). (Laruence) + +- PDO_OCI: + . Fixed bug #70308 (PDO::ATTR_PREFETCH is ignored). (Chris Jones) + +- SPL: + . Fixed bug #70303 (Incorrect constructor reflection for ArrayObject). (cmb) + - Standard: + . Fixed bug #70342 (changing configuration with ignore_user_abort(true) isn't + working). (Laruence) + . Fixed bug #70295 (Segmentation fault with setrawcookie). (Bob) . Fixed bug #67131 (setcookie() conditional for empty values not met). (cmb) -03 Sep 2015, PHP 5.6.13 +- Reflection: + . Fixed bug causing bogus traces for ReflectionGenerator::getTrace(). (Bob) + +20 Aug 2015, PHP 7.0.0 RC 1 - Core: - . Fixed bug #69900 (Too long timeout on pipes). (Anatol) + . Fixed bug #70299 (Memleak while assigning object offsetGet result). + (Laruence) + . Fixed bug #70288 (Apache crash related to ZEND_SEND_REF). (Laruence) + . Fixed bug #70262 (Accessing array crashes PHP 7.0beta3). + (Laruence, Dmitry) + . Fixed bug #70258 (Segfault if do_resize fails to allocated memory). + (Laruence) + . Fixed bug #70253 (segfault at _efree () in zend_alloc.c:1389). (Laruence) + . Fixed bug #70240 (Segfault when doing unset($var());). (Laruence) + . Fixed bug #70223 (Incrementing value returned by magic getter). (Laruence) + . Fixed bug #70215 (Segfault when __invoke is static). (Bob) + . Fixed bug #70207 (Finally is broken with opcache). (Laruence, Dmitry) + . Fixed bug #70173 (ZVAL_COPY_VALUE_EX broken for 32bit Solaris Sparc). + (Laruence, cmb) . Fixed bug #69487 (SAPI may truncate POST data). (cmb) . Fixed bug #70198 (Checking liveness does not work as expected). (Shafreeck Sea, Anatol Belski) diff --cc ext/pdo/pdo_dbh.c index ec5f33f7f7,c7d7e0774f..bf5907bef2 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@@ -278,11 -286,17 +278,10 @@@ static PHP_METHOD(PDO, dbh_constructor plen = spprintf(&hashkey, 0, "PDO:DBH:DSN=%s:%s:%s:%s", data_source, username ? username : "", password ? password : "", - Z_STRVAL_PP(v)); + Z_STRVAL_P(v)); is_persistent = 1; } else { - convert_to_long_ex(v); - is_persistent = Z_LVAL_P(v) ? 1 : 0; - if (Z_TYPE_PP(v) != IS_LONG) { - zval tmp = **v; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - is_persistent = Z_LVAL(tmp)? 1 : 0; - } else { - is_persistent = Z_LVAL_PP(v)? 1 : 0; - } ++ is_persistent = zval_get_long(v) ? 1 : 0; plen = spprintf(&hashkey, 0, "PDO:DBH:DSN=%s:%s:%s", data_source, username ? username : "", password ? password : ""); diff --cc ext/pdo/php_pdo_driver.h index efa21a4e14,44082df498..57b2d7b8b0 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@@ -194,25 -192,35 +194,23 @@@ enum pdo_null_handling }; /* {{{ utils for reading attributes set as driver_options */ -static inline long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, long defval TSRMLS_DC) +static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, zend_long defval) { - zval **v; - - if (options && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), option_name, (void**)&v)) { - if (Z_TYPE_PP(v) != IS_LONG) { - zval tmp = **v; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - return Z_LVAL(tmp); - } - return Z_LVAL_PP(v); + zval *v; + + if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) { - convert_to_long_ex(v); - return Z_LVAL_P(v); ++ return zval_get_long(v); } return defval; } - static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval) -static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval TSRMLS_DC) ++static inline zend_string *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, zend_string *defval) { - zval **v; - - if (options && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), option_name, (void**)&v)) { - if (Z_TYPE_PP(v) != IS_STRING) { - zval tmp = **v; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - return Z_STRVAL(tmp); - } - return estrndup(Z_STRVAL_PP(v), Z_STRLEN_PP(v)); + zval *v; + + if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) { - convert_to_string_ex(v); - return estrndup(Z_STRVAL_P(v), Z_STRLEN_P(v)); ++ return zval_get_string(v); } -- return defval ? estrdup(defval) : NULL; ++ return defval ? zend_string_copy(defval) : NULL; } /* }}} */ diff --cc ext/pdo_mysql/mysql_driver.c index 8931da2e8c,f198753100..c2c0692a96 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@@ -600,26 -597,26 +600,26 @@@ static int pdo_mysql_handle_factory(pdo /* handle MySQL options */ if (driver_options) { - long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC); - long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC); - char *init_cmd = NULL; + zend_long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30); + zend_long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0); - char *init_cmd = NULL; ++ zend_string *init_cmd = NULL; #ifndef PDO_USE_MYSQLND -- char *default_file = NULL, *default_group = NULL; ++ zend_string *default_file = NULL, *default_group = NULL; #endif - long compress = 0; - char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL; - H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1 TSRMLS_CC); + zend_long compress = 0; - char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL; ++ zend_string *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL; + H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1); H->emulate_prepare = pdo_attr_lval(driver_options, - PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare TSRMLS_CC); - H->emulate_prepare = pdo_attr_lval(driver_options, - PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare TSRMLS_CC); + PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare); + H->emulate_prepare = pdo_attr_lval(driver_options, + PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare); #ifndef PDO_USE_MYSQLND - H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size TSRMLS_CC); + H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size); #endif - if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_FOUND_ROWS, 0 TSRMLS_CC)) { + if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_FOUND_ROWS, 0)) { connect_opts |= CLIENT_FOUND_ROWS; } @@@ -656,37 -653,37 +656,37 @@@ mysql_options(H->server, MYSQL_OPT_RECONNECT, (const char*)&reconnect); } #endif - init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL TSRMLS_CC); + init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL); if (init_cmd) { -- if (mysql_options(H->server, MYSQL_INIT_COMMAND, (const char *)init_cmd)) { -- efree(init_cmd); ++ if (mysql_options(H->server, MYSQL_INIT_COMMAND, (const char *)ZSTR_VAL(init_cmd))) { ++ zend_string_release(init_cmd); pdo_mysql_error(dbh); goto cleanup; } -- efree(init_cmd); ++ zend_string_release(init_cmd); } -#ifndef PDO_USE_MYSQLND - default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL TSRMLS_CC); +#ifndef PDO_USE_MYSQLND + default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL); if (default_file) { -- if (mysql_options(H->server, MYSQL_READ_DEFAULT_FILE, (const char *)default_file)) { -- efree(default_file); ++ if (mysql_options(H->server, MYSQL_READ_DEFAULT_FILE, (const char *)ZSTR_VAL(default_file))) { ++ zend_string_release(default_file); pdo_mysql_error(dbh); goto cleanup; } -- efree(default_file); ++ zend_string_release(default_file); } - - default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL TSRMLS_CC); + - default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL); ++ default_group = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL); if (default_group) { -- if (mysql_options(H->server, MYSQL_READ_DEFAULT_GROUP, (const char *)default_group)) { -- efree(default_group); ++ if (mysql_options(H->server, MYSQL_READ_DEFAULT_GROUP, (const char *)ZSTR_VAL(default_group))) { ++ zend_string_release(default_group); pdo_mysql_error(dbh); goto cleanup; } -- efree(default_group); ++ zend_string_release(default_group); } #endif - compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0 TSRMLS_CC); + compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0); if (compress) { if (mysql_options(H->server, MYSQL_OPT_COMPRESS, 0)) { pdo_mysql_error(dbh); @@@ -694,41 -691,41 +694,46 @@@ } } - ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL TSRMLS_CC); - ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL TSRMLS_CC); - ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL TSRMLS_CC); - ssl_capath = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CAPATH, NULL TSRMLS_CC); - ssl_cipher = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CIPHER, NULL TSRMLS_CC); - + ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL); + ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL); + ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL); + ssl_capath = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CAPATH, NULL); + ssl_cipher = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CIPHER, NULL); + if (ssl_key || ssl_cert || ssl_ca || ssl_capath || ssl_cipher) { -- mysql_ssl_set(H->server, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher); ++ mysql_ssl_set(H->server, ++ ssl_key? ZSTR_VAL(ssl_key) : NULL, ++ ssl_cert? ZSTR_VAL(ssl_cert) : NULL, ++ ssl_ca? ZSTR_VAL(ssl_ca) : NULL, ++ ssl_capath? ZSTR_VAL(ssl_capath) : NULL, ++ ssl_cipher? ZSTR_VAL(ssl_cipher) : NULL); if (ssl_key) { -- efree(ssl_key); ++ zend_string_release(ssl_key); } if (ssl_cert) { -- efree(ssl_cert); ++ zend_string_release(ssl_cert); } if (ssl_ca) { -- efree(ssl_ca); ++ zend_string_release(ssl_ca); } if (ssl_capath) { -- efree(ssl_capath); ++ zend_string_release(ssl_capath); } if (ssl_cipher) { -- efree(ssl_cipher); ++ zend_string_release(ssl_cipher); } } #if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND) { - char *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL); - char *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL TSRMLS_CC); ++ zend_string *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL); if (public_key) { -- if (mysql_options(H->server, MYSQL_SERVER_PUBLIC_KEY, public_key)) { ++ if (mysql_options(H->server, MYSQL_SERVER_PUBLIC_KEY, ZSTR_VAL(public_key))) { pdo_mysql_error(dbh); -- efree(public_key); ++ zend_string_release(public_key); goto cleanup; } -- efree(public_key); ++ zend_string_release(public_key); } } #endif