Skip to content

Commit 2044884

Browse files
committed
Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (28 commits) /me blushes, really hard only build and test nts non-debug and ts debug builds as discussed at #654 Fix mysqli build when building against libmysqlclient. Fix author name on the #63228 patch. Fixed bug #67169: []= after_array_splice incorrect Revert "show leaks in their own group" using valgrind would be a bit too much for travis I guess. show leaks in their own group Use the right path for the suggested PHP invocation in ext_skel. Changed to more understandable NEWS message one heading is enough add new NEWS block for alpha3 XFAIL the leaking multibyte tests, we should really get to the bottom of this Fixed numbering in UPGRADING file Updated NEWS for fixed phpdbg issue #85 Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85 Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85 add missing NEWS entry to the correct release where it was added 5.5.12 was released yesterday add missing NEWS entry to the correct release where it was added Updated NEWS entry for phpdbg ... Conflicts: ext/curl/interface.c
2 parents ba19cc7 + 003ba74 commit 2044884

19 files changed

+266
-58
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ env:
1515
- PDO_MYSQL_TEST_USER=travis
1616
- PDO_MYSQL_TEST_PASS=
1717
- PDO_MYSQL_TEST_HOST=127.0.0.1
18-
matrix:
1918
- REPORT_EXIT_STATUS=1
19+
matrix:
20+
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
21+
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
2022

2123
before_script:
2224
# Compile PHP

NEWS

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? 2014, PHP 5.6.0 Beta 2
3+
?? ??? 2014, PHP 5.6.0 Beta 3
4+
5+
- Core:
6+
. Fixed bug #67169 (array_splice all elements, then []= gives wrong index).
7+
(Nikita)
8+
9+
01 May 2014, PHP 5.6.0 Beta 2
410

511
- CLI server:
612
. Fixed bug #67079 (Missing MIME types for XML/XSL files). (Anatol)
@@ -22,8 +28,10 @@ PHP NEWS
2228
. Fixed bug #67064 (Countable interface prevents using 2nd parameter
2329
($mode) of count() function). (Bob)
2430
. Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol)
31+
. Fixed bug #67033 (Remove reference to Windows 95). (Anatol)
2532

2633
- cURL:
34+
. Fixed bug #64247 (CURLOPT_INFILE doesn't allow reset). (Mike)
2735
. Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent).
2836
(Freek Lijten)
2937

@@ -58,12 +66,27 @@ PHP NEWS
5866
- LDAP:
5967
. Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
6068

69+
- litespeed
70+
. Fixed bug #63228 (-Werror=format-security error in lsapi code).
71+
(Elan Ruusamäe, George)
72+
73+
- mysqli:
74+
. Fixed building against an external libmysqlclient. (Adam)
75+
6176
- mysqlnd:
6277
. Added a new fetching mode to mysqlnd. (Andrey)
6378

6479
- OpenSSL:
6580
. Fix bug #66942 (memory leak in openssl_seal()). (Chuan Ma)
6681
. Fix bug #66952 (memory leak in openssl_open()). (Chuan Ma)
82+
. Fix bug #66840 (Fix broken build when extension built separately).
83+
(Daniel Lowrey)
84+
85+
- phpdbg:
86+
. Added watchpoints (watch command). (Bob)
87+
. Renamed some commands (next => continue and how to step). (Joe)
88+
. Fixed issue #85 (https://github.com/krakjoe/phpdbg/issues/85)
89+
(Added stdin/stdout/stderr constants and their php:// wrappers). (Bob)
6790

6891
- PDO:
6992
. Fixed bug #66604 ('pdo/php_pdo_error.h' not copied to the include dir).
@@ -219,7 +242,6 @@ PHP NEWS
219242
. Fixed bug #53965 (<xsl:include> cannot find files with relative paths
220243
when loaded with "file://"). (Anatol)
221244

222-
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
223245
27 Feb 2014, PHP 5.6.0 Alpha 3
224246

225247
- Core

UPGRADING

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ PHP 5.6 UPGRADE NOTES
44

55
1. Backward Incompatible Changes
66
2. New Features
7-
2. Changes in SAPI modules
8-
3. Deprecated Functionality
9-
4. Changed Functions
10-
5. New Functions
11-
6. New Classes and Interfaces
12-
7. Removed Extensions
13-
8. Other Changes to Extensions
14-
9. New Global Constants
15-
10. Changes to INI File Handling
16-
11. Other Changes
7+
3. Changes in SAPI modules
8+
4. Deprecated Functionality
9+
5. Changed Functions
10+
6. New Functions
11+
7. New Classes and Interfaces
12+
8. Removed Extensions
13+
9. Other Changes to Extensions
14+
10. New Global Constants
15+
11. Changes to INI File Handling
16+
12. Other Changes
1717

1818

1919
========================================
@@ -152,7 +152,7 @@ PHP 5.6 UPGRADE NOTES
152152
operations using the ext/pgsql extension.
153153

154154
========================================
155-
2. Changes in SAPI modules
155+
3. Changes in SAPI modules
156156
========================================
157157

