From 311a35c9558e9c77a42dee59b40c8a14de0dee89 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 21 Aug 2024 19:54:59 +0900 Subject: [PATCH] Fix #2396 display warning if exec() function is disabled --- modules/file/file.admin.view.php | 1 + modules/file/lang/en.php | 1 + modules/file/lang/ko.php | 1 + modules/file/tpl/upload_config.html | 3 +++ 4 files changed, 6 insertions(+) diff --git a/modules/file/file.admin.view.php b/modules/file/file.admin.view.php index 6a5a4788a..c1e79603e 100644 --- a/modules/file/file.admin.view.php +++ b/modules/file/file.admin.view.php @@ -224,6 +224,7 @@ class FileAdminView extends File Context::set('config', $config); Context::set('is_ffmpeg', function_exists('exec') && !empty($config->ffmpeg_command) && Rhymix\Framework\Storage::isExecutable($config->ffmpeg_command) && !empty($config->ffprobe_command) && Rhymix\Framework\Storage::isExecutable($config->ffprobe_command)); Context::set('is_magick', function_exists('exec') && !empty($config->magick_command) && Rhymix\Framework\Storage::isExecutable($config->magick_command)); + Context::set('is_exec_available', function_exists('exec')); // Set a template file $this->setTemplatePath($this->module_path.'tpl'); diff --git a/modules/file/lang/en.php b/modules/file/lang/en.php index 7fd2b2630..1fd6d25fd 100644 --- a/modules/file/lang/en.php +++ b/modules/file/lang/en.php @@ -128,6 +128,7 @@ $lang->ffprobe_path = 'Absolute Path to ffprobe'; $lang->magick_path = 'Absolute Path to magick'; $lang->about_ffmpeg_path = 'Rhymix uses ffmpeg to convert video files.'; $lang->about_magick_path = 'Rhymix uses magick to convert newer image formats such as AVIF and HEIC.
Note that the \'convert\' command from previous versions of ImageMagick doesn\'t support these formats.
The latest version can be downloaded from their official site.'; +$lang->msg_cannot_use_exec = 'The exec() function is disabled on this server.'; $lang->msg_cannot_use_ffmpeg = 'In order to use this feature, PHP must be able to execute \'ffmpeg\' and \'ffprobe\' commands.'; $lang->msg_cannot_use_exif = 'In order to use this feature, PHP must be installed with the \'exif\' extension.'; $lang->msg_need_magick = 'In order to handle AVIF and HEIC formats, PHP must be able to execute the \'magick\' command from ImageMagick 7.x or higher.'; diff --git a/modules/file/lang/ko.php b/modules/file/lang/ko.php index 53ee8e429..192a2649f 100644 --- a/modules/file/lang/ko.php +++ b/modules/file/lang/ko.php @@ -131,6 +131,7 @@ $lang->ffprobe_path = 'ffprobe 절대경로'; $lang->magick_path = 'magick 절대경로'; $lang->about_ffmpeg_path = '동영상 변환에 사용합니다.'; $lang->about_magick_path = 'AVIF, HEIC 등 일부 이미지 변환에 사용합니다.
구 버전 ImageMagick의 convert 명령은 이러한 포맷을 지원하지 않습니다.
새 버전은 공식 사이트에서 다운받을 수 있습니다.'; +$lang->msg_cannot_use_exec = '이 서버에서 exec() 함수를 사용할 수 없습니다.'; $lang->msg_cannot_use_ffmpeg = '이 기능을 사용하려면 PHP에서 ffmpeg 및 ffprobe 명령을 실행할 수 있어야 합니다.'; $lang->msg_cannot_use_exif = '이 기능을 사용하려면 PHP exif 확장모듈이 필요합니다.'; $lang->msg_need_magick = 'AVIF, HEIC 변환을 위해서는 PHP에서 ImageMagick 7.x 이상의 magick 명령을 실행할 수 있어야 합니다.'; diff --git a/modules/file/tpl/upload_config.html b/modules/file/tpl/upload_config.html index 724094a40..f13a544fa 100644 --- a/modules/file/tpl/upload_config.html +++ b/modules/file/tpl/upload_config.html @@ -253,6 +253,7 @@

{$lang->about_ffmpeg_path}

+

{$lang->msg_cannot_use_exec}

@@ -260,6 +261,7 @@

{$lang->about_ffmpeg_path}

+

{$lang->msg_cannot_use_exec}

@@ -267,6 +269,7 @@

{$lang->about_magick_path}

+

{$lang->msg_cannot_use_exec}