From f6596a955b4aabc73019339e7dc1cd8c98a31a75 Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Wed, 3 Aug 2022 00:15:59 +0000 Subject: [PATCH] * Fix error when branch name is Chinese. --- module/repo/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index f0cd4acaa2..a86682e54f 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -480,7 +480,7 @@ class repo extends control $revisions = $this->repo->getCommits($repo, $path, $revision, $logType, $pager); /* Synchronous commit only in root path. */ - if(in_array($repo->SCM, $this->config->repo->gitTypeList) and empty($path) and $infos and empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID&branch=" . base64_encode($this->cookie->repoBranch))); + if(in_array($repo->SCM, $this->config->repo->gitTypeList) and empty($path) and $infos and empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID&branch=" . helper::safe64Encode(base64_encode($this->cookie->repoBranch)))); $this->view->title = $this->lang->repo->common; $this->view->repo = $repo; @@ -910,7 +910,7 @@ class repo extends control $this->commonAction($repoID, $objectID); if($repoID == 0) $repoID = $this->session->repoID; - if($branch) $branch = base64_decode($branch); + if($branch) $branch = base64_decode(helper::safe64Decode($branch)); $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->showSyncCommit; $this->view->position[] = $this->lang->repo->showSyncCommit;