From 639768c5ef6fc80a780db94df6957ffadf7b6157 Mon Sep 17 00:00:00 2001 From: myfreescalewebpage Date: Sat, 29 Oct 2016 13:15:07 +0200 Subject: [PATCH] Fix fatal error with long tags See issue #696 --- src/Util/Routing.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Util/Routing.php b/src/Util/Routing.php index f578f4b..2ab2e31 100644 --- a/src/Util/Routing.php +++ b/src/Util/Routing.php @@ -39,8 +39,10 @@ class Routing $slashPosition === 40)) { // We may have a commit hash as our commitish. $hash = substr($commitishPath, 0, 40); - if ($repository->hasCommit($hash)) { - $commitish = $hash; + if (preg_match('/[^a-zA-Z0-9]/i', $hash) === 0) { + if ($repository->hasCommit($hash)) { + $commitish = $hash; + } } }