Fix urlencoding of gitlab dots, fixes #6064

main
Jordi Boggiano 8 years ago
parent 65a5727315
commit f3d0e4660d

@ -220,7 +220,9 @@ class GitLabDriver extends VcsDriver
$encoded = '';
for ($i = 0; isset($string[$i]); $i++) {
$character = $string[$i];
if (!ctype_alnum($character)) $character = '%' . sprintf('%02X', ord($character));
if (!ctype_alnum($character) && !in_array($character, array('-', '_'), true)) {
$character = '%' . sprintf('%02X', ord($character));
}
$encoded .= $character;
}
return $encoded;

@ -290,8 +290,8 @@ JSON;
public function testGitlabSubDirectory()
{
$url = 'https://mycompany.com/gitlab/mygroup/myproject';
$apiUrl = 'https://mycompany.com/gitlab/api/v3/projects/mygroup%2Fmyproject';
$url = 'https://mycompany.com/gitlab/mygroup/my-pro.ject';
$apiUrl = 'https://mycompany.com/gitlab/api/v3/projects/mygroup%2Fmy-pro%2Eject';
$driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->process->reveal(), $this->remoteFilesystem->reveal());
$driver->initialize();

Loading…
Cancel
Save