From aaffd2788c1fee87245b7a54fd0d7aef5b514585 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Fri, 22 Apr 2022 13:07:10 +0800 Subject: [PATCH] * Fix bug from max #16729. --- module/my/control.php | 4 ++++ module/user/model.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/my/control.php b/module/my/control.php index 96593fcdb5..ec90460d6b 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -1021,6 +1021,10 @@ EOF; return $this->send($response); } $listID = $this->user->createContactList($data->newList, $data->users); + if(dao::isError()) + { + return $this->send(array('result' => 'fail', 'message' => dao::getError())); + } $this->user->setGlobalContacts($listID, isset($data->share)); if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.parent.ajaxGetContacts('#mailto')")); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('manageContacts', "listID=$listID"))); diff --git a/module/user/model.php b/module/user/model.php index 4cd28e993e..3bc0a120c7 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1482,7 +1482,7 @@ class userModel extends model $this->dao->insert(TABLE_USERCONTACT)->data($data) ->autoCheck() ->exec(); - if(dao::isError()) return print(js::error(dao::getError())); + if(dao::isError()) return false; return $this->dao->lastInsertID(); }