diff --git a/src/ZM/API/CQ.php b/src/ZM/API/CQ.php index 2eb57e24..fea189da 100644 --- a/src/ZM/API/CQ.php +++ b/src/ZM/API/CQ.php @@ -354,7 +354,7 @@ class CQ */ public static function encode($msg, bool $is_content = false): string { - $msg = str_replace(['&', '[', ']'], ['&', '[', ']'], $msg); + $msg = str_replace(['&', '[', ']'], ['&', '[', ']'], strval($msg)); if ($is_content) { $msg = str_replace(',', ',', $msg); } diff --git a/tests/ZM/Utils/TerminalTest.php b/tests/ZM/Utils/TerminalTest.php index 438ec9c1..cac5ff94 100644 --- a/tests/ZM/Utils/TerminalTest.php +++ b/tests/ZM/Utils/TerminalTest.php @@ -18,6 +18,7 @@ class TerminalTest extends TestCase { Console::setLevel(4); Terminal::init(); + Console::setLevel(0); $this->expectOutputRegex('/Initializing\ Terminal/'); } @@ -28,6 +29,7 @@ class TerminalTest extends TestCase { Console::setLevel(2); Terminal::executeCommand('echo zhamao-framework'); + Console::setLevel(0); $this->expectOutputRegex('/zhamao-framework/'); } }