File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ PHP NEWS
2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? ????, PHP 7.3.16
4
4
5
+ - COM:
6
+ . Fixed bug #66322 (COMPersistHelper::SaveToFile can save to wrong location).
7
+ (cmb)
8
+
5
9
- PCRE:
6
10
. Fixed bug #79188 (Memory corruption in preg_replace/preg_replace_callback
7
11
and unicode). (Nikita)
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ CPH_METHOD(SaveToFile)
398
398
RETURN_FALSE ;
399
399
}
400
400
401
- olefilename = php_com_string_to_olestring (filename , strlen (fullpath ), helper -> codepage );
401
+ olefilename = php_com_string_to_olestring (fullpath , strlen (fullpath ), helper -> codepage );
402
402
efree (fullpath );
403
403
}
404
404
res = IPersistFile_Save (helper -> ipf , olefilename , remember );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #66322 (COMPersistHelper::SaveToFile can save to wrong location)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('com_dotnet ' )) die ('skip com_dotnet extension not available ' );
6
+ try {
7
+ new COM ('Word.Application ' );
8
+ } catch (com_exception $ ex ) {
9
+ die ('skip MS Word not available ' );
10
+ }
11
+ if (getenv ("SKIP_SLOW_TESTS " )) die ('skip slow test ' );
12
+ ?>
13
+ --FILE--
14
+ <?php
15
+ $ w = new COM ('Word.Application ' );
16
+ $ doc = $ w ->Documents ->Add ();
17
+ $ ph = new COMPersistHelper ($ doc );
18
+ $ filename = __DIR__ . '\\.. \\' . basename (__DIR__ ) . '\\66322.docx ' ;
19
+ $ ph ->SaveToFile ($ filename );
20
+ var_dump (file_exists ($ filename ));
21
+ $ w ->Quit ();
22
+ ?>
23
+ --EXPECT--
24
+ bool(true)
You can’t perform that action at this time.
0 commit comments