From: Reedy Date: Thu, 29 Mar 2012 14:38:36 +0000 (+0100) Subject: Bug 35583 - GitInfo::isSHA1 returns true for non-sha1 values X-Git-Tag: 1.31.0-rc.0~24097^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=b5adbc772c076cbc15f87777937160bd1753aa34;p=lhc%2Fweb%2Fwiklou.git Bug 35583 - GitInfo::isSHA1 returns true for non-sha1 values Patch by Alexis Change-Id: I6c69d017d2d6ad1237b0c34ffa8a7ae5fb518178 --- diff --git a/includes/GitInfo.php b/includes/GitInfo.php index bc3f35e3d1..618ae94721 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -46,7 +46,7 @@ class GitInfo { * @return bool Whether or not the string looks like a SHA1 */ public static function isSHA1( $str ) { - return !!preg_match( '/^[0-9A-Z]{40}$/i', $str ); + return !!preg_match( '/^[0-9A-F]{40}$/i', $str ); } /** @@ -119,4 +119,4 @@ class GitInfo { return self::repo()->getCurrentBranch(); } -} \ No newline at end of file +}