From 0f861554f06f52e674c46a47cdd2b4c19c3373df Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Dec 2020 08:06:47 +1100 Subject: [PATCH] Fixes for exec and open_basedir checks --- app/Utils/SystemHealth.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index 9b09f6b8947b..b32d1a14c1c4 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -78,9 +78,27 @@ class SystemHealth 'node_status' => self::checkNode(), 'cache_enabled' => self::checkConfigCache(), 'phantom_enabled' => (bool) config('ninja.phantomjs_pdf_generation'), + 'exec' => (bool) self::checkExecWorks(), + 'open_basedir' => (bool) self::checkOpenBaseDir(), ]; } + public static function checkOpenBaseDir() + { + if(strlen(ini_get('open_basedir') == 0)) + return true; + + return false; + } + + public static function checkExecWorks() + { + if(function_exists('exec')) + return true; + + return false; + } + public static function checkConfigCache() { if (env('APP_URL')) {