From e0b65585d769283f4e8c09ee5127fb7805c29c59 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 13 Jan 2022 17:22:05 +0800 Subject: [PATCH] * Finish task #47232. --- module/sonarqube/control.php | 4 +++- module/sonarqube/view/browseproject.html.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index 9baceb72de..89da1b558e 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -189,7 +189,9 @@ class sonarqube extends control { if($confirm != 'yes') die(js::confirm($this->lang->sonarqube->confirmDeleteProject, inlink('deleteProject', "sonarqubeID=$sonarqubeID&projectKey=$projectKey&confirm=yes"))); - $reponse = $this->sonarqube->apiDeleteProject($sonarqubeID, $projectKey); + /* Fix error when request type is PATH_INFO and the tag name contains '-'.*/ + $projectKey = str_replace('*', '-', $projectKey); + $reponse = $this->sonarqube->apiDeleteProject($sonarqubeID, $projectKey); if(isset($reponse->errors)) return print(js::alert($reponse->errors[0]->msg)); diff --git a/module/sonarqube/view/browseproject.html.php b/module/sonarqube/view/browseproject.html.php index e53afcd5b8..bd18482b39 100644 --- a/module/sonarqube/view/browseproject.html.php +++ b/module/sonarqube/view/browseproject.html.php @@ -58,7 +58,9 @@ lastAnalysisDate, 0, 10);?> createLink('sonarqube', 'deleteProject', "sonarqubeID=$sonarqubeID&project=$sonarqubeProject->key"), '', 'hiddenwin', "title='{$lang->sonarqube->deleteProject}' class='btn'"); + /* Fix error when request type is PATH_INFO and the project key contains '-'.*/ + $projectKey = str_replace('-', '*', $sonarqubeProject->key); + if(common::hasPriv('sonarqube', 'deleteProject')) echo html::a($this->createLink('sonarqube', 'deleteProject', "sonarqubeID=$sonarqubeID&project=$projectKey"), '', 'hiddenwin', "title='{$lang->sonarqube->deleteProject}' class='btn'"); ?>