$nt = Title::newFromText( $this->mSearch );
if ( $nt ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$this->mQueryConds[] = 'LOWER(img_name)' .
$dbr->buildLike( $dbr->anyString(),
strtolower( $nt->getDBkey() ), $dbr->anyString() );
if ( $this->mSearch !== '' ) {
$nt = Title::newFromText( $this->mSearch );
if ( $nt ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$conds[] = 'LOWER(' . $prefix . '_name)' .
$dbr->buildLike( $dbr->anyString(),
strtolower( $nt->getDBkey() ), $dbr->anyString() );
}
unset( $field );
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
if ( $dbr->implicitGroupby() ) {
$options = [ 'GROUP BY' => 'img_name' ];
} else {
// If statement for paranoia
if ( $file ) {
$thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] );
-
- return $thumb->toHtml( [ 'desc-link' => true ] );
+ if ( $thumb ) {
+ return $thumb->toHtml( [ 'desc-link' => true ] );
+ } else {
+ return wfMessage( 'thumbnail_error', '' )->escaped();
+ }
} else {
return htmlspecialchars( $value );
}
case 'img_description':
return Linker::formatComment( $value );
case 'count':
- return intval( $value ) + 1;
+ return $this->getLanguage()->formatNum( intval( $value ) + 1 );
case 'top':
// Messages: listfiles-latestversion-yes, listfiles-latestversion-no
return $this->msg( 'listfiles-latestversion-' . $value );