Use shell_exec in exec_edit
This commit is contained in:
parent
6db2b4cc1f
commit
6a7f91ef1d
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user