Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #78650: new COM Crash
This commit is contained in:
Christoph M. Becker 2019-10-09 14:17:25 +02:00
commit 73e9acbaff
2 changed files with 33 additions and 1 deletions

View File

@ -172,6 +172,11 @@ static void com_write_dimension(zend_object *object, zval *offset, zval *value)
}
}
static zval *com_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
{
return NULL;
}
static int com_property_exists(zend_object *object, zend_string *member, int check_empty, void **cache_slot)
{
DISPID dispid;
@ -531,7 +536,7 @@ zend_object_handlers php_com_object_handlers = {
com_property_write,
com_read_dimension,
com_write_dimension,
NULL,
com_get_property_ptr_ptr,
com_property_exists,
com_property_delete,
com_dimension_exists,

View File

@ -0,0 +1,27 @@
--TEST--
Bug #78650 (new COM Crash)
--SKIPIF--
<?php
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
?>
--FILE--
<?php
$fname = __DIR__ . '/bug78650/foo/bar';
mkdir($fname, 0777, true);
$fso = new COM("Scripting.FileSystemObject");
$folder = $fso->GetFolder($fname);
$folder->ParentFolder->Name = 'baz';
print('OK');
?>
--EXPECT--
OK
--CLEAN--
<?php
rmdir(__DIR__ . '/bug78650/baz/bar');
rmdir(__DIR__ . '/bug78650/foo/bar');
rmdir(__DIR__ . '/bug78650/baz');
rmdir(__DIR__ . '/bug78650/foo');
rmdir(__DIR__ . '/bug78650');
?>