* in the wiki's own database. This is the most commonly used repository class.
*
* @ingroup FileRepo
+ * @method LocalFile|null newFile( $title, $time = false )
*/
class LocalRepo extends FileRepo {
/** @var callable */
* @return string
*/
public static function getHashFromKey( $key ) {
- return strtok( $key, '.' );
+ $sha1 = strtok( $key, '.' );
+ if ( is_string( $sha1 ) && strlen( $sha1 ) === 32 && $sha1[0] === '0' ) {
+ $sha1 = substr( $sha1, 1 );
+ }
+ return $sha1;
}
/**