}
/**
- * Callback for usort() to do file sorts by title
+ * Callback for usort() to do file sorts by name
*
* @param $a File
* @param $b File
*
- * @return Integer: result of title comparison
+ * @return Integer: result of name comparison
*/
public static function compare( File $a, File $b ) {
- return Title::compare( $a->getTitle(), $b->getTitle() );
+ return strcmp( $a->getName(), $b->getName() );
}
/**
return $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
} else {
return new MediaTransformError( 'thumbnail_error',
- $params['width'], 0, wfMsg( 'thumbnail-dest-create' ) );
+ $params['width'], 0, wfMessage( 'thumbnail-dest-create' )->text() );
}
}
$tmpThumbPath = $tmpFile->getPath(); // path of 0-byte temp file
// Actually render the thumbnail...
+ wfProfileIn( __METHOD__ . '-doTransform' );
$thumb = $this->handler->doTransform( $this, $tmpThumbPath, $thumbUrl, $params );
+ wfProfileOut( __METHOD__ . '-doTransform' );
$tmpFile->bind( $thumb ); // keep alive with $thumb
if ( !$thumb ) { // bad params?