8 if( !defined( 'MEDIAWIKI' ) )
12 * Special handling for image description pages
16 class ImagePage
extends Article
{
18 /* private */ var $img; // Image object this page is shown for
19 /* private */ var $repo;
20 var $mExtraDescription = false;
22 function __construct( $title, $time = false ) {
23 parent
::__construct( $title );
24 $this->img
= wfFindFile( $this->mTitle
, $time );
26 $this->img
= wfLocalFile( $this->mTitle
);
27 $this->current
= $this->img
;
29 $this->current
= $time ?
wfLocalFile( $this->mTitle
) : $this->img
;
31 $this->repo
= $this->img
->repo
;
35 * Handler for action=render
36 * Include body text only; none of the image extras
40 $wgOut->setArticleBodyOnly( true );
45 global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
47 if ( $this->img
->getRedirected() )
48 return Article
::view();
50 $diff = $wgRequest->getVal( 'diff' );
51 $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
53 if ( $this->mTitle
->getNamespace() != NS_IMAGE ||
( isset( $diff ) && $diffOnly ) )
54 return Article
::view();
56 if ($wgShowEXIF && $this->img
->exists()) {
57 // FIXME: bad interface, see note on MediaHandler::formatMetadata().
58 $formattedMetadata = $this->img
->formatMetadata();
59 $showmeta = $formattedMetadata !== false;
64 if ($this->img
->exists())
65 $wgOut->addHTML($this->showTOC($showmeta));
67 $this->openShowImage();
69 # No need to display noarticletext, we use our own message, output in openShowImage()
70 if ( $this->getID() ) {
73 # Just need to set the right headers
74 $wgOut->setArticleFlag( true );
75 $wgOut->setRobotpolicy( 'noindex,nofollow' );
76 $wgOut->setPageTitle( $this->mTitle
->getPrefixedText() );
80 # Show shared description, if needed
81 if ( $this->mExtraDescription
) {
82 $fol = wfMsgNoTrans( 'shareddescriptionfollows' );
83 if( $fol != '-' && !wfEmptyMsg( 'shareddescriptionfollows', $fol ) ) {
84 $wgOut->addWikiText( $fol );
86 $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription
. '</div>' );
88 $this->checkSharedConflict();
91 $this->closeShowImage();
92 $this->imageHistory();
96 global $wgStylePath, $wgStyleVersion;
97 $expand = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-expand' ) ) );
98 $collapse = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-collapse' ) ) );
99 $wgOut->addHTML( Xml
::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ). "\n" );
100 $wgOut->addWikiText( $this->makeMetadataTable( $formattedMetadata ) );
102 "<script type=\"text/javascript\" src=\"$wgStylePath/common/metadata.js?$wgStyleVersion\"></script>\n" .
103 "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
107 public function getRedirectTarget() {
108 if ( $this->img
->isLocal() )
109 return parent
::getRedirectTarget();
111 // Foreign image page
112 $from = $this->img
->getRedirected();
113 return $this->mRedirectTarget
= Title
::makeTitle( NS_IMAGE
, $from );
115 public function followRedirect() {
116 if ( $this->img
->isLocal() )
117 return parent
::followRedirect();
119 $from = $this->img
->getRedirected();
120 return Title
::makeTitle( NS_IMAGE
, $from );
128 * @param bool $metadata Whether or not to show the metadata link
131 function showTOC( $metadata ) {
133 $r = '<ul id="filetoc">
134 <li><a href="#file">' . $wgLang->getNsText( NS_IMAGE
) . '</a></li>
135 <li><a href="#filehistory">' . wfMsgHtml( 'filehist' ) . '</a></li>
136 <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>' .
137 ($metadata ?
' <li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . '
143 * Make a table with metadata to be shown in the output page.
145 * FIXME: bad interface, see note on MediaHandler::formatMetadata().
149 * @param array $exif The array containing the EXIF data
152 function makeMetadataTable( $metadata ) {
153 $r = wfMsg( 'metadata-help' ) . "\n\n";
154 $r .= "{| id=mw_metadata class=mw_metadata\n";
155 foreach ( $metadata as $type => $stuff ) {
156 foreach ( $stuff as $v ) {
157 $class = Sanitizer
::escapeId( $v['id'] );
158 if( $type == 'collapsed' ) {
159 $class .= ' collapsable';
161 $r .= "|- class=\"$class\"\n";
162 $r .= "!| {$v['name']}\n";
163 $r .= "|| {$v['value']}\n";
171 * Overloading Article's getContent method.
173 * Omit noarticletext if sharedupload; text will be fetched from the
174 * shared upload server if possible.
176 function getContent() {
177 if( $this->img
&& !$this->img
->isLocal() && 0 == $this->getID() ) {
180 return Article
::getContent();
183 function openShowImage() {
184 global $wgOut, $wgUser, $wgImageLimits, $wgRequest, $wgLang, $wgContLang;
186 $full_url = $this->img
->getURL();
187 $linkAttribs = false;
188 $sizeSel = intval( $wgUser->getOption( 'imagesize') );
189 if( !isset( $wgImageLimits[$sizeSel] ) ) {
190 $sizeSel = User
::getDefaultOption( 'imagesize' );
192 // The user offset might still be incorrect, specially if
193 // $wgImageLimits got changed (see bug #8858).
194 if( !isset( $wgImageLimits[$sizeSel] ) ) {
195 // Default to the first offset in $wgImageLimits
199 $max = $wgImageLimits[$sizeSel];
201 $maxHeight = $max[1];
202 $sk = $wgUser->getSkin();
203 $dirmark = $wgContLang->getDirMark();
205 if ( $this->img
->exists() ) {
207 $page = $wgRequest->getIntOrNull( 'page' );
208 if ( is_null( $page ) ) {
212 $params = array( 'page' => $page );
214 $width_orig = $this->img
->getWidth();
215 $width = $width_orig;
216 $height_orig = $this->img
->getHeight();
217 $height = $height_orig;
218 $mime = $this->img
->getMimeType();
220 $linkAttribs = array( 'href' => $full_url );
221 $longDesc = $this->img
->getLongDesc();
223 wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this , &$wgOut ) ) ;
225 if ( $this->img
->allowInlineDisplay() ) {
228 # "Download high res version" link below the image
229 #$msgsize = wfMsgHtml('file-info-size', $width_orig, $height_orig, $sk->formatSize( $this->img->getSize() ), $mime );
230 # We'll show a thumbnail of this image
231 if ( $width > $maxWidth ||
$height > $maxHeight ) {
232 # Calculate the thumbnail size.
233 # First case, the limiting factor is the width, not the height.
234 if ( $width / $height >= $maxWidth / $maxHeight ) {
235 $height = round( $height * $maxWidth / $width);
237 # Note that $height <= $maxHeight now.
239 $newwidth = floor( $width * $maxHeight / $height);
240 $height = round( $height * $newwidth / $width );
242 # Note that $height <= $maxHeight now, but might not be identical
243 # because of rounding.
245 $msgbig = wfMsgHtml( 'show-big-image' );
246 $msgsmall = wfMsgExt( 'show-big-image-thumb',
247 array( 'parseinline' ), $wgLang->formatNum( $width ), $wgLang->formatNum( $height ) );
249 # Image is small enough to show full size on image page
250 $msgbig = htmlspecialchars( $this->img
->getName() );
251 $msgsmall = wfMsgExt( 'file-nohires', array( 'parseinline' ) );
254 $params['width'] = $width;
255 $thumbnail = $this->img
->transform( $params );
257 $anchorclose = "<br />";
258 if( $this->img
->mustRender() ) {
263 '<br />' . Xml
::tags( 'a', $linkAttribs, $msgbig ) . "$dirmark " . $longDesc;
266 if ( $this->img
->isMultipage() ) {
267 $wgOut->addHTML( '<table class="multipageimage"><tr><td>' );
272 'alt' => $this->img
->getTitle()->getPrefixedText(),
275 $wgOut->addHTML( '<div class="fullImageLink" id="file">' .
276 $thumbnail->toHtml( $options ) .
277 $anchorclose . '</div>' );
280 if ( $this->img
->isMultipage() ) {
281 $count = $this->img
->pageCount();
284 $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
285 $link = $sk->makeKnownLinkObj( $this->mTitle
, $label, 'page='. ($page-1) );
286 $thumb1 = $sk->makeThumbLinkObj( $this->mTitle
, $this->img
, $link, $label, 'none',
287 array( 'page' => $page - 1 ) );
292 if ( $page < $count ) {
293 $label = wfMsg( 'imgmultipagenext' );
294 $link = $sk->makeKnownLinkObj( $this->mTitle
, $label, 'page='. ($page+
1) );
295 $thumb2 = $sk->makeThumbLinkObj( $this->mTitle
, $this->img
, $link, $label, 'none',
296 array( 'page' => $page +
1 ) );
302 $select = '<form name="pageselector" action="' .
303 htmlspecialchars( $wgScript ) .
304 '" method="get" onchange="document.pageselector.submit();">' .
305 Xml
::hidden( 'title', $this->getTitle()->getPrefixedDbKey() );
306 $select .= $wgOut->parse( wfMsg( 'imgmultigotopre' ), false ) .
307 ' <select id="pageselector" name="page">';
308 for ( $i=1; $i <= $count; $i++
) {
309 $select .= Xml
::option( $wgLang->formatNum( $i ), $i,
312 $select .= '</select>' . $wgOut->parse( wfMsg( 'imgmultigotopost' ), false ) .
313 '<input type="submit" value="' .
314 htmlspecialchars( wfMsg( 'imgmultigo' ) ) . '"></form>';
316 $wgOut->addHTML( '</td><td><div class="multipageimagenavbox">' .
317 "$select<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>" );
320 #if direct link is allowed but it's not a renderable image, show an icon.
321 if ($this->img
->isSafeFile()) {
322 $icon= $this->img
->iconThumb();
324 $wgOut->addHTML( '<div class="fullImageLink" id="file">' .
325 $icon->toHtml( array( 'desc-link' => true ) ) .
334 $filename = wfEscapeWikiText( $this->img
->getName() );
336 if (!$this->img
->isSafeFile()) {
337 $warning = wfMsgNoTrans( 'mediawarning' );
338 $wgOut->addWikiText( <<<EOT
339 <div class="fullMedia">
340 <span class="dangerousLink">[[Media:$filename|$filename]]</span>$dirmark
341 <span class="fileInfo"> $longDesc</span>
344 <div class="mediaWarning">$warning</div>
348 $wgOut->addWikiText( <<<EOT
349 <div class="fullMedia">
350 [[Media:$filename|$filename]]$dirmark <span class="fileInfo"> $longDesc</span>
357 if(!$this->img
->isLocal()) {
358 $this->printSharedImageText();
361 # Image does not exist
363 $title = SpecialPage
::getTitleFor( 'Upload' );
364 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
365 'wpDestFile=' . urlencode( $this->img
->getName() ) );
366 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
371 * Show a notice that the file is from a shared repository
373 function printSharedImageText() {
374 global $wgOut, $wgUser;
376 $descUrl = $this->img
->getDescriptionUrl();
377 $descText = $this->img
->getDescriptionText();
378 $s = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml( 'sharedupload' );
380 $sk = $wgUser->getSkin();
381 $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadwiki-linktext' ) );
382 $msg = ( $descText ) ?
'shareduploadwiki-desc' : 'shareduploadwiki';
383 $msg = wfMsgExt( $msg, array( 'parseinline', 'replaceafter' ), $link );
385 # Show message only if not voided by local sysops
390 $wgOut->addHTML( $s );
393 $this->mExtraDescription
= $descText;
397 function checkSharedConflict() {
398 global $wgOut, $wgUser;
399 $repoGroup = RepoGroup
::singleton();
400 if( !$repoGroup->hasForeignRepos() ) {
403 if( !$this->img
->isLocal() ) {
407 $this->dupFile
= null;
408 $repoGroup->forEachForeignRepo( array( $this, 'checkSharedConflictCallback' ) );
410 if( !$this->dupFile
)
412 $dupfile = $this->dupFile
;
414 ($this->img
->getSha1() == $dupfile->getSha1()) &&
415 ($this->img
->getSize() == $dupfile->getSize())
418 $sk = $wgUser->getSkin();
419 $descUrl = $dupfile->getDescriptionUrl();
421 $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadduplicate-linktext' ) );
422 $wgOut->addHTML( '<div id="shared-image-dup">' . wfMsgWikiHtml( 'shareduploadduplicate', $link ) . '</div>' );
424 $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadconflict-linktext' ) );
425 $wgOut->addHTML( '<div id="shared-image-conflict">' . wfMsgWikiHtml( 'shareduploadconflict', $link ) . '</div>' );
429 function checkSharedConflictCallback( $repo ) {
430 $dupfile = $repo->newFile( $this->img
->getTitle() );
431 if( $dupfile->exists() )
432 $this->dupFile
= $dupfile;
433 return $dupfile->exists();
436 function getUploadUrl() {
437 $uploadTitle = SpecialPage
::getTitleFor( 'Upload' );
438 return $uploadTitle->getFullUrl( 'wpDestFile=' . urlencode( $this->img
->getName() ) );
442 * Print out the various links at the bottom of the image page, e.g. reupload,
443 * external editing (and instructions link) etc.
445 function uploadLinksBox() {
446 global $wgUser, $wgOut;
448 if( !$this->img
->isLocal() )
451 $sk = $wgUser->getSkin();
453 $wgOut->addHtml( '<br /><ul>' );
455 # "Upload a new version of this file" link
456 if( UploadForm
::userCanReUpload($wgUser,$this->img
->name
) ) {
457 $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
458 $wgOut->addHtml( "<li><div class='plainlinks'>{$ulink}</div></li>" );
461 # Link to Special:FileDuplicateSearch
462 $dupeLink = $sk->makeKnownLinkObj( SpecialPage
::getTitleFor( 'FileDuplicateSearch', $this->mTitle
->getDBkey() ), wfMsgHtml( 'imagepage-searchdupe' ) );
463 $wgOut->addHtml( "<li>{$dupeLink}</li>" );
465 # External editing link
466 $elink = $sk->makeKnownLinkObj( $this->mTitle
, wfMsgHtml( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
467 $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
469 $wgOut->addHtml( '</ul>' );
472 function closeShowImage()
479 * If the page we've just displayed is in the "Image" namespace,
480 * we follow it with an upload history of the image and its usage.
482 function imageHistory()
484 global $wgUser, $wgOut, $wgUseExternalEditor;
486 $sk = $wgUser->getSkin();
488 if ( $this->img
->exists() ) {
489 $list = new ImageHistoryList( $sk, $this->current
);
490 $file = $this->current
;
491 $dims = $file->getDimensionsString();
492 $s = $list->beginImageHistoryList() .
493 $list->imageHistoryLine( true, $file );
494 // old image versions
495 $hist = $this->img
->getHistory();
496 foreach( $hist as $file ) {
497 $dims = $file->getDimensionsString();
498 $s .= $list->imageHistoryLine( false, $file );
500 $s .= $list->endImageHistoryList();
502 $wgOut->addHTML( $s );
504 $this->img
->resetHistory(); // free db resources
506 # Exist check because we don't want to show this on pages where an image
507 # doesn't exist along with the noimage message, that would suck. -ævar
508 if( $wgUseExternalEditor && $this->img
->exists() ) {
509 $this->uploadLinksBox();
514 function imageLinks()
516 global $wgUser, $wgOut;
518 $wgOut->addHTML( Xml
::element( 'h2', array( 'id' => 'filelinks' ), wfMsg( 'imagelinks' ) ) . "\n" );
520 $dbr = wfGetDB( DB_SLAVE
);
521 $page = $dbr->tableName( 'page' );
522 $imagelinks = $dbr->tableName( 'imagelinks' );
524 $sql = "SELECT page_namespace,page_title FROM $imagelinks,$page WHERE il_to=" .
525 $dbr->addQuotes( $this->mTitle
->getDBkey() ) . " AND il_from=page_id";
526 $sql = $dbr->limitResult($sql, 500, 0);
527 $res = $dbr->query( $sql, "ImagePage::imageLinks" );
529 if ( 0 == $dbr->numRows( $res ) ) {
530 $wgOut->addHtml( '<p>' . wfMsg( "nolinkstoimage" ) . "</p>\n" );
533 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
535 $sk = $wgUser->getSkin();
536 while ( $s = $dbr->fetchObject( $res ) ) {
537 $name = Title
::MakeTitle( $s->page_namespace
, $s->page_title
);
538 $link = $sk->makeKnownLinkObj( $name, "" );
539 $wgOut->addHTML( "<li>{$link}</li>\n" );
541 $wgOut->addHTML( "</ul>\n" );
545 * Delete the file, or an earlier version of it
547 public function delete() {
548 if( !$this->img
->exists() ||
!$this->img
->isLocal() ) {
549 // Standard article deletion
553 $deleter = new FileDeleteForm( $this->img
);
558 * Revert the file to an earlier version
560 public function revert() {
561 $reverter = new FileRevertForm( $this->img
);
562 $reverter->execute();
566 * Override handling of action=purge
569 if( $this->img
->exists() ) {
570 wfDebug( "ImagePage::doPurge purging " . $this->img
->getName() . "\n" );
571 $update = new HTMLCacheUpdate( $this->mTitle
, 'imagelinks' );
573 $this->img
->upgradeRow();
574 $this->img
->purgeCache();
576 wfDebug( "ImagePage::doPurge no image\n" );
582 * Display an error with a wikitext description
584 function showError( $description ) {
586 $wgOut->setPageTitle( wfMsg( "internalerror" ) );
587 $wgOut->setRobotpolicy( "noindex,nofollow" );
588 $wgOut->setArticleRelated( false );
589 $wgOut->enableClientCache( false );
590 $wgOut->addWikiText( $description );
596 * Builds the image revision log shown on image pages
600 class ImageHistoryList
{
602 protected $img, $skin, $title, $repo;
604 public function __construct( $skin, $img ) {
607 $this->title
= $img->getTitle();
610 public function beginImageHistoryList() {
611 global $wgOut, $wgUser;
612 $deleteColumn = $wgUser->isAllowed( 'delete' ) ||
$wgUser->isAllowed( 'deleterevision' );
613 return Xml
::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) )
614 . $wgOut->parse( wfMsgNoTrans( 'filehist-help' ) )
615 . Xml
::openElement( 'table', array( 'class' => 'filehistory' ) ) . "\n"
617 . ( $this->img
->isLocal() && $deleteColumn ?
'<td></td>' : '' )
618 . '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>'
619 . '<th>' . wfMsgHtml( 'filehist-user' ) . '</th>'
620 . '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>'
621 . '<th class="mw-imagepage-filesize">' . wfMsgHtml( 'filehist-filesize' ) . '</th>'
622 . '<th>' . wfMsgHtml( 'filehist-comment' ) . '</th>'
626 public function endImageHistoryList() {
630 public function imageHistoryLine( $iscur, $file ) {
631 global $wgUser, $wgLang, $wgContLang, $wgTitle;
633 $timestamp = wfTimestamp(TS_MW
, $file->getTimestamp());
634 $img = $iscur ?
$file->getName() : $file->getArchiveName();
635 $user = $file->getUser('id');
636 $usertext = $file->getUser('text');
637 $size = $file->getSize();
638 $description = $file->getDescription();
639 $dims = $file->getDimensionsString();
640 $sha1 = $file->getSha1();
642 $local = $this->img
->isLocal();
646 if( $local && ($wgUser->isAllowed('delete') ||
$wgUser->isAllowed('deleterevision') ) ) {
648 # Link to remove from history
649 if( $wgUser->isAllowed( 'delete' ) ) {
651 $q[] = 'action=delete';
653 $q[] = 'oldimage=' . urlencode( $img );
654 $row .= $this->skin
->makeKnownLinkObj(
656 wfMsgHtml( $iscur ?
'filehist-deleteall' : 'filehist-deleteone' ),
661 # Link to hide content
662 if( $wgUser->isAllowed( 'deleterevision' ) ) {
663 $revdel = SpecialPage
::getTitleFor( 'Revisiondelete' );
664 // If file is top revision or locked from this user, don't link
665 if( $iscur ||
!$file->userCan(File
::DELETED_RESTRICTED
) ) {
666 $del = wfMsgHtml( 'rev-delundel' );
668 // If the file was hidden, link to sha-1
669 list($ts,$name) = explode('!',$img,2);
670 $del = $this->skin
->makeKnownLinkObj( $revdel, wfMsg( 'rev-delundel' ),
671 'target=' . urlencode( $wgTitle->getPrefixedText() ) .
672 '&oldimage=' . urlencode( $ts ) );
673 // Bolden oversighted content
674 if( $file->isDeleted(File
::DELETED_RESTRICTED
) )
675 $del = "<strong>$del</strong>";
677 $row .= "<tt><small>$del</small></tt>";
682 // Reversion link/current indicator
685 $row .= wfMsgHtml( 'filehist-current' );
686 } elseif( $local && $wgUser->isLoggedIn() && $this->title
->userCan( 'edit' ) ) {
687 if( $file->isDeleted(File
::DELETED_FILE
) ) {
688 $row .= wfMsgHtml('filehist-revert');
691 $q[] = 'action=revert';
692 $q[] = 'oldimage=' . urlencode( $img );
693 $q[] = 'wpEditToken=' . urlencode( $wgUser->editToken( $img ) );
694 $row .= $this->skin
->makeKnownLinkObj( $this->title
,
695 wfMsgHtml( 'filehist-revert' ),
696 implode( '&', $q ) );
701 // Date/time and image link
703 if( !$file->userCan(File
::DELETED_FILE
) ) {
704 # Don't link to unviewable files
705 $row .= '<span class="history-deleted">' . $wgLang->timeAndDate( $timestamp, true ) . '</span>';
706 } else if( $file->isDeleted(File
::DELETED_FILE
) ) {
707 $revdel = SpecialPage
::getTitleFor( 'Revisiondelete' );
708 # Make a link to review the image
709 $url = $this->skin
->makeKnownLinkObj( $revdel, $wgLang->timeAndDate( $timestamp, true ),
710 "target=".$wgTitle->getPrefixedText()."&file=$sha1.".$this->img
->getExtension() );
711 $row .= '<span class="history-deleted">'.$url.'</span>';
713 $url = $iscur ?
$this->img
->getUrl() : $this->img
->getArchiveUrl( $img );
714 $row .= Xml
::element( 'a',
715 array( 'href' => $url ),
716 $wgLang->timeAndDate( $timestamp, true ) );
724 // Hide deleted usernames
725 if( $file->isDeleted(File
::DELETED_USER
) )
726 $row .= '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>';
728 $row .= $this->skin
->userLink( $user, $usertext ) .
729 $this->skin
->userToolLinks( $user, $usertext );
731 $row .= htmlspecialchars( $usertext );
736 $row .= '<td>' . htmlspecialchars( $dims ) . '</td>';
739 $row .= '<td class="mw-imagepage-filesize">' . $this->skin
->formatSize( $size ) . '</td>';
741 // Don't show deleted descriptions
742 if ( $file->isDeleted(File
::DELETED_COMMENT
) )
743 $row .= '<td><span class="history-deleted">' . wfMsgHtml('rev-deleted-comment') . '</span></td>';
745 $row .= '<td>' . $this->skin
->commentBlock( $description, $this->title
) . '</td>';
747 return "<tr>{$row}</tr>\n";