1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Fix urlencoding of gitlab dots, fixes #6064

This commit is contained in:
Jordi Boggiano 2017-01-27 18:01:24 +01:00
parent 65a5727315
commit f3d0e4660d
2 changed files with 5 additions and 3 deletions

View file

@ -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;