ensure ref name is encoded

This commit is contained in:
Vitaliy Ognev
2012-12-23 15:34:17 +02:00
parent 06f65ca8e2
commit 652af777aa

View File

@@ -199,7 +199,7 @@ class Repository
// Otherwise, attempt to detect the ref using a list of the project's branches and tags
$valid_refs = array_merge((array) $repository->getBranches(), (array) $repository->getTags());
foreach ($valid_refs as $k => $v) {
if (!preg_match("#^{$v}/#", $input)) {
if (!preg_match(sprintf("#^%s/#", preg_quote($v, '#')), $input)) {
unset($valid_refs[$k]);
}
}