Bug 35583 - GitInfo::isSHA1 returns true for non-sha1 values
authorReedy <reedy@wikimedia.org>
Thu, 29 Mar 2012 14:38:36 +0000 (15:38 +0100)
committerReedy <reedy@wikimedia.org>
Thu, 29 Mar 2012 14:38:36 +0000 (15:38 +0100)
Patch by Alexis

Change-Id: I6c69d017d2d6ad1237b0c34ffa8a7ae5fb518178

includes/GitInfo.php

index bc3f35e..618ae94 100644 (file)
@@ -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
+}