From 89c52df9b7f08da6de98254167d0aab7cbbcb3bc Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 22 Feb 2022 17:21:35 +0800 Subject: [PATCH] * Fix bug #19869,19876. --- lib/scm/gitlab.class.php | 2 +- module/repo/control.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 11e5e29c00..e5645e816c 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -365,7 +365,7 @@ class gitlab $commits = $this->getCommitsByPath($entry); if(!empty($commits)) $file->revision = zget($commits[0], 'id', ''); - $info->kind = $file->type == 'tree' ? 'dir' : 'file'; + $info->kind = (isset($file->type) and $file->type == 'tree') ? 'dir' : 'file'; } return $info; diff --git a/module/repo/control.php b/module/repo/control.php index 173c5c2f45..b5df739ff5 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -716,6 +716,8 @@ class repo extends control */ public function diff($repoID, $objectID = 0, $entry = '', $oldRevision = '', $newRevision = '', $showBug = 'false', $encoding = '', $isBranchOrTag = false) { + $oldRevision = urldecode(urldecode($oldRevision)); //Fix error. + $this->commonAction($repoID, $objectID); if($this->get->repoPath) $entry = $this->get->repoPath;