From 652af777aa03f1045b7170bfe1183e606f4ab072 Mon Sep 17 00:00:00 2001 From: Vitaliy Ognev Date: Sun, 23 Dec 2012 15:34:17 +0200 Subject: [PATCH] ensure ref name is encoded --- src/GitList/Util/Repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index 0236d14..5659125 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -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]); } }