diff options
author | Aleksander Machniak <alec@alec.pl> | 2017-05-05 12:36:30 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2017-05-05 12:37:22 +0300 |
commit | 5b741abed7a85e02196c13a5a9843bab49755eda (patch) | |
tree | d9034bfde49b519b24eb5d368293c0dfa86fb31f /bin | |
parent | 0b595fa401307185d8a8bd0fc0fe95b9b29a8ae7 (diff) |
Print error from CLI scripts when system/exec function is disabled (#5744)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/install-jsdeps.sh | 5 | ||||
-rwxr-xr-x | bin/installto.sh | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/bin/install-jsdeps.sh b/bin/install-jsdeps.sh index 7a27aeecd..9a33c06a6 100755 --- a/bin/install-jsdeps.sh +++ b/bin/install-jsdeps.sh @@ -23,6 +23,10 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' ); require_once INSTALL_PATH . 'program/include/clisetup.php'; +if (!function_exists('exec')) { + die("PHP exec() function is required. Check disable_functions in php.ini\n"); +} + $SOURCES = json_decode(file_get_contents(INSTALL_PATH . 'jsdeps.json'), true); if (empty($SOURCES['dependencies'])) { @@ -319,4 +323,3 @@ foreach ($SOURCES['dependencies'] as $package) { echo "Done.\n\n"; } - diff --git a/bin/installto.sh b/bin/installto.sh index 3eb09a392..667d3ae1a 100755 --- a/bin/installto.sh +++ b/bin/installto.sh @@ -23,6 +23,10 @@ define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' ); require_once INSTALL_PATH . 'program/include/clisetup.php'; +if (!function_exists('system')) { + rcube::raise_error("PHP system() function is required. Check disable_functions in php.ini.", false, true); +} + $target_dir = unslashify($_SERVER['argv'][1]); if (empty($target_dir) || !is_dir(realpath($target_dir))) |