diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-02-23 23:33:28 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-02-23 23:34:15 +0100 |
commit | 09e7c86779b281c3d1fbff5954fbb9e0b052cf33 (patch) | |
tree | 80554fd52d9a895abb66db375e44c04c0e56751e /ext/com_dotnet | |
parent | 578a8113ebade39e68489c974cd6c16b2aecbf2e (diff) | |
parent | 9e6358af36e71fa867b3de24dae2ec76d678c428 (diff) | |
download | php-git-09e7c86779b281c3d1fbff5954fbb9e0b052cf33.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix #79299: com_print_typeinfo prints duplicate variables
Diffstat (limited to 'ext/com_dotnet')
-rw-r--r-- | ext/com_dotnet/com_typeinfo.c | 2 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug79299.phpt | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 44d0340af5..bb5f92a591 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -480,6 +480,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri char *ansiname = NULL; size_t ansinamelen; int ret = 0; + DISPID lastid = 0; /* for props */ if (FAILED(ITypeInfo_GetTypeAttr(typeinfo, &attr))) { return 0; @@ -513,7 +514,6 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri /* So we've got the dispatch interface; lets list the event methods */ for (i = 0; i < attr->cFuncs; i++) { zval tmp; - DISPID lastid = 0; /* for props */ int isprop; if (FAILED(ITypeInfo_GetFuncDesc(typeinfo, i, &func))) diff --git a/ext/com_dotnet/tests/bug79299.phpt b/ext/com_dotnet/tests/bug79299.phpt new file mode 100644 index 0000000000..99c1a99742 --- /dev/null +++ b/ext/com_dotnet/tests/bug79299.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #79299 (com_print_typeinfo prints duplicate variables) +--SKIPIF-- +<?php +if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); +?> +--FILE-- +<?php +$dict = new COM("Scripting.Dictionary"); +ob_start(); +com_print_typeinfo($dict); +$typeinfo = ob_get_clean(); +preg_match_all('/\/\* DISPID=9 \*\//', $typeinfo, $matches); +var_dump($matches[0]); +?> +--EXPECT-- +array(1) { + [0]=> + string(14) "/* DISPID=9 */" +}
\ No newline at end of file |