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; + } } }