From 6a7f91ef1daa801983ea2c7654addd175f645741 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sat, 5 Dec 2020 20:48:51 +0100 Subject: [PATCH] Use shell_exec in exec_edit --- MD_STD.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } }