From 786e93fb3708f90e55811000eab2a6bbd6e3e08f Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Tue, 21 Aug 2007 03:57:54 +0000 Subject: [PATCH] Static code analysis housekeeping time... things that could be double-checked are marked with "[Note: some-comment]" : if-if-else without curly braces [api/ApiQuerySiteinfo.php] --> adding Unused global declaration: $wgGroupPermissions --> removing Unused global declaration: $wgEmailConfirmToEdit (line 301) --> removing Variable $id appears only once (line 1021) --> removing Variable $m was used before it was defined (line 805) --> defining. Variable $retval was used before it was defined (line 2346) --> renaming to $result Variable $rcid appears only once (line 244 of RecentChange.php) --> using this instead of $change [Note: was left over from r24607 refactoring, revert if wrong please] Unused global declaration: $wgCommandLineMode (line 11) --> removing Variable $k appears only once (line 132 of ImagePage.php) --> removing. Variable $info appears only once (line 311 of ImagePage.php) --> removing. Unused global declaration: $wgTitle (line 569 of ImagePage.php) -> removing. Variable $handlerParams was used before it was defined (line 616 of Linker.php) --> resolved by Raymond in r24966 Variable $match was used before it was defined (line 1031 of Linker.php) --> defining. Unused global declaration: $wgEnotifWatchlist (line 253 of UserMailer.php) --> removing Unused global declaration: $wgShowUpdatedMarker (line 253 of UserMailer.php) --> removing Variable $img appears only once (line 446 of SpecialUpload.php) --> added definition, defined as null, flagged with @todo [Note: should $img be defined in this context, or is it intended to be null? And should the return value after the hook be checked in some way?] Unused global declaration: $wgEnableAPI (line 739 of SpecialUpload.php) --> removing. Unused global declaration: $wgNamespaceProtection (line 1030 of OutputPage.php) --> removing. Unused global declaration: $wgContLang (line 18 of SpecialWatchlist.php) --> removing. Unused global declaration: $wgRawHtml (line 269 of SpecialMovepage.php) --> removing. The value of variable $page was never used (line 331 of SpecialUndelete.php) --> removing line, as $page gets redefined a few lines down. Variable $synIndex appears only once (line 521 of MagicWord.php) --> commenting out. Variable $case appears only once (line 539 of MagicWord.php) --> removing from foreach index key usage. Variable $wgUser appears only once (line 1039 of Title.php) --> adding line to declare as a global, would be null otherwise. Variable $m was used before it was defined (line 285 of Title.php) --> defining. Variable $id appears only once (line 1150 of Title.php) --> removing from foreach index key usage. Variable $subpage appears only once (line 1297 of Title.php) --> commenting out. Variable $restrictions appears only once (line 1399 of Title.php) --> commenting out. Variable $mime appears only once (line 210 of filerepo/OldLocalFile.php) --> removing. Variable $deprefixedName appears only once (line 213 of filerepo/LocalFile.php) --> removing. Variable $m appears only once (line 541 of filerepo/LocalFile.php) --> removing. Variable $where appears only once (line 1245 of filerepo/LocalFile.php) --> removing. Variable $info appears only once (line 1427 of filerepo/LocalFile.php) --> removing. Variable $rel appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out. Variable $zone appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out. Variable $nbytes appears only once (line 208 of media/Generic.php) --> added a return line that uses $nbytes. [Note: I'm assuming that this was the intent] Variable $offset appears only once (line 201 of SpecialListusers.php) --> removing. Variable $limit appears only once (line 201 of SpecialListusers.php) --> removing. Variable $groupTarget appears only once (line 203 of SpecialListusers.php) --> removing. Unused global declaration: $wgLang (line 74 of SpecialWantedpages.php) --> removing. Variable $block appears only once (line 244 of SpecialProtectedpages.php) --> removing. Variable $offset appears only once (line 281 of SpecialProtectedpages.php) --> removing. Variable $limit appears only once (line 281 of SpecialProtectedpages.php) --> removing. Unused global declaration: $wgLang (line 30 of FileDeleteForm.php) --> removing. Unused global declaration: $wgServer (line 30 of FileDeleteForm.php) --> removing. --- includes/Article.php | 3 ++- includes/Database.php | 2 +- includes/EditPage.php | 9 +++++---- includes/FileDeleteForm.php | 2 +- includes/ImagePage.php | 5 ++--- includes/Linker.php | 1 + includes/MagicWord.php | 4 ++-- includes/OutputPage.php | 1 - includes/RecentChange.php | 2 +- includes/SpecialListusers.php | 4 ---- includes/SpecialMovepage.php | 2 +- includes/SpecialProtectedpages.php | 3 --- includes/SpecialUndelete.php | 1 - includes/SpecialUpload.php | 3 ++- includes/SpecialUserlogin.php | 1 - includes/SpecialUserrights.php | 2 +- includes/SpecialWantedpages.php | 1 - includes/SpecialWatchlist.php | 2 +- includes/Title.php | 9 +++++---- includes/UserMailer.php | 1 - includes/api/ApiQuerySiteinfo.php | 7 ++++--- includes/filerepo/LocalFile.php | 4 ---- includes/filerepo/OldLocalFile.php | 1 - includes/filerepo/RepoGroup.php | 2 +- includes/media/Generic.php | 1 + 25 files changed, 31 insertions(+), 42 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index cbf034b2e8..32ce420e06 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -802,6 +802,7 @@ class Article { // Give hooks a chance to customise the output if( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) { // Wrap the whole lot in a
 and don't parse
+					$m = array();
 					preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
 					$wgOut->addHtml( "
\n" );
 					$wgOut->addHtml( htmlspecialchars( $this->mContent ) );
@@ -2344,7 +2345,7 @@ class Article {
 				$wgOut->returnToMain( false, $this->mTitle );
 				break;
 			default:
-				throw new MWException( __METHOD__ . ": Unknown return value `{$retval}`" );
+				throw new MWException( __METHOD__ . ": Unknown return value `{$result}`" );
 		}
 
 	}
diff --git a/includes/Database.php b/includes/Database.php
index e0969f2c73..7e5266fc83 100644
--- a/includes/Database.php
+++ b/includes/Database.php
@@ -214,7 +214,7 @@ border=\"0\" ALT=\"Google\">
 
 			$cache = new HTMLFileCache( $t );
 			if( $cache->isFileCached() ) {
-				// FIXME: $msg is not defined on the next line.
+				// @todo, FIXME: $msg is not defined on the next line.
 				$msg = '

'.$msg."
\n" . $cachederror . "

\n"; diff --git a/includes/EditPage.php b/includes/EditPage.php index a8db8bcc03..4cd776fa53 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -298,7 +298,6 @@ class EditPage { */ function edit() { global $wgOut, $wgUser, $wgRequest, $wgTitle; - global $wgEmailConfirmToEdit; if ( ! wfRunHooks( 'AlternateEdit', array( &$this ) ) ) return; @@ -333,10 +332,11 @@ class EditPage { if ($error[0] == 'readonlytext') { - if ($this->edit) + if ($this->edit) { $this->formtype = 'preview'; - else if ($this->save || $this->preview || $this->diff) + } elseif ($this->save || $this->preview || $this->diff) { $remove[] = $error; + } } } # array_diff returns elements in $permErrors that are not in $remove. @@ -1018,9 +1018,10 @@ class EditPage { if ( count($cascadeSources) > 0 ) { # Explain, and list the titles responsible $notice = wfMsgExt( 'cascadeprotectedwarning', array('parsemag'), count($cascadeSources) ) . "\n"; - foreach( $cascadeSources as $id => $page ) + foreach( $cascadeSources as $page ) { $notice .= '* [[:' . $page->getPrefixedText() . "]]\n"; } + } $wgOut->addWikiText( $notice ); } diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index fec993afc7..ad4e963bca 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -29,7 +29,7 @@ class FileDeleteForm { * pending authentication, confirmation, etc. */ public function execute() { - global $wgOut, $wgRequest, $wgUser, $wgLang, $wgServer; + global $wgOut, $wgRequest, $wgUser; $this->setHeaders(); if( wfReadOnly() ) { diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 6443a16730..f08a284fdf 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -129,7 +129,7 @@ class ImagePage extends Article { $r = wfMsg( 'metadata-help' ) . "\n\n"; $r .= "{| id=mw_metadata class=mw_metadata\n"; foreach ( $metadata as $type => $stuff ) { - foreach ( $stuff as $k => $v ) { + foreach ( $stuff as $v ) { $class = Sanitizer::escapeId( $v['id'] ); if( $type == 'collapsed' ) { $class .= ' collapsable'; @@ -308,7 +308,6 @@ class ImagePage extends Article { if ($showLink) { $filename = wfEscapeWikiText( $this->img->getName() ); - $info = wfMsg( 'file-info', $sk->formatSize( $this->img->getSize() ), $mime ); global $wgContLang; $dirmark = $wgContLang->getDirMark(); @@ -566,7 +565,7 @@ class ImageHistoryList { } public function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $dims ) { - global $wgUser, $wgLang, $wgTitle, $wgContLang; + global $wgUser, $wgLang, $wgContLang; $local = $this->img->isLocal(); $row = ''; diff --git a/includes/Linker.php b/includes/Linker.php index d321e72e1e..bede54bd6d 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1028,6 +1028,7 @@ class Linker { $medians = '(?:' . preg_quote( Namespace::getCanonicalName( NS_MEDIA ), '/' ) . '|'; $medians .= preg_quote( $wgContLang->getNsText( NS_MEDIA ), '/' ) . '):'; + $match = array(); while(preg_match('/\[\[:?(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) { # Handle link renaming [[foo|text]] will show link as "text" if( "" != $match[3] ) { diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 9e8d025c22..f7a9400db2 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -518,7 +518,7 @@ class MagicWordArray { // continue; throw new MWException( __METHOD__ . ': bad parameter name' ); } - list( $synIndex, $magicName ) = $parts; + list( /* $synIndex */, $magicName ) = $parts; $paramValue = next( $m ); return array( $magicName, $paramValue ); } @@ -536,7 +536,7 @@ class MagicWordArray { public function matchVariableStartToEnd( $text ) { global $wgContLang; $regexes = $this->getVariableStartToEndRegex(); - foreach ( $regexes as $case => $regex ) { + foreach ( $regexes as $regex ) { if ( $regex !== '' ) { $m = false; if ( preg_match( $regex, $text, $m ) ) { diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 0dd4c3ed58..ae68f639fa 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1027,7 +1027,6 @@ class OutputPage { $this->addWikiText( wfMsgExt( 'cascadeprotected', 'parsemag', $count ) . "\n{$titles}" ); } elseif( !$wgTitle->isProtected( 'edit' ) && $wgTitle->isNamespaceProtected() ) { // Namespace protection - global $wgNamespaceProtection; $ns = $wgTitle->getNamespace() == NS_MAIN ? wfMsg( 'nstab-main' ) : $wgTitle->getNsText(); diff --git a/includes/RecentChange.php b/includes/RecentChange.php index c1bf4e67c3..79f32d0c86 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -251,7 +251,7 @@ class RecentChange 'rc_patrolled' => 1 ), array( - 'rc_id' => $change + 'rc_id' => $rcid ), __METHOD__ ); diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index d6d4a341b7..460d4259cd 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -198,10 +198,6 @@ class UsersPager extends AlphabeticPager { function wfSpecialListusers( $par = null ) { global $wgRequest, $wgOut; - list( $limit, $offset ) = wfCheckLimits(); - - $groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' ); - $up = new UsersPager($par); # getBody() first to check, if empty diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 22b1a91c42..cfc434ae5f 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -266,7 +266,7 @@ class MovePageForm { } function showSuccess() { - global $wgOut, $wgRequest, $wgUser, $wgRawHtml; + global $wgOut, $wgRequest, $wgUser; $old = Title::newFromText( $wgRequest->getVal( 'oldtitle' ) ); $new = Title::newFromText( $wgRequest->getVal( 'newtitle' ) ); diff --git a/includes/SpecialProtectedpages.php b/includes/SpecialProtectedpages.php index 416e861dd9..122ca8fc98 100644 --- a/includes/SpecialProtectedpages.php +++ b/includes/SpecialProtectedpages.php @@ -241,7 +241,6 @@ class ProtectedPagesPager extends AlphabeticPager { } function formatRow( $row ) { - $block = new Block; return $this->mForm->formatRow( $row ); } @@ -278,8 +277,6 @@ class ProtectedPagesPager extends AlphabeticPager { */ function wfSpecialProtectedpages() { - list( $limit, $offset ) = wfCheckLimits(); - $ppForm = new ProtectedPagesForm(); $ppForm->showList(); diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index ad8890645c..5678a81e72 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -328,7 +328,6 @@ class PageArchive { $restoreAll = empty( $timestamps ); $dbw = wfGetDB( DB_MASTER ); - $page = $dbw->tableName( 'archive' ); # Does this page already exist? We'll have to update it... $article = new Article( $this->title ); diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 1c738cce6e..597fd148bf 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -443,6 +443,7 @@ class UploadForm { } // Success, redirect to description page $wgOut->redirect( $this->mLocalFile->getTitle()->getFullURL() ); + $img = null; // @todo: added to avoid passing a ref to null - should this be defined somewhere? wfRunHooks( 'UploadComplete', array( &$img ) ); } } @@ -736,7 +737,7 @@ class UploadForm { function mainUploadForm( $msg='' ) { global $wgOut, $wgUser, $wgContLang; global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview; - global $wgRequest, $wgAllowCopyUploads, $wgEnableAPI; + global $wgRequest, $wgAllowCopyUploads; global $wgStylePath, $wgStyleVersion; $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck; diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 2689c03c4c..f358c1fd72 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -8,7 +8,6 @@ * constructor */ function wfSpecialUserlogin() { - global $wgCommandLineMode; global $wgRequest; if( session_id() == '' ) { wfSetupSession(); diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index 93c1f38c51..b97e5168ea 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -319,7 +319,7 @@ class UserrightsForm extends HTMLForm { * @return Array array( 'add' => array( addablegroups ), 'remove' => array( removablegroups ) ) */ private function changeableGroups() { - global $wgUser, $wgGroupPermissions; + global $wgUser; $groups = array( 'add' => array(), 'remove' => array() ); $addergroups = $wgUser->getEffectiveGroups(); diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index 02cd11277f..5fc45a8834 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -71,7 +71,6 @@ class WantedPagesPage extends QueryPage { * @return string */ public function formatResult( $skin, $result ) { - global $wgLang; $title = Title::makeTitleSafe( $result->namespace, $result->title ); if( $title instanceof Title ) { if( $this->isCached() ) { diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 924edc27bf..e9aa7e6883 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -15,7 +15,7 @@ require_once( dirname(__FILE__) . '/SpecialRecentchanges.php' ); * @param $par Parameter passed to the page */ function wfSpecialWatchlist( $par ) { - global $wgUser, $wgOut, $wgLang, $wgRequest, $wgContLang; + global $wgUser, $wgOut, $wgLang, $wgRequest; global $wgRCShowWatchingUsers, $wgEnotifWatchlist, $wgShowUpdatedMarker; global $wgEnotifWatchlist; $fname = 'wfSpecialWatchlist'; diff --git a/includes/Title.php b/includes/Title.php index 73bf7ad74b..e37ed07057 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -279,6 +279,7 @@ class Title { $redir = MagicWord::get( 'redirect' ); if( $redir->matchStart( $text ) ) { // Extract the first link and see if it's usable + $m = array(); if( preg_match( '!\[{2}(.*?)(?:\||\]{2})!', $text, $m ) ) { // Strip preceding colon used to "escape" categories, etc. // and URL-decode links @@ -1034,7 +1035,7 @@ class Title { $errors[] = array( 'readonlytext' ); } - global $wgEmailConfirmToEdit; + global $wgEmailConfirmToEdit, $wgUser; if ( $wgEmailConfirmToEdit && !$wgUser->isEmailConfirmed() ) { @@ -1147,7 +1148,7 @@ class Title { $right = ( $right == 'sysop' ) ? 'protect' : $right; if( '' != $right && !$user->isAllowed( $right ) ) { $pages = ''; - foreach( $cascadingSources as $id => $page ) + foreach( $cascadingSources as $page ) $pages .= '* [[:' . $page->getPrefixedText() . "]]\n"; $errors[] = array( 'cascadeprotected', count( $cascadingSources ), $pages ); } @@ -1294,7 +1295,7 @@ class Title { */ if( $this->getNamespace() == NS_SPECIAL ) { $name = $this->getText(); - list( $name, $subpage ) = SpecialPage::resolveAliasWithSubpage( $name ); + list( $name, /* $subpage */) = SpecialPage::resolveAliasWithSubpage( $name ); $pure = SpecialPage::getTitleFor( $name )->getPrefixedText(); if( in_array( $pure, $wgWhitelistRead, true ) ) return true; @@ -1396,7 +1397,7 @@ class Title { * @return bool If the page is subject to cascading restrictions. */ public function isCascadeProtected() { - list( $sources, $restrictions ) = $this->getCascadeProtectionSources( false ); + list( $sources, /* $restrictions */ ) = $this->getCascadeProtectionSources( false ); return ( $sources > 0 ); } diff --git a/includes/UserMailer.php b/includes/UserMailer.php index ee85e25c05..835dd3107f 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -250,7 +250,6 @@ class EmailNotification { function notifyOnPageChange($editor, &$title, $timestamp, $summary, $minorEdit, $oldid = false) { global $wgEnotifUseJobQ; - global $wgEnotifWatchlist, $wgShowUpdatedMarker; if( $title->getNamespace() < 0 ) return; diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 283275a3d7..0a1245e9f9 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -106,12 +106,13 @@ class ApiQuerySiteinfo extends ApiQueryBase { $this->addTables('interwiki'); $this->addFields(array('iw_prefix', 'iw_local', 'iw_url')); - if($filter === 'local') + if($filter === 'local') { $this->addWhere('iw_local = 1'); - else if($filter === '!local') + } elseif($filter === '!local') { $this->addWhere('iw_local = 0'); - else if($filter !== false) + } elseif($filter !== false) { ApiBase :: dieDebug(__METHOD__, "Unknown filter=$filter"); + } $this->addOption('ORDER BY', 'iw_prefix'); diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index d8f49efae1..a2e19c8f43 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -210,7 +210,6 @@ class LocalFile extends File } $decoded = array(); foreach ( $array as $name => $value ) { - $deprefixedName = substr( $name, $prefixLength ); $decoded[substr( $name, $prefixLength )] = $value; } $decoded['timestamp'] = wfTimestamp( TS_MW, $decoded['timestamp'] ); @@ -539,7 +538,6 @@ class LocalFile extends File $dir = $this->getThumbPath(); $urls = array(); foreach ( $files as $file ) { - $m = array(); # Check that the base file name is part of the thumb name # This is a basic sanity check to avoid erasing unrelated directories if ( strpos( $file, $this->getName() ) !== false ) { @@ -1243,7 +1241,6 @@ class LocalFileDeleteBatch { $dbw = $this->file->repo->getMasterDB(); list( $oldRels, $deleteCurrent ) = $this->getOldRels(); if ( $deleteCurrent ) { - $where = array( 'img_name' => $this->file->getName() ); $dbw->delete( 'image', array( 'img_name' => $this->file->getName() ), __METHOD__ ); } if ( count( $oldRels ) ) { @@ -1425,7 +1422,6 @@ class LocalFileRestoreBatch { if ( $first && !$exists ) { // This revision will be published as the new current version $destRel = $this->file->getRel(); - $info = $this->file->repo->getFileProps( $deletedUrl ); $insertCurrent = array( 'img_name' => $row->fa_name, 'img_size' => $row->fa_size, diff --git a/includes/filerepo/OldLocalFile.php b/includes/filerepo/OldLocalFile.php index 0e35df68d5..850a8d8ad8 100644 --- a/includes/filerepo/OldLocalFile.php +++ b/includes/filerepo/OldLocalFile.php @@ -207,7 +207,6 @@ class OldLocalFile extends LocalFile { $dbw = $this->repo->getMasterDB(); list( $major, $minor ) = self::splitMime( $this->mime ); - $mime = $this->mime; wfDebug(__METHOD__.': upgrading '.$this->archive_name." to the current schema\n"); $dbw->update( 'oldimage', diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 89096a59f3..23d222af69 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -135,7 +135,7 @@ class RepoGroup { function getFileProps( $fileName ) { if ( FileRepo::isVirtualUrl( $fileName ) ) { - list( $repoName, $zone, $rel ) = $this->splitVirtualUrl( $fileName ); + list( $repoName, /* $zone */, /* $rel */ ) = $this->splitVirtualUrl( $fileName ); if ( $repoName === '' ) { $repoName = 'local'; } diff --git a/includes/media/Generic.php b/includes/media/Generic.php index b97fa047b6..145054cb1b 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -207,6 +207,7 @@ abstract class MediaHandler { global $wgLang; $nbytes = '(' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $file->getSize() ) ) . ')'; + return "($nbytes)"; } function getLongDesc( $file ) { -- 2.20.1