* (bug 3210) Fix Media: links with remote image URL path
[mediawiki.git] / includes / ImagePage.php
blob4c6cf28c8efbacfbdea08a6b1aaaaf4c3eea795a
1 <?php
2 /**
3 * @package MediaWiki
4 */
6 /**
8 */
9 if( !defined( 'MEDIAWIKI' ) )
10 die();
12 require_once( 'Image.php' );
14 /**
15 * Special handling for image description pages
16 * @package MediaWiki
18 class ImagePage extends Article {
20 /* private */ var $img; // Image object this page is shown for
21 var $mExtraDescription = false;
23 function render() {
24 global $wgOut;
25 $wgOut->setArticleBodyOnly(true);
26 $wgOut->addWikitext($this->getContent(true));
29 function view() {
30 global $wgUseExternalEditor, $wgOut, $wgShowEXIF;
32 $this->img = new Image( $this->mTitle );
34 if( $this->mTitle->getNamespace() == NS_IMAGE ) {
35 if ($wgShowEXIF && $this->img->exists()) {
36 $exif = $this->img->getExifData();
37 $showmeta = count($exif) ? true : false;
38 } else {
39 $exif = false;
40 $showmeta = false;
43 if ($this->img->exists())
44 $wgOut->addHTML($this->showTOC($showmeta));
46 $this->openShowImage();
47 if ($exif)
48 $wgOut->addWikiText($this->makeMetadataTable($exif));
50 # No need to display noarticletext, we use our own message, output in openShowImage()
51 if( $this->getID() ) {
52 Article::view();
53 } else {
54 # Just need to set the right headers
55 $wgOut->setArticleFlag( true );
56 $wgOut->setRobotpolicy( 'index,follow' );
57 $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
58 $wgOut->addMetaTags();
59 $this->viewUpdates();
62 if ($this->mExtraDescription) {
63 $fol = wfMsg('shareddescriptionfollows');
64 if ($fol != '-')
65 $wgOut->addWikiText(wfMsg('shareddescriptionfollows'));
66 $wgOut->addHTML($this->mExtraDescription);
69 $this->closeShowImage();
70 $this->imageHistory();
71 $this->imageLinks();
72 } else {
73 Article::view();
77 /**
78 * Create the TOC
80 * @access private
82 * @param bool $metadata Whether or not to show the metadata link
83 * @return string
85 function showTOC( $metadata ) {
86 global $wgLang;
87 $r = '<ul id="filetoc">
88 <li><a href="#file">' . $wgLang->getNsText( NS_IMAGE ) . '</a></li>' .
89 ($metadata ? '<li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . '
90 <li><a href="#filehistory">' . wfMsgHtml( 'imghistory' ) . '</a></li>
91 <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>
92 </ul>';
93 return $r;
96 /**
97 * Make a table with metadata to be shown in the output page.
99 * @access private
101 * @param array $exif The array containing the EXIF data
102 * @return string
104 function makeMetadataTable( $exif ) {
105 $r = "{| class=metadata align=right width=250px\n";
106 $r .= '|+ id=metadata | '. htmlspecialchars( wfMsgHtml( 'metadata' ) ) . "\n";
107 foreach( $exif as $k => $v ) {
108 $tag = strtolower( $k );
109 $r .= "! class=$tag |" . wfMsg( "exif-$tag" ) . "\n";
110 $r .= "| class=$tag |" . htmlspecialchars( $v ) . "\n";
111 $r .= "|-\n";
113 return substr($r, 0, -3) . '|}';
117 * Overloading Article's getContent method.
118 * Omit noarticletext if sharedupload
120 * @param $noredir If true, do not follow redirects
122 function getContent( $noredir )
124 if ( $this->img && $this->img->fromSharedDirectory && 0 == $this->getID() ) {
125 return '';
127 return Article::getContent( $noredir );
130 function openShowImage()
132 global $wgOut, $wgUser, $wgImageLimits, $wgRequest,
133 $wgUseImageResize, $wgRepositoryBaseUrl,
134 $wgUseExternalEditor, $wgServer, $wgFetchCommonsDescriptions;
135 $full_url = $this->img->getViewURL();
136 $anchoropen = '';
137 $anchorclose = '';
139 if( $wgUser->getOption( 'imagesize' ) == '' ) {
140 $sizeSel = User::getDefaultOption( 'imagesize' );
141 } else {
142 $sizeSel = intval( $wgUser->getOption( 'imagesize' ) );
144 if( !isset( $wgImageLimits[$sizeSel] ) ) {
145 $sizeSel = User::getDefaultOption( 'imagesize' );
147 $max = $wgImageLimits[$sizeSel];
148 $maxWidth = $max[0];
149 $maxHeight = $max[1];
150 $sk = $wgUser->getSkin();
152 if ( $this->img->exists() ) {
153 # image
154 $width = $this->img->getWidth();
155 $height = $this->img->getHeight();
156 $showLink = false;
158 if ( $this->img->allowInlineDisplay() and $width and $height) {
159 # image
161 # "Download high res version" link below the image
162 $msg = wfMsgHtml('showbigimage', $width, $height, intval( $this->img->getSize()/1024 ) );
163 if ( $width > $maxWidth ) {
164 $height = floor( $height * $maxWidth / $width );
165 $width = $maxWidth;
167 if ( $height > $maxHeight ) {
168 $width = floor( $width * $maxHeight / $height );
169 $height = $maxHeight;
171 if ( !$this->img->mustRender()
172 && ( $width != $this->img->getWidth() || $height != $this->img->getHeight() ) ) {
173 if( $wgUseImageResize ) {
174 $thumbnail = $this->img->getThumbnail( $width );
175 if ( $thumbnail == null ) {
176 $url = $full_url;
177 } else {
178 $url = $thumbnail->getUrl();
180 } else {
181 # No resize ability? Show the full image, but scale
182 # it down in the browser so it fits on the page.
183 $url = $full_url;
185 $anchoropen = "<a href=\"{$full_url}\">";
186 $anchorclose = "</a><br />\n$anchoropen{$msg}</a>";
187 } else {
188 $url = $full_url;
189 $showLink = $this->img->mustRender();
191 $wgOut->addHTML( '<div class="fullImageLink" id="file">' . $anchoropen .
192 "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
193 htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '</div>' );
194 } else {
195 #if direct link is allowed but it's not a renderable image, show an icon.
196 if ($this->img->isSafeFile()) {
197 $icon= $this->img->iconThumb();
199 $wgOut->addHTML( '<div class="fullImageLink" id="file"><a href="' . $full_url . '">' .
200 $icon->toHtml() .
201 '</a></div>' );
204 $showLink = true;
208 if ($showLink) {
209 $filename = wfEscapeWikiText( $this->img->getName() );
210 $info = wfMsg( 'fileinfo',
211 ceil($this->img->getSize()/1024.0),
212 $this->img->getMimeType() );
214 if (!$this->img->isSafeFile()) {
215 $warning = wfMsg( 'mediawarning' );
216 $wgOut->addWikiText( <<<END
217 <div class="fullMedia">
218 <span class="dangerousLink">[[Media:$filename|$filename]]</span>
219 <span class="fileInfo"> ($info)</span>
220 </div>
222 <div class="mediaWarning">$warning</div>
225 } else {
226 $wgOut->addWikiText( <<<END
227 <div class="fullMedia">
228 [[Media:$filename|$filename]] <span class="fileInfo"> ($info)</span>
229 </div>
235 if($this->img->fromSharedDirectory) {
236 $this->printSharedImageText();
238 } else {
239 # Image does not exist
241 $title = Title::makeTitle( NS_SPECIAL, 'Upload' );
242 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
243 'wpDestFile=' . urlencode( $this->img->getName() ) );
244 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
248 function printSharedImageText() {
249 global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser;
251 $url = $wgRepositoryBaseUrl . urlencode($this->mTitle->getDBkey());
252 $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
253 if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) {
255 $sk = $wgUser->getSkin();
256 $title = Title::makeTitle( NS_SPECIAL, 'Upload' );
257 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
258 array( 'wpDestFile' => urlencode( $this->img->getName() )));
259 $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
261 $sharedtext .= "</div>";
262 $wgOut->addHTML($sharedtext);
264 if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
265 require_once("HttpFunctions.php");
266 $ur = ini_set('allow_url_fopen', true);
267 $text = wfGetHTTP($url . '?action=render');
268 ini_set('allow_url_fopen', $ur);
269 if ($text)
270 $this->mExtraDescription = $text;
274 function getUploadUrl() {
275 global $wgServer;
276 $uploadTitle = Title::makeTitle( NS_SPECIAL, 'Upload' );
277 return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) );
281 function uploadLinksBox()
283 global $wgUser, $wgOut;
285 if ($this->img->fromSharedDirectory)
286 return;
288 $sk = $wgUser->getSkin();
289 $wgOut->addHTML( '<br /><ul><li>' );
290 $wgOut->addWikiText( '<div>'. wfMsg( 'uploadnewversion', $this->getUploadUrl() ) .'</div>' );
291 $wgOut->addHTML( '</li><li>' );
292 $wgOut->addHTML( $sk->makeKnownLinkObj( $this->mTitle,
293 wfMsg( 'edit-externally' ), "action=edit&externaledit=true&mode=file" ) );
294 $wgOut->addWikiText( '<div>' . wfMsg('edit-externally-help') . '</div>' );
295 $wgOut->addHTML( '</li></ul>' );
298 function closeShowImage()
300 # For overloading
305 * If the page we've just displayed is in the "Image" namespace,
306 * we follow it with an upload history of the image and its usage.
308 function imageHistory()
310 global $wgUser, $wgOut, $wgUseExternalEditor;
312 $sk = $wgUser->getSkin();
314 $line = $this->img->nextHistoryLine();
316 if ( $line ) {
317 $list =& new ImageHistoryList( $sk );
318 $s = $list->beginImageHistoryList() .
319 $list->imageHistoryLine( true, wfTimestamp(TS_MW, $line->img_timestamp),
320 $this->mTitle->getDBkey(), $line->img_user,
321 $line->img_user_text, $line->img_size, $line->img_description );
323 while ( $line = $this->img->nextHistoryLine() ) {
324 $s .= $list->imageHistoryLine( false, $line->img_timestamp,
325 $line->oi_archive_name, $line->img_user,
326 $line->img_user_text, $line->img_size, $line->img_description );
328 $s .= $list->endImageHistoryList();
329 } else { $s=''; }
330 $wgOut->addHTML( $s );
332 # Exist check because we don't want to show this on pages where an image
333 # doesn't exist along with the noimage message, that would suck. -ævar
334 if( $wgUseExternalEditor && $this->img->exists() ) {
335 $this->uploadLinksBox();
340 function imageLinks()
342 global $wgUser, $wgOut;
344 $wgOut->addHTML( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) . "</h2>\n" );
346 $dbr =& wfGetDB( DB_SLAVE );
347 $page = $dbr->tableName( 'page' );
348 $imagelinks = $dbr->tableName( 'imagelinks' );
350 $sql = "SELECT page_namespace,page_title FROM $imagelinks,$page WHERE il_to=" .
351 $dbr->addQuotes( $this->mTitle->getDBkey() ) . " AND il_from=page_id";
352 $sql = $dbr->limitResult($sql, 500, 0);
353 $res = $dbr->query( $sql, "ImagePage::imageLinks" );
355 if ( 0 == $dbr->numRows( $res ) ) {
356 $wgOut->addHtml( '<p>' . wfMsg( "nolinkstoimage" ) . "</p>\n" );
357 return;
359 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
361 $sk = $wgUser->getSkin();
362 while ( $s = $dbr->fetchObject( $res ) ) {
363 $name = Title::MakeTitle( $s->page_namespace, $s->page_title );
364 $link = $sk->makeKnownLinkObj( $name, "" );
365 $wgOut->addHTML( "<li>{$link}</li>\n" );
367 $wgOut->addHTML( "</ul>\n" );
370 function delete()
372 global $wgUser, $wgOut, $wgRequest;
374 $confirm = $wgRequest->getBool( 'wpConfirmB' );
375 $image = $wgRequest->getVal( 'image' );
376 $oldimage = $wgRequest->getVal( 'oldimage' );
378 # Only sysops can delete images. Previously ordinary users could delete
379 # old revisions, but this is no longer the case.
380 if ( !$wgUser->isAllowed('delete') ) {
381 $wgOut->sysopRequired();
382 return;
384 if ( $wgUser->isBlocked() ) {
385 return $this->blockedIPpage();
387 if ( wfReadOnly() ) {
388 $wgOut->readOnlyPage();
389 return;
392 # Better double-check that it hasn't been deleted yet!
393 $wgOut->setPagetitle( wfMsg( 'confirmdelete' ) );
394 if ( ( !is_null( $image ) )
395 && ( '' == trim( $image ) ) ) {
396 $wgOut->fatalError( wfMsg( 'cannotdelete' ) );
397 return;
400 $this->img = new Image( $this->mTitle );
402 # Deleting old images doesn't require confirmation
403 if ( !is_null( $oldimage ) || $confirm ) {
404 if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
405 $this->doDelete();
406 } else {
407 $wgOut->fatalError( wfMsg( 'sessionfailure' ) );
409 return;
412 if ( !is_null( $image ) ) {
413 $q = '&image=' . urlencode( $image );
414 } else if ( !is_null( $oldimage ) ) {
415 $q = '&oldimage=' . urlencode( $oldimage );
416 } else {
417 $q = '';
419 return $this->confirmDelete( $q, $wgRequest->getText( 'wpReason' ) );
422 function doDelete()
424 global $wgOut, $wgUser, $wgContLang, $wgRequest;
425 global $wgUseSquid, $wgInternalServer, $wgPostCommitUpdateList;
426 $fname = 'ImagePage::doDelete';
428 $reason = $wgRequest->getVal( 'wpReason' );
429 $oldimage = $wgRequest->getVal( 'oldimage' );
431 $dbw =& wfGetDB( DB_MASTER );
433 if ( !is_null( $oldimage ) ) {
434 if ( strlen( $oldimage ) < 16 ) {
435 $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
436 return;
438 if ( strstr( $oldimage, "/" ) || strstr( $oldimage, "\\" ) ) {
439 $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
440 return;
443 # Invalidate description page cache
444 $this->mTitle->invalidateCache();
446 # Squid purging
447 if ( $wgUseSquid ) {
448 $urlArr = Array(
449 $wgInternalServer.wfImageArchiveUrl( $oldimage ),
450 $wgInternalServer.$this->mTitle->getFullURL()
452 wfPurgeSquidServers($urlArr);
454 $this->doDeleteOldImage( $oldimage );
455 $dbw->delete( 'oldimage', array( 'oi_archive_name' => $oldimage ) );
456 $deleted = $oldimage;
457 } else {
458 $image = $this->mTitle->getDBkey();
459 $dest = wfImageDir( $image );
460 $archive = wfImageDir( $image );
462 # Delete the image file if it exists; due to sync problems
463 # or manual trimming sometimes the file will be missing.
464 $targetFile = "{$dest}/{$image}";
465 if( file_exists( $targetFile ) && ! @unlink( $targetFile ) ) {
466 # If the deletion operation actually failed, bug out:
467 $wgOut->fileDeleteError( $targetFile );
468 return;
470 $dbw->delete( 'image', array( 'img_name' => $image ) );
471 $res = $dbw->select( 'oldimage', array( 'oi_archive_name' ), array( 'oi_name' => $image ) );
473 # Purge archive URLs from the squid
474 $urlArr = Array();
475 while ( $s = $dbw->fetchObject( $res ) ) {
476 $this->doDeleteOldImage( $s->oi_archive_name );
477 $urlArr[] = $wgInternalServer.wfImageArchiveUrl( $s->oi_archive_name );
480 # And also the HTML of all pages using this image
481 $linksTo = $this->img->getLinksTo();
482 if ( $wgUseSquid ) {
483 $u = SquidUpdate::newFromTitles( $linksTo, $urlArr );
484 array_push( $wgPostCommitUpdateList, $u );
487 $dbw->delete( 'oldimage', array( 'oi_name' => $image ) );
489 # Image itself is now gone, and database is cleaned.
490 # Now we remove the image description page.
492 $article = new Article( $this->mTitle );
493 $article->doDeleteArticle( $reason ); # ignore errors
495 # Invalidate parser cache and client cache for pages using this image
496 # This is left until relatively late to reduce lock time
497 Title::touchArray( $linksTo );
499 /* Delete thumbnails and refresh image metadata cache */
500 $this->img->purgeCache();
503 $deleted = $image;
506 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
507 $wgOut->setRobotpolicy( 'noindex,nofollow' );
509 $loglink = '[[Special:Log/delete|' . wfMsg( 'deletionlog' ) . ']]';
510 $text = wfMsg( 'deletedtext', $deleted, $loglink );
512 $wgOut->addWikiText( $text );
514 $wgOut->returnToMain( false, $this->mTitle->getPrefixedText() );
517 function doDeleteOldImage( $oldimage )
519 global $wgOut;
521 $name = substr( $oldimage, 15 );
522 $archive = wfImageArchiveDir( $name );
524 # Delete the image if it exists. Sometimes the file will be missing
525 # due to manual intervention or weird sync problems; treat that
526 # condition gracefully and continue to delete the database entry.
527 # Also some records may end up with an empty oi_archive_name field
528 # if the original file was missing when a new upload was made;
529 # don't try to delete the directory then!
531 $targetFile = "{$archive}/{$oldimage}";
532 if( $oldimage != '' && file_exists( $targetFile ) && !@unlink( $targetFile ) ) {
533 # If we actually have a file and can't delete it, throw an error.
534 $wgOut->fileDeleteError( "{$archive}/{$oldimage}" );
535 } else {
536 # Log the deletion
537 $log = new LogPage( 'delete' );
538 $log->addEntry( 'delete', $this->mTitle, wfMsg('deletedrevision',$oldimage) );
542 function revert()
544 global $wgOut, $wgRequest, $wgUser;
545 global $wgUseSquid, $wgInternalServer, $wgDeferredUpdateList;
547 $oldimage = $wgRequest->getText( 'oldimage' );
548 if ( strlen( $oldimage ) < 16 ) {
549 $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
550 return;
552 if ( strstr( $oldimage, "/" ) || strstr( $oldimage, "\\" ) ) {
553 $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
554 return;
557 if ( wfReadOnly() ) {
558 $wgOut->readOnlyPage();
559 return;
561 if( $wgUser->isAnon() ) {
562 $wgOut->errorpage( 'uploadnologin', 'uploadnologintext' );
563 return;
565 if ( ! $this->mTitle->userCanEdit() ) {
566 $wgOut->sysopRequired();
567 return;
569 if ( $wgUser->isBlocked() ) {
570 return $this->blockedIPpage();
572 if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
573 $wgOut->errorpage( 'internalerror', 'sessionfailure' );
574 return;
576 $name = substr( $oldimage, 15 );
578 $dest = wfImageDir( $name );
579 $archive = wfImageArchiveDir( $name );
580 $curfile = "{$dest}/{$name}";
582 if ( ! is_file( $curfile ) ) {
583 $wgOut->fileNotFoundError( htmlspecialchars( $curfile ) );
584 return;
586 $oldver = wfTimestampNow() . "!{$name}";
588 $dbr =& wfGetDB( DB_SLAVE );
589 $size = $dbr->selectField( 'oldimage', 'oi_size', array( 'oi_archive_name' => $oldimage ) );
591 if ( ! rename( $curfile, "${archive}/{$oldver}" ) ) {
592 $wgOut->fileRenameError( $curfile, "${archive}/{$oldver}" );
593 return;
595 if ( ! copy( "{$archive}/{$oldimage}", $curfile ) ) {
596 $wgOut->fileCopyError( "${archive}/{$oldimage}", $curfile );
599 # Record upload and update metadata cache
600 $img = Image::newFromName( $name );
601 $img->recordUpload( $oldver, wfMsg( "reverted" ) );
603 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
604 $wgOut->setRobotpolicy( 'noindex,nofollow' );
605 $wgOut->addHTML( wfMsg( 'imagereverted' ) );
607 $descTitle = $img->getTitle();
608 $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
611 function blockedIPpage() {
612 require_once( 'EditPage.php' );
613 $edit = new EditPage( $this );
614 return $edit->blockedIPpage();
620 * @todo document
621 * @package MediaWiki
623 class ImageHistoryList {
624 function ImageHistoryList( &$skin ) {
625 $this->skin =& $skin;
628 function beginImageHistoryList() {
629 $s = "\n<h2 id=\"filehistory\">" . wfMsg( 'imghistory' ) . "</h2>\n" .
630 "<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
631 return $s;
634 function endImageHistoryList() {
635 $s = "</ul>\n";
636 return $s;
639 function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description ) {
640 global $wgUser, $wgLang, $wgContLang, $wgTitle;
642 $datetime = $wgLang->timeanddate( $timestamp, true );
643 $del = wfMsg( 'deleteimg' );
644 $delall = wfMsg( 'deleteimgcompletely' );
645 $cur = wfMsg( 'cur' );
647 if ( $iscur ) {
648 $url = Image::imageUrl( $img );
649 $rlink = $cur;
650 if ( $wgUser->isAllowed('delete') ) {
651 $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
652 '&action=delete' );
653 $style = $this->skin->getInternalLinkAttributes( $link, $delall );
655 $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>';
656 } else {
657 $dlink = $del;
659 } else {
660 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
661 if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
662 $token = urlencode( $wgUser->editToken( $img ) );
663 $rlink = $this->skin->makeKnownLinkObj( $wgTitle,
664 wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
665 urlencode( $img ) . "&wpEditToken=$token" );
666 $dlink = $this->skin->makeKnownLinkObj( $wgTitle,
667 $del, 'action=delete&oldimage=' . urlencode( $img ) .
668 "&wpEditToken=$token" );
669 } else {
670 # Having live active links for non-logged in users
671 # means that bots and spiders crawling our site can
672 # inadvertently change content. Baaaad idea.
673 $rlink = wfMsg( 'revertimg' );
674 $dlink = $del;
677 if ( 0 == $user ) {
678 $userlink = $usertext;
679 } else {
680 $userlink = $this->skin->makeLinkObj(
681 Title::makeTitle( NS_USER, $usertext ),
682 $usertext );
684 $nbytes = wfMsg( 'nbytes', $size );
685 $style = $this->skin->getInternalLinkAttributes( $url, $datetime );
687 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a>"
688 . " . . {$userlink} ({$nbytes})";
690 $s .= $this->skin->commentBlock( $description, $wgTitle );
691 $s .= "</li>\n";
692 return $s;