From 85d8ee1f87b22a61cd808f9bc102fccf712e42f3 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 10 Oct 2012 20:13:40 +0200 Subject: [PATCH] Remove a bunch of trailing spaces and unneeded newlines Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997 --- includes/Cdb_PHP.php | 6 +-- includes/Collation.php | 22 ++++---- includes/CryptRand.php | 2 +- includes/ExternalUser.php | 4 +- includes/FeedUtils.php | 2 +- includes/FormOptions.php | 2 +- includes/MessageBlobStore.php | 2 +- includes/OutputHandler.php | 6 +-- includes/Preferences.php | 2 +- includes/ProtectionForm.php | 2 +- includes/SquidPurgeClient.php | 10 ++-- includes/StringUtils.php | 2 +- includes/WebRequest.php | 1 - includes/Xml.php | 2 +- includes/actions/CreditsAction.php | 2 +- includes/actions/RevertAction.php | 4 +- includes/api/ApiDelete.php | 2 +- includes/api/ApiMain.php | 4 +- includes/api/ApiParse.php | 2 +- includes/api/ApiQueryAllCategories.php | 1 - includes/api/ApiUpload.php | 8 +-- includes/cache/FileCacheBase.php | 2 +- includes/cache/SquidUpdate.php | 3 +- includes/conf/DatabaseConf.php | 2 +- includes/context/ContextSource.php | 2 - includes/context/RequestContext.php | 3 +- includes/db/CloneDatabase.php | 9 ++-- includes/db/ORMTable.php | 2 +- includes/installer/Ibm_db2Updater.php | 2 +- includes/installer/MysqlUpdater.php | 1 - includes/installer/SqliteUpdater.php | 1 - includes/logging/LogEntry.php | 28 +++++----- includes/logging/LogPage.php | 2 +- includes/parser/DateFormatter.php | 4 +- includes/parser/LinkHolderArray.php | 16 +++--- includes/parser/ParserCache.php | 4 +- includes/parser/ParserOptions.php | 68 ++++++++++++------------ includes/parser/Parser_LinkHooks.php | 43 +++++++-------- includes/parser/Preprocessor_DOM.php | 2 +- includes/parser/StripState.php | 6 +-- includes/specials/SpecialBlockList.php | 2 +- includes/specials/SpecialExport.php | 2 +- includes/specials/SpecialUpload.php | 2 +- includes/specials/SpecialUploadStash.php | 2 +- includes/specials/SpecialWantedfiles.php | 2 +- includes/specials/SpecialWantedpages.php | 2 +- includes/upload/UploadFromFile.php | 12 ++--- maintenance/eval.php | 2 +- opensearch_desc.php5 | 2 +- thumb.php5 | 2 +- 50 files changed, 152 insertions(+), 166 deletions(-) diff --git a/includes/Cdb_PHP.php b/includes/Cdb_PHP.php index c97cf13c11..f58e07e1d5 100644 --- a/includes/Cdb_PHP.php +++ b/includes/Cdb_PHP.php @@ -180,7 +180,7 @@ class CdbReader_PHP extends CdbReader { protected function read( $length, $pos ) { if ( fseek( $this->handle, $pos ) == -1 ) { // This can easily happen if the internal pointers are incorrect - throw new MWException( + throw new MWException( 'Seek failed, file "' . $this->fileName . '" may be corrupted.' ); } @@ -205,7 +205,7 @@ class CdbReader_PHP extends CdbReader { protected function unpack31( $s ) { $data = unpack( 'V', $s ); if ( $data[1] > 0x7fffffff ) { - throw new MWException( + throw new MWException( 'Error in CDB file "' . $this->fileName . '", integer too big.' ); } return $data[1]; @@ -477,7 +477,7 @@ class CdbWriter_PHP extends CdbWriter { /** * Clean up the temp file and throw an exception - * + * * @param $msg string * @throws MWException */ diff --git a/includes/Collation.php b/includes/Collation.php index ad2b94b177..8554c2b047 100644 --- a/includes/Collation.php +++ b/includes/Collation.php @@ -152,10 +152,10 @@ class IcuCollation extends Collation { /** * Unified CJK blocks. * - * The same definition of a CJK block must be used for both Collation and - * generateCollationData.php. These blocks are omitted from the first - * letter data, as an optimisation measure and because the default UCA table - * is pretty useless for sorting Chinese text anyway. Japanese and Korean + * The same definition of a CJK block must be used for both Collation and + * generateCollationData.php. These blocks are omitted from the first + * letter data, as an optimisation measure and because the default UCA table + * is pretty useless for sorting Chinese text anyway. Japanese and Korean * blocks are not included here, because they are smaller and more useful. */ static $cjkBlocks = array( @@ -180,7 +180,7 @@ class IcuCollation extends Collation { function __construct( $locale ) { if ( !extension_loaded( 'intl' ) ) { - throw new MWException( 'An ICU collation was requested, ' . + throw new MWException( 'An ICU collation was requested, ' . 'but the intl extension is not available.' ); } $this->locale = $locale; @@ -218,8 +218,8 @@ class IcuCollation extends Collation { // Check for CJK $firstChar = mb_substr( $string, 0, 1, 'UTF-8' ); - if ( ord( $firstChar ) > 0x7f - && self::isCjk( utf8ToCodepoint( $firstChar ) ) ) + if ( ord( $firstChar ) > 0x7f + && self::isCjk( utf8ToCodepoint( $firstChar ) ) ) { return $firstChar; } @@ -265,9 +265,9 @@ class IcuCollation extends Collation { // Sort the letters. // // It's impossible to have the precompiled data file properly sorted, - // because the sort order changes depending on ICU version. If the - // array is not properly sorted, the binary search will return random - // results. + // because the sort order changes depending on ICU version. If the + // array is not properly sorted, the binary search will return random + // results. // // We also take this opportunity to remove primary collisions. $letterMap = array(); @@ -320,7 +320,7 @@ class IcuCollation extends Collation { } /** - * Do a binary search, and return the index of the largest item that sorts + * Do a binary search, and return the index of the largest item that sorts * less than or equal to the target value. * * @param $valueCallback array A function to call to get the value with diff --git a/includes/CryptRand.php b/includes/CryptRand.php index 858eebf205..fcf6a3966b 100644 --- a/includes/CryptRand.php +++ b/includes/CryptRand.php @@ -391,7 +391,7 @@ class MWCryptRand { // We hash the random state with more salt to avoid the state from leaking // out and being used to predict the /randomness/ that follows. if ( strlen( $buffer ) < $bytes ) { - wfDebug( __METHOD__ . ": Falling back to using a pseudo random state to generate randomness.\n" ); + wfDebug( __METHOD__ . ": Falling back to using a pseudo random state to generate randomness.\n" ); } while ( strlen( $buffer ) < $bytes ) { wfProfileIn( __METHOD__ . '-fallback' ); diff --git a/includes/ExternalUser.php b/includes/ExternalUser.php index 9a01deb70b..23944a5d01 100644 --- a/includes/ExternalUser.php +++ b/includes/ExternalUser.php @@ -288,7 +288,7 @@ abstract class ExternalUser { 'eu_external_id' => $this->getId() ), __METHOD__ ); } - + /** * Check whether this external user id is already linked with * a local user. @@ -305,5 +305,5 @@ abstract class ExternalUser { ? User::newFromId( $row->eu_local_id ) : null; } - + } diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index b0a0e2b9c3..82c6e4a0ea 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -87,7 +87,7 @@ class FeedUtils { ($row->rc_deleted & Revision::DELETED_COMMENT) ? wfMessage('rev-deleted-comment')->escaped() : $row->rc_comment, - $actiontext + $actiontext ); } diff --git a/includes/FormOptions.php b/includes/FormOptions.php index f978639de1..1cfe88e891 100644 --- a/includes/FormOptions.php +++ b/includes/FormOptions.php @@ -22,7 +22,7 @@ * * @file * @author Niklas Laxström - * @author Antoine Musso + * @author Antoine Musso */ /** diff --git a/includes/MessageBlobStore.php b/includes/MessageBlobStore.php index 3a698e5bc5..09561bd78a 100644 --- a/includes/MessageBlobStore.php +++ b/includes/MessageBlobStore.php @@ -140,7 +140,7 @@ class MessageBlobStore { // Save the old and new blobs for later $oldBlob = $row->mr_blob; $newBlob = self::generateMessageBlob( $module, $lang ); - + $newRow = array( 'mr_resource' => $name, 'mr_lang' => $lang, diff --git a/includes/OutputHandler.php b/includes/OutputHandler.php index 46a43f6338..78435e415b 100644 --- a/includes/OutputHandler.php +++ b/includes/OutputHandler.php @@ -22,9 +22,9 @@ /** * Standard output handler for use with ob_start - * + * * @param $s string - * + * * @return string */ function wfOutputHandler( $s ) { @@ -85,7 +85,7 @@ function wfRequestExtension() { /** * Handler that compresses data with gzip if allowed by the Accept header. * Unlike ob_gzhandler, it works for HEAD requests too. - * + * * @param $s string * * @return string diff --git a/includes/Preferences.php b/includes/Preferences.php index 216ba48c8f..65a0d0291b 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -879,7 +879,7 @@ class Preferences { global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge; $watchlistdaysMax = ceil( $wgRCMaxAge / ( 3600 * 24 ) ); - + ## Watchlist ##################################### $defaultPreferences['watchlistdays'] = array( 'type' => 'float', diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index beb20eabc7..9643ba7a30 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -63,7 +63,7 @@ class ProtectionForm { $this->mArticle = $article; $this->mTitle = $article->getTitle(); $this->mApplicableTypes = $this->mTitle->getRestrictionTypes(); - + // Check if the form should be disabled. // If it is, the form will be available in read-only to show levels. $this->mPermErrors = $this->mTitle->getUserPermissionsErrors( 'protect', $wgUser ); diff --git a/includes/SquidPurgeClient.php b/includes/SquidPurgeClient.php index 8eb0f6bfc8..4aecf2e5e7 100644 --- a/includes/SquidPurgeClient.php +++ b/includes/SquidPurgeClient.php @@ -21,9 +21,9 @@ */ /** - * An HTTP 1.0 client built for the purposes of purging Squid and Varnish. - * Uses asynchronous I/O, allowing purges to be done in a highly parallel - * manner. + * An HTTP 1.0 client built for the purposes of purging Squid and Varnish. + * Uses asynchronous I/O, allowing purges to be done in a highly parallel + * manner. * * Could be replaced by curl_multi_exec() or some such. */ @@ -123,7 +123,7 @@ class SquidPurgeClient { return array( $socket ); } - /** + /** * Get the host's IP address. * Does not support IPv6 at present due to the lack of a convenient interface in PHP. */ @@ -408,7 +408,7 @@ class SquidPurgeClientPool { $numReady = socket_select( $readSockets, $writeSockets, $exceptSockets, $timeout ); wfRestoreWarnings(); if ( $numReady === false ) { - wfDebugLog( 'squid', __METHOD__.': Error in stream_select: ' . + wfDebugLog( 'squid', __METHOD__.': Error in stream_select: ' . socket_strerror( socket_last_error() ) . "\n" ); break; } diff --git a/includes/StringUtils.php b/includes/StringUtils.php index 43275a660f..fba31ea976 100644 --- a/includes/StringUtils.php +++ b/includes/StringUtils.php @@ -424,7 +424,7 @@ class ReplacementArray { /** * An iterator which works exactly like: - * + * * foreach ( explode( $delim, $s ) as $element ) { * ... * } diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 80fb81a5f8..7005416410 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -380,7 +380,6 @@ class WebRequest { return $ret; } - /** * Unset an arbitrary value from our get/post data. * diff --git a/includes/Xml.php b/includes/Xml.php index 35019ff9f9..2f8ba0fe39 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -208,7 +208,7 @@ class Xml { /** * Construct a language selector appropriate for use in a form or preferences - * + * * @param string $selected The language code of the selected language * @param boolean $customisedOnly If true only languages which have some content are listed * @param string $inLanguage The ISO code of the language to display the select list in (optional) diff --git a/includes/actions/CreditsAction.php b/includes/actions/CreditsAction.php index f715229724..d0bc22cb5d 100644 --- a/includes/actions/CreditsAction.php +++ b/includes/actions/CreditsAction.php @@ -122,7 +122,7 @@ class CreditsAction extends FormlessAction { # Sift for real versus user names foreach ( $contributors as $user ) { - $cnt--; + $cnt--; if ( $user->isLoggedIn() ) { $link = $this->link( $user ); if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) { diff --git a/includes/actions/RevertAction.php b/includes/actions/RevertAction.php index 1fc7e90752..a5fc4e1734 100644 --- a/includes/actions/RevertAction.php +++ b/includes/actions/RevertAction.php @@ -124,7 +124,7 @@ class RevertFileAction extends FormAction { $lang = $this->getLanguage(); $userDate = $lang->userDate( $timestamp, $user ); $userTime = $lang->userTime( $timestamp, $user ); - + $this->getOutput()->addWikiMsg( 'filerevert-success', $this->getTitle()->getText(), $userDate, $userTime, wfExpandUrl( $this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage' ) ), @@ -136,7 +136,7 @@ class RevertFileAction extends FormAction { protected function getPageTitle() { return $this->msg( 'filerevert', $this->getTitle()->getText() ); } - + protected function getDescription() { $this->getOutput()->addBacklinkSubtitle( $this->getTitle() ); return ''; diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 283250ca87..964e0ae40b 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -119,7 +119,7 @@ class ApiDelete extends ApiBase { // Need to pass a throwaway variable because generateReason expects // a reference $hasHistory = false; - $reason = $page->getAutoDeleteReason( $hasHistory ); + $reason = $page->getAutoDeleteReason( $hasHistory ); if ( $reason === false ) { return array( array( 'cannotdelete', $title->getPrefixedText() ) ); } diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 7d7eb14175..3aa51b7967 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -840,7 +840,7 @@ class ApiMain extends ApiBase { protected function logRequest( $time ) { $request = $this->getRequest(); $milliseconds = $time === null ? '?' : round( $time * 1000 ); - $s = 'API' . + $s = 'API' . ' ' . $request->getMethod() . ' ' . wfUrlencode( str_replace( ' ', '_', $this->getUser()->getName() ) ) . ' ' . $request->getIP() . @@ -897,7 +897,7 @@ class ApiMain extends ApiBase { */ public function getCheck( $name ) { $this->mParamsUsed[$name] = true; - return $this->getRequest()->getCheck( $name ); + return $this->getRequest()->getCheck( $name ); } /** diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 312e43963d..a29a0bd0b7 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -158,7 +158,7 @@ class ApiParse extends ApiBase { $popts->enableLimitReport( !$params['disablepp'] ); // Potentially cached - $p_result = $this->getParsedContent( $pageObj, $popts, $pageid, + $p_result = $this->getParsedContent( $pageObj, $popts, $pageid, isset( $prop['wikitext'] ) ) ; } } else { // Not $oldid, $pageid, $page. Hence based on $text diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index 4f4c77f0e7..c2beaec6a7 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -81,7 +81,6 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { } else { $this->addWhereRange( 'cat_pages', 'older', $max, $min); } - if ( isset( $params['prefix'] ) ) { $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 3a9b5c5642..0454bb379a 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -89,7 +89,7 @@ class ApiUpload extends ApiBase { } else { $this->verifyUpload(); } - + // Check if the user has the rights to modify or overwrite the requested title // (This check is irrelevant if stashing is already requested, since the errors // can always be fixed by changing the title) @@ -99,7 +99,7 @@ class ApiUpload extends ApiBase { $this->dieRecoverableError( $permErrors[0], 'filename' ); } } - // Get the result based on the current upload context: + // Get the result based on the current upload context: $result = $this->getContextResult(); if ( $result['result'] === 'Success' ) { @@ -196,7 +196,7 @@ class ApiUpload extends ApiBase { return array(); } - // Check we added the last chunk: + // Check we added the last chunk: if( $this->mParams['offset'] + $chunkSize == $this->mParams['filesize'] ) { $status = $this->mUpload->concatenateChunks(); @@ -222,7 +222,7 @@ class ApiUpload extends ApiBase { $result['offset'] = $this->mParams['offset'] + $chunkSize; return $result; } - + /** * Stash the file and return the file key * Also re-raises exceptions with slightly more informative message strings (useful for API) diff --git a/includes/cache/FileCacheBase.php b/includes/cache/FileCacheBase.php index c0c5609c6a..1a08d9f2cd 100644 --- a/includes/cache/FileCacheBase.php +++ b/includes/cache/FileCacheBase.php @@ -229,7 +229,7 @@ abstract class FileCacheBase { public function incrMissesRecent( WebRequest $request ) { global $wgMemc; if ( mt_rand( 0, self::MISS_FACTOR - 1 ) == 0 ) { - # Get a large IP range that should include the user even if that + # Get a large IP range that should include the user even if that # person's IP address changes $ip = $request->getIP(); if ( !IP::isValid( $ip ) ) { diff --git a/includes/cache/SquidUpdate.php b/includes/cache/SquidUpdate.php index 423e388448..a4b2002fe5 100644 --- a/includes/cache/SquidUpdate.php +++ b/includes/cache/SquidUpdate.php @@ -249,7 +249,7 @@ class SquidUpdate { static function expand( $url ) { return wfExpandUrl( $url, PROTO_INTERNAL ); } - + /** * Find the HTCP routing rule to use for a given URL. * @param $url string URL to match @@ -264,5 +264,4 @@ class SquidUpdate { } return false; } - } diff --git a/includes/conf/DatabaseConf.php b/includes/conf/DatabaseConf.php index e2e36cef2c..d8f644deec 100644 --- a/includes/conf/DatabaseConf.php +++ b/includes/conf/DatabaseConf.php @@ -39,7 +39,7 @@ class DatabaseConf extends Conf { * * @param $name * @param $value - * + * * @return bool */ protected function writeSetting( $name, $value ) { diff --git a/includes/context/ContextSource.php b/includes/context/ContextSource.php index 45bd6fffb4..d5a6d15ad9 100644 --- a/includes/context/ContextSource.php +++ b/includes/context/ContextSource.php @@ -165,6 +165,4 @@ abstract class ContextSource implements IContextSource { $args = func_get_args(); return call_user_func_array( array( $this->getContext(), 'msg' ), $args ); } - } - diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index a528f22cc0..cd2bf556f8 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -307,7 +307,7 @@ class RequestContext implements IContextSource { public function getSkin() { if ( $this->skin === null ) { wfProfileIn( __METHOD__ . '-createskin' ); - + $skin = null; wfRunHooks( 'RequestContextCreateSkin', array( $this, &$skin ) ); @@ -397,4 +397,3 @@ class RequestContext implements IContextSource { } } - diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 4e43642fae..4ff7913bd2 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -87,18 +87,17 @@ class CloneDatabase { * Clone the table structure */ public function cloneTableStructure() { - foreach( $this->tablesToClone as $tbl ) { # Clean up from previous aborted run. So that table escaping # works correctly across DB engines, we need to change the pre- # fix back and forth so tableName() works right. - + self::changePrefix( $this->oldTablePrefix ); $oldTableName = $this->db->tableName( $tbl, 'raw' ); - + self::changePrefix( $this->newTablePrefix ); $newTableName = $this->db->tableName( $tbl, 'raw' ); - + if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) ) ) { $this->db->dropTable( $tbl, __METHOD__ ); wfDebug( __METHOD__." dropping {$newTableName}\n", true); @@ -108,9 +107,7 @@ class CloneDatabase { # Create new table wfDebug( __METHOD__." duplicating $oldTableName to $newTableName\n", true ); $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables ); - } - } /** diff --git a/includes/db/ORMTable.php b/includes/db/ORMTable.php index a77074ffca..39f16a0745 100644 --- a/includes/db/ORMTable.php +++ b/includes/db/ORMTable.php @@ -333,7 +333,7 @@ abstract class ORMTable implements IORMTable { $functionName ) !== false; // DatabaseBase::delete does not always return true for success as documented... } - + /** * Get API parameters for the fields supported by this object. * diff --git a/includes/installer/Ibm_db2Updater.php b/includes/installer/Ibm_db2Updater.php index 3a42953544..805ff0ff66 100644 --- a/includes/installer/Ibm_db2Updater.php +++ b/includes/installer/Ibm_db2Updater.php @@ -77,7 +77,7 @@ class Ibm_db2Updater extends DatabaseUpdater { array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ), array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'), - array( 'doRebuildLocalisationCache' ), + array( 'doRebuildLocalisationCache' ), // 1.19 array( 'addIndex', 'logging', 'type_action', 'patch-logging-type-action-index.sql'), diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 00009ca523..68a3922256 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -206,7 +206,6 @@ class MysqlUpdater extends DatabaseUpdater { array( 'modifyField', 'user_groups', 'ug_group', 'patch-ug_group-length-increase.sql' ), array( 'addField', 'uploadstash', 'us_chunk_inx', 'patch-uploadstash_chunk.sql' ), array( 'addfield', 'job', 'job_timestamp', 'patch-jobs-add-timestamp.sql' ), - array( 'modifyField', 'user_former_groups', 'ufg_group', 'patch-ufg_group-length-increase.sql' ), // 1.20 diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php index e26aa78b68..ab38055538 100644 --- a/includes/installer/SqliteUpdater.php +++ b/includes/installer/SqliteUpdater.php @@ -85,7 +85,6 @@ class SqliteUpdater extends DatabaseUpdater { array( 'modifyField', 'user_groups', 'ug_group', 'patch-ug_group-length-increase.sql' ), array( 'addField', 'uploadstash', 'us_chunk_inx', 'patch-uploadstash_chunk.sql' ), array( 'addfield', 'job', 'job_timestamp', 'patch-jobs-add-timestamp.sql' ), - array( 'modifyField', 'user_former_groups', 'ufg_group', 'patch-ug_group-length-increase.sql' ), // 1.20 diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index 37560d8055..2ca525e159 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -335,9 +335,9 @@ class ManualLogEntry extends LogEntryBase { /** * Constructor. - * + * * @since 1.19 - * + * * @param string $type * @param string $subtype */ @@ -357,9 +357,9 @@ class ManualLogEntry extends LogEntryBase { * '4:color' => 'blue', * 'animal' => 'dog' * ); - * + * * @since 1.19 - * + * * @param $parameters array Associative array */ public function setParameters( $parameters ) { @@ -368,9 +368,9 @@ class ManualLogEntry extends LogEntryBase { /** * Set the user that performed the action being logged. - * + * * @since 1.19 - * + * * @param User $performer */ public function setPerformer( User $performer ) { @@ -379,9 +379,9 @@ class ManualLogEntry extends LogEntryBase { /** * Set the title of the object changed. - * + * * @since 1.19 - * + * * @param Title $target */ public function setTarget( Title $target ) { @@ -390,9 +390,9 @@ class ManualLogEntry extends LogEntryBase { /** * Set the timestamp of when the logged action took place. - * + * * @since 1.19 - * + * * @param string $timestamp */ public function setTimestamp( $timestamp ) { @@ -401,9 +401,9 @@ class ManualLogEntry extends LogEntryBase { /** * Set a comment associated with the action being logged. - * + * * @since 1.19 - * + * * @param string $comment */ public function setComment( $comment ) { @@ -412,9 +412,9 @@ class ManualLogEntry extends LogEntryBase { /** * TODO: document - * + * * @since 1.19 - * + * * @param integer $deleted */ public function setDeleted( $deleted ) { diff --git a/includes/logging/LogPage.php b/includes/logging/LogPage.php index d96a5ea51a..90393ea8d6 100644 --- a/includes/logging/LogPage.php +++ b/includes/logging/LogPage.php @@ -220,7 +220,7 @@ class LogPage { } /** - * Generate text for a log entry. + * Generate text for a log entry. * Only LogFormatter should call this function. * * @param $type String: log type diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index 2917b4a740..0f22675e28 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -200,7 +200,7 @@ class DateFormatter { $linked = true; if ( isset( $this->mLinked ) ) $linked = $this->mLinked; - + $bits = array(); $key = $this->keys[$this->mSource]; for ( $p=0; $p < strlen($key); $p++ ) { @@ -219,7 +219,7 @@ class DateFormatter { */ function formatDate( $bits, $link = true ) { $format = $this->targets[$this->mTarget]; - + if (!$link) { // strip piped links $format = preg_replace( '/\[\[[^|]+\|([^\]]+)\]\]/', '$1', $format ); diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index d9356b48be..49160e8a71 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -45,7 +45,7 @@ class LinkHolderArray { /** * Don't serialize the parent object, it is big, and not needed when it is - * a parameter to mergeForeign(), which is the only application of + * a parameter to mergeForeign(), which is the only application of * serializing at present. * * Compact the titles, only serialize the text form. @@ -103,9 +103,9 @@ class LinkHolderArray { } /** - * Merge a LinkHolderArray from another parser instance into this one. The - * keys will not be preserved. Any text which went with the old - * LinkHolderArray and needs to work with the new one should be passed in + * Merge a LinkHolderArray from another parser instance into this one. The + * keys will not be preserved. Any text which went with the old + * LinkHolderArray and needs to work with the new one should be passed in * the $texts array. The strings in this array will have their link holders * converted for use in the destination link holder. The resulting array of * strings will be returned. @@ -126,7 +126,7 @@ class LinkHolderArray { $maxId = $newKey > $maxId ? $newKey : $maxId; } } - $texts = preg_replace_callback( '/()/', + $texts = preg_replace_callback( '/()/', array( $this, 'mergeForeignCallback' ), $texts ); # Renumber interwiki links @@ -135,7 +135,7 @@ class LinkHolderArray { $this->interwikis[$newKey] = $entry; $maxId = $newKey > $maxId ? $newKey : $maxId; } - $texts = preg_replace_callback( '/()/', + $texts = preg_replace_callback( '/()/', array( $this, 'mergeForeignCallback' ), $texts ); # Set the parent link ID to be beyond the highest used ID @@ -159,8 +159,8 @@ class LinkHolderArray { # Internal links $pos = 0; while ( $pos < strlen( $text ) ) { - if ( !preg_match( '//', - $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) + if ( !preg_match( '//', + $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) { break; } diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index e5beba814e..d41962127a 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -201,8 +201,8 @@ class ParserCache { wfDebug( "ParserOutput cache found.\n" ); - // The edit section preference may not be the appropiate one in - // the ParserOutput, as we are not storing it in the parsercache + // The edit section preference may not be the appropiate one in + // the ParserOutput, as we are not storing it in the parsercache // key. Force it here. See bug 31445. $value->setEditSectionTokens( $popts->getEditSection() ); diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 009b18a13e..064182e7f8 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -29,67 +29,67 @@ * @ingroup Parser */ class ParserOptions { - + /** * Use DateFormatter to format dates */ var $mUseDynamicDates; - + /** * Interlanguage links are removed and returned in an array */ var $mInterwikiMagic; - + /** * Allow external images inline? */ var $mAllowExternalImages; - + /** * If not, any exception? */ var $mAllowExternalImagesFrom; - + /** * If not or it doesn't match, should we check an on-wiki whitelist? */ var $mEnableImageWhitelist; - + /** * Date format index */ var $mDateFormat = null; - + /** * Create "edit section" links? */ var $mEditSection = true; - + /** * Allow inclusion of special pages? */ var $mAllowSpecialInclusion; - + /** * Use tidy to cleanup output HTML? */ var $mTidy = false; - + /** * Which lang to call for PLURAL and GRAMMAR */ var $mInterfaceMessage = false; - + /** * Overrides $mInterfaceMessage with arbitrary language */ var $mTargetLanguage = null; - + /** * Maximum size of template expansions, in bytes */ var $mMaxIncludeSize; - + /** * Maximum number of nodes touched by PPFrame::expand() */ @@ -99,56 +99,56 @@ class ParserOptions { * Maximum number of nodes generated by Preprocessor::preprocessToObj() */ var $mMaxGeneratedPPNodeCount; - + /** * Maximum recursion depth in PPFrame::expand() */ var $mMaxPPExpandDepth; - + /** * Maximum recursion depth for templates within templates */ var $mMaxTemplateDepth; - + /** * Maximum number of calls per parse to expensive parser functions */ var $mExpensiveParserFunctionLimit; - + /** * Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS */ var $mRemoveComments = true; - + /** * Callback for template fetching. Used as first argument to call_user_func(). */ var $mTemplateCallback = array( 'Parser', 'statelessFetchTemplate' ); - + /** * Enable limit report in an HTML comment on output */ var $mEnableLimitReport = false; - + /** * Timestamp used for {{CURRENTDAY}} etc. */ var $mTimestamp; - + /** * Target attribute for external links */ var $mExternalLinkTarget; - + /** - * Clean up signature texts? + * Clean up signature texts? * * 1) Strip ~~~, ~~~~ and ~~~~~ out of signatures * 2) Substitute all transclusions */ var $mCleanSignatures; - + /** * Transform wiki markup when saving the page? */ @@ -168,43 +168,43 @@ class ParserOptions { * Automatically number headings? */ var $mNumberHeadings; - + /** * User math preference (as integer). Not used (1.19) */ var $mMath; - + /** * Thumb size preferred by the user. */ var $mThumbSize; - + /** * Maximum article size of an article to be marked as "stub" */ private $mStubThreshold; - + /** * Language object of the User language. */ var $mUserLang; /** - * @var User + * @var User * Stored user object */ var $mUser; - + /** * Parsing the page for a "preview" operation? */ var $mIsPreview = false; - + /** * Parsing the page for a "preview" operation on a single section? */ var $mIsSectionPreview = false; - + /** * Parsing the printable version of the page? */ @@ -415,8 +415,8 @@ class ParserOptions { return new ParserOptions( $context->getUser(), $context->getLanguage() ); } - /** - * Get user options + /** + * Get user options * * @param $user User object * @param $lang Language object diff --git a/includes/parser/Parser_LinkHooks.php b/includes/parser/Parser_LinkHooks.php index 9c750b8ce1..e4f5d1262a 100644 --- a/includes/parser/Parser_LinkHooks.php +++ b/includes/parser/Parser_LinkHooks.php @@ -32,7 +32,7 @@ class Parser_LinkHooks extends Parser { * can automatically discard old data. */ const VERSION = '1.6.4'; - + # Flags for Parser::setLinkHook # Also available as global constants from Defines.php const SLH_PATTERN = 1; @@ -112,7 +112,7 @@ class Parser_LinkHooks extends Parser { $this->mLinkHooks[$ns] = array( $callback, $flags ); return $oldVal; } - + /** * Get all registered link hook identifiers * @@ -147,7 +147,7 @@ class Parser_LinkHooks extends Parser { } $holders = new LinkHolderArray( $this ); - + if( is_null( $this->mTitle ) ) { wfProfileOut( __METHOD__ ); wfProfileOut( __METHOD__.'-setup' ); @@ -155,7 +155,7 @@ class Parser_LinkHooks extends Parser { } wfProfileOut( __METHOD__.'-setup' ); - + $offset = 0; $offsetStack = array(); $markers = new LinkMarkerReplacer( $this, $holders, array( &$this, 'replaceInternalLinksCallback' ) ); @@ -181,7 +181,7 @@ class Parser_LinkHooks extends Parser { $startBracketOffset = array_pop($offsetStack); # Just to clean up the code, lets place offsets on the outer ends $endBracketOffset += 2; - + # Only do logic if we actually have a opening bracket for this if( isset($startBracketOffset) ) { # Extract text inside the link @@ -206,22 +206,20 @@ class Parser_LinkHooks extends Parser { # ToDO: Some LinkHooks use patterns rather than namespaces # these need to be tested at this point here } - } # Bump our offset to after our current bracket $offset = $bracketOffset+2; } - - + # Now expand our tree wfProfileIn( __METHOD__.'-expand' ); $s = $markers->expand( $s ); wfProfileOut( __METHOD__.'-expand' ); - + wfProfileOut( __METHOD__ ); return $holders; } - + function replaceInternalLinksCallback( $parser, $holders, $markers, $titleText, $paramText ) { wfProfileIn( __METHOD__ ); $wt = isset($paramText) ? "[[$titleText|$paramText]]" : "[[$titleText]]"; @@ -233,16 +231,16 @@ class Parser_LinkHooks extends Parser { wfProfileOut( __METHOD__ ); return $wt; } - + # Make subpage if necessary if( $this->areSubpagesAllowed() ) { $titleText = $this->maybeDoSubpageLink( $titleText, $paramText ); } - + # Check for a leading colon and strip it if it is there $leadingColon = $titleText[0] == ':'; if( $leadingColon ) $titleText = substr( $titleText, 1 ); - + wfProfileOut( __METHOD__."-misc" ); # Make title object wfProfileIn( __METHOD__."-title" ); @@ -254,7 +252,7 @@ class Parser_LinkHooks extends Parser { } $ns = $title->getNamespace(); wfProfileOut( __METHOD__."-title" ); - + # Default for Namespaces is a default link # ToDo: Default for patterns is plain wikitext $return = true; @@ -273,7 +271,7 @@ class Parser_LinkHooks extends Parser { } if( $return === true ) { # True (treat as plain link) was returned, call the defaultLinkHook - $return = CoreLinkFunctions::defaultLinkHook( $parser, $holders, $markers, $title, + $return = CoreLinkFunctions::defaultLinkHook( $parser, $holders, $markers, $title, $titleText, $paramText, $leadingColon ); } if( $return === false ) { @@ -285,13 +283,13 @@ class Parser_LinkHooks extends Parser { wfProfileOut( __METHOD__ ); return $return; } - + } class LinkMarkerReplacer { - + protected $markers, $nextId, $parser, $holders, $callback; - + function __construct( $parser, $holders, $callback ) { $this->nextId = 0; $this->markers = array(); @@ -299,21 +297,21 @@ class LinkMarkerReplacer { $this->holders = $holders; $this->callback = $callback; } - + function addMarker($titleText, $paramText) { $id = $this->nextId++; $this->markers[$id] = array( $titleText, $paramText ); return ""; } - + function findMarker( $string ) { return (bool) preg_match('//', $string ); } - + function expand( $string ) { return StringUtils::delimiterReplaceCallback( "", array( &$this, 'callback' ), $string ); } - + function callback( $m ) { $id = intval($m[1]); if( !array_key_exists($id, $this->markers) ) return $m[0]; @@ -323,5 +321,4 @@ class LinkMarkerReplacer { array_unshift( $args, $this->parser ); return call_user_func_array( $this->callback, $args ); } - } diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 15ea5e4b82..b2dd7db1a1 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -165,7 +165,7 @@ class Preprocessor_DOM implements Preprocessor { } // Fail if the number of elements exceeds acceptable limits - // Do not attempt to generate the DOM + // Do not attempt to generate the DOM $this->parser->mGeneratedPPNodeCount += substr_count( $xml, '<' ); $max = $this->parser->mOptions->getMaxGeneratedPPNodeCount(); if ( $this->parser->mGeneratedPPNodeCount > $max ) { diff --git a/includes/parser/StripState.php b/includes/parser/StripState.php index ad95d5f76a..57f623de85 100644 --- a/includes/parser/StripState.php +++ b/includes/parser/StripState.php @@ -112,7 +112,7 @@ class StripState { * @return mixed */ protected function unstripType( $type, $text ) { - // Shortcut + // Shortcut if ( !count( $this->data[$type] ) ) { return $text; } @@ -139,7 +139,7 @@ class StripState { . ''; } if ( $this->recursionLevel >= self::UNSTRIP_RECURSION_LIMIT ) { - return '' . + return '' . wfMessage( 'parser-unstrip-recursion-limit' ) ->numParams( self::UNSTRIP_RECURSION_LIMIT )->inContentLanguage()->text() . ''; @@ -156,7 +156,7 @@ class StripState { } /** - * Get a StripState object which is sufficient to unstrip the given text. + * Get a StripState object which is sufficient to unstrip the given text. * It will contain the minimum subset of strip items necessary. * * @param $text string diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 7143d5bc42..faaab72d4b 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -441,7 +441,7 @@ class BlockListPager extends TablePager { $name = str_replace( ' ', '_', $user->getName() ); $lb->add( NS_USER, $name ); $lb->add( NS_USER_TALK, $name ); - } + } $lb->execute(); wfProfileOut( __METHOD__ ); diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index b4294b3288..18dde20a97 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -286,7 +286,7 @@ class SpecialExport extends SpecialPage { } else { $pageSet = array(); // Inverted index of all pages to look up - + // Split up and normalize input foreach( explode( "\n", $page ) as $pageName ) { $pageName = trim( $pageName ); diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index a15fdd20bd..a061963d1e 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -646,7 +646,7 @@ class SpecialUpload extends SpecialPage { $exists['normalizedFile']->getTitle()->getPrefixedText() )->parse(); } elseif ( $exists['warning'] == 'thumb' ) { // Swapped argument order compared with other messages for backwards compatibility - $warning = wfMessage( 'fileexists-thumbnail-yes', + $warning = wfMessage( 'fileexists-thumbnail-yes', $exists['thumbFile']->getTitle()->getPrefixedText(), $filename )->parse(); } elseif ( $exists['warning'] == 'thumb-name' ) { // Image w/o '180px-' does not exists, but we do not like these filenames diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 6353b1cf61..3f9851ed33 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -192,7 +192,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { // now we should construct a File, so we can get mime and other such info in a standard way // n.b. mimetype may be different from original (ogx original -> jpeg thumb) - $thumbFile = new UnregisteredLocalFile( false, + $thumbFile = new UnregisteredLocalFile( false, $this->stash->repo, $thumbnailImage->getStoragePath(), false ); if ( !$thumbFile ) { throw new UploadStashFileNotFoundException( "couldn't create local file object for thumbnail" ); diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index f52f7bb9bd..ddeb4a1b38 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -42,7 +42,7 @@ class WantedFilesPage extends WantedQueryPage { $catMessage = $this->msg( 'broken-file-category' ) ->title( Title::newFromText( "Wanted Files", NS_MAIN ) ) ->inContentLanguage(); - + if ( !$catMessage->isDisabled() ) { $category = Title::makeTitleSafe( NS_CATEGORY, $catMessage->text() ); } else { diff --git a/includes/specials/SpecialWantedpages.php b/includes/specials/SpecialWantedpages.php index dec123de01..05df400eae 100644 --- a/includes/specials/SpecialWantedpages.php +++ b/includes/specials/SpecialWantedpages.php @@ -27,7 +27,7 @@ * @ingroup SpecialPage */ class WantedPagesPage extends WantedQueryPage { - + function __construct( $name = 'Wantedpages' ) { parent::__construct( $name ); } diff --git a/includes/upload/UploadFromFile.php b/includes/upload/UploadFromFile.php index aa0cc77bbf..ab2a7a396a 100644 --- a/includes/upload/UploadFromFile.php +++ b/includes/upload/UploadFromFile.php @@ -79,21 +79,21 @@ class UploadFromFile extends UploadBase { * @return array */ public function verifyUpload() { - # Check for a post_max_size or upload_max_size overflow, so that a + # Check for a post_max_size or upload_max_size overflow, so that a # proper error can be shown to the user if ( is_null( $this->mTempPath ) || $this->isEmptyFile() ) { if ( $this->mUpload->isIniSizeOverflow() ) { - return array( + return array( 'status' => UploadBase::FILE_TOO_LARGE, - 'max' => min( - self::getMaxUploadSize( $this->getSourceType() ), - wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ), + 'max' => min( + self::getMaxUploadSize( $this->getSourceType() ), + wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ), wfShorthandToInteger( ini_get( 'post_max_size' ) ) ), ); } } - + return parent::verifyUpload(); } } diff --git a/maintenance/eval.php b/maintenance/eval.php index 5aefe1c970..69cf548417 100644 --- a/maintenance/eval.php +++ b/maintenance/eval.php @@ -43,7 +43,7 @@ if ( isset( $options['d'] ) ) { } if ( $d > 1 ) { $lb = wfGetLB(); - $serverCount = $lb->getServerCount(); + $serverCount = $lb->getServerCount(); for ( $i = 0; $i < $serverCount; $i++ ) { $server = $lb->getServerInfo( $i ); $server['flags'] |= DBO_DEBUG; diff --git a/opensearch_desc.php5 b/opensearch_desc.php5 index 16d09ea5dd..58bd351bd7 100644 --- a/opensearch_desc.php5 +++ b/opensearch_desc.php5 @@ -21,4 +21,4 @@ * @file */ -require './opensearch_desc.php'; +require './opensearch_desc.php'; diff --git a/thumb.php5 b/thumb.php5 index 0c9b702a50..db388d2b1e 100644 --- a/thumb.php5 +++ b/thumb.php5 @@ -22,4 +22,4 @@ * @ingroup Media */ -require './thumb.php'; +require './thumb.php'; -- 2.20.1