From 22812fc9f9eb972ef5800f3dafa6a59db5892b3c Mon Sep 17 00:00:00 2001 From: Soner Tari Date: Sun, 25 Feb 2024 23:19:31 +0300 Subject: [PATCH] Remove errout from sh.php output otherwise breaks json encoded output --- src/Controller/sh.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;