diff --git a/MD_STD.php b/MD_STD.php index abf98dd..b9e1578 100644 --- a/MD_STD.php +++ b/MD_STD.php @@ -412,7 +412,7 @@ final class MD_STD { * * @return void */ - public static function ensure_file(string $filepath, array $accepted_mimetype = []) { + public static function ensure_file(string $filepath, array $accepted_mimetype = []):void { if (!\file_exists($filepath)) { throw new MDFileDoesNotExist("File " . basename($filepath) . " does not exist"); @@ -441,9 +441,9 @@ final class MD_STD { */ public static function exec_edit(string $cmds):void { - $error = \exec($cmds . ' 2>&1'); + $error = \shell_exec($cmds . ' 2>&1'); if (!empty($error)) { - throw new \Exception('Shell error: ' . $error); + throw new \Exception('Shell error: ' . $error . PHP_EOL . PHP_EOL . 'Command was: ' . $cmds); } }