diff options
author | Mario <mario@mariovavti.com> | 2023-04-21 10:33:05 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-04-21 10:33:05 +0000 |
commit | 39e14eb95c0b88c6905c50816149d13a0c9746e9 (patch) | |
tree | 3c531886f652cab2e1e2fb5cfd8e304a2b4c1a39 /Zotlabs/Thumbs/Video.php | |
parent | f277d08244986c080d48af3e8bc86a9886d098bc (diff) | |
download | volse-hubzilla-39e14eb95c0b88c6905c50816149d13a0c9746e9.tar.gz volse-hubzilla-39e14eb95c0b88c6905c50816149d13a0c9746e9.tar.bz2 volse-hubzilla-39e14eb95c0b88c6905c50816149d13a0c9746e9.zip |
hotfix: make sure to not pass an empty path to fopen()
Diffstat (limited to 'Zotlabs/Thumbs/Video.php')
-rw-r--r-- | Zotlabs/Thumbs/Video.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Zotlabs/Thumbs/Video.php b/Zotlabs/Thumbs/Video.php index 15d3ace12..9df27d703 100644 --- a/Zotlabs/Thumbs/Video.php +++ b/Zotlabs/Thumbs/Video.php @@ -11,16 +11,19 @@ class Video { function Thumb($attach,$preview_style,$height = 300, $width = 300) { + $file = dbunescbin($attach['content']); + if (!$file) { + return; + } + $photo = false; $t = explode('/',$attach['filetype']); if($t[1]) $extension = '.' . $t[1]; else - return; + return; - - $file = dbunescbin($attach['content']); $tmpfile = $file . $extension; $outfile = $file . '.jpg'; @@ -40,7 +43,7 @@ class Video { $ffmpeg = trim(shell_exec('which ffmpeg')); - if($ffmpeg) { + if($ffmpeg) { logger('ffmpeg not found in path. Video thumbnails may fail.'); } @@ -59,7 +62,7 @@ class Video { @rename($outfile,$file . '.thumb'); } } - + @unlink($tmpfile); } } |