From 06abe97624fb073d52fb8eaeb65257a2285861a2 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 2 Aug 2022 15:19:08 +0800 Subject: [PATCH] * Modify branch check error. --- framework/base/helper.class.php | 7 ++++++- lib/scm/gitea.class.php | 2 +- lib/scm/gogs.class.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index c787cc08fe..b39d02977d 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -77,7 +77,12 @@ class baseHelper /* 处理$viewType和$vars。Set $viewType and $vars. */ if(empty($viewType)) $viewType = $app->getViewType(); - if(!is_array($vars)) parse_str($vars, $vars); + if(!is_array($vars)) + { + /* Prevent + from converting to spaces. */ + $vars = str_replace('+', '%2B', $vars); + parse_str($vars, $vars); + } /* 生成url链接的开始部分。Set the begin parts of the link. */ if($config->requestType == 'PATH_INFO') $link = $config->webRoot . $appName; diff --git a/lib/scm/gitea.class.php b/lib/scm/gitea.class.php index a9ed40bfe0..0e28d04d5f 100644 --- a/lib/scm/gitea.class.php +++ b/lib/scm/gitea.class.php @@ -162,7 +162,7 @@ class Gitea { $localBranch = trim($localBranch); if(substr($localBranch, 0, 19) == 'remotes/origin/HEAD') continue; - if(substr($localBranch, 0, 1) == '*') $localBranch = substr($localBranch, 1); + if(substr($localBranch, 0, 1) == '*') continue; if(substr($localBranch, 0, 15) == 'remotes/origin/') $localBranch = substr($localBranch, 15); $localBranch = trim($localBranch); diff --git a/lib/scm/gogs.class.php b/lib/scm/gogs.class.php index eb8ad0754a..7dfe06709e 100644 --- a/lib/scm/gogs.class.php +++ b/lib/scm/gogs.class.php @@ -162,7 +162,7 @@ class Gogs { $localBranch = trim($localBranch); if(substr($localBranch, 0, 19) == 'remotes/origin/HEAD') continue; - if(substr($localBranch, 0, 1) == '*') $localBranch = substr($localBranch, 1); + if(substr($localBranch, 0, 1) == '*') continue; if(substr($localBranch, 0, 15) == 'remotes/origin/') $localBranch = substr($localBranch, 15); $localBranch = trim($localBranch);