From 0527993d984bf4e209a9611602adaf53da927223 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 12 Feb 2021 14:32:20 -0800 Subject: [PATCH] Added check for FileInfo extension --- e107_admin/phpinfo.php | 18 +++++++++++------- e107_languages/English/admin/lan_phpinfo.php | 2 +- install.php | 13 +++++++------ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/e107_admin/phpinfo.php b/e107_admin/phpinfo.php index 956fdcdeb..6ca36c2f1 100644 --- a/e107_admin/phpinfo.php +++ b/e107_admin/phpinfo.php @@ -41,20 +41,24 @@ $phpinfo = preg_replace('/]*>/i', ' function_exists('exif_imagetype'), 'url'=> 'http://php.net/manual/en/book.exif.php'), - 'gd' => array('label'=> 'GD Library', 'status' => function_exists('gd_info'), 'url'=> 'http://php.net/manual/en/book.image.php'), - 'mb' => array('label'=> 'MB String Library', 'status' => function_exists('mb_strimwidth'), 'url'=> 'http://php.net/manual/en/book.mbstring.php'), - 'pdo' => array('label'=> "PDO (MySQL)", 'status' => extension_loaded('pdo_mysql'), 'url'=> 'https://php.net/manual/en/book.pdo.php'), - 'xml' => array('label'=> "XML Extension", 'status' => function_exists('utf8_encode') && class_exists('DOMDocument', false), 'url'=> 'http://php.net/manual/en/ref.xml.php'), + 'curl' => array('label'=> 'Curl Library', 'status' => function_exists('curl_version'), 'url'=> 'http://php.net/manual/en/book.curl.php'), + 'exif' => array('label'=> "EXIF Extension", 'status' => function_exists('exif_imagetype'), 'url'=> 'http://php.net/manual/en/book.exif.php'), + 'fileinfo' => array('label'=> "FileInfo. Extension", 'status' => extension_loaded('fileinfo'), 'url'=> 'https://www.php.net/manual/en/book.fileinfo'), + 'gd' => array('label'=> 'GD Library', 'status' => function_exists('gd_info'), 'url'=> 'http://php.net/manual/en/book.image.php'), + 'mb' => array('label'=> 'MB String Library', 'status' => extension_loaded('mbstring'), 'url'=> 'http://php.net/manual/en/book.mbstring.php'), + 'pdo' => array('label'=> "PDO (MySQL)", 'status' => extension_loaded('pdo_mysql'), 'url'=> 'https://php.net/manual/en/book.pdo.php'), + 'xml' => array('label'=> "XML Extension", 'status' => function_exists('utf8_encode') && class_exists('DOMDocument', false), 'url'=> 'http://php.net/manual/en/ref.xml.php'), ); + + + foreach($extensionCheck as $var) { if($var['status'] !== true) { $erTitle = deftrue('PHP_LAN_7', "PHP Configuration Issue(s) Found:"); - $def = deftrue('PHP_LAN_8', "[x] is missing from the PHP configuration and need to be installed."); + $def = deftrue('PHP_LAN_8', "[x] is missing from the PHP configuration and needs to be installed."); $message = e107::getParser()->lanVars($def,$var['label'],true); $mes->setIcon('fa-hand-stop-o', E_MESSAGE_ERROR)->setTitle($erTitle,E_MESSAGE_ERROR)->addError($message." ".ADMIN_INFO_ICON." "); diff --git a/e107_languages/English/admin/lan_phpinfo.php b/e107_languages/English/admin/lan_phpinfo.php index 581d88aab..f23ab317c 100644 --- a/e107_languages/English/admin/lan_phpinfo.php +++ b/e107_languages/English/admin/lan_phpinfo.php @@ -17,4 +17,4 @@ define("PHP_LAN_4", "Disabling this will hide your PHP version from browsers."); define("PHP_LAN_5", "This is a security risk and should be disabled."); define("PHP_LAN_6", "[b]session.save_path[/b] is not writable! That can cause major issues with your site."); define("PHP_LAN_7", "PHP Configuration Issue(s) Found:"); -define("PHP_LAN_8", "[x] is missing and need to be installed."); +define("PHP_LAN_8", "[x] is missing and needs to be installed."); diff --git a/install.php b/install.php index 84be2b77a..fe0b0ca11 100644 --- a/install.php +++ b/install.php @@ -1002,12 +1002,13 @@ class e_install $extensionCheck = array( - 'pdo' => array('label'=> "PDO (MySQL)", 'status' => extension_loaded('pdo_mysql'), 'url'=> 'https:/php.net/manual/en/book.pdo.php'), - 'xml' => array('label'=> LANINS_050, 'status' => function_exists('utf8_encode') && class_exists('DOMDocument', false), 'url'=> 'http://php.net/manual/en/ref.xml.php'), - 'exif' => array('label'=> LANINS_048, 'status' => function_exists('exif_imagetype'), 'url'=> 'http://php.net/manual/en/book.exif.php'), - 'curl' => array('label'=> 'Curl Library', 'status' => function_exists('curl_version'), 'url'=> 'http://php.net/manual/en/book.curl.php'), - 'gd' => array('label'=> 'GD Library', 'status' => function_exists('gd_info'), 'url'=> 'http://php.net/manual/en/book.image.php'), - 'mb' => array('label'=> 'MB String Library', 'status' => function_exists('mb_strimwidth'), 'url'=> 'http://php.net/manual/en/book.mbstring.php'), + 'pdo' => array('label' => "PDO (MySQL)", 'status' => extension_loaded('pdo_mysql'), 'url' => 'https:/php.net/manual/en/book.pdo.php'), + 'xml' => array('label' => LANINS_050, 'status' => function_exists('utf8_encode') && class_exists('DOMDocument', false), 'url' => 'http://php.net/manual/en/ref.xml.php'), + 'exif' => array('label' => LANINS_048, 'status' => function_exists('exif_imagetype'), 'url' => 'http://php.net/manual/en/book.exif.php'), + 'fileinfo' => array('label' => "FileInfo. Extension", 'status' => extension_loaded('fileinfo'), 'url' => 'https://www.php.net/manual/en/book.fileinfo'), + 'curl' => array('label' => 'Curl Library', 'status' => function_exists('curl_version'), 'url' => 'http://php.net/manual/en/book.curl.php'), + 'gd' => array('label' => 'GD Library', 'status' => function_exists('gd_info'), 'url' => 'http://php.net/manual/en/book.image.php'), + 'mb' => array('label' => 'MB String Library', 'status' => function_exists('mb_strimwidth'), 'url' => 'http://php.net/manual/en/book.mbstring.php'), );