From 9ff48ea79d83a50a9171cf66cb3dbf3f85926e19 Mon Sep 17 00:00:00 2001 From: zhaoke Date: Thu, 7 Sep 2023 13:37:27 +0800 Subject: [PATCH] * Fix bug #38360. --- module/gitea/model.php | 1 + module/system/control.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module/gitea/model.php b/module/gitea/model.php index a650474572..9c58c8ca33 100644 --- a/module/gitea/model.php +++ b/module/gitea/model.php @@ -377,6 +377,7 @@ class giteaModel extends model $gitea = $this->getByID($giteaID); $oauth = "oauth2:{$gitea->token}@"; $project->tokenCloneUrl = preg_replace('/(http(s)?:\/\/)/', "\$1$oauth", $project->html_url); + $project->tokenCloneUrl = str_replace(array('https://', 'http://'), strstr($url, ':', true) . '://', $project->tokenCloneUrl); } return $project; diff --git a/module/system/control.php b/module/system/control.php index e75f76cd6f..2645ba59e9 100644 --- a/module/system/control.php +++ b/module/system/control.php @@ -454,7 +454,7 @@ class system extends control { session_write_close(); $this->system->saveDomainSettings(); - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::$errors)); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError(true))); return $this->send(array('result' => 'success', 'message' => $this->lang->system->notices->updateDomainSuccess, 'locate' => $this->inlink('domainView'))); }