forked from GNUsocial/gnu-social
[Avatar][Embed] Change use of TemporaryFile::getPath to getRealPath
This commit is contained in:
parent
aad4bddedd
commit
d11615ded6
@ -93,7 +93,7 @@ class Avatar extends Controller
|
|||||||
if ($encoding_user == 'base64') {
|
if ($encoding_user == 'base64') {
|
||||||
$data_user = base64_decode($data_user);
|
$data_user = base64_decode($data_user);
|
||||||
$tempfile = new TemporaryFile('avatar');
|
$tempfile = new TemporaryFile('avatar');
|
||||||
$path = $tempfile->getPath();
|
$path = $tempfile->getRealPath();
|
||||||
file_put_contents($path, $data_user);
|
file_put_contents($path, $data_user);
|
||||||
$sfile = new SymfonyFile($path);
|
$sfile = new SymfonyFile($path);
|
||||||
} else {
|
} else {
|
||||||
|
@ -337,12 +337,12 @@ END, ['embed' => $embed, 'attributes' => $attributes]);
|
|||||||
$file = new TemporaryFile();
|
$file = new TemporaryFile();
|
||||||
$file->write($imgData);
|
$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');
|
$filepath = Common::config('storage', 'dir') . "embed/{$hash}" . Common::config('thumbnail', 'extension');
|
||||||
$width = Common::config('thumbnail', 'width');
|
$width = Common::config('thumbnail', 'width');
|
||||||
$height = Common::config('thumbnail', 'height');
|
$height = Common::config('thumbnail', 'height');
|
||||||
$smart_crop = Common::config('thumbnail', 'smart_crop');
|
$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);
|
unset($file);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user