* @file
*/
+use Wikimedia\Rdbms\ResultWrapper;
+
/**
* Class for viewing MediaWiki file description pages
*
}
$out->addModuleStyles( [
- 'filepage', // always show the local local Filepage.css, bug 29277
+ 'filepage', // always show the local local Filepage.css, T31277
'mediawiki.action.view.filepage', // Add MediaWiki styles for a file page
] );
}
$filename = wfEscapeWikiText( $this->displayImg->getName() );
$linktext = $filename;
- // Use of &$this in hooks triggers warnings in PHP 7.1
+ // Avoid PHP 7.1 warning from passing $this by reference
$imagePage = $this;
Hooks::run( 'ImageOpenShowImageInlineBefore', [ &$imagePage, &$out ] );
// this will get messy.
// The dirmark, however, must not be immediately adjacent
// to the filename, because it can get copied with it.
- // See bug 25277.
+ // See T27277.
// @codingStandardsIgnoreStart Ignore long line
$out->addWikiText( <<<EOT
<div class="fullMedia"><span class="dangerousLink">{$medialink}</span> $dirmark<span class="fileInfo">$longDesc</span></div>
} else {
# Image does not exist
if ( !$this->getId() ) {
+ $dbr = wfGetDB( DB_REPLICA );
+
# No article exists either
# Show deletion log to be consistent with normal articles
LogEventsList::showLogExtract(
$this->getTitle()->getPrefixedText(),
'',
[ 'lim' => 10,
- 'conds' => [ "log_action != 'revision'" ],
+ 'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
'showIfEmpty' => false,
'msgKey' => [ 'moveddeleted-notice' ]
]