From c73d251b17c9c8f5d2f8d0951e15f7f85df84192 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:56:52 +0800 Subject: [PATCH] encode the array before assigning it to 'error' --- application/common/models/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/common/models/User.php b/application/common/models/User.php index fa30c0f7..2640cf6a 100644 --- a/application/common/models/User.php +++ b/application/common/models/User.php @@ -693,7 +693,7 @@ private function saveOrError(string $msg, int $code = null): void \Yii::error([ 'action' => $msg, 'status' => 'error', - 'error' => $this->getFirstErrors(), + 'error' => json_encode($this->getFirstErrors()), ]); if ($code !== null) { throw new \Exception($msg, $code);