From: Bram Schoenmakers Date: Wed, 17 Sep 2014 17:05:52 +0000 (+0200) Subject: Updater: check whether system() is useable. X-Git-Tag: 1.14~6^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=96aba17f013a8457d154a7ba5c85451cfd69d239;p=tt-rss.git Updater: check whether system() is useable. system() was disabled on my system for security reasons, but the updater would just continue, only to find out that the tarball hasn't been extracted. --- diff --git a/plugins/updater/init.php b/plugins/updater/init.php index ef48858b..6ee018f7 100644 --- a/plugins/updater/init.php +++ b/plugins/updater/init.php @@ -63,6 +63,20 @@ class Updater extends Plugin { putenv("PATH=" . getenv("PATH") . PATH_SEPARATOR . "/bin" . PATH_SEPARATOR . "/usr/bin"); + array_push($log, "Checking for system() call..."); + + $disabled = explode(',', ini_get('disable_functions')); + foreach ($disabled as $function) { + if ( trim($function) == 'system' ) { + array_push($log, "Can not execute commands with PHP's system() function."); + $stop = true; + } + } + + if ( $stop == true ) { + break; + } + array_push($log, "Checking for tar..."); $system_rc = 0;