diff --git a/src/Controller/sh.php b/src/Controller/sh.php index a1544cad..bee0f2e2 100755 --- a/src/Controller/sh.php +++ b/src/Controller/sh.php @@ -98,7 +98,8 @@ $cwd= dirname(__FILE__); // Run the ctlr using doas and passing -n for no arg validation, as we have already done that above -exec("/usr/bin/doas $cwd/ctlr.php -n ".escapeshellarg($args)." 2>&1", $encoded, $retval); +// Remove errout (redirect to /dev/null), otherwise breaks json encoded output +exec("/usr/bin/doas $cwd/ctlr.php -n ".escapeshellarg($args)." 2>/dev/null", $encoded, $retval); // There must be only one element in $encoded array, but do not miss the others if any $encoded= implode(' ', $encoded); echo $encoded;