mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #66322: COMPersistHelper::SaveToFile can save to wrong location
This commit is contained in:
commit
0d49cf4ed2
3 changed files with 29 additions and 1 deletions
4
NEWS
4
NEWS
|
@ -3,6 +3,10 @@ PHP NEWS
|
||||||
|
|
||||||
?? ??? ????, PHP 7.4.4
|
?? ??? ????, PHP 7.4.4
|
||||||
|
|
||||||
|
- COM:
|
||||||
|
. Fixed bug #66322 (COMPersistHelper::SaveToFile can save to wrong location).
|
||||||
|
(cmb)
|
||||||
|
|
||||||
- CURL:
|
- CURL:
|
||||||
. Fixed bug #79019 (Copied cURL handles upload empty file). (cmb)
|
. Fixed bug #79019 (Copied cURL handles upload empty file). (cmb)
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,7 @@ CPH_METHOD(SaveToFile)
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage);
|
olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage);
|
||||||
efree(fullpath);
|
efree(fullpath);
|
||||||
}
|
}
|
||||||
res = IPersistFile_Save(helper->ipf, olefilename, remember);
|
res = IPersistFile_Save(helper->ipf, olefilename, remember);
|
||||||
|
|
24
ext/com_dotnet/tests/bug66322.phpt
Normal file
24
ext/com_dotnet/tests/bug66322.phpt
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #66322 (COMPersistHelper::SaveToFile can save to wrong location)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||||
|
try {
|
||||||
|
new COM('Word.Application');
|
||||||
|
} catch (com_exception $ex) {
|
||||||
|
die('skip MS Word not available');
|
||||||
|
}
|
||||||
|
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$w = new COM('Word.Application');
|
||||||
|
$doc = $w->Documents->Add();
|
||||||
|
$ph = new COMPersistHelper($doc);
|
||||||
|
$filename = __DIR__ . '\\..\\' . basename(__DIR__) . '\\66322.docx';
|
||||||
|
$ph->SaveToFile($filename);
|
||||||
|
var_dump(file_exists($filename));
|
||||||
|
$w->Quit();
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
bool(true)
|
Loading…
Add table
Add a link
Reference in a new issue