From d11615ded65cfd139452f969ef6c451f78f6b89c Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Thu, 29 Apr 2021 20:42:26 +0000 Subject: [PATCH] [Avatar][Embed] Change use of TemporaryFile::getPath to getRealPath --- components/Avatar/Controller/Avatar.php | 2 +- plugins/Embed/Embed.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Avatar/Controller/Avatar.php b/components/Avatar/Controller/Avatar.php index 8c89a7f8e6..302a9db4d8 100644 --- a/components/Avatar/Controller/Avatar.php +++ b/components/Avatar/Controller/Avatar.php @@ -93,7 +93,7 @@ class Avatar extends Controller if ($encoding_user == 'base64') { $data_user = base64_decode($data_user); $tempfile = new TemporaryFile('avatar'); - $path = $tempfile->getPath(); + $path = $tempfile->getRealPath(); file_put_contents($path, $data_user); $sfile = new SymfonyFile($path); } else { diff --git a/plugins/Embed/Embed.php b/plugins/Embed/Embed.php index 9157b0f1f9..6bba39e919 100644 --- a/plugins/Embed/Embed.php +++ b/plugins/Embed/Embed.php @@ -337,12 +337,12 @@ END, ['embed' => $embed, 'attributes' => $attributes]); $file = new TemporaryFile(); $file->write($imgData); - Event::handle('HashFile', [$file->getPathname(), &$hash]); + Event::handle('HashFile', [$file->getRealPath(), &$hash]); $filepath = Common::config('storage', 'dir') . "embed/{$hash}" . Common::config('thumbnail', 'extension'); $width = Common::config('thumbnail', 'width'); $height = Common::config('thumbnail', 'height'); $smart_crop = Common::config('thumbnail', 'smart_crop'); - Event::handle('ResizeImagePath', [$file->getPathname(), $filepath, $width, $height, $smart_crop, &$mimetype]); + Event::handle('ResizeImagePath', [$file->getRealPath(), $filepath, $width, $height, $smart_crop, &$mimetype]); unset($file);