@@ -100,7 +100,7 @@ protected function getFilePath($keyword, $skip = false): string
100100 );
101101 }
102102
103- return $ path . ' / ' . $ filename . '. ' . $ this ->getConfig ()->getCacheFileExtension ();
103+ return $ path . \ DIRECTORY_SEPARATOR . $ filename . '. ' . $ this ->getConfig ()->getCacheFileExtension ();
104104 }
105105
106106 /**
@@ -322,7 +322,7 @@ protected function readFile($file): string
322322 * @return bool
323323 * @throws PhpfastcacheIOException
324324 */
325- protected function writefile ($ file , $ data , $ secureFileManipulation = false ): bool
325+ protected function writefile (string $ file , string $ data , bool $ secureFileManipulation = false ): bool
326326 {
327327 /**
328328 * @eventName CacheWriteFileOnDisk
@@ -335,11 +335,10 @@ protected function writefile($file, $data, $secureFileManipulation = false): boo
335335
336336 if ($ secureFileManipulation ) {
337337 $ tmpFilename = Directory::getAbsolutePath (
338- dirname ($ file ) . '/tmp_ ' . $ this ->getConfig ()->getDefaultFileNameHashFunction ()(
339- \str_shuffle (\uniqid ($ this ->getDriverName (), false ))
340- . \str_shuffle (\uniqid ($ this ->getDriverName (), false ))
338+ dirname ($ file ) . \DIRECTORY_SEPARATOR . 'tmp_ ' . $ this ->getConfig ()->getDefaultFileNameHashFunction ()(
339+ \bin2hex (\random_bytes (16 ))
341340 )
342- );
341+ ) . ' . ' . $ this -> getConfig ()-> getCacheFileExtension () . \random_int ( 1000 , 9999 ) ;
343342
344343 $ handle = \fopen ($ tmpFilename , 'w+b ' );
345344 if (\is_resource ($ handle )) {
0 commit comments