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/Text.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/Text.php')
-rw-r--r-- | Zotlabs/Thumbs/Text.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Zotlabs/Thumbs/Text.php b/Zotlabs/Thumbs/Text.php index 31e27d014..b2f13c578 100644 --- a/Zotlabs/Thumbs/Text.php +++ b/Zotlabs/Thumbs/Text.php @@ -11,11 +11,12 @@ class Text { function Thumb($attach,$preview_style,$height = 300, $width = 300) { - if (empty($attach['content'])) { + $file = dbunescbin($attach['content']); + if (!$file) { return; } - $stream = @fopen(dbunescbin($attach['content']),'rb'); + $stream = @fopen($file,'rb'); if($stream) { $content = trim(stream_get_contents($stream,4096)); $content = str_replace("\r",'',$content); |