From 2dba97ecfb64a56370a91d264ada4aaa7afa9761 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Wed, 5 Dec 2018 21:51:15 +0200 Subject: [PATCH] Don't encode slashes unnecessarily --- Puc/v4p4/Vcs/GitLabApi.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Puc/v4p4/Vcs/GitLabApi.php b/Puc/v4p4/Vcs/GitLabApi.php index 2c827fa..e09a82f 100644 --- a/Puc/v4p4/Vcs/GitLabApi.php +++ b/Puc/v4p4/Vcs/GitLabApi.php @@ -184,10 +184,10 @@ if ( !class_exists('Puc_v4p4_Vcs_GitLabApi', false) ): ); foreach ($variables as $name => $value) { - $url = str_replace("/:{$name}", urlencode('/' . $value), $url); + $url = str_replace("/:{$name}", '/' . urlencode($value), $url); } - $url = substr($url, 3); + $url = substr($url, 1); $url = sprintf('https://%1$s/api/v4/projects/%2$s', $this->repositoryHost, $url); if ( !empty($this->accessToken) ) {