File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
wcfsetup/install/files/lib/system/file/command Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ final class ReplaceFileSource
2525 public function __construct (
2626 private readonly File $ file ,
2727 private readonly string $ pathname ,
28+ private readonly ?string $ filename = null ,
2829 ) {}
2930
3031 public function __invoke (): File
@@ -70,7 +71,7 @@ private function replaceSource(): File
7071 [$ width , $ height ] = \getimagesize ($ this ->pathname );
7172 }
7273
73- $ filename = \basename ($ this ->pathname );
74+ $ filename = $ this -> filename ? $ this -> filename : \basename ($ this ->pathname );
7475 $ fileSize = \filesize ($ this ->pathname );
7576 $ fileHash = \hash_file ('sha256 ' , $ this ->pathname );
7677 $ fileExtension = File::getSafeFileExtension ($ mimeType , $ filename );
@@ -105,6 +106,9 @@ private function replaceSource(): File
105106
106107 $ updatedFile = new File ($ this ->file ->fileID );
107108
109+ $ path = \dirname ($ updatedFile ->getPathname ());
110+ FileUtil::makePath ($ path );
111+
108112 \rename (
109113 $ this ->pathname ,
110114 $ updatedFile ->getPathname (),
You can’t perform that action at this time.
0 commit comments