return "<!-- ERROR -->$html";
}
- if ( is_string( $query ) ) {
- // some functions withing core using this still hand over query strings
- wfDeprecated( __METHOD__ . ' with parameter $query as string (should be array)', '1.20' );
- $query = wfCgiToArray( $query );
- }
-
$services = MediaWikiServices::getInstance();
$options = (array)$options;
if ( $options ) {
# Use manually specified thumbnail
$manual_title = Title::makeTitleSafe( NS_FILE, $frameParams['manualthumb'] );
if ( $manual_title ) {
- $manual_img = wfFindFile( $manual_title );
+ $manual_img = MediaWikiServices::getInstance()->getRepoGroup()
+ ->findFile( $manual_title );
if ( $manual_img ) {
$thumb = $manual_img->getUnscaledThumb( $handlerParams );
$manualthumb = true;
$label = $title->getPrefixedText();
}
$encLabel = htmlspecialchars( $label );
- $currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
+ $currentExists = $time
+ && MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title ) !== false;
if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads )
&& !$currentExists
* @since 1.16.3
* @param LinkTarget $title
* @param string $html Pre-sanitized HTML
- * @param string $time MW timestamp of file creation time
+ * @param string|false $time MW timestamp of file creation time
* @return string HTML
*/
public static function makeMediaLinkObj( $title, $html = '', $time = false ) {
- $img = wfFindFile( $title, [ 'time' => $time ] );
+ $img = MediaWikiServices::getInstance()->getRepoGroup()->findFile(
+ $title, [ 'time' => $time ]
+ );
return self::makeMediaLinkFile( $title, $img, $html );
}