158158
- Added phpdbg SAPI.
@@ -166,7 +166,7 @@ PHP 5.6 UPGRADE NOTES
166166
application/xml is now sent automatically.
167167

168168
========================================
169-
3. Deprecated Functionality
169+
4. Deprecated Functionality
170170
========================================
171171

172172
- Incompatible context calls:
@@ -195,7 +195,7 @@ PHP 5.6 UPGRADE NOTES
195195
mbstring.internal_encoding
196196

197197
========================================
198-
4. Changed Functions
198+
5. Changed Functions
199199
========================================
200200

201201
- cURL:
@@ -240,7 +240,7 @@ PHP 5.6 UPGRADE NOTES
240240
replacing "C:" with "O:" at the start will now produce an error.
241241

242242
========================================
243-
5. New Functions
243+
6. New Functions
244244
========================================
245245

246246
- GMP:
@@ -279,17 +279,17 @@ PHP 5.6 UPGRADE NOTES
279279
Added SplFileObject::fread($length) to complement fwrite() method (>= 5.5.11)
280280

281281
========================================
282-
6. New Classes and Interfaces
282+
7. New Classes and Interfaces
283283
========================================
284284

285285

286286
========================================
287-
7. Removed Extensions
287+
8. Removed Extensions
288288
========================================
289289

290290

291291
========================================
292-
8. Other Changes to Extensions
292+
9. Other Changes to Extensions
293293
========================================
294294

295295
- cURL:
@@ -353,7 +353,7 @@ PHP 5.6 UPGRADE NOTES
353353
as described in https://bugs.php.net/bug.php?id=42614.
354354

355355
========================================
356-
9. New Global Constants
356+
10. New Global Constants
357357
========================================
358358

359359
- LDAP:
@@ -387,7 +387,7 @@ PHP 5.6 UPGRADE NOTES
387387
OPENSSL_DEFAULT_STREAM_CIPHERS string
388388

389389
========================================
390-
10. Changes to INI File Handling
390+
11. Changes to INI File Handling
391391
========================================
392392

393393
- Core:
@@ -412,7 +412,7 @@ PHP 5.6 UPGRADE NOTES
412412
global CA default specification as necessary.
413413

414414
========================================
415-
11. Other Changes
415+
12. Other Changes
416416
========================================
417417

418418
- File upload:

Zend/tests/bug67169.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Bug #67169: array_splice all elements, then []= gives wrong index
3+
--FILE--
4+
<?php
5+
6+
$array = array('a', 'b');
7+
array_splice($array, 0, 2);
8+
$array[] = 'c';
9+
var_dump($array);
10+
11+
$array = array('a', 'b');
12+
array_shift($array);
13+
array_shift($array);
14+
$array[] = 'c';
15+
var_dump($array);
16+
17+
?>
18+
--EXPECT--
19+
array(1) {
20+
[0]=>
21+
string(1) "c"
22+
}
23+
array(1) {
24+
[0]=>
25+
string(1) "c"
26+
}

Zend/zend_hash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys) {
487487

488488
IS_CONSISTENT(ht);
489489
if (UNEXPECTED(ht->nNumOfElements == 0)) {
490+
ht->nNextFreeElement = 0;
490491
return;
491492
}
492493

ext/curl/interface.c

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,25 +2345,34 @@ static int _php_curl_setopt(php_curl *ch, php_int_t option, zval **zvalue TSRMLS
23452345
case CURLOPT_WRITEHEADER: {
23462346
FILE *fp = NULL;
23472347
int type;
2348-
void * what;
2348+
void *what = NULL;
23492349

2350-
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
2351-
if (!what) {
2352-
return FAILURE;
2353-
}
2350+
if (Z_TYPE_PP(zvalue) != IS_NULL) {
2351+
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
2352+
if (!what) {
2353+
return FAILURE;
2354+
}
23542355

2355-
if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) {
2356-
return FAILURE;
2357-
}
2356+
if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) {
2357+
return FAILURE;
2358+
}
23582359

2359-
if (!fp) {
2360-
return FAILURE;
2360+
if (!fp) {
2361+
return FAILURE;
2362+
}
23612363
}
23622364

23632365
error = CURLE_OK;
23642366
switch (option) {
23652367
case CURLOPT_FILE:
2366-
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
2368+
if (!what) {
2369+
if (ch->handlers->write->stream) {
2370+
Z_DELREF_P(ch->handlers->write->stream);
2371+
ch->handlers->write->stream = NULL;
2372+
}
2373+
ch->handlers->write->fp = NULL;
2374+
ch->handlers->write->method = PHP_CURL_STDOUT;
2375+
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
23672376
if (ch->handlers->write->stream) {
23682377
Z_DELREF_P(ch->handlers->write->stream);
23692378
}
@@ -2377,7 +2386,14 @@ static int _php_curl_setopt(php_curl *ch, php_int_t option, zval **zvalue TSRMLS
23772386
}
23782387
break;
23792388
case CURLOPT_WRITEHEADER:
2380-
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
2389+
if (!what) {
2390+
if (ch->handlers->write_header->stream) {
2391+
Z_DELREF_P(ch->handlers->write_header->stream);
2392+
ch->handlers->write_header->stream = NULL;
2393+
}
2394+
ch->handlers->write_header->fp = NULL;
2395+
ch->handlers->write_header->method = PHP_CURL_IGNORE;
2396+
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
23812397
if (ch->handlers->write_header->stream) {
23822398
Z_DELREF_P(ch->handlers->write_header->stream);
23832399
}
@@ -2391,16 +2407,30 @@ static int _php_curl_setopt(php_curl *ch, php_int_t option, zval **zvalue TSRMLS
23912407
}
23922408
break;
23932409
case CURLOPT_INFILE:
2394-
if (ch->handlers->read->stream) {
2395-
Z_DELREF_P(ch->handlers->read->stream);
2410+
if (!what) {
2411+
if (ch->handlers->read->stream) {
2412+
Z_DELREF_P(ch->handlers->read->stream);
2413+
ch->handlers->read->stream = NULL;
2414+
}
2415+
ch->handlers->read->fp = NULL;
2416+
ch->handlers->read->fd = 0;
2417+
} else {
2418+
if (ch->handlers->read->stream) {
2419+
Z_DELREF_P(ch->handlers->read->stream);
2420+
}
2421+
Z_ADDREF_PP(zvalue);
2422+
ch->handlers->read->fp = fp;
2423+
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
2424+
ch->handlers->read->stream = *zvalue;
23962425
}
2397-
Z_ADDREF_PP(zvalue);
2398-
ch->handlers->read->fp = fp;
2399-
ch->handlers->read->fd = Z_IVAL_PP(zvalue);
2400-
ch->handlers->read->stream = *zvalue;
24012426
break;
24022427
case CURLOPT_STDERR:
2403-
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
2428+
if (!what) {
2429+
if (ch->handlers->std_err) {
2430+
zval_ptr_dtor(&ch->handlers->std_err);
2431+
ch->handlers->std_err = NULL;
2432+
}
2433+
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
24042434
if (ch->handlers->std_err) {
24052435
zval_ptr_dtor(&ch->handlers->std_err);
24062436
}

ext/curl/tests/bug54798.phpt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,13 @@ foreach($options_to_check as $option) {
5353
}
5454

5555
?>
56+
===DONE===
5657
--CLEAN--
5758
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?>
5859
--EXPECTF--
59-
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug54798.php on line %d
60-
* About to connect() %a
61-
* Closing connection %d
62-
Ok for CURLOPT_STDERR
63-
64-
Warning: curl_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug54798.php on line 24
65-
Ok for CURLOPT_WRITEHEADER
66-
67-
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug54798.php on line 24
60+
%a
61+
%aOk for CURLOPT_STDERR
62+
%aOk for CURLOPT_WRITEHEADER
6863
%aOk for CURLOPT_FILE
69-
70-
Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug54798.php on line %d
71-
Ok for CURLOPT_INFILE
64+
%aOk for CURLOPT_INFILE
65+
===DONE===

ext/curl/tests/bug64267.phpt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
Bug #64267 (CURLOPT_INFILE doesn't allow reset)
3+
--SKIPIF--
4+
<?php
5+
extension_loaded("curl") or die("skip need ext/curl");
6+
?>
7+
--FILE--
8+
<?php
9+
10+
echo "TEST\n";
11+
12+
$c = curl_init("http://google.com");
13+
$f = fopen(__FILE__,"r");
14+
var_dump(curl_setopt_array($c, [
15+
CURLOPT_RETURNTRANSFER => true,
16+
CURLOPT_UPLOAD => true,
17+
CURLOPT_INFILE => $f,
18+
CURLOPT_INFILESIZE => filesize(__FILE__)
19+
]));
20+
fclose($f);
21+
var_dump(curl_setopt_array($c, [
22+
CURLOPT_UPLOAD => false,
23+
CURLOPT_INFILE => null,
24+
CURLOPT_INFILESIZE => 0,
25+
]));
26+
curl_exec($c);
27+
var_dump(curl_getinfo($c, CURLINFO_RESPONSE_CODE));
28+
?>
29+
===DONE===
30+
--EXPECTF--
31+
TEST
32+
bool(true)
33+
bool(true)
34+
int(30%d)
35+
===DONE===

ext/curl/tests/curl_basic_008.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ curl_close($ch);
2525

2626
?>
2727
--EXPECTF--
28-
%unicode|string%(%d) "%r(Couldn't resolve host|Could not resolve host:)%r %Swww.%s"
28+
%s resolve%s
2929
int(6)

ext/curl/tests/curl_basic_010.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ curl_close($ch);
2626

2727
?>
2828
--EXPECTF--
29-
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:)%r %s"
29+
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:)%r %s"
3030
int(5)

0 commit comments

Comments
 (0)