Skip to content

Commit 09e7c86

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79299: com_print_typeinfo prints duplicate variables
2 parents 578a811 + 9e6358a commit 09e7c86

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ PHP NEWS
1313
x86). (cmb)
1414
. Fixed bug #79247 (Garbage collecting variant objects segfaults). (cmb)
1515
. Fixed bug #79248 (Traversing empty VT_ARRAY throws com_exception). (cmb)
16+
. Fixed bug #79299 (com_print_typeinfo prints duplicate variables). (Litiano
17+
Moura)
1618

1719
- CURL:
1820
. Fixed bug #79019 (Copied cURL handles upload empty file). (cmb)

ext/com_dotnet/com_typeinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
480480
char *ansiname = NULL;
481481
size_t ansinamelen;
482482
int ret = 0;
483+
DISPID lastid = 0; /* for props */
483484

484485
if (FAILED(ITypeInfo_GetTypeAttr(typeinfo, &attr))) {
485486
return 0;
@@ -513,7 +514,6 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
513514
/* So we've got the dispatch interface; lets list the event methods */
514515
for (i = 0; i < attr->cFuncs; i++) {
515516
zval tmp;
516-
DISPID lastid = 0; /* for props */
517517
int isprop;
518518

519519
if (FAILED(ITypeInfo_GetFuncDesc(typeinfo, i, &func)))

ext/com_dotnet/tests/bug79299.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #79299 (com_print_typeinfo prints duplicate variables)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
6+
?>
7+
--FILE--
8+
<?php
9+
$dict = new COM("Scripting.Dictionary");
10+
ob_start();
11+
com_print_typeinfo($dict);
12+
$typeinfo = ob_get_clean();
13+
preg_match_all('/\/\* DISPID=9 \*\//', $typeinfo, $matches);
14+
var_dump($matches[0]);
15+
?>
16+
--EXPECT--
17+
array(1) {
18+
[0]=>
19+
string(14) "/* DISPID=9 */"
20+
}

0 commit comments

Comments
 (0)