* (bug 27018) Added action=filerevert to revert files to an old version
* (bug 27897) list=allusers and list=users list hidden users
* (bug 27717) API's exturlusage module does not respect $wgMiserMode
+* (bug 27588) list=filearchive&faprop=sha1 returns empty attribute
=== Languages updated in 1.18 ===
self::addTitleInfo( $file, Title::makeTitle( NS_FILE, $row->fa_name ) );
if ( $fld_sha1 ) {
- $file['sha1'] = wfBaseConvert( $row->fa_storage_key, 36, 16, 40 );
+ $file['sha1'] = LocalRepo::getHashFromKey( $row->fa_storage_key );
}
if ( $fld_timestamp ) {
$file['timestamp'] = wfTimestamp( TS_ISO_8601, $row->fa_timestamp );
array( 'fa_storage_group' => 'deleted', 'fa_storage_key' => $key ),
__METHOD__, array( 'FOR UPDATE' ) );
if( !$inuse ) {
- $sha1 = substr( $key, 0, strcspn( $key, '.' ) );
- $ext = substr( $key, strcspn($key,'.') + 1 );
+ $sha1 = self::getHashFromKey( $key );
+ $ext = substr( $key, strcspn( $key, '.' ) + 1 );
$ext = File::normalizeExtension($ext);
$inuse = $dbw->selectField( 'oldimage', '1',
array( 'oi_sha1' => $sha1,
}
return $status;
}
+
+ /**
+ * Gets the SHA1 hash from a storage key
+ *
+ * @static
+ * @param string $key
+ * @return string
+ */
+ public static function getHashFromKey( $key ) {
+ return strtok( $key, '.' );
+ }
/**
* Checks if there is a redirect named as $title