Skip to content

Commit 884e2a0

Browse files
author
Zheng SHAO
committed
Fixed NEWS conflicts
2 parents fb98907 + 9fb8ea5 commit 884e2a0

File tree

14 files changed

+232
-19
lines changed

14 files changed

+232
-19
lines changed

.appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
version: "{branch}.build.{build}"
3+
14
image: Visual Studio 2015
25

36
clone_depth: 64
@@ -26,6 +29,9 @@ environment:
2629
- THREAD_SAFE: 1
2730
OPCACHE: 1
2831

32+
matrix:
33+
fast_finish: true
34+
2935
services:
3036
# the setup scripts have to be touched, once some other db version is used
3137
- mysql

NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ PHP NEWS
3535
- Apache2handler:
3636
. Fixed bug #61471 (POST request timeout did not handle correctly). (Zheng SHAO)
3737

38+
- Reflection:
39+
. Fixed bug #46103 (ReflectionObject memory leak). (Nikita)
40+
41+
- Standard:
42+
. Fixed bug #73594 (dns_get_record does not populate $additional out parameter).
43+
(Bruce Weirdan)
44+
3845
08 Dec 2016 PHP 7.0.14
3946

4047
- Core:

appveyor/build_task.bat

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
@echo off
22

33
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
4-
if errorlevel 1 exit /b 1
4+
if %errorlevel% neq 0 exit /b 3
55
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
6-
if errorlevel 1 exit /b 1
6+
if %errorlevel% neq 0 exit /b 3
77
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
8-
if errorlevel 1 exit /b 1
8+
if %errorlevel% neq 0 exit /b 3
99

1010
cd /D %APPVEYOR_BUILD_FOLDER%
11-
if errorlevel 1 exit /b 1
11+
if %errorlevel% neq 0 exit /b 3
1212

1313
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
1414
set BRANCH=%APPVEYOR_REPO_BRANCH:~4%
@@ -21,9 +21,10 @@ set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%APPVEY
2121
rem SDK is cached, deps info is cached as well
2222
echo Updating dependencies
2323
call phpsdk_deps --update --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
24+
if %errorlevel% neq 0 exit /b 3
2425

2526
call buildconf.bat --force
26-
if errorlevel 1 exit /b 1
27+
if %errorlevel% neq 0 exit /b 3
2728

2829
if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
2930

@@ -40,10 +41,10 @@ call configure.bat ^
4041
--with-php-build=%DEPS_DIR% ^
4142
%ADD_CONF% ^
4243
--with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST%
43-
if errorlevel 1 exit /b 1
44+
if %errorlevel% neq 0 exit /b 3
4445

4546
nmake /NOLOGO
46-
if errorlevel 1 exit /b 1
47+
if %errorlevel% neq 0 exit /b 3
4748

4849
exit /b 0
4950

ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,12 @@ mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc)
239239
if ((device->pos + len) >= device->length) {
240240
/* reallocate buffer */
241241
int newlen = device->length + (len + MBFL_MEMORY_DEVICE_ALLOC_SIZE)*sizeof(unsigned char);
242+
unsigned char *tmp;
242243
if (newlen <= 0) {
243244
/* overflow */
244245
return -1;
245246
}
246-
unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
247+
tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
247248
if (tmp == NULL) {
248249
return -1;
249250
}
@@ -270,11 +271,12 @@ mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len
270271
if ((device->pos + len) >= device->length) {
271272
/* reallocate buffer */
272273
int newlen = device->length + len + MBFL_MEMORY_DEVICE_ALLOC_SIZE;
274+
unsigned char *tmp;
273275
if (newlen <= 0) {
274276
/* overflow */
275277
return -1;
276278
}
277-
unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
279+
tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
278280
if (tmp == NULL) {
279281
return -1;
280282
}
@@ -301,11 +303,12 @@ mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src)
301303
if ((dest->pos + src->pos) >= dest->length) {
302304
/* reallocate buffer */
303305
int newlen = dest->length + src->pos + MBFL_MEMORY_DEVICE_ALLOC_SIZE;
306+
unsigned char *tmp;
304307
if (newlen <= 0) {
305308
/* overflow */
306309
return -1;
307310
}
308-
unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char));
311+
tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char));
309312
if (tmp == NULL) {
310313
return -1;
311314
}

ext/pdo/tests/bug_60665.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ PDOTest::skip();
1313
if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
1414
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1515
$db = PDOTest::factory();
16-
17-
$statement = $db->prepare("SELECT NULL AS null_value, 0 AS zero, 1 AS one");
16+
switch ($db->getAttribute(PDO::ATTR_DRIVER_NAME)) {
17+
case 'oci': $from = 'from dual'; break;
18+
case 'firebird': $from = 'from rdb$database'; break;
19+
default: $from = ''; break;
20+
}
21+
$statement = $db->prepare("SELECT NULL AS null_value, 0 AS zero, 1 AS one $from");
1822
$statement->execute();
1923
$row = $statement->fetch(PDO::FETCH_LAZY);
2024
var_dump(

ext/pdo_firebird/firebird_statement.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
152152
}
153153

154154
*S->name = 0;
155-
S->cursor_open = (S->out_sqlda.sqln > 0); /* A cursor is opened, when more than zero columns returned */
156-
S->exhausted = !S->cursor_open;
155+
S->cursor_open = S->out_sqlda.sqln && (S->statement_type != isc_info_sql_stmt_exec_procedure);
156+
S->exhausted = !S->out_sqlda.sqln; /* There are data to fetch */
157157

158158
return 1;
159159
} while (0);

ext/pdo_firebird/tests/bug_aaa.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
PDO_Firebird: cursor should not be marked as opened on singleton statements
3+
--SKIPIF--
4+
<?php if (!extension_loaded('interbase') || !extension_loaded('pdo_firebird')) die('skip'); ?>
5+
--FILE--
6+
<?php
7+
require 'testdb.inc';
8+
$C = new PDO('firebird:dbname='.$test_base, $user, $password, [PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING]) or die;
9+
@$C->exec('drop table ta_table');
10+
$C->exec('create table ta_table (id integer)');
11+
$S = $C->prepare('insert into ta_table (id) values (:id) returning id');
12+
$S->execute(['id' => 1]);
13+
$S->execute(['id' => 2]);
14+
unset($S);
15+
unset($C);
16+
echo 'OK';
17+
?>
18+
--EXPECT--
19+
OK

ext/reflection/php_reflection.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,15 @@ static void reflection_free_objects_storage(zend_object *object) /* {{{ */
344344
}
345345
/* }}} */
346346

347+
static HashTable *reflection_get_gc(zval *obj, zval **gc_data, int *gc_data_count) /* {{{ */
348+
{
349+
reflection_object *intern = Z_REFLECTION_P(obj);
350+
*gc_data = &intern->obj;
351+
*gc_data_count = 1;
352+
return zend_std_get_properties(obj);
353+
}
354+
/* }}} */
355+
347356
static zend_object *reflection_objects_new(zend_class_entry *class_type) /* {{{ */
348357
{
349358
reflection_object *intern;
@@ -6524,6 +6533,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
65246533
reflection_object_handlers.free_obj = reflection_free_objects_storage;
65256534
reflection_object_handlers.clone_obj = NULL;
65266535
reflection_object_handlers.write_property = _reflection_write_property;
6536+
reflection_object_handlers.get_gc = reflection_get_gc;
65276537

65286538
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions);
65296539
reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_ce_exception);

ext/reflection/tests/bug46103.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #46103: ReflectionObject memory leak
3+
--FILE--
4+
<?php
5+
6+
$obj = new stdClass;
7+
$obj->r = new ReflectionObject($obj);
8+
var_dump($obj);
9+
10+
?>
11+
--EXPECT--
12+
object(stdClass)#1 (1) {
13+
["r"]=>
14+
object(ReflectionObject)#2 (1) {
15+
["name"]=>
16+
string(8) "stdClass"
17+
}
18+
}

ext/standard/dns.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t
761761
}
762762
/* }}} */
763763

764-
/* {{{ proto array|false dns_get_record(string hostname [, int type[, array authns, array addtl]])
764+
/* {{{ proto array|false dns_get_record(string hostname [, int type[, array &authns[, array &addtl[, bool raw]]]])
765765
Get any Resource Record corresponding to a given Internet host name */
766766
PHP_FUNCTION(dns_get_record)
767767
{
@@ -785,7 +785,7 @@ PHP_FUNCTION(dns_get_record)
785785
int type, first_query = 1, store_results = 1;
786786
zend_bool raw = 0;
787787

788-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b",
788+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/!z/!b",
789789
&hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) {
790790
return;
791791
}

ext/standard/dns_win32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,18 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw,
341341
}
342342
/* }}} */
343343

344-
/* {{{ proto array|false dns_get_record(string hostname [, int type[, array authns, array addtl]])
344+
/* {{{ proto array|false dns_get_record(string hostname [, int type[, array &authns[, array &addtl[, bool raw]]]])
345345
Get any Resource Record corresponding to a given Internet host name */
346346
PHP_FUNCTION(dns_get_record)
347347
{
348348
char *hostname;
349349
size_t hostname_len;
350-
long type_param = PHP_DNS_ANY;
350+
zend_long type_param = PHP_DNS_ANY;
351351
zval *authns = NULL, *addtl = NULL;
352352
int type, type_to_fetch, first_query = 1, store_results = 1;
353353
zend_bool raw = 0;
354354

355-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b",
355+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/!z/!b",
356356
&hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) {
357357
return;
358358
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
--TEST--
2+
Test get_browser() function variation : Return data as object
3+
--INI--
4+
browscap={PWD}/browscap.ini
5+
--SKIPIF--
6+
<?php
7+
/**
8+
* Basic test, it would be pretty much coincidence if there's
9+
* a browscap.ini on another place that isn't valid.
10+
*/
11+
if(! is_readable( ini_get( 'browscap' ) ) ) {
12+
die( 'skip: browscap.ini file ' . ini_get('browscap') . " not readable" );
13+
}
14+
?>
15+
--FILE--
16+
<?php
17+
18+
$agent = "Opera/7.11 (Windows NT 5.1; U) [en]";
19+
var_dump(get_browser($agent));
20+
21+
?>
22+
--EXPECT--
23+
object(stdClass)#1 (35) {
24+
["browser_name_regex"]=>
25+
string(41) "~^opera/7\.1.* \(windows nt 5\.1; .\).*$~"
26+
["browser_name_pattern"]=>
27+
string(31) "Opera/7.1* (Windows NT 5.1; ?)*"
28+
["parent"]=>
29+
string(9) "Opera 7.1"
30+
["platform"]=>
31+
string(5) "WinXP"
32+
["win32"]=>
33+
string(1) "1"
34+
["browser"]=>
35+
string(5) "Opera"
36+
["version"]=>
37+
string(3) "7.1"
38+
["majorver"]=>
39+
string(1) "7"
40+
["minorver"]=>
41+
string(1) "1"
42+
["frames"]=>
43+
string(1) "1"
44+
["iframes"]=>
45+
string(1) "1"
46+
["tables"]=>
47+
string(1) "1"
48+
["cookies"]=>
49+
string(1) "1"
50+
["backgroundsounds"]=>
51+
string(1) "1"
52+
["javaapplets"]=>
53+
string(1) "1"
54+
["javascript"]=>
55+
string(1) "1"
56+
["css"]=>
57+
string(1) "2"
58+
["cssversion"]=>
59+
string(1) "2"
60+
["supportscss"]=>
61+
string(1) "1"
62+
["alpha"]=>
63+
string(0) ""
64+
["beta"]=>
65+
string(0) ""
66+
["win16"]=>
67+
string(0) ""
68+
["win64"]=>
69+
string(0) ""
70+
["authenticodeupdate"]=>
71+
string(0) ""
72+
["cdf"]=>
73+
string(0) ""
74+
["vbscript"]=>
75+
string(0) ""
76+
["activexcontrols"]=>
77+
string(0) ""
78+
["stripper"]=>
79+
string(0) ""
80+
["isbanned"]=>
81+
string(0) ""
82+
["wap"]=>
83+
string(0) ""
84+
["ismobiledevice"]=>
85+
string(0) ""
86+
["issyndicationreader"]=>
87+
string(0) ""
88+
["crawler"]=>
89+
string(0) ""
90+
["aol"]=>
91+
string(0) ""
92+
["aolversion"]=>
93+
string(1) "0"
94+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Bug #73594 (dns_get_record() does not populate $additional out parameter)
3+
--SKIPIF--
4+
<?php
5+
if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
6+
7+
$out = array();
8+
$ret = 0;
9+
exec("dig -tmx php.net +noall +additional 2>/dev/null", $out, $ret);
10+
11+
if ($ret != 0) die("skip dig command is not present or failed to run");
12+
13+
// skip empty and header lines
14+
$out = preg_grep("/^(?!($|;))/", $out);
15+
16+
if (empty($out)) die("skip local resolver does not return additional records");
17+
?>
18+
--FILE--
19+
<?php
20+
$auth = array();
21+
$additional = array();
22+
dns_get_record('php.net', DNS_MX, $auth, $additional);
23+
var_dump(empty($additional));
24+
?>
25+
--EXPECT--
26+
bool(false)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Bug #73594 (dns_get_record() does not populate $additional out parameter - $authns parameter)
3+
--SKIPIF--
4+
<?php
5+
if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
6+
7+
$out = array();
8+
$ret = 0;
9+
exec("dig -tmx php.net +noall +authority 2>/dev/null", $out, $ret);
10+
11+
if ($ret != 0) die("skip dig command is not present or failed to run");
12+
13+
// skip empty and header lines
14+
$out = preg_grep("/^(?!($|;))/", $out);
15+
16+
if (empty($out)) die("skip local resolver does not return authority records");
17+
?>
18+
--FILE--
19+
<?php
20+
$auth = array();
21+
dns_get_record('php.net', DNS_MX, $auth);
22+
var_dump(empty($auth));
23+
?>
24+
--EXPECT--
25+
bool(false)

0 commit comments

Comments
 (0)