diff options
| author | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
|---|---|---|
| committer | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
| commit | 2c69095a1edf7474073451285238659d0f62ce3f (patch) | |
| tree | 5dee476605402c66dc2853d0836b29f6aedae62b /inc/lib/webm/posthandler.php | |
| parent | e9a61e2fbbd930eaa80d6a5f33420cedc59d748c (diff) | |
PHP8.1 fixes from Rector
Diffstat (limited to 'inc/lib/webm/posthandler.php')
| -rw-r--r-- | inc/lib/webm/posthandler.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/lib/webm/posthandler.php b/inc/lib/webm/posthandler.php index 15c6600d..4cd26d6a 100644 --- a/inc/lib/webm/posthandler.php +++ b/inc/lib/webm/posthandler.php @@ -5,7 +5,7 @@ function postHandler($post) { global $board, $config; if ($post->has_file) foreach ($post->files as &$file) if ($file->extension == 'webm' || $file->extension == 'mp4') { if ($config['webm']['use_ffmpeg']) { - require_once dirname(__FILE__) . '/ffmpeg.php'; + require_once __DIR__ . '/ffmpeg.php'; $webminfo = get_webm_info($file->file_path); if (empty($webminfo['error'])) { $file->width = $webminfo['width']; @@ -29,7 +29,7 @@ function postHandler($post) { } } else { - require_once dirname(__FILE__) . '/videodata.php'; + require_once __DIR__ . '/videodata.php'; $videoDetails = videoData($file->file_path); if (!isset($videoDetails['container']) || $videoDetails['container'] != 'webm') return "not a WebM file"; // Set thumbnail @@ -39,7 +39,7 @@ function postHandler($post) { $file = webm_set_spoiler($file); } elseif (isset($videoDetails['frame']) && $thumbFile = fopen($thumbName, 'wb')) { // Use single frame from video as pseudo-thumbnail - fwrite($thumbFile, $videoDetails['frame']); + fwrite($thumbFile, (string) $videoDetails['frame']); fclose($thumbFile); $file->thumb = $file->file_id . '.webm'; } else { @@ -60,7 +60,7 @@ function postHandler($post) { } function set_thumbnail_dimensions($post,$file) { global $board, $config; - $tn_dimensions = array(); + $tn_dimensions = []; $tn_maxw = $post->op ? $config['thumb_op_width'] : $config['thumb_width']; $tn_maxh = $post->op ? $config['thumb_op_height'] : $config['thumb_height']; if ($file->width > $tn_maxw || $file->height > $tn_maxh) { |
