diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/com_dotnet/com_typeinfo.c | 2 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug79299.phpt | 20 |
3 files changed, 23 insertions, 1 deletions
@@ -8,6 +8,8 @@ PHP NEWS . Fixed bug #79242 (COM error constants don't match com_exception codes on x86). (cmb) . Fixed bug #79248 (Traversing empty VT_ARRAY throws com_exception). (cmb) + . Fixed bug #79299 (com_print_typeinfo prints duplicate variables). (Litiano + Moura) - DOM: . Fixed bug #77569: (Write Access Violation in DomImplementation). (Nikita, diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 330d7b0052..f3cecd82f5 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -436,6 +436,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; @@ -469,7 +470,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 |