Merge "Remove subpage from form target on Special:BlockList"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 26 Apr 2013 15:16:29 +0000 (15:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 26 Apr 2013 15:16:29 +0000 (15:16 +0000)
456 files changed:
.gitignore
RELEASE-NOTES-1.21
RELEASE-NOTES-1.22
docs/hooks.txt
includes/AjaxDispatcher.php
includes/Article.php
includes/AutoLoader.php
includes/Autopromote.php
includes/Block.php
includes/Cdb.php
includes/Cdb_PHP.php
includes/ChangeTags.php
includes/ChangesFeed.php
includes/ChangesList.php
includes/Collation.php
includes/ConfEditor.php
includes/CryptRand.php [deleted file]
includes/DataUpdate.php
includes/DefaultSettings.php
includes/EditPage.php
includes/Exception.php
includes/Export.php
includes/Fallback.php
includes/Feed.php
includes/FeedUtils.php
includes/FileDeleteForm.php
includes/ForkController.php
includes/FormOptions.php
includes/GitInfo.php
includes/GlobalFunctions.php
includes/HTMLForm.php
includes/HashRing.php
includes/HistoryBlob.php
includes/Hooks.php
includes/Html.php
includes/HttpFunctions.php
includes/IP.php
includes/ImageGallery.php
includes/ImagePage.php
includes/ImageQueryPage.php
includes/Import.php
includes/Licenses.php
includes/LinkFilter.php
includes/Linker.php
includes/LinksUpdate.php
includes/MWCryptRand.php [new file with mode: 0644]
includes/MWFunction.php
includes/MagicWord.php
includes/Message.php
includes/Metadata.php
includes/MimeMagic.php
includes/OutputHandler.php
includes/Pager.php
includes/PathRouter.php
includes/PoolCounter.php
includes/Preferences.php
includes/PrefixSearch.php
includes/ProtectionForm.php
includes/QueryPage.php
includes/RecentChange.php
includes/Revision.php
includes/RevisionList.php
includes/Sanitizer.php
includes/Setup.php
includes/SiteConfiguration.php
includes/SiteStats.php
includes/Skin.php
includes/SkinLegacy.php
includes/SkinTemplate.php
includes/SpecialPage.php
includes/SpecialPageFactory.php
includes/StatCounter.php
includes/Status.php
includes/StringUtils.php
includes/Timestamp.php
includes/Title.php
includes/User.php
includes/UserMailer.php
includes/UserRightsProxy.php
includes/WatchedItem.php
includes/WebRequest.php
includes/WebResponse.php
includes/WebStart.php
includes/Wiki.php
includes/WikiError.php
includes/WikiMap.php
includes/WikiPage.php
includes/Xml.php
includes/XmlTypeCheck.php
includes/ZhClient.php
includes/actions/CreditsAction.php
includes/actions/HistoryAction.php
includes/actions/InfoAction.php
includes/actions/PurgeAction.php
includes/actions/RawAction.php
includes/api/ApiBase.php
includes/api/ApiEditPage.php
includes/api/ApiFeedContributions.php
includes/api/ApiFormatXml.php
includes/api/ApiMain.php
includes/api/ApiPageSet.php
includes/api/ApiQueryBlocks.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQuerySearch.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryWatchlist.php
includes/api/ApiUpload.php
includes/cache/BacklinkCache.php
includes/cache/CacheDependency.php
includes/cache/FileCacheBase.php
includes/cache/GenderCache.php
includes/cache/LinkBatch.php
includes/cache/LinkCache.php
includes/cache/MessageCache.php
includes/cache/SquidUpdate.php
includes/context/RequestContext.php
includes/db/CloneDatabase.php
includes/db/Database.php
includes/db/DatabaseMssql.php
includes/db/DatabaseMysql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/db/LoadBalancer.php
includes/db/LoadMonitor.php
includes/debug/Debug.php
includes/diff/DairikiDiff.php
includes/externalstore/ExternalStoreDB.php
includes/filebackend/FSFileBackend.php
includes/filebackend/FileBackend.php
includes/filebackend/FileBackendGroup.php
includes/filebackend/FileBackendStore.php
includes/filebackend/FileOp.php
includes/filebackend/SwiftFileBackend.php
includes/filebackend/filejournal/DBFileJournal.php
includes/filebackend/lockmanager/DBLockManager.php
includes/filebackend/lockmanager/LockManagerGroup.php
includes/filerepo/FSRepo.php
includes/filerepo/FileRepo.php
includes/filerepo/ForeignAPIRepo.php
includes/filerepo/ForeignDBRepo.php
includes/filerepo/LocalRepo.php
includes/filerepo/RepoGroup.php
includes/filerepo/file/ArchivedFile.php
includes/filerepo/file/File.php
includes/filerepo/file/ForeignAPIFile.php
includes/filerepo/file/LocalFile.php
includes/installer/CliInstaller.php
includes/installer/DatabaseInstaller.php
includes/installer/Installer.i18n.php
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php
includes/installer/MysqlInstaller.php
includes/installer/MysqlUpdater.php
includes/installer/PostgresInstaller.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteInstaller.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerOutput.php
includes/installer/WebInstallerPage.php
includes/job/Job.php
includes/job/JobQueueAggregatorMemc.php
includes/job/JobQueueDB.php
includes/job/JobQueueFederated.php
includes/job/JobQueueRedis.php
includes/job/jobs/AssembleUploadChunksJob.php
includes/job/jobs/EnotifNotifyJob.php
includes/job/jobs/HTMLCacheUpdateJob.php
includes/job/jobs/PublishStashedFileJob.php
includes/job/jobs/RefreshLinksJob.php
includes/logging/DeleteLogFormatter.php
includes/logging/LogEntry.php
includes/logging/LogEventsList.php
includes/logging/LogFormatter.php
includes/logging/LogPage.php
includes/logging/LogPager.php
includes/logging/MoveLogFormatter.php
includes/media/BMP.php
includes/media/Bitmap.php
includes/media/BitmapMetadataHandler.php
includes/media/DjVu.php
includes/media/DjVuImage.php
includes/media/Exif.php
includes/media/FormatMetadata.php
includes/media/GIF.php
includes/media/GIFMetadataExtractor.php
includes/media/IPTC.php
includes/media/ImageHandler.php
includes/media/Jpeg.php
includes/media/JpegMetadataExtractor.php
includes/media/MediaHandler.php
includes/media/MediaTransformOutput.php
includes/media/PNG.php
includes/media/PNGMetadataExtractor.php
includes/media/SVG.php
includes/media/SVGMetadataExtractor.php
includes/media/XCF.php
includes/media/XMP.php
includes/media/XMPInfo.php
includes/objectcache/BagOStuff.php
includes/objectcache/MemcachedBagOStuff.php
includes/objectcache/MemcachedClient.php
includes/objectcache/ObjectCache.php
includes/objectcache/ObjectCacheSessionHandler.php
includes/objectcache/RedisBagOStuff.php
includes/parser/CacheTime.php
includes/parser/CoreParserFunctions.php
includes/parser/CoreTagHooks.php
includes/parser/DateFormatter.php
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/parser/ParserCache.php
includes/parser/ParserOptions.php
includes/parser/ParserOutput.php
includes/parser/Parser_DiffTest.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/parser/Tidy.php
includes/profiler/Profiler.php
includes/profiler/ProfilerSimpleUDP.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/resourceloader/ResourceLoaderUserGroupsModule.php
includes/revisiondelete/RevisionDelete.php
includes/revisiondelete/RevisionDeleteAbstracts.php
includes/revisiondelete/RevisionDeleteUser.php
includes/revisiondelete/RevisionDeleter.php
includes/search/SearchEngine.php
includes/search/SearchMssql.php
includes/search/SearchMySQL.php
includes/search/SearchOracle.php
includes/search/SearchPostgres.php
includes/search/SearchSqlite.php
includes/search/SearchUpdate.php
includes/specials/SpecialContributions.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWatchlist.php
includes/templates/Usercreate.php
includes/templates/UsercreateVForm.php [new file with mode: 0644]
includes/templates/Userlogin.php
includes/templates/UserloginVForm.php
includes/upload/UploadBase.php
includes/upload/UploadFromChunks.php
includes/upload/UploadFromFile.php
includes/upload/UploadFromStash.php
includes/upload/UploadFromUrl.php
includes/upload/UploadStash.php
languages/Language.php
languages/classes/LanguageKk.php
languages/messages/MessagesAs.php
languages/messages/MessagesBa.php
languages/messages/MessagesBe_tarask.php
languages/messages/MessagesBn.php
languages/messages/MessagesCa.php
languages/messages/MessagesCe.php
languages/messages/MessagesCkb.php
languages/messages/MessagesCs.php
languages/messages/MessagesDa.php
languages/messages/MessagesDe.php
languages/messages/MessagesDiq.php
languages/messages/MessagesEn.php
languages/messages/MessagesEo.php
languages/messages/MessagesEs.php
languages/messages/MessagesFa.php
languages/messages/MessagesFr.php
languages/messages/MessagesHe.php
languages/messages/MessagesHsb.php
languages/messages/MessagesIa.php
languages/messages/MessagesInh.php
languages/messages/MessagesIt.php
languages/messages/MessagesJa.php
languages/messages/MessagesKab.php
languages/messages/MessagesKiu.php
languages/messages/MessagesKo.php
languages/messages/MessagesKsh.php
languages/messages/MessagesLb.php
languages/messages/MessagesLij.php
languages/messages/MessagesLus.php
languages/messages/MessagesMin.php
languages/messages/MessagesMk.php
languages/messages/MessagesMl.php
languages/messages/MessagesMs.php
languages/messages/MessagesNb.php
languages/messages/MessagesNds_nl.php
languages/messages/MessagesNl.php
languages/messages/MessagesOr.php
languages/messages/MessagesPa.php
languages/messages/MessagesPfl.php
languages/messages/MessagesPl.php
languages/messages/MessagesPms.php
languages/messages/MessagesQqq.php
languages/messages/MessagesRo.php
languages/messages/MessagesRoa_tara.php
languages/messages/MessagesSah.php
languages/messages/MessagesSk.php
languages/messages/MessagesSl.php
languages/messages/MessagesTet.php
languages/messages/MessagesTr.php
languages/messages/MessagesUk.php
languages/messages/MessagesVi.php
languages/messages/MessagesVmf.php
languages/messages/MessagesZh_hant.php
maintenance/backup.inc
maintenance/backupPrefetch.inc
maintenance/backupTextPass.inc
maintenance/fuzz-tester.php
maintenance/getConfiguration.php
maintenance/language/checkLanguage.inc
maintenance/language/messageTypes.inc
maintenance/language/messages.inc
maintenance/mwdocgen.php
maintenance/oracle/tables.sql
maintenance/storage/checkStorage.php
resources/Resources.php
resources/mediawiki.special/images/icon-contributors.png [new file with mode: 0644]
resources/mediawiki.special/images/icon-edits.png [new file with mode: 0644]
resources/mediawiki.special/images/icon-pages.png [new file with mode: 0644]
resources/mediawiki.special/mediawiki.special.createAccount.vform.css [new file with mode: 0644]
resources/mediawiki.special/mediawiki.special.createAccount.vform.js [new file with mode: 0644]
resources/mediawiki.special/mediawiki.special.vforms.css
resources/mediawiki.ui/mediawiki.ui.default.css
resources/mediawiki.ui/mediawiki.ui.vector.css
resources/mediawiki.ui/sourcefiles/scss/components/default/_forms.scss
resources/mediawiki/mediawiki.searchSuggest.js
resources/mediawiki/mediawiki.util.js
skins/Vector.php
skins/monobook/main.css
skins/vector/screen.css
tests/RunSeleniumTests.php
tests/TestsAutoLoader.php
tests/parser/ParserTestResult.php [new file with mode: 0644]
tests/parser/parserTest.inc
tests/parser/parserTests.txt
tests/phpunit/MediaWikiLangTestCase.php
tests/phpunit/MediaWikiPHPUnitCommand.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/bootstrap.php
tests/phpunit/includes/ArticleTablesTest.php
tests/phpunit/includes/BlockTest.php
tests/phpunit/includes/CdbTest.php
tests/phpunit/includes/CollationTest.php
tests/phpunit/includes/DiffHistoryBlobTest.php
tests/phpunit/includes/FormOptionsInitializationTest.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php
tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php
tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php
tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php
tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
tests/phpunit/includes/HooksTest.php
tests/phpunit/includes/HtmlTest.php
tests/phpunit/includes/HttpTest.php
tests/phpunit/includes/LanguageConverterTest.php
tests/phpunit/includes/LinksUpdateTest.php
tests/phpunit/includes/MWFunctionTest.php
tests/phpunit/includes/MWNamespaceTest.php
tests/phpunit/includes/PathRouterTest.php
tests/phpunit/includes/PreferencesTest.php
tests/phpunit/includes/Providers.php
tests/phpunit/includes/RecentChangeTest.php
tests/phpunit/includes/RequestContextTest.php
tests/phpunit/includes/ResourceLoaderTest.php
tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php
tests/phpunit/includes/RevisionTest.php
tests/phpunit/includes/SanitizerTest.php
tests/phpunit/includes/SiteConfigurationTest.php
tests/phpunit/includes/StringUtilsTest.php
tests/phpunit/includes/TemplateCategoriesTest.php
tests/phpunit/includes/TestUser.php
tests/phpunit/includes/TimestampTest.php
tests/phpunit/includes/TitleMethodsTest.php
tests/phpunit/includes/TitlePermissionTest.php
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/WikiPageTest.php
tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php
tests/phpunit/includes/api/ApiAccountCreationTest.php
tests/phpunit/includes/api/ApiBlockTest.php
tests/phpunit/includes/api/ApiEditPageTest.php
tests/phpunit/includes/api/ApiOptionsTest.php
tests/phpunit/includes/api/ApiParseTest.php
tests/phpunit/includes/api/ApiPurgeTest.php
tests/phpunit/includes/api/ApiTestCase.php
tests/phpunit/includes/api/ApiTestCaseUpload.php
tests/phpunit/includes/api/ApiUploadTest.php
tests/phpunit/includes/api/ApiWatchTest.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/api/format/ApiFormatPhpTest.php
tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
tests/phpunit/includes/api/query/ApiQueryTest.php
tests/phpunit/includes/api/query/ApiQueryTestBase.php
tests/phpunit/includes/cache/ProcessCacheLRUTest.php
tests/phpunit/includes/content/ContentHandlerTest.php
tests/phpunit/includes/content/CssContentTest.php
tests/phpunit/includes/content/JavaScriptContentTest.php
tests/phpunit/includes/content/TextContentTest.php
tests/phpunit/includes/content/WikitextContentHandlerTest.php
tests/phpunit/includes/db/DatabaseSQLTest.php
tests/phpunit/includes/db/DatabaseSqliteTest.php
tests/phpunit/includes/db/DatabaseTestHelper.php
tests/phpunit/includes/db/ORMRowTest.php
tests/phpunit/includes/db/ORMTableTest.php
tests/phpunit/includes/db/TestORMRowTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/filerepo/FileRepoTest.php
tests/phpunit/includes/filerepo/StoreBatchTest.php
tests/phpunit/includes/jobqueue/JobQueueTest.php
tests/phpunit/includes/json/FormatJsonTest.php
tests/phpunit/includes/libs/GenericArrayObjectTest.php
tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
tests/phpunit/includes/media/ExifTest.php
tests/phpunit/includes/media/IPTCTest.php
tests/phpunit/includes/media/PNGMetadataExtractorTest.php
tests/phpunit/includes/media/SVGMetadataExtractorTest.php
tests/phpunit/includes/media/XMPTest.php
tests/phpunit/includes/media/XMPValidateTest.php
tests/phpunit/includes/objectcache/BagOStuffTest.php
tests/phpunit/includes/parser/MediaWikiParserTest.php
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/includes/parser/ParserMethodsTest.php
tests/phpunit/includes/parser/ParserPreloadTest.php
tests/phpunit/includes/search/SearchEngineTest.php
tests/phpunit/includes/search/SearchUpdateTest.php
tests/phpunit/includes/site/MediaWikiSiteTest.php
tests/phpunit/includes/site/SiteListTest.php
tests/phpunit/includes/site/SiteSQLStoreTest.php
tests/phpunit/includes/site/SiteTest.php
tests/phpunit/includes/site/TestSites.php
tests/phpunit/includes/specials/SpecialRecentchangesTest.php
tests/phpunit/includes/specials/SpecialSearchTest.php
tests/phpunit/includes/upload/UploadFromUrlTest.php
tests/phpunit/includes/upload/UploadTest.php
tests/phpunit/languages/LanguageClassesTestCase.php
tests/phpunit/languages/LanguageTest.php
tests/phpunit/languages/LanguageTrTest.php
tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php
tests/phpunit/maintenance/DumpTestCase.php
tests/phpunit/maintenance/MaintenanceTest.php
tests/phpunit/maintenance/backupPrefetchTest.php
tests/phpunit/maintenance/backupTextPassTest.php
tests/phpunit/maintenance/backup_LogTest.php
tests/phpunit/maintenance/backup_PageTest.php
tests/phpunit/maintenance/fetchTextTest.php
tests/phpunit/maintenance/getSlaveServerTest.php
tests/phpunit/phpunit.php
tests/phpunit/resources/ResourcesTest.php
tests/phpunit/skins/SideBarTest.php
tests/phpunit/suites/UploadFromUrlTestSuite.php
tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
tests/selenium/suites/AddContentToNewPageTestCase.php
tests/testHelpers.inc

index ca87d93..dbe20fc 100644 (file)
@@ -7,6 +7,8 @@
 # Editors
 *.kate-swp
 *~
+\#*#
+.#*
 .*.swp
 .project
 cscope.files
index 6c68d82..1930636 100644 (file)
@@ -115,6 +115,7 @@ production.
   uz, vi.
 * Added 'CategoryAfterPageAdded' and 'CategoryAfterPageRemoved' hooks.
 * Added 'HistoryRevisionTools' and 'DiffRevisionTools' hooks.
+* Added 'SpecialSearchResultsPrepend' and 'SpecialSearchResultsAppend' hooks.
 * (bug 33186) Add image rotation api "imagerotate"
 * (bug 34040) Add "User rights management" link on user page toolbox.
 * (bug 45526) Add QUnit assertion helper "QUnit.assert.htmlEqual" for asserting
index 13a3c3c..eda1e7c 100644 (file)
@@ -12,7 +12,8 @@ production.
 * $wgRedirectScript was removed. It was unused.
 * Removed $wgLocalMessageCacheSerialized, it is now always true.
 * When $wgUseVFormUserLogin is true, the redesign of Special:UserLogin is
-  activated.
+  activated; when $wgUseVFormCreateAccount is true, the redesign of
+  Special:UserLogin/signup is activated.
 * $wgVectorUseIconWatch is now enabled by default.
 
 === New features in 1.22 ===
@@ -24,13 +25,26 @@ production.
   preference). This feature was moved from the Vector extension, and is now part
   of core for all skins. Take care when upgrading that you don't use an older
   version of the Vector extension as this feature may conflict.
-* New version of Special:UserLogin form. It is opt-in for now, controlled by
-  the $wgUseVFormUserLogin setting or a 'useNew' URL parameter trigger.
-* Added 'SpecialSearchResultsPrepend' and 'SpecialSearchResultsAppend' hooks.
+* New 'mediawiki.ui' CSS module providing mw-ui-* styles for buttons and a
+  compact vertical form layout.
+* New versions of login (Special:UserLogin) and create account
+  (Special:UserLogin/signup) forms. They are opt-in for now, controlled by
+  the $wgUseVFormUserLogin and $wgUseVFormCreateAccount settings or a 'useNew'
+  URL parameter trigger.
 * (bug 23343) Implemented ability to apply IP blocks to the contents of X-Forwarded-For headers
   by adding a new configuration variable $wgApplyIpBlocksToXff (disabled by default).
 * The new hook 'APIGetPossibleErrors' to modify the list of possible errors was
   added.
+* (bug 25592) LogEventsList::showLogExtract() will now ignore various
+  Pager-related WebRequest parameters by default, as this is overwhelmingly
+  likely to be what was intended by users of the method. If any caller wishes
+  to use these parameters, the new param 'useRequestParams' may be set to true.
+* mw.util.addPortletLink: Tooltip is no longer required to be plain (without
+  an accesskey in it already). As such it now rountrips. Creating a link with a
+  message as tooltip, grabbing the title attribute and using it to create
+  another portlet will work as expected.
+* (bug 6747) {{ROOTPAGENAME}} introduced, contains the name of the topmost
+  page without namespace.
 
 === Bug fixes in 1.22 ===
 * Disable Special:PasswordReset when $wgEnableEmail. Previously one could still
@@ -44,6 +58,9 @@ production.
 * (bug 47218) Special:BlockList now handles correctly user names with spaces
   when passed as subpage.
 * Pager's properly validate which fields are allowed to be sorted on.
+* mw.util.tooltipAccessKeyRegexp: The regex now matches "option-" as well.
+  Support for Mac "option" was added in 1.16, but the regex was never updated.
+* (bug 46768) Usernames of blocking users now display correctly, even if numeric.
 
 === API changes in 1.22 ===
 * (bug 46626) xmldoublequote parameter was removed. Because of a bug, the
@@ -55,6 +72,7 @@ production.
   longer be), and will no longer choke on booleans.
 * action=opensearch no longer silently ignores the format parameter.
 * action=opensearch now supports format=jsonfm.
+* list=usercontribs&ucprop=ids will now include the parent revision id.
 
 === Languages updated in 1.22===
 
@@ -81,6 +99,8 @@ changes to languages because of Bugzilla reports.
 * Calling Linker methods using a skin will now output deprecation warnings.
 * (bug 46680) "Return to" links are no longer tagged with rel="next".
 * The Special:ActiveUsers special page was removed.
+* BREAKING CHANGE: mw.util.tooltipAccessKeyRegexp: The match group for the
+  accesskey character is now $6 instead of $5.
 
 == Compatibility ==
 
index 2cde591..2d64bce 100644 (file)
@@ -1138,6 +1138,15 @@ $title: Title object of page
 $url: string value as output (out parameter, can modify)
 $query: query options passed to Title::getFullURL()
 
+'GetHumanTimestamp': Pre-emptively override the human-readable timestamp generated
+by MWTimestamp::getHumanTimestamp(). Return false in this hook to use the custom
+output.
+&$output: string for the output timestamp
+$timestamp: MWTimestamp object of the current (user-adjusted) timestamp
+$relativeTo: MWTimestamp object of the relative (user-adjusted) timestamp
+$user: User whose preferences are being used to make timestamp
+$lang: Language that will be used to render the timestamp
+
 'GetInternalURL': Modify fully-qualified URLs used for squid cache purging.
 $title: Title object of page
 $url: string value as output (out parameter, can modify)
index b00cf30..e22fe20 100644 (file)
@@ -63,7 +63,7 @@ class AjaxDispatcher {
                        $this->mode = "post";
                }
 
-               switch( $this->mode ) {
+               switch ( $this->mode ) {
                        case 'get':
                                $this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : '';
                                if ( ! empty( $_GET["rsargs"] ) ) {
index d2f52bc..87b94ae 100644 (file)
@@ -160,7 +160,7 @@ class Article implements Page {
                $page = null;
                wfRunHooks( 'ArticleFromTitle', array( &$title, &$page ) );
                if ( !$page ) {
-                       switch( $title->getNamespace() ) {
+                       switch ( $title->getNamespace() ) {
                                case NS_FILE:
                                        $page = new ImagePage( $title );
                                        break;
@@ -609,7 +609,7 @@ class Article implements Page {
                $this->mParserOutput = false;
 
                while ( !$outputDone && ++$pass ) {
-                       switch( $pass ) {
+                       switch ( $pass ) {
                                case 1:
                                        wfRunHooks( 'ArticleViewHeader', array( &$this, &$outputDone, &$useParserCache ) );
                                        break;
@@ -673,12 +673,12 @@ class Article implements Page {
                                                wfDebug( __METHOD__ . ": showing CSS/JS source\n" );
                                                $this->showCssOrJsPage();
                                                $outputDone = true;
-                                       } elseif( !wfRunHooks( 'ArticleContentViewCustom',
+                                       } elseif ( !wfRunHooks( 'ArticleContentViewCustom',
                                                        array( $this->fetchContentObject(), $this->getTitle(), $outputPage ) ) ) {
 
                                                # Allow extensions do their own custom view for certain pages
                                                $outputDone = true;
-                                       } elseif( !ContentHandler::runLegacyHooks( 'ArticleViewCustom',
+                                       } elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom',
                                                        array( $this->fetchContentObject(), $this->getTitle(), $outputPage ) ) ) {
 
                                                # Allow extensions do their own custom view for certain pages
@@ -875,7 +875,7 @@ class Article implements Page {
                        }
                        if ( Block::newFromTarget( $specificTarget, $vagueTarget ) instanceof Block ) {
                                return array(
-                                       'index'  => 'noindex',
+                                       'index' => 'noindex',
                                        'follow' => 'nofollow'
                                );
                        }
@@ -884,19 +884,19 @@ class Article implements Page {
                if ( $this->mPage->getID() === 0 || $this->getOldID() ) {
                        # Non-articles (special pages etc), and old revisions
                        return array(
-                               'index'  => 'noindex',
+                               'index' => 'noindex',
                                'follow' => 'nofollow'
                        );
                } elseif ( $this->getContext()->getOutput()->isPrintable() ) {
                        # Discourage indexing of printable versions, but encourage following
                        return array(
-                               'index'  => 'noindex',
+                               'index' => 'noindex',
                                'follow' => 'follow'
                        );
                } elseif ( $this->getContext()->getRequest()->getInt( 'curid' ) ) {
                        # For ?curid=x urls, disallow indexing
                        return array(
-                               'index'  => 'noindex',
+                               'index' => 'noindex',
                                'follow' => 'follow'
                        );
                }
@@ -1100,7 +1100,7 @@ class Article implements Page {
                        $user = User::newFromName( $rootPart, false /* allow IP users*/ );
                        $ip = User::isIP( $rootPart );
 
-                       if ( !($user && $user->isLoggedIn()) && !$ip ) { # User does not exist
+                       if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist
                                $outputPage->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n\$1\n</div>",
                                        array( 'userpage-userdoesnotexist-view', wfEscapeWikiText( $rootPart ) ) );
                        } elseif ( $user->isBlocked() ) { # Show log extract if the user is currently blocked
index 4e562f6..4813d45 100644 (file)
@@ -65,7 +65,6 @@ $wgAutoloadLocalClasses = array(
        'ConfEditorToken' => 'includes/ConfEditor.php',
        'Cookie' => 'includes/Cookie.php',
        'CookieJar' => 'includes/Cookie.php',
-       'MWCryptRand' => 'includes/CryptRand.php',
        'CurlHttpRequest' => 'includes/HttpFunctions.php',
        'DeferrableUpdate' => 'includes/DeferredUpdates.php',
        'DeferredUpdates' => 'includes/DeferredUpdates.php',
@@ -90,11 +89,6 @@ $wgAutoloadLocalClasses = array(
        'EnhancedChangesList' => 'includes/ChangesList.php',
        'ErrorPageError' => 'includes/Exception.php',
        'ExplodeIterator' => 'includes/StringUtils.php',
-       'ExternalStore' => 'includes/externalstore/ExternalStore.php',
-       'ExternalStoreDB' => 'includes/externalstore/ExternalStoreDB.php',
-       'ExternalStoreHttp' => 'includes/externalstore/ExternalStoreHttp.php',
-       'ExternalStoreMedium' => 'includes/externalstore/ExternalStoreMedium.php',
-       'ExternalStoreMwstore' => 'includes/externalstore/ExternalStoreMwstore.php',
        'FakeTitle' => 'includes/FakeTitle.php',
        'Fallback' => 'includes/Fallback.php',
        'FatalError' => 'includes/Exception.php',
@@ -117,6 +111,7 @@ $wgAutoloadLocalClasses = array(
        'Hooks' => 'includes/Hooks.php',
        'Html' => 'includes/Html.php',
        'HTMLApiField' => 'includes/HTMLForm.php',
+       'HTMLButtonField' => 'includes/HTMLForm.php',
        'HTMLCheckField' => 'includes/HTMLForm.php',
        'HTMLCheckMatrix' => 'includes/HTMLForm.php',
        'HTMLEditTools' => 'includes/HTMLForm.php',
@@ -172,6 +167,7 @@ $wgAutoloadLocalClasses = array(
        'Message' => 'includes/Message.php',
        'MessageBlobStore' => 'includes/MessageBlobStore.php',
        'MimeMagic' => 'includes/MimeMagic.php',
+       'MWCryptRand' => 'includes/MWCryptRand.php',
        'MWException' => 'includes/Exception.php',
        'MWExceptionHandler' => 'includes/Exception.php',
        'MWFunction' => 'includes/MWFunction.php',
@@ -542,6 +538,13 @@ $wgAutoloadLocalClasses = array(
        'WikiDiff3' => 'includes/diff/WikiDiff3.php',
        'WordLevelDiff' => 'includes/diff/DairikiDiff.php',
 
+       # includes/externalstore
+       'ExternalStore' => 'includes/externalstore/ExternalStore.php',
+       'ExternalStoreDB' => 'includes/externalstore/ExternalStoreDB.php',
+       'ExternalStoreHttp' => 'includes/externalstore/ExternalStoreHttp.php',
+       'ExternalStoreMedium' => 'includes/externalstore/ExternalStoreMedium.php',
+       'ExternalStoreMwstore' => 'includes/externalstore/ExternalStoreMwstore.php',
+
        # includes/filebackend
        'FileBackendGroup' => 'includes/filebackend/FileBackendGroup.php',
        'FileBackend' => 'includes/filebackend/FileBackend.php',
@@ -574,9 +577,9 @@ $wgAutoloadLocalClasses = array(
        'LSLockManager' => 'includes/filebackend/lockmanager/LSLockManager.php',
        'MemcLockManager' => 'includes/filebackend/lockmanager/MemcLockManager.php',
        'QuorumLockManager' => 'includes/filebackend/lockmanager/QuorumLockManager.php',
-       'MySqlLockManager'=> 'includes/filebackend/lockmanager/DBLockManager.php',
-       'PostgreSqlLockManager'=> 'includes/filebackend/lockmanager/DBLockManager.php',
-       'RedisLockManager'=> 'includes/filebackend/lockmanager/RedisLockManager.php',
+       'MySqlLockManager' => 'includes/filebackend/lockmanager/DBLockManager.php',
+       'PostgreSqlLockManager' => 'includes/filebackend/lockmanager/DBLockManager.php',
+       'RedisLockManager' => 'includes/filebackend/lockmanager/RedisLockManager.php',
        'NullLockManager' => 'includes/filebackend/lockmanager/LockManager.php',
        'FileOp' => 'includes/filebackend/FileOp.php',
        'FileOpBatch' => 'includes/filebackend/FileOpBatch.php',
@@ -1005,6 +1008,7 @@ $wgAutoloadLocalClasses = array(
        'UserloginTemplate' => 'includes/templates/Userlogin.php',
        'UserloginTemplateVForm' => 'includes/templates/UserloginVForm.php',
        'UsercreateTemplate' => 'includes/templates/Usercreate.php',
+       'UsercreateTemplateVForm' => 'includes/templates/UsercreateVForm.php',
 
        # includes/upload
        'UploadBase' => 'includes/upload/UploadBase.php',
index 604b924..ec9dcf5 100644 (file)
@@ -165,7 +165,7 @@ class Autopromote {
                        return false;
                }
 
-               switch( $cond[0] ) {
+               switch ( $cond[0] ) {
                        case APCOND_EMAILCONFIRMED:
                                if ( Sanitizer::validateEmail( $user->getEmail() ) ) {
                                        if ( $wgEmailAuthentication ) {
index 3f00a51..47ddc7d 100644 (file)
@@ -65,11 +65,11 @@ class Block {
                $timestamp = 0, $auto = 0, $expiry = '', $anonOnly = 0, $createAccount = 0, $enableAutoblock = 0,
                $hideName = 0, $blockEmail = 0, $allowUsertalk = 0, $byText = '' )
        {
-               if( $timestamp === 0 ) {
+               if ( $timestamp === 0 ) {
                        $timestamp = wfTimestampNow();
                }
 
-               if( count( func_get_args() ) > 0 ) {
+               if ( count( func_get_args() ) > 0 ) {
                        # Soon... :D
                        # wfDeprecated( __METHOD__ . " with arguments" );
                }
@@ -206,16 +206,16 @@ class Block {
         */
        public function load( $address = '', $user = 0 ) {
                wfDeprecated( __METHOD__, '1.18' );
-               if( $user ) {
+               if ( $user ) {
                        $username = User::whoIs( $user );
                        $block = self::newFromTarget( $username, $address );
                } else {
                        $block = self::newFromTarget( null, $address );
                }
 
-               if( $block instanceof Block ) {
+               if ( $block instanceof Block ) {
                        # This is mildly evil, but hey, it's B/C :D
-                       foreach( $block as $variable => $value ) {
+                       foreach ( $block as $variable => $value ) {
                                $this->$variable = $value;
                        }
                        return true;
@@ -237,7 +237,7 @@ class Block {
        protected function newLoad( $vagueTarget = null ) {
                $db = wfGetDB( $this->mFromMaster ? DB_MASTER : DB_SLAVE );
 
-               if( $this->type !== null ) {
+               if ( $this->type !== null ) {
                        $conds = array(
                                'ipb_address' => array( (string)$this->target ),
                        );
@@ -247,9 +247,9 @@ class Block {
 
                # Be aware that the != '' check is explicit, since empty values will be
                # passed by some callers (bug 29116)
-               if( $vagueTarget != '' ) {
+               if ( $vagueTarget != '' ) {
                        list( $target, $type ) = self::parseTarget( $vagueTarget );
-                       switch( $type ) {
+                       switch ( $type ) {
                                case self::TYPE_USER:
                                        # Slightly weird, but who are we to argue?
                                        $conds['ipb_address'][] = (string)$target;
@@ -285,20 +285,20 @@ class Block {
                # This is begging for $this = $bestBlock, but that's not allowed in PHP :(
                $bestBlockPreventsEdit = null;
 
-               foreach( $res as $row ) {
+               foreach ( $res as $row ) {
                        $block = self::newFromRow( $row );
 
                        # Don't use expired blocks
-                       if( $block->deleteIfExpired() ) {
+                       if ( $block->deleteIfExpired() ) {
                                continue;
                        }
 
                        # Don't use anon only blocks on users
-                       if( $this->type == self::TYPE_USER && !$block->isHardblock() ) {
+                       if ( $this->type == self::TYPE_USER && !$block->isHardblock() ) {
                                continue;
                        }
 
-                       if( $block->getType() == self::TYPE_RANGE ) {
+                       if ( $block->getType() == self::TYPE_RANGE ) {
                                # This is the number of bits that are allowed to vary in the block, give
                                # or take some floating point errors
                                $end = wfBaseconvert( $block->getRangeEnd(), 16, 10 );
@@ -313,14 +313,14 @@ class Block {
                                $score = $block->getType();
                        }
 
-                       if( $score < $bestBlockScore ) {
+                       if ( $score < $bestBlockScore ) {
                                $bestBlockScore = $score;
                                $bestRow = $row;
                                $bestBlockPreventsEdit = $block->prevents( 'edit' );
                        }
                }
 
-               if( $bestRow !== null ) {
+               if ( $bestRow !== null ) {
                        $this->initFromRow( $bestRow );
                        $this->prevents( 'edit', $bestBlockPreventsEdit );
                        return true;
@@ -511,7 +511,7 @@ class Block {
         * @return Array
         */
        protected function getDatabaseArray( $db = null ) {
-               if( !$db ) {
+               if ( !$db ) {
                        $db = wfGetDB( DB_SLAVE );
                }
                $expiry = $db->encodeExpiry( $this->mExpiry );
@@ -579,7 +579,7 @@ class Block {
                global $wgPutIPinRC;
 
                // No IPs are in recentchanges table, so nothing to select
-               if( !$wgPutIPinRC ) {
+               if ( !$wgPutIPinRC ) {
                        return;
                }
 
@@ -601,7 +601,9 @@ class Block {
                        foreach ( $res as $row ) {
                                if ( $row->rc_ip ) {
                                        $id = $block->doAutoblock( $row->rc_ip );
-                                       if ( $id ) $blockIds[] = $id;
+                                       if ( $id ) {
+                                               $blockIds[] = $id;
+                                       }
                                }
                        }
                }
@@ -793,7 +795,7 @@ class Block {
         * @return String IP in Hex form
         */
        public function getRangeStart() {
-               switch( $this->type ) {
+               switch ( $this->type ) {
                        case self::TYPE_USER:
                                return '';
                        case self::TYPE_IP:
@@ -812,7 +814,7 @@ class Block {
         * @return String IP in Hex form
         */
        public function getRangeEnd() {
-               switch( $this->type ) {
+               switch ( $this->type ) {
                        case self::TYPE_USER:
                                return '';
                        case self::TYPE_IP:
@@ -909,7 +911,7 @@ class Block {
         * @return Bool
         */
        public function prevents( $action, $x = null ) {
-               switch( $action ) {
+               switch ( $action ) {
                        case 'edit':
                                # For now... <evil laugh>
                                return true;
@@ -1057,24 +1059,24 @@ class Block {
        public static function newFromTarget( $specificTarget, $vagueTarget = null, $fromMaster = false ) {
 
                list( $target, $type ) = self::parseTarget( $specificTarget );
-               if( $type == Block::TYPE_ID || $type == Block::TYPE_AUTO ) {
+               if ( $type == Block::TYPE_ID || $type == Block::TYPE_AUTO ) {
                        return Block::newFromID( $target );
 
-               } elseif( $target === null && $vagueTarget == '' ) {
+               } elseif ( $target === null && $vagueTarget == '' ) {
                        # We're not going to find anything useful here
                        # Be aware that the == '' check is explicit, since empty values will be
                        # passed by some callers (bug 29116)
                        return null;
 
-               } elseif( in_array( $type, array( Block::TYPE_USER, Block::TYPE_IP, Block::TYPE_RANGE, null ) ) ) {
+               } elseif ( in_array( $type, array( Block::TYPE_USER, Block::TYPE_IP, Block::TYPE_RANGE, null ) ) ) {
                        $block = new Block();
                        $block->fromMaster( $fromMaster );
 
-                       if( $type !== null ) {
+                       if ( $type !== null ) {
                                $block->setTarget( $target );
                        }
 
-                       if( $block->newLoad( $vagueTarget ) ) {
+                       if ( $block->newLoad( $vagueTarget ) ) {
                                return $block;
                        }
                }
@@ -1171,7 +1173,7 @@ class Block {
         * @param Array $block Array of blocks
         * @return Block|null the "best" block from the list
         */
-       public static function chooseBlock( array $blocks, array $ipChain  ) {
+       public static function chooseBlock( array $blocks, array $ipChain ) {
                if ( !count( $blocks ) ) {
                        return null;
                } elseif ( count( $blocks ) == 1 ) {
@@ -1278,13 +1280,13 @@ class Block {
         */
        public static function parseTarget( $target ) {
                # We may have been through this before
-               if( $target instanceof User ) {
-                       if( IP::isValid( $target->getName() ) ) {
+               if ( $target instanceof User ) {
+                       if ( IP::isValid( $target->getName() ) ) {
                                return array( $target, self::TYPE_IP );
                        } else {
                                return array( $target, self::TYPE_USER );
                        }
-               } elseif( $target === null ) {
+               } elseif ( $target === null ) {
                        return array( null, null );
                }
 
@@ -1305,7 +1307,7 @@ class Block {
 
                # Consider the possibility that this is not a username at all
                # but actually an old subpage (bug #29797)
-               if( strpos( $target, '/' ) !== false ) {
+               if ( strpos( $target, '/' ) !== false ) {
                        # An old subpage, drill down to the user behind it
                        $parts = explode( '/', $target );
                        $target = $parts[0];
@@ -1391,4 +1393,43 @@ class Block {
        public function setBlocker( $user ) {
                $this->blocker = $user;
        }
+
+       /**
+        * Get the key and parameters for the corresponding error message.
+        *
+        * @since 1.22
+        * @param IContextSource $context
+        * @return array
+        */
+       public function getPermissionsError( IContextSource $context ) {
+               $blocker = $this->getBlocker();
+               if ( $blocker instanceof User ) { // local user
+                       $blockerUserpage = $blocker->getUserPage();
+                       $link = "[[{$blockerUserpage->getPrefixedText()}|{$blockerUserpage->getText()}]]";
+               } else { // foreign user
+                       $link = $blocker;
+               }
+
+               $reason = $this->mReason;
+               if ( $reason == '' ) {
+                       $reason = $context->msg( 'blockednoreason' )->text();
+               }
+
+               /* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
+                * This could be a username, an IP range, or a single IP. */
+               $intended = $this->getTarget();
+
+               $lang = $context->getLanguage();
+               return array(
+                       $this->mAuto ? 'autoblockedtext' : 'blockedtext',
+                       $link,
+                       $reason,
+                       $context->getRequest()->getIP(),
+                       $this->getByName(),
+                       $this->getId(),
+                       $lang->formatExpiry( $this->mExpiry ),
+                       (string)$intended,
+                       $lang->timeanddate( wfTimestamp( TS_MW, $this->mTimestamp ), true ),
+               );
+       }
 }
index a142c7c..81c0afe 100644 (file)
@@ -133,7 +133,7 @@ class CdbReader_DBA {
        }
 
        function close() {
-               if( isset( $this->handle ) ) {
+               if ( isset( $this->handle ) ) {
                        dba_close( $this->handle );
                }
                unset( $this->handle );
@@ -164,7 +164,7 @@ class CdbWriter_DBA {
        }
 
        function close() {
-               if( isset( $this->handle ) ) {
+               if ( isset( $this->handle ) ) {
                        dba_close( $this->handle );
                }
                if ( wfIsWindows() ) {
index e16397b..166242a 100644 (file)
@@ -138,7 +138,7 @@ class CdbReader_PHP extends CdbReader {
        }
 
        function close() {
-               if( isset( $this->handle ) ) {
+               if ( isset( $this->handle ) ) {
                        fclose( $this->handle );
                }
                unset( $this->handle );
@@ -332,7 +332,7 @@ class CdbWriter_PHP extends CdbWriter {
         */
        public function close() {
                $this->finish();
-               if( isset( $this->handle ) ) {
+               if ( isset( $this->handle ) ) {
                        fclose( $this->handle );
                }
                if ( wfIsWindows() && file_exists( $this->realFileName ) ) {
@@ -450,9 +450,11 @@ class CdbWriter_PHP extends CdbWriter {
                                $hp = $packedTables[$starts[$i] + $u];
                                $where = CdbFunctions::unsignedMod(
                                        CdbFunctions::unsignedShiftRight( $hp['h'], 8 ), $len );
-                               while ( $hashtable[$where]['p'] )
-                                       if ( ++$where == $len )
+                               while ( $hashtable[$where]['p'] ) {
+                                       if ( ++$where == $len ) {
                                                $where = 0;
+                                       }
+                               }
                                $hashtable[$where] = $hp;
                        }
 
index 3adf58f..5478396 100644 (file)
@@ -37,14 +37,15 @@ class ChangeTags {
        static function formatSummaryRow( $tags, $page ) {
                global $wgLang;
 
-               if( !$tags )
+               if ( !$tags ) {
                        return array( '', array() );
+               }
 
                $classes = array();
 
                $tags = explode( ',', $tags );
                $displayTags = array();
-               foreach( $tags as $tag ) {
+               foreach ( $tags as $tag ) {
                        $displayTags[] = Xml::tags(
                                'span',
                                array( 'class' => 'mw-tag-marker ' .
@@ -93,21 +94,21 @@ class ChangeTags {
 
                $tags = array_filter( $tags ); // Make sure we're submitting all tags...
 
-               if( !$rc_id && !$rev_id && !$log_id ) {
+               if ( !$rc_id && !$rev_id && !$log_id ) {
                        throw new MWException( "At least one of: RCID, revision ID, and log ID MUST be specified when adding a tag to a change!" );
                }
 
                $dbr = wfGetDB( DB_SLAVE );
 
                // Might as well look for rcids and so on.
-               if( !$rc_id ) {
+               if ( !$rc_id ) {
                        $dbr = wfGetDB( DB_MASTER ); // Info might be out of date, somewhat fractionally, on slave.
-                       if( $log_id ) {
+                       if ( $log_id ) {
                                $rc_id = $dbr->selectField( 'recentchanges', 'rc_id', array( 'rc_logid' => $log_id ), __METHOD__ );
-                       } elseif( $rev_id ) {
+                       } elseif ( $rev_id ) {
                                $rc_id = $dbr->selectField( 'recentchanges', 'rc_id', array( 'rc_this_oldid' => $rev_id ), __METHOD__ );
                        }
-               } elseif( !$log_id && !$rev_id ) {
+               } elseif ( !$log_id && !$rev_id ) {
                        $dbr = wfGetDB( DB_MASTER ); // Info might be out of date, somewhat fractionally, on slave.
                        $log_id = $dbr->selectField( 'recentchanges', 'rc_logid', array( 'rc_id' => $rc_id ), __METHOD__ );
                        $rev_id = $dbr->selectField( 'recentchanges', 'rc_this_oldid', array( 'rc_id' => $rc_id ), __METHOD__ );
@@ -138,7 +139,7 @@ class ChangeTags {
 
                // Insert the tags rows.
                $tagsRows = array();
-               foreach( $tags as $tag ) { // Filter so we don't insert NULLs as zero accidentally.
+               foreach ( $tags as $tag ) { // Filter so we don't insert NULLs as zero accidentally.
                        $tagsRows[] = array_filter(
                                array(
                                        'ct_tag' => $tag,
@@ -173,14 +174,14 @@ class ChangeTags {
                                                                                &$join_conds, &$options, $filter_tag = false ) {
                global $wgRequest, $wgUseTagFilter;
 
-               if( $filter_tag === false ) {
+               if ( $filter_tag === false ) {
                        $filter_tag = $wgRequest->getVal( 'tagfilter' );
                }
 
                // Figure out which conditions can be done.
                if ( in_array( 'recentchanges', $tables ) ) {
                        $join_cond = 'rc_id';
-               } elseif( in_array( 'logging', $tables ) ) {
+               } elseif ( in_array( 'logging', $tables ) ) {
                        $join_cond = 'log_id';
                } elseif ( in_array( 'revision', $tables ) ) {
                        $join_cond = 'rev_id';
@@ -193,7 +194,7 @@ class ChangeTags {
                $join_conds['tag_summary'] = array( 'LEFT JOIN', "ts_$join_cond=$join_cond" );
                $fields[] = 'ts_tags';
 
-               if( $wgUseTagFilter && $filter_tag ) {
+               if ( $wgUseTagFilter && $filter_tag ) {
                        // Somebody wants to filter on a tag.
                        // Add an INNER JOIN on change_tag
 
index e900e34..8e710de 100644 (file)
@@ -54,7 +54,7 @@ class ChangesFeed {
                        return false;
                }
 
-               if( !array_key_exists( $this->format, $wgFeedClasses ) ) {
+               if ( !array_key_exists( $this->format, $wgFeedClasses ) ) {
                        // falling back to atom
                        $this->format = 'atom';
                }
@@ -92,7 +92,7 @@ class ChangesFeed {
                 * gets it quick too.
                 */
                $cachedFeed = $this->loadFromCache( $lastmod, $timekey, $key );
-               if( is_string( $cachedFeed ) ) {
+               if ( is_string( $cachedFeed ) ) {
                        wfDebug( "RC: Outputting cached feed\n" );
                        $feed->httpHeaders();
                        echo $cachedFeed;
@@ -134,7 +134,7 @@ class ChangesFeed {
 
                $feedLastmod = $messageMemc->get( $timekey );
 
-               if( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) {
+               if ( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) {
                        /**
                         * If the cached feed was rendered very recently, we may
                         * go ahead and use it even if there have been edits made
@@ -146,7 +146,7 @@ class ChangesFeed {
                        $feedLastmodUnix = wfTimestamp( TS_UNIX, $feedLastmod );
                        $lastmodUnix = wfTimestamp( TS_UNIX, $lastmod );
 
-                       if( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix ) {
+                       if ( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix ) {
                                wfDebug( "RC: loading feed from cache ($key; $feedLastmod; $lastmod)...\n" );
                                if ( $feedLastmodUnix < $lastmodUnix ) {
                                        $wgOut->setLastModified( $feedLastmod ); // bug 21916
@@ -172,8 +172,8 @@ class ChangesFeed {
                # Merge adjacent edits by one user
                $sorted = array();
                $n = 0;
-               foreach( $rows as $obj ) {
-                       if( $n > 0 &&
+               foreach ( $rows as $obj ) {
+                       if ( $n > 0 &&
                                $obj->rc_type == RC_EDIT &&
                                $obj->rc_namespace >= 0 &&
                                $obj->rc_cur_id == $sorted[$n - 1]->rc_cur_id &&
@@ -185,11 +185,13 @@ class ChangesFeed {
                        }
                }
 
-               foreach( $sorted as $obj ) {
+               foreach ( $sorted as $obj ) {
                        $title = Title::makeTitle( $obj->rc_namespace, $obj->rc_title );
                        $talkpage = MWNamespace::canTalk( $obj->rc_namespace ) ? $title->getTalkPage()->getFullURL() : '';
                        // Skip items with deleted content (avoids partially complete/inconsistent output)
-                       if( $obj->rc_deleted ) continue;
+                       if ( $obj->rc_deleted ) {
+                               continue;
+                       }
 
                        if ( $obj->rc_this_oldid ) {
                                $url = $title->getFullURL(
index 79e2d0b..b589057 100644 (file)
@@ -99,7 +99,7 @@ class ChangesList extends ContextSource {
                $user = $context->getUser();
                $sk = $context->getSkin();
                $list = null;
-               if( wfRunHooks( 'FetchChangesList', array( $user, &$sk, &$list ) ) ) {
+               if ( wfRunHooks( 'FetchChangesList', array( $user, &$sk, &$list ) ) ) {
                        $new = $context->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
                        return $new ? new EnhancedChangesList( $context ) : new OldChangesList( $context );
                } else {
@@ -120,9 +120,11 @@ class ChangesList extends ContextSource {
         * they are called often, we call them once and save them in $this->message
         */
        private function preCacheMessages() {
-               if( !isset( $this->message ) ) {
-                       foreach ( explode( ' ', 'cur diff hist last blocklink history ' .
-                       'semicolon-separator pipe-separator' ) as $msg ) {
+               if ( !isset( $this->message ) ) {
+                       foreach ( array(
+                               'cur', 'diff', 'hist', 'last', 'blocklink', 'history',
+                               'semicolon-separator', 'pipe-separator' ) as $msg
+                       ) {
                                $this->message[$msg] = $this->msg( $msg )->escaped();
                        }
                }
@@ -136,7 +138,7 @@ class ChangesList extends ContextSource {
         */
        protected function recentChangesFlags( $flags, $nothing = '&#160;' ) {
                $f = '';
-               foreach( array( 'newpage', 'minor', 'bot', 'unpatrolled' ) as $flag ) {
+               foreach ( array( 'newpage', 'minor', 'bot', 'unpatrolled' ) as $flag ) {
                        $f .= isset( $flags[$flag] ) && $flags[$flag]
                                ? self::flag( $flag )
                                : $nothing;
@@ -162,7 +164,7 @@ class ChangesList extends ContextSource {
                                'botedit' => array( 'boteditletter', 'recentchanges-label-bot' ),
                                'unpatrolled' => array( 'unpatrolledletter', 'recentchanges-label-unpatrolled' ),
                        );
-                       foreach( $messages as &$value ) {
+                       foreach ( $messages as &$value ) {
                                $value[0] = wfMessage( $value[0] )->escaped();
                                $value[1] = wfMessage( $value[1] )->escaped();
                        }
@@ -227,7 +229,7 @@ class ChangesList extends ContextSource {
                        $formattedSize = $context->msg( 'rc-change-size', $formattedSize )->text();
                }
 
-               if( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) {
+               if ( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) {
                        $tag = 'strong';
                } else {
                        $tag = 'span';
@@ -267,7 +269,7 @@ class ChangesList extends ContextSource {
                        $newlen = $old->mAttribs['rc_new_len'];
                }
 
-               if( $oldlen === null || $newlen === null ) {
+               if ( $oldlen === null || $newlen === null ) {
                        return '';
                }
 
@@ -279,7 +281,7 @@ class ChangesList extends ContextSource {
         * @return String
         */
        public function endRecentChangesList() {
-               if( $this->rclistOpen ) {
+               if ( $this->rclistOpen ) {
                        return "</ul>\n";
                } else {
                        return '';
@@ -293,8 +295,8 @@ class ChangesList extends ContextSource {
        public function insertDateHeader( &$s, $rc_timestamp ) {
                # Make date header if necessary
                $date = $this->getLanguage()->userDate( $rc_timestamp, $this->getUser() );
-               if( $date != $this->lastdate ) {
-                       if( $this->lastdate != '' ) {
+               if ( $date != $this->lastdate ) {
+                       if ( $this->lastdate != '' ) {
                                $s .= "</ul>\n";
                        }
                        $s .= Xml::element( 'h4', null, $date ) . "\n<ul class=\"special\">";
@@ -321,7 +323,7 @@ class ChangesList extends ContextSource {
         */
        public function insertDiffHist( &$s, &$rc, $unpatrolled ) {
                # Diff link
-               if( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
+               if ( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
                        $diffLink = $this->message['diff'];
                } elseif ( !self::userCan( $rc, Revision::DELETED_TEXT, $this->getUser() ) ) {
                        $diffLink = $this->message['diff'];
@@ -332,7 +334,7 @@ class ChangesList extends ContextSource {
                                'oldid' => $rc->mAttribs['rc_last_oldid']
                        );
 
-                       if( $unpatrolled ) {
+                       if ( $unpatrolled ) {
                                $query['rcid'] = $rc->mAttribs['rc_id'];
                        };
 
@@ -378,7 +380,7 @@ class ChangesList extends ContextSource {
                        array( 'class' => 'mw-changeslist-title' ),
                        $params
                );
-               if( $this->isDeleted( $rc, Revision::DELETED_TEXT ) ) {
+               if ( $this->isDeleted( $rc, Revision::DELETED_TEXT ) ) {
                        $articlelink = '<span class="history-deleted">' . $articlelink . '</span>';
                }
                # To allow for boldening pages watched by this user
@@ -421,7 +423,7 @@ class ChangesList extends ContextSource {
         * @param &$rc RecentChange
         */
        public function insertUserRelatedLinks( &$s, &$rc ) {
-               if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
+               if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
                        $s .= ' <span class="history-deleted">' . $this->msg( 'rev-deleted-user' )->escaped() . '</span>';
                } else {
                        $s .= $this->getLanguage()->getDirMark() . Linker::userLink( $rc->mAttribs['rc_user'],
@@ -450,8 +452,8 @@ class ChangesList extends ContextSource {
         * @return string
         */
        public function insertComment( $rc ) {
-               if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
-                       if( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) {
+               if ( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
+                       if ( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) {
                                return ' <span class="history-deleted">' . $this->msg( 'rev-deleted-comment' )->escaped() . '</span>';
                        } else {
                                return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() );
@@ -475,8 +477,8 @@ class ChangesList extends ContextSource {
         */
        protected function numberofWatchingusers( $count ) {
                static $cache = array();
-               if( $count > 0 ) {
-                       if( !isset( $cache[$count] ) ) {
+               if ( $count > 0 ) {
+                       if ( !isset( $cache[$count] ) ) {
                                $cache[$count] = $this->msg( 'number_of_watching_users_RCview' )->numParams( $count )->escaped();
                        }
                        return $cache[$count];
@@ -504,7 +506,7 @@ class ChangesList extends ContextSource {
         * @return Boolean
         */
        public static function userCan( $rc, $field, User $user = null ) {
-               if( $rc->mAttribs['rc_type'] == RC_LOG ) {
+               if ( $rc->mAttribs['rc_type'] == RC_LOG ) {
                        return LogEventsList::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
                } else {
                        return Revision::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
@@ -517,7 +519,7 @@ class ChangesList extends ContextSource {
         * @return string
         */
        protected function maybeWatchedLink( $link, $watched = false ) {
-               if( $watched ) {
+               if ( $watched ) {
                        return '<strong class="mw-watched">' . $link . '</strong>';
                } else {
                        return '<span class="mw-rc-unwatched">' . $link . '</span>';
@@ -530,7 +532,7 @@ class ChangesList extends ContextSource {
         * @param $rc RecentChange
         */
        public function insertRollback( &$s, &$rc ) {
-               if( $rc->mAttribs['rc_type'] != RC_NEW && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
+               if ( $rc->mAttribs['rc_type'] != RC_NEW && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
                        $page = $rc->getTitle();
                        /** Check for rollback and edit permissions, disallow special pages, and only
                          * show a link on the top-most revision */
@@ -554,8 +556,9 @@ class ChangesList extends ContextSource {
         * @param $classes
         */
        public function insertTags( &$s, &$rc, &$classes ) {
-               if ( empty( $rc->mAttribs['ts_tags'] ) )
+               if ( empty( $rc->mAttribs['ts_tags'] ) ) {
                        return;
+               }
 
                list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow( $rc->mAttribs['ts_tags'], 'changeslist' );
                $classes = array_merge( $classes, $newClasses );
@@ -605,11 +608,10 @@ class OldChangesList extends ChangesList {
                $s = '';
                $classes = array();
                // use mw-line-even/mw-line-odd class only if linenumber is given (feature from bug 14468)
-               if( $linenumber ) {
-                       if( $linenumber & 1 ) {
+               if ( $linenumber ) {
+                       if ( $linenumber & 1 ) {
                                $classes[] = 'mw-line-odd';
-                       }
-                       else {
+                       } else {
                                $classes[] = 'mw-line-even';
                        }
                }
@@ -619,15 +621,15 @@ class OldChangesList extends ChangesList {
                $classes[] = $watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
 
                // Moved pages (very very old, not supported anymore)
-               if( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) {
+               if ( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) {
                // Log entries
-               } elseif( $rc->mAttribs['rc_log_type'] ) {
+               } elseif ( $rc->mAttribs['rc_log_type'] ) {
                        $logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] );
                        $this->insertLog( $s, $logtitle, $rc->mAttribs['rc_log_type'] );
                // Log entries (old format) or log targets, and special pages
-               } elseif( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
+               } elseif ( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
                        list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $rc->mAttribs['rc_title'] );
-                       if( $name == 'Log' ) {
+                       if ( $name == 'Log' ) {
                                $this->insertLog( $s, $rc->getTitle(), $subpage );
                        }
                // Regular entries
@@ -673,11 +675,11 @@ class OldChangesList extends ChangesList {
                $this->insertExtra( $s, $rc, $classes );
 
                # How many users watch this page
-               if( $rc->numberofWatchingusers > 0 ) {
+               if ( $rc->numberofWatchingusers > 0 ) {
                        $s .= ' ' . $this->numberofWatchingusers( $rc->numberofWatchingusers );
                }
 
-               if( $this->watchlist ) {
+               if ( $this->watchlist ) {
                        $classes[] = Sanitizer::escapeClass( 'watchlist-' . $rc->mAttribs['rc_namespace'] . '-' . $rc->mAttribs['rc_title'] );
                }
 
@@ -730,7 +732,7 @@ class EnhancedChangesList extends ChangesList {
                # If it's a new day, add the headline and flush the cache
                $date = $this->getLanguage()->userDate( $rc->mAttribs['rc_timestamp'], $this->getUser() );
                $ret = '';
-               if( $date != $this->lastdate ) {
+               if ( $date != $this->lastdate ) {
                        # Process current cache
                        $ret = $this->recentChangesBlock();
                        $this->rc_cache = array();
@@ -746,14 +748,14 @@ class EnhancedChangesList extends ChangesList {
                $type = $rc->mAttribs['rc_type'];
                $logType = $rc->mAttribs['rc_log_type'];
                // Page moves, very old style, not supported anymore
-               if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
+               if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
                // New unpatrolled pages
-               } elseif( $rc->unpatrolled && $type == RC_NEW ) {
+               } elseif ( $rc->unpatrolled && $type == RC_NEW ) {
                        $clink = Linker::linkKnown( $rc->getTitle(), null, array(),
                                array( 'rcid' => $rc->mAttribs['rc_id'] ) );
                // Log entries
-               } elseif( $type == RC_LOG ) {
-                       if( $logType ) {
+               } elseif ( $type == RC_LOG ) {
+                       if ( $logType ) {
                                $logtitle = SpecialPage::getTitleFor( 'Log', $logType );
                                $logpage = new LogPage( $logType );
                                $logname = $logpage->getName()->escaped();
@@ -763,7 +765,7 @@ class EnhancedChangesList extends ChangesList {
                        }
                        $watched = false;
                // Log entries (old format) and special pages
-               } elseif( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
+               } elseif ( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
                        wfDebug( "Unexpected special page in recentchanges\n" );
                        $clink = '';
                // Edits
@@ -786,7 +788,7 @@ class EnhancedChangesList extends ChangesList {
                # called too many times (50% of CPU time on RecentChanges!).
                $thisOldid = $rc->mAttribs['rc_this_oldid'];
                $lastOldid = $rc->mAttribs['rc_last_oldid'];
-               if( $rc->unpatrolled ) {
+               if ( $rc->unpatrolled ) {
                        $rcIdQuery = array( 'rcid' => $rc->mAttribs['rc_id'] );
                } else {
                        $rcIdQuery = array();
@@ -795,10 +797,10 @@ class EnhancedChangesList extends ChangesList {
                $querydiff = $curIdEq + array( 'diff' => $thisOldid, 'oldid' =>
                        $lastOldid ) + $rcIdQuery;
 
-               if( !$showdifflinks ) {
+               if ( !$showdifflinks ) {
                        $curLink = $this->message['cur'];
                        $diffLink = $this->message['diff'];
-               } elseif( in_array( $type, array( RC_NEW, RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) {
+               } elseif ( in_array( $type, array( RC_NEW, RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) {
                        if ( $type != RC_NEW ) {
                                $curLink = $this->message['cur'];
                        } else {
@@ -814,9 +816,9 @@ class EnhancedChangesList extends ChangesList {
                }
 
                # Make "last" link
-               if( !$showdifflinks || !$lastOldid ) {
+               if ( !$showdifflinks || !$lastOldid ) {
                        $lastLink = $this->message['last'];
-               } elseif( in_array( $type, array( RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) {
+               } elseif ( in_array( $type, array( RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) {
                        $lastLink = $this->message['last'];
                } else {
                        $lastLink = Linker::linkKnown( $rc->getTitle(), $this->message['last'],
@@ -824,7 +826,7 @@ class EnhancedChangesList extends ChangesList {
                }
 
                # Make user links
-               if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
+               if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
                        $rc->userlink = ' <span class="history-deleted">' . $this->msg( 'rev-deleted-user' )->escaped() . '</span>';
                } else {
                        $rc->userlink = Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] );
@@ -839,15 +841,15 @@ class EnhancedChangesList extends ChangesList {
                # Page moves go on their own line
                $title = $rc->getTitle();
                $secureName = $title->getPrefixedDBkey();
-               if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
+               if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
                        # Use an @ character to prevent collision with page names
                        $this->rc_cache['@@' . ($this->rcMoveIndex++)] = array( $rc );
                } else {
                        # Logs are grouped by type
-                       if( $type == RC_LOG ) {
+                       if ( $type == RC_LOG ) {
                                $secureName = SpecialPage::getTitleFor( 'Log', $logType )->getPrefixedDBkey();
                        }
-                       if( !isset( $this->rc_cache[$secureName] ) ) {
+                       if ( !isset( $this->rc_cache[$secureName] ) ) {
                                $this->rc_cache[$secureName] = array();
                        }
 
@@ -893,39 +895,39 @@ class EnhancedChangesList extends ChangesList {
                # Some catalyst variables...
                $namehidden = true;
                $allLogs = true;
-               foreach( $block as $rcObj ) {
+               foreach ( $block as $rcObj ) {
                        $oldid = $rcObj->mAttribs['rc_last_oldid'];
-                       if( $rcObj->mAttribs['rc_type'] == RC_NEW ) {
+                       if ( $rcObj->mAttribs['rc_type'] == RC_NEW ) {
                                $isnew = true;
                        }
                        // If all log actions to this page were hidden, then don't
                        // give the name of the affected page for this block!
-                       if( !$this->isDeleted( $rcObj, LogPage::DELETED_ACTION ) ) {
+                       if ( !$this->isDeleted( $rcObj, LogPage::DELETED_ACTION ) ) {
                                $namehidden = false;
                        }
                        $u = $rcObj->userlink;
-                       if( !isset( $userlinks[$u] ) ) {
+                       if ( !isset( $userlinks[$u] ) ) {
                                $userlinks[$u] = 0;
                        }
-                       if( $rcObj->unpatrolled ) {
+                       if ( $rcObj->unpatrolled ) {
                                $unpatrolled = true;
                        }
-                       if( $rcObj->mAttribs['rc_type'] != RC_LOG ) {
+                       if ( $rcObj->mAttribs['rc_type'] != RC_LOG ) {
                                $allLogs = false;
                        }
                        # Get the latest entry with a page_id and oldid
                        # since logs may not have these.
-                       if( !$curId && $rcObj->mAttribs['rc_cur_id'] ) {
+                       if ( !$curId && $rcObj->mAttribs['rc_cur_id'] ) {
                                $curId = $rcObj->mAttribs['rc_cur_id'];
                        }
-                       if( !$currentRevision && $rcObj->mAttribs['rc_this_oldid'] ) {
+                       if ( !$currentRevision && $rcObj->mAttribs['rc_this_oldid'] ) {
                                $currentRevision = $rcObj->mAttribs['rc_this_oldid'];
                        }
 
-                       if( !$rcObj->mAttribs['rc_bot'] ) {
+                       if ( !$rcObj->mAttribs['rc_bot'] ) {
                                $allBots = false;
                        }
-                       if( !$rcObj->mAttribs['rc_minor'] ) {
+                       if ( !$rcObj->mAttribs['rc_minor'] ) {
                                $allMinors = false;
                        }
 
@@ -936,10 +938,10 @@ class EnhancedChangesList extends ChangesList {
                krsort( $userlinks );
                asort( $userlinks );
                $users = array();
-               foreach( $userlinks as $userlink => $count ) {
+               foreach ( $userlinks as $userlink => $count ) {
                        $text = $userlink;
                        $text .= $this->getLanguage()->getDirMark();
-                       if( $count > 1 ) {
+                       if ( $count > 1 ) {
                                $text .= ' ' . $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped();
                        }
                        array_push( $users, $text );
@@ -965,9 +967,9 @@ class EnhancedChangesList extends ChangesList {
                $r .= '&#160;' . $block[0]->timestamp . '&#160;</td><td>';
 
                # Article link
-               if( $namehidden ) {
+               if ( $namehidden ) {
                        $r .= ' <span class="history-deleted">' . $this->msg( 'rev-deleted-event' )->escaped() . '</span>';
-               } elseif( $allLogs ) {
+               } elseif ( $allLogs ) {
                        $r .= $this->maybeWatchedLink( $block[0]->link, $block[0]->watched );
                } else {
                        $this->insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched );
@@ -985,10 +987,10 @@ class EnhancedChangesList extends ChangesList {
                # Total change link
                $r .= ' ';
                $logtext = '';
-               if( !$allLogs ) {
-                       if( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
+               if ( !$allLogs ) {
+                       if ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
                                $logtext .= $nchanges[$n];
-                       } elseif( $isnew ) {
+                       } elseif ( $isnew ) {
                                $logtext .= $nchanges[$n];
                        } else {
                                $params = $queryParams;
@@ -1006,9 +1008,9 @@ class EnhancedChangesList extends ChangesList {
                }
 
                # History
-               if( $allLogs ) {
+               if ( $allLogs ) {
                        // don't show history link for logs
-               } elseif( $namehidden || !$block[0]->getTitle()->exists() ) {
+               } elseif ( $namehidden || !$block[0]->getTitle()->exists() ) {
                        $logtext .= $this->message['pipe-separator'] . $this->message['hist'];
                } else {
                        $params = $queryParams;
@@ -1023,27 +1025,27 @@ class EnhancedChangesList extends ChangesList {
                                );
                }
 
-               if( $logtext !== '' ) {
+               if ( $logtext !== '' ) {
                        $r .= $this->msg( 'parentheses' )->rawParams( $logtext )->escaped();
                }
 
                $r .= ' <span class="mw-changeslist-separator">. .</span> ';
 
                # Character difference (does not apply if only log items)
-               if( $wgRCShowChangedSize && !$allLogs ) {
+               if ( $wgRCShowChangedSize && !$allLogs ) {
                        $last = 0;
                        $first = count( $block ) - 1;
                        # Some events (like logs) have an "empty" size, so we need to skip those...
-                       while( $last < $first && $block[$last]->mAttribs['rc_new_len'] === null ) {
+                       while ( $last < $first && $block[$last]->mAttribs['rc_new_len'] === null ) {
                                $last++;
                        }
-                       while( $first > $last && $block[$first]->mAttribs['rc_old_len'] === null ) {
+                       while ( $first > $last && $block[$first]->mAttribs['rc_old_len'] === null ) {
                                $first--;
                        }
                        # Get net change
                        $chardiff = $this->formatCharacterDifference( $block[$first], $block[$last] );
 
-                       if( $chardiff == '' ) {
+                       if ( $chardiff == '' ) {
                                $r .= ' ';
                        } else {
                                $r .= ' ' . $chardiff . ' <span class="mw-changeslist-separator">. .</span> ';
@@ -1054,7 +1056,7 @@ class EnhancedChangesList extends ChangesList {
                $r .= $this->numberofWatchingusers( $block[0]->numberofWatchingusers );
 
                # Sub-entries
-               foreach( $block as $rcObj ) {
+               foreach ( $block as $rcObj ) {
                        # Classes to apply -- TODO implement
                        $classes = array();
                        $type = $rcObj->mAttribs['rc_type'];
@@ -1070,15 +1072,15 @@ class EnhancedChangesList extends ChangesList {
 
                        $params = $queryParams;
 
-                       if( $rcObj->mAttribs['rc_this_oldid'] != 0 ) {
+                       if ( $rcObj->mAttribs['rc_this_oldid'] != 0 ) {
                                $params['oldid'] = $rcObj->mAttribs['rc_this_oldid'];
                        }
 
                        # Log timestamp
-                       if( $type == RC_LOG ) {
+                       if ( $type == RC_LOG ) {
                                $link = $rcObj->timestamp;
                        # Revision link
-                       } elseif( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
+                       } elseif ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
                                $link = '<span class="history-deleted">' . $rcObj->timestamp . '</span> ';
                        } else {
                                if ( $rcObj->unpatrolled && $type == RC_NEW) {
@@ -1091,7 +1093,7 @@ class EnhancedChangesList extends ChangesList {
                                                array(),
                                                $params
                                        );
-                               if( $this->isDeleted( $rcObj, Revision::DELETED_TEXT ) ) {
+                               if ( $this->isDeleted( $rcObj, Revision::DELETED_TEXT ) ) {
                                        $link = '<span class="history-deleted">' . $link . '</span> ';
                                }
                        }
@@ -1192,7 +1194,7 @@ class EnhancedChangesList extends ChangesList {
                $type = $rcObj->mAttribs['rc_type'];
                $logType = $rcObj->mAttribs['rc_log_type'];
                $classes = array( 'mw-enhanced-rc' );
-               if( $logType ) {
+               if ( $logType ) {
                        # Log entry
                        $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-'
                                        . $logType . '-' . $rcObj->mAttribs['rc_title'] );
@@ -1206,7 +1208,7 @@ class EnhancedChangesList extends ChangesList {
 
                $r .= '<td class="mw-enhanced-rc"><span class="mw-enhancedchanges-arrow-space"></span>';
                # Flag and Timestamp
-               if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
+               if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
                        $r .= '&#160;&#160;&#160;&#160;'; // 4 flags -> 4 spaces
                } else {
                        $r .= $this->recentChangesFlags( array(
@@ -1218,7 +1220,7 @@ class EnhancedChangesList extends ChangesList {
                }
                $r .= '&#160;' . $rcObj->timestamp . '&#160;</td><td>';
                # Article or log link
-               if( $logType ) {
+               if ( $logType ) {
                        $logPage = new LogPage( $logType );
                        $logTitle = SpecialPage::getTitleFor( 'Log', $logType );
                        $logName = $logPage->getName()->escaped();
@@ -1272,15 +1274,15 @@ class EnhancedChangesList extends ChangesList {
         * @return string
         */
        protected function recentChangesBlock() {
-               if( count ( $this->rc_cache ) == 0 ) {
+               if ( count ( $this->rc_cache ) == 0 ) {
                        return '';
                }
 
                wfProfileIn( __METHOD__ );
 
                $blockOut = '';
-               foreach( $this->rc_cache as $block ) {
-                       if( count( $block ) < 2 ) {
+               foreach ( $this->rc_cache as $block ) {
+                       if ( count( $block ) < 2 ) {
                                $blockOut .= $this->recentChangesBlockLine( array_shift( $block ) );
                        } else {
                                $blockOut .= $this->recentChangesBlockGroup( $block );
index 723b38e..ed8a031 100644 (file)
@@ -40,7 +40,7 @@ abstract class Collation {
         * @return Collation
         */
        static function factory( $collationName ) {
-               switch( $collationName ) {
+               switch ( $collationName ) {
                        case 'uppercase':
                                return new UppercaseCollation;
                        case 'identity':
@@ -349,15 +349,15 @@ class IcuCollation extends Collation {
                $cacheEntry = $cache->get( $cacheKey );
 
                if ( $cacheEntry && isset( $cacheEntry['version'] )
-                       && $cacheEntry['version'] == self::FIRST_LETTER_VERSION ) 
-               {
+                       && $cacheEntry['version'] == self::FIRST_LETTER_VERSION
+               {
                        $this->firstLetterData = $cacheEntry;
                        return $this->firstLetterData;
                }
 
                // Generate data from serialized data file
 
-               if ( isset ( self::$tailoringFirstLetters[$this->locale] ) ) {
+               if ( isset( self::$tailoringFirstLetters[$this->locale] ) ) {
                        $letters = wfGetPrecompiledData( "first-letters-root.ser" );
                        // Append additional characters
                        $letters = array_merge( $letters, self::$tailoringFirstLetters[$this->locale] );
@@ -430,7 +430,7 @@ class IcuCollation extends Collation {
 
                $prev = false;
                $duplicatePrefixes = array();
-               foreach( $letterMap as $key => $value ) {
+               foreach ( $letterMap as $key => $value ) {
                        // Remove terminator byte. Otherwise the prefix
                        // comparison will get hung up on that.
                        $trimmedKey = rtrim( $key, "\0" );
@@ -456,7 +456,7 @@ class IcuCollation extends Collation {
                        }
                        $prev = $trimmedKey;
                }
-               foreach( $duplicatePrefixes as $badKey ) {
+               foreach ( $duplicatePrefixes as $badKey ) {
                        wfDebug( "Removing '{$letterMap[$badKey]}' from first letters." );
                        unset( $letterMap[$badKey] );
                        // This code assumes that unsetting does not change sort order.
index 293d53d..78af1c1 100644 (file)
@@ -278,19 +278,23 @@ class ConfEditor {
        function getVars() {
                $vars = array();
                $this->parse();
-               foreach( $this->pathInfo as $path => $data ) {
-                       if ( $path[0] != '$' )
+               foreach ( $this->pathInfo as $path => $data ) {
+                       if ( $path[0] != '$' ) {
                                continue;
+                       }
                        $trimmedPath = substr( $path, 1 );
                        $name = $data['name'];
-                       if ( $name[0] == '@' )
+                       if ( $name[0] == '@' ) {
                                continue;
-                       if ( $name[0] == '$' )
+                       }
+                       if ( $name[0] == '$' ) {
                                $name = substr( $name, 1 );
+                       }
                        $parentPath = substr( $trimmedPath, 0,
                                strlen( $trimmedPath ) - strlen( $name ) );
-                       if( substr( $parentPath, -1 ) == '/' )
+                       if ( substr( $parentPath, -1 ) == '/' ) {
                                $parentPath = substr( $parentPath, 0, -1 );
+                       }
 
                        $value = substr( $this->text, $data['valueStartByte'],
                                $data['valueEndByte'] - $data['valueStartByte']
@@ -315,13 +319,15 @@ class ConfEditor {
                $target =& $array;
                if ( $path !== '' ) {
                        foreach ( $pathArr as $p ) {
-                               if( !isset( $target[$p] ) )
+                               if ( !isset( $target[$p] ) ) {
                                        $target[$p] = array();
+                               }
                                $target =& $target[$p];
                        }
                }
-               if ( !isset( $target[$key] ) )
+               if ( !isset( $target[$key] ) ) {
                        $target[$key] = $value;
+               }
        }
 
        /**
@@ -329,25 +335,30 @@ class ConfEditor {
         * @return mixed Parsed value
         */
        function parseScalar( $str ) {
-               if ( $str !== '' && $str[0] == '\'' )
+               if ( $str !== '' && $str[0] == '\'' ) {
                        // Single-quoted string
                        // @todo FIXME: trim() call is due to mystery bug where whitespace gets
                        // appended to the token; without it we ended up reading in the
                        // extra quote on the end!
                        return strtr( substr( trim( $str ), 1, -1 ),
                                array( '\\\'' => '\'', '\\\\' => '\\' ) );
-               if ( $str !== '' && $str[0] == '"' )
+               }
+               if ( $str !== '' && $str[0] == '"' ) {
                        // Double-quoted string
                        // @todo FIXME: trim() call is due to mystery bug where whitespace gets
                        // appended to the token; without it we ended up reading in the
                        // extra quote on the end!
                        return stripcslashes( substr( trim( $str ), 1, -1 ) );
-               if ( substr( $str, 0, 4 ) == 'true' )
+               }
+               if ( substr( $str, 0, 4 ) == 'true' ) {
                        return true;
-               if ( substr( $str, 0, 5 ) == 'false' )
+               }
+               if ( substr( $str, 0, 5 ) == 'false' ) {
                        return false;
-               if ( substr( $str, 0, 4 ) == 'null' )
+               }
+               if ( substr( $str, 0, 4 ) == 'null' ) {
                        return null;
+               }
                // Must be some kind of numeric value, so let PHP's weak typing
                // be useful for a change
                return $str;
@@ -617,16 +628,18 @@ class ConfEditor {
                                $this->expect( '=' );
                                $this->skipSpace();
                                $this->startPathValue();
-                               if ( $arrayAssign )
+                               if ( $arrayAssign ) {
                                        $this->pushState( 'expression', 'array assign end' );
-                               else
+                               } else {
                                        $this->pushState( 'expression', 'statement end' );
+                               }
                                break;
                        case 'array assign end':
                        case 'statement end':
                                $this->endPathValue();
-                               if ( $state == 'array assign end' )
+                               if ( $state == 'array assign end' ) {
                                        $this->popPath();
+                               }
                                $this->skipSpace();
                                $this->expect( ';' );
                                $this->nextPath( '@extra-' . ($this->serial++) );
diff --git a/includes/CryptRand.php b/includes/CryptRand.php
deleted file mode 100644 (file)
index d0305d8..0000000
+++ /dev/null
@@ -1,497 +0,0 @@
-<?php
-/**
- * A cryptographic random generator class used for generating secret keys
- *
- * This is based in part on Drupal code as well as what we used in our own code
- * prior to introduction of this class.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @author Daniel Friesen
- * @file
- */
-
-class MWCryptRand {
-
-       /**
-        * Minimum number of iterations we want to make in our drift calculations.
-        */
-       const MIN_ITERATIONS = 1000;
-
-       /**
-        * Number of milliseconds we want to spend generating each separate byte
-        * of the final generated bytes.
-        * This is used in combination with the hash length to determine the duration
-        * we should spend doing drift calculations.
-        */
-       const MSEC_PER_BYTE = 0.5;
-
-       /**
-        * Singleton instance for public use
-        */
-       protected static $singleton = null;
-
-       /**
-        * The hash algorithm being used
-        */
-       protected $algo = null;
-
-       /**
-        * The number of bytes outputted by the hash algorithm
-        */
-       protected $hashLength = null;
-
-       /**
-        * A boolean indicating whether the previous random generation was done using
-        * cryptographically strong random number generator or not.
-        */
-       protected $strong = null;
-
-       /**
-        * Initialize an initial random state based off of whatever we can find
-        */
-       protected function initialRandomState() {
-               // $_SERVER contains a variety of unstable user and system specific information
-               // It'll vary a little with each page, and vary even more with separate users
-               // It'll also vary slightly across different machines
-               $state = serialize( $_SERVER );
-
-               // To try vary the system information of the state a bit more
-               // by including the system's hostname into the state
-               $state .= wfHostname();
-
-               // Try to gather a little entropy from the different php rand sources
-               $state .= rand() . uniqid( mt_rand(), true );
-
-               // Include some information about the filesystem's current state in the random state
-               $files = array();
-
-               // We know this file is here so grab some info about ourselves
-               $files[] = __FILE__;
-
-               // We must also have a parent folder, and with the usual file structure, a grandparent
-               $files[] = __DIR__;
-               $files[] = dirname( __DIR__ );
-
-               // The config file is likely the most often edited file we know should be around
-               // so include its stat info into the state.
-               // The constant with its location will almost always be defined, as WebStart.php defines
-               // MW_CONFIG_FILE to $IP/LocalSettings.php unless being configured with MW_CONFIG_CALLBACK (eg. the installer)
-               if ( defined( 'MW_CONFIG_FILE' ) ) {
-                       $files[] = MW_CONFIG_FILE;
-               }
-
-               foreach ( $files as $file ) {
-                       wfSuppressWarnings();
-                       $stat = stat( $file );
-                       wfRestoreWarnings();
-                       if ( $stat ) {
-                               // stat() duplicates data into numeric and string keys so kill off all the numeric ones
-                               foreach ( $stat as $k => $v ) {
-                                       if ( is_numeric( $k ) ) {
-                                               unset( $k );
-                                       }
-                               }
-                               // The absolute filename itself will differ from install to install so don't leave it out
-                               if( ( $path = realpath( $file ) ) !== false ) {
-                                       $state .= $path;
-                               } else {
-                                       $state .= $file;
-                               }
-                               $state .= implode( '', $stat );
-                       } else {
-                               // The fact that the file isn't there is worth at least a
-                               // minuscule amount of entropy.
-                               $state .= '0';
-                       }
-               }
-
-               // Try and make this a little more unstable by including the varying process
-               // id of the php process we are running inside of if we are able to access it
-               if ( function_exists( 'getmypid' ) ) {
-                       $state .= getmypid();
-               }
-
-               // If available try to increase the instability of the data by throwing in
-               // the precise amount of memory that we happen to be using at the moment.
-               if ( function_exists( 'memory_get_usage' ) ) {
-                       $state .= memory_get_usage( true );
-               }
-
-               // It's mostly worthless but throw the wiki's id into the data for a little more variance
-               $state .= wfWikiID();
-
-               // If we have a secret key or proxy key set then throw it into the state as well
-               global $wgSecretKey, $wgProxyKey;
-               if ( $wgSecretKey ) {
-                       $state .= $wgSecretKey;
-               } elseif ( $wgProxyKey ) {
-                       $state .= $wgProxyKey;
-               }
-
-               return $state;
-       }
-
-       /**
-        * Randomly hash data while mixing in clock drift data for randomness
-        *
-        * @param string $data The data to randomly hash.
-        * @return String The hashed bytes
-        * @author Tim Starling
-        */
-       protected function driftHash( $data ) {
-               // Minimum number of iterations (to avoid slow operations causing the loop to gather little entropy)
-               $minIterations = self::MIN_ITERATIONS;
-               // Duration of time to spend doing calculations (in seconds)
-               $duration = ( self::MSEC_PER_BYTE / 1000 ) * $this->hashLength();
-               // Create a buffer to use to trigger memory operations
-               $bufLength = 10000000;
-               $buffer = str_repeat( ' ', $bufLength );
-               $bufPos = 0;
-
-               // Iterate for $duration seconds or at least $minIterations number of iterations
-               $iterations = 0;
-               $startTime = microtime( true );
-               $currentTime = $startTime;
-               while ( $iterations < $minIterations || $currentTime - $startTime < $duration ) {
-                       // Trigger some memory writing to trigger some bus activity
-                       // This may create variance in the time between iterations
-                       $bufPos = ( $bufPos + 13 ) % $bufLength;
-                       $buffer[$bufPos] = ' ';
-                       // Add the drift between this iteration and the last in as entropy
-                       $nextTime = microtime( true );
-                       $delta = (int)( ( $nextTime - $currentTime ) * 1000000 );
-                       $data .= $delta;
-                       // Every 100 iterations hash the data and entropy
-                       if ( $iterations % 100 === 0 ) {
-                               $data = sha1( $data );
-                       }
-                       $currentTime = $nextTime;
-                       $iterations++;
-               }
-               $timeTaken = $currentTime - $startTime;
-               $data = $this->hash( $data );
-
-               wfDebug( __METHOD__ . ": Clock drift calculation " .
-                       "(time-taken=" . ( $timeTaken * 1000 ) . "ms, " .
-                       "iterations=$iterations, " .
-                       "time-per-iteration=" . ( $timeTaken / $iterations * 1e6 ) . "us)\n" );
-               return $data;
-       }
-
-       /**
-        * Return a rolling random state initially build using data from unstable sources
-        * @return string A new weak random state
-        */
-       protected function randomState() {
-               static $state = null;
-               if ( is_null( $state ) ) {
-                       // Initialize the state with whatever unstable data we can find
-                       // It's important that this data is hashed right afterwards to prevent
-                       // it from being leaked into the output stream
-                       $state = $this->hash( $this->initialRandomState() );
-               }
-               // Generate a new random state based on the initial random state or previous
-               // random state by combining it with clock drift
-               $state = $this->driftHash( $state );
-               return $state;
-       }
-
-       /**
-        * Decide on the best acceptable hash algorithm we have available for hash()
-        * @throws MWException
-        * @return String A hash algorithm
-        */
-       protected function hashAlgo() {
-               if ( !is_null( $this->algo ) ) {
-                       return $this->algo;
-               }
-
-               $algos = hash_algos();
-               $preference = array( 'whirlpool', 'sha256', 'sha1', 'md5' );
-
-               foreach ( $preference as $algorithm ) {
-                       if ( in_array( $algorithm, $algos ) ) {
-                               $this->algo = $algorithm;
-                               wfDebug( __METHOD__ . ": Using the {$this->algo} hash algorithm.\n" );
-                               return $this->algo;
-                       }
-               }
-
-               // We only reach here if no acceptable hash is found in the list, this should
-               // be a technical impossibility since most of php's hash list is fixed and
-               // some of the ones we list are available as their own native functions
-               // But since we already require at least 5.2 and hash() was default in
-               // 5.1.2 we don't bother falling back to methods like sha1 and md5.
-               throw new MWException( "Could not find an acceptable hashing function in hash_algos()" );
-       }
-
-       /**
-        * Return the byte-length output of the hash algorithm we are
-        * using in self::hash and self::hmac.
-        *
-        * @return int Number of bytes the hash outputs
-        */
-       protected function hashLength() {
-               if ( is_null( $this->hashLength ) ) {
-                       $this->hashLength = strlen( $this->hash( '' ) );
-               }
-               return $this->hashLength;
-       }
-
-       /**
-        * Generate an acceptably unstable one-way-hash of some text
-        * making use of the best hash algorithm that we have available.
-        *
-        * @param $data string
-        * @return String A raw hash of the data
-        */
-       protected function hash( $data ) {
-               return hash( $this->hashAlgo(), $data, true );
-       }
-
-       /**
-        * Generate an acceptably unstable one-way-hmac of some text
-        * making use of the best hash algorithm that we have available.
-        *
-        * @param $data string
-        * @param $key string
-        * @return String A raw hash of the data
-        */
-       protected function hmac( $data, $key ) {
-               return hash_hmac( $this->hashAlgo(), $data, $key, true );
-       }
-
-       /**
-        * @see self::wasStrong()
-        */
-       public function realWasStrong() {
-               if ( is_null( $this->strong ) ) {
-                       throw new MWException( __METHOD__ . ' called before generation of random data' );
-               }
-               return $this->strong;
-       }
-
-       /**
-        * @see self::generate()
-        */
-       public function realGenerate( $bytes, $forceStrong = false ) {
-               wfProfileIn( __METHOD__ );
-
-               wfDebug( __METHOD__ . ": Generating cryptographic random bytes for " . wfGetAllCallers( 5 ) . "\n" );
-
-               $bytes = floor( $bytes );
-               static $buffer = '';
-               if ( is_null( $this->strong ) ) {
-                       // Set strength to false initially until we know what source data is coming from
-                       $this->strong = true;
-               }
-
-               if ( strlen( $buffer ) < $bytes ) {
-                       // If available make use of mcrypt_create_iv URANDOM source to generate randomness
-                       // On unix-like systems this reads from /dev/urandom but does it without any buffering
-                       // and bypasses openbasedir restrictions, so it's preferable to reading directly
-                       // On Windows starting in PHP 5.3.0 Windows' native CryptGenRandom is used to generate
-                       // entropy so this is also preferable to just trying to read urandom because it may work
-                       // on Windows systems as well.
-                       if ( function_exists( 'mcrypt_create_iv' ) ) {
-                               wfProfileIn( __METHOD__ . '-mcrypt' );
-                               $rem = $bytes - strlen( $buffer );
-                               $iv = mcrypt_create_iv( $rem, MCRYPT_DEV_URANDOM );
-                               if ( $iv === false ) {
-                                       wfDebug( __METHOD__ . ": mcrypt_create_iv returned false.\n" );
-                               } else {
-                                       $buffer .= $iv;
-                                       wfDebug( __METHOD__ . ": mcrypt_create_iv generated " . strlen( $iv ) . " bytes of randomness.\n" );
-                               }
-                               wfProfileOut( __METHOD__ . '-mcrypt' );
-                       }
-               }
-
-               if ( strlen( $buffer ) < $bytes ) {
-                       // If available make use of openssl's random_pseudo_bytes method to attempt to generate randomness.
-                       // However don't do this on Windows with PHP < 5.3.4 due to a bug:
-                       // http://stackoverflow.com/questions/1940168/openssl-random-pseudo-bytes-is-slow-php
-                       // http://git.php.net/?p=php-src.git;a=commitdiff;h=cd62a70863c261b07f6dadedad9464f7e213cad5
-                       if ( function_exists( 'openssl_random_pseudo_bytes' )
-                               && ( !wfIsWindows() || version_compare( PHP_VERSION, '5.3.4', '>=' ) )
-                       ) {
-                               wfProfileIn( __METHOD__ . '-openssl' );
-                               $rem = $bytes - strlen( $buffer );
-                               $openssl_bytes = openssl_random_pseudo_bytes( $rem, $openssl_strong );
-                               if ( $openssl_bytes === false ) {
-                                       wfDebug( __METHOD__ . ": openssl_random_pseudo_bytes returned false.\n" );
-                               } else {
-                                       $buffer .= $openssl_bytes;
-                                       wfDebug( __METHOD__ . ": openssl_random_pseudo_bytes generated " . strlen( $openssl_bytes ) . " bytes of " . ( $openssl_strong ? "strong" : "weak" ) . " randomness.\n" );
-                               }
-                               if ( strlen( $buffer ) >= $bytes ) {
-                                       // openssl tells us if the random source was strong, if some of our data was generated
-                                       // using it use it's say on whether the randomness is strong
-                                       $this->strong = !!$openssl_strong;
-                               }
-                               wfProfileOut( __METHOD__ . '-openssl' );
-                       }
-               }
-
-               // Only read from urandom if we can control the buffer size or were passed forceStrong
-               if ( strlen( $buffer ) < $bytes && ( function_exists( 'stream_set_read_buffer' ) || $forceStrong ) ) {
-                       wfProfileIn( __METHOD__ . '-fopen-urandom' );
-                       $rem = $bytes - strlen( $buffer );
-                       if ( !function_exists( 'stream_set_read_buffer' ) && $forceStrong ) {
-                               wfDebug( __METHOD__ . ": Was forced to read from /dev/urandom without control over the buffer size.\n" );
-                       }
-                       // /dev/urandom is generally considered the best possible commonly
-                       // available random source, and is available on most *nix systems.
-                       wfSuppressWarnings();
-                       $urandom = fopen( "/dev/urandom", "rb" );
-                       wfRestoreWarnings();
-
-                       // Attempt to read all our random data from urandom
-                       // php's fread always does buffered reads based on the stream's chunk_size
-                       // so in reality it will usually read more than the amount of data we're
-                       // asked for and not storing that risks depleting the system's random pool.
-                       // If stream_set_read_buffer is available set the chunk_size to the amount
-                       // of data we need. Otherwise read 8k, php's default chunk_size.
-                       if ( $urandom ) {
-                               // php's default chunk_size is 8k
-                               $chunk_size = 1024 * 8;
-                               if ( function_exists( 'stream_set_read_buffer' ) ) {
-                                       // If possible set the chunk_size to the amount of data we need
-                                       stream_set_read_buffer( $urandom, $rem );
-                                       $chunk_size = $rem;
-                               }
-                               $random_bytes = fread( $urandom, max( $chunk_size, $rem ) );
-                               $buffer .= $random_bytes;
-                               fclose( $urandom );
-                               wfDebug( __METHOD__ . ": /dev/urandom generated " . strlen( $random_bytes ) . " bytes of randomness.\n" );
-                               if ( strlen( $buffer ) >= $bytes ) {
-                                       // urandom is always strong, set to true if all our data was generated using it
-                                       $this->strong = true;
-                               }
-                       } else {
-                               wfDebug( __METHOD__ . ": /dev/urandom could not be opened.\n" );
-                       }
-                       wfProfileOut( __METHOD__ . '-fopen-urandom' );
-               }
-
-               // If we cannot use or generate enough data from a secure source
-               // use this loop to generate a good set of pseudo random data.
-               // This works by initializing a random state using a pile of unstable data
-               // and continually shoving it through a hash along with a variable salt.
-               // 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" );
-               }
-               while ( strlen( $buffer ) < $bytes ) {
-                       wfProfileIn( __METHOD__ . '-fallback' );
-                       $buffer .= $this->hmac( $this->randomState(), mt_rand() );
-                       // This code is never really cryptographically strong, if we use it
-                       // at all, then set strong to false.
-                       $this->strong = false;
-                       wfProfileOut( __METHOD__ . '-fallback' );
-               }
-
-               // Once the buffer has been filled up with enough random data to fulfill
-               // the request shift off enough data to handle the request and leave the
-               // unused portion left inside the buffer for the next request for random data
-               $generated = substr( $buffer, 0, $bytes );
-               $buffer = substr( $buffer, $bytes );
-
-               wfDebug( __METHOD__ . ": " . strlen( $buffer ) . " bytes of randomness leftover in the buffer.\n" );
-
-               wfProfileOut( __METHOD__ );
-               return $generated;
-       }
-
-       /**
-        * @see self::generateHex()
-        */
-       public function realGenerateHex( $chars, $forceStrong = false ) {
-               // hex strings are 2x the length of raw binary so we divide the length in half
-               // odd numbers will result in a .5 that leads the generate() being 1 character
-               // short, so we use ceil() to ensure that we always have enough bytes
-               $bytes = ceil( $chars / 2 );
-               // Generate the data and then convert it to a hex string
-               $hex = bin2hex( $this->generate( $bytes, $forceStrong ) );
-               // A bit of paranoia here, the caller asked for a specific length of string
-               // here, and it's possible (eg when given an odd number) that we may actually
-               // have at least 1 char more than they asked for. Just in case they made this
-               // call intending to insert it into a database that does truncation we don't
-               // want to give them too much and end up with their database and their live
-               // code having two different values because part of what we gave them is truncated
-               // hence, we strip out any run of characters longer than what we were asked for.
-               return substr( $hex, 0, $chars );
-       }
-
-       /** Publicly exposed static methods **/
-
-       /**
-        * Return a singleton instance of MWCryptRand
-        * @return MWCryptRand
-        */
-       protected static function singleton() {
-               if ( is_null( self::$singleton ) ) {
-                       self::$singleton = new self;
-               }
-               return self::$singleton;
-       }
-
-       /**
-        * Return a boolean indicating whether or not the source used for cryptographic
-        * random bytes generation in the previously run generate* call
-        * was cryptographically strong.
-        *
-        * @return bool Returns true if the source was strong, false if not.
-        */
-       public static function wasStrong() {
-               return self::singleton()->realWasStrong();
-       }
-
-       /**
-        * Generate a run of (ideally) cryptographically random data and return
-        * it in raw binary form.
-        * You can use MWCryptRand::wasStrong() if you wish to know if the source used
-        * was cryptographically strong.
-        *
-        * @param int $bytes the number of bytes of random data to generate
-        * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
-        *                          strong sources of entropy even if reading from them may steal
-        *                          more entropy from the system than optimal.
-        * @return String Raw binary random data
-        */
-       public static function generate( $bytes, $forceStrong = false ) {
-               return self::singleton()->realGenerate( $bytes, $forceStrong );
-       }
-
-       /**
-        * Generate a run of (ideally) cryptographically random data and return
-        * it in hexadecimal string format.
-        * You can use MWCryptRand::wasStrong() if you wish to know if the source used
-        * was cryptographically strong.
-        *
-        * @param int $chars the number of hex chars of random data to generate
-        * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
-        *                          strong sources of entropy even if reading from them may steal
-        *                          more entropy from the system than optimal.
-        * @return String Hexadecimal random data
-        */
-       public static function generateHex( $chars, $forceStrong = false ) {
-               return self::singleton()->realGenerateHex( $chars, $forceStrong );
-       }
-
-}
index c1076b2..7b9ac28 100644 (file)
@@ -78,7 +78,9 @@ abstract class DataUpdate implements DeferrableUpdate {
         * @throws Exception|null
         */
        public static function runUpdates( $updates ) {
-               if ( empty( $updates ) ) return; # nothing to do
+               if ( empty( $updates ) ) {
+                       return; # nothing to do
+               }
 
                $open_transactions = array();
                $exception = null;
index ff299fc..c198081 100644 (file)
@@ -1873,7 +1873,7 @@ $wgSessionHandler = null;
 $wgMemCachedDebug = false;
 
 /** The list of MemCached servers and port numbers */
-$wgMemCachedServers = array( '127.0.0.1:11000' );
+$wgMemCachedServers = array( '127.0.0.1:11211' );
 
 /**
  * Use persistent connections to MemCached, which are shared across multiple
@@ -2829,12 +2829,22 @@ $wgVectorUseSimpleSearch = true;
 $wgVectorUseIconWatch = true;
 
 /**
- * Use VForm design for Special:Userlogin.  This can be overridden by
- * a useNew bool in the query string.  For instance, if it is globally
- * false, you can try it with useNew=1.
+ * Use compact vertical form ("VForm") design for Special:Userlogin.  This can
+ * be overridden by a useNew bool in the query string.  For instance, if it is
+ * globally false, you can try it with useNew=1.
+ *
+ * @since 1.22
  */
 $wgUseVFormUserLogin = false;
 
+/**
+ * Use compact vertical form ("VForm") design for account creation
+ * (Special:Userlogin?type=signup).
+ *
+ * @since 1.22
+ */
+$wgUseVFormCreateAccount = false;
+
 /**
  * Display user edit counts in various prominent places.
  */
index ae35f3e..c97431a 100644 (file)
@@ -1220,7 +1220,7 @@ class EditPage {
 
                        case self::AS_SUCCESS_NEW_ARTICLE:
                                $query = $resultDetails['redirect'] ? 'redirect=no' : '';
-                               $anchor = isset ( $resultDetails['sectionanchor'] ) ? $resultDetails['sectionanchor'] : '';
+                               $anchor = isset( $resultDetails['sectionanchor'] ) ? $resultDetails['sectionanchor'] : '';
                                $wgOut->redirect( $this->mTitle->getFullURL( $query ) . $anchor );
                                return false;
 
index 93fddac..c513ef7 100644 (file)
@@ -333,7 +333,7 @@ class ErrorPageError extends MWException {
                // customized by the local wiki. So get the default English version for
                // passing to the parent constructor. Our overridden report() below
                // makes sure that the page shown to the user is not forced to English.
-               if( $msg instanceof Message ) {
+               if ( $msg instanceof Message ) {
                        $enMsg = clone( $msg );
                } else {
                        $enMsg = wfMessage( $msg, $params );
@@ -467,39 +467,9 @@ class ThrottledError extends ErrorPageError {
  */
 class UserBlockedError extends ErrorPageError {
        public function __construct( Block $block ) {
-               global $wgLang, $wgRequest;
-
-               $blocker = $block->getBlocker();
-               if ( $blocker instanceof User ) { // local user
-                       $blockerUserpage = $block->getBlocker()->getUserPage();
-                       $link = "[[{$blockerUserpage->getPrefixedText()}|{$blockerUserpage->getText()}]]";
-               } else { // foreign user
-                       $link = $blocker;
-               }
-
-               $reason = $block->mReason;
-               if( $reason == '' ) {
-                       $reason = wfMessage( 'blockednoreason' )->text();
-               }
-
-               /* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
-                * This could be a username, an IP range, or a single IP. */
-               $intended = $block->getTarget();
-
-               parent::__construct(
-                       'blockedtitle',
-                       $block->mAuto ? 'autoblockedtext' : 'blockedtext',
-                       array(
-                               $link,
-                               $reason,
-                               $wgRequest->getIP(),
-                               $block->getByName(),
-                               $block->getId(),
-                               $wgLang->formatExpiry( $block->mExpiry ),
-                               $intended,
-                               $wgLang->timeanddate( wfTimestamp( TS_MW, $block->mTimestamp ), true )
-                       )
-               );
+               // @todo FIXME: Implement a more proper way to get context here.
+               $params = $block->getPermissionsError( RequestContext::getMain() );
+               parent::__construct( 'blockedtitle', array_shift( $params ), $params );
        }
 }
 
index 996c14b..9400c41 100644 (file)
@@ -249,9 +249,13 @@ class WikiExporter {
                        $where = array( 'user_id = log_user' );
                        # Hide private logs
                        $hideLogs = LogEventsList::getExcludeClause( $this->db );
-                       if ( $hideLogs ) $where[] = $hideLogs;
+                       if ( $hideLogs ) {
+                               $where[] = $hideLogs;
+                       }
                        # Add on any caller specified conditions
-                       if ( $cond ) $where[] = $cond;
+                       if ( $cond ) {
+                               $where[] = $cond;
+                       }
                        # Get logging table name for logging.* clause
                        $logging = $this->db->tableName( 'logging' );
 
@@ -638,7 +642,7 @@ class XmlDumpWriter {
 
                $out = "    <revision>\n";
                $out .= "      " . Xml::element( 'id', null, strval( $row->rev_id ) ) . "\n";
-               if( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {
+               if ( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {
                        $out .= "      " . Xml::element( 'parentid', null, strval( $row->rev_parent_id ) ) . "\n";
                }
 
index 2e19a09..cdf6c88 100644 (file)
@@ -35,13 +35,13 @@ class Fallback {
                if ( substr( $to, -8 ) == '//IGNORE' ) {
                        $to = substr( $to, 0, strlen( $to ) - 8 );
                }
-               if( strcasecmp( $from, $to ) == 0 ) {
+               if ( strcasecmp( $from, $to ) == 0 ) {
                        return $string;
                }
-               if( strcasecmp( $from, 'utf-8' ) == 0 ) {
+               if ( strcasecmp( $from, 'utf-8' ) == 0 ) {
                        return utf8_decode( $string );
                }
-               if( strcasecmp( $to, 'utf-8' ) == 0 ) {
+               if ( strcasecmp( $to, 'utf-8' ) == 0 ) {
                        return utf8_encode( $string );
                }
                return $string;
@@ -64,12 +64,12 @@ class Fallback {
         * @return string
         */
        public static function mb_substr( $str, $start, $count = 'end' ) {
-               if( $start != 0 ) {
+               if ( $start != 0 ) {
                        $split = self::mb_substr_split_unicode( $str, intval( $start ) );
                        $str = substr( $str, $split );
                }
 
-               if( $count !== 'end' ) {
+               if ( $count !== 'end' ) {
                        $split = self::mb_substr_split_unicode( $str, intval( $count ) );
                        $str = substr( $str, 0, $split );
                }
@@ -83,14 +83,14 @@ class Fallback {
         * @return int
         */
        public static function mb_substr_split_unicode( $str, $splitPos ) {
-               if( $splitPos == 0 ) {
+               if ( $splitPos == 0 ) {
                        return 0;
                }
 
                $byteLen = strlen( $str );
 
-               if( $splitPos > 0 ) {
-                       if( $splitPos > 256 ) {
+               if ( $splitPos > 0 ) {
+                       if ( $splitPos > 256 ) {
                                // Optimize large string offsets by skipping ahead N bytes.
                                // This will cut out most of our slow time on Latin-based text,
                                // and 1/2 to 1/3 on East European and Asian scripts.
@@ -104,7 +104,7 @@ class Fallback {
                                $bytePos = 0;
                        }
 
-                       while( $charPos++ < $splitPos ) {
+                       while ( $charPos++ < $splitPos ) {
                                ++$bytePos;
                                // Move past any tail bytes
                                while ( $bytePos < $byteLen && $str[$bytePos] >= "\x80" && $str[$bytePos] < "\xc0" ) {
@@ -115,7 +115,7 @@ class Fallback {
                        $splitPosX = $splitPos + 1;
                        $charPos = 0; // relative to end of string; we don't care about the actual char position here
                        $bytePos = $byteLen;
-                       while( $bytePos > 0 && $charPos-- >= $splitPosX ) {
+                       while ( $bytePos > 0 && $charPos-- >= $splitPosX ) {
                                --$bytePos;
                                // Move past any tail bytes
                                while ( $bytePos > 0 && $str[$bytePos] >= "\x80" && $str[$bytePos] < "\xc0" ) {
@@ -138,12 +138,12 @@ class Fallback {
                $total = 0;
 
                // Count ASCII bytes
-               for( $i = 0; $i < 0x80; $i++ ) {
+               for ( $i = 0; $i < 0x80; $i++ ) {
                        $total += $counts[$i];
                }
 
                // Count multibyte sequence heads
-               for( $i = 0xc0; $i < 0xff; $i++ ) {
+               for ( $i = 0xc0; $i < 0xff; $i++ ) {
                        $total += $counts[$i];
                }
                return $total;
@@ -163,7 +163,7 @@ class Fallback {
                $ar = array();
                preg_match( '/' . $needle . '/u', $haystack, $ar, PREG_OFFSET_CAPTURE, $offset );
 
-               if( isset( $ar[0][1] ) ) {
+               if ( isset( $ar[0][1] ) ) {
                        return $ar[0][1];
                } else {
                        return false;
@@ -184,7 +184,7 @@ class Fallback {
                $ar = array();
                preg_match_all( '/' . $needle . '/u', $haystack, $ar, PREG_OFFSET_CAPTURE, $offset );
 
-               if( isset( $ar[0] ) && count( $ar[0] ) > 0 &&
+               if ( isset( $ar[0] ) && count( $ar[0] ) > 0 &&
                        isset( $ar[0][count( $ar[0] ) - 1][1] ) ) {
                        return $ar[0][count( $ar[0] ) - 1][1];
                } else {
index caf2e57..635b04e 100644 (file)
@@ -245,7 +245,7 @@ abstract class ChannelFeed extends FeedItem {
                global $wgRequest;
                $ctype = $wgRequest->getVal( 'ctype', 'application/xml' );
                $allowedctypes = array( 'application/xml', 'text/xml', 'application/rss+xml', 'application/atom+xml' );
-               return (in_array( $ctype, $allowedctypes ) ? $ctype : 'application/xml');
+               return ( in_array( $ctype, $allowedctypes ) ? $ctype : 'application/xml' );
        }
 
        /**
@@ -306,13 +306,13 @@ class RSSFeed extends ChannelFeed {
        function outItem( $item ) {
        ?>
                <item>
-                       <title><?php print $item->getTitle() ?></title>
-                       <link><?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?></link>
-                       <guid<?php if( !$item->rssIsPermalink ) print ' isPermaLink="false"' ?>><?php print $item->getUniqueId() ?></guid>
+                       <title><?php print $item->getTitle(); ?></title>
+                       <link><?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ); ?></link>
+                       <guid<?php if ( !$item->rssIsPermalink ) { print ' isPermaLink="false"'; } ?>><?php print $item->getUniqueId(); ?></guid>
                        <description><?php print $item->getDescription() ?></description>
-                       <?php if( $item->getDate() ) { ?><pubDate><?php print $this->formatTime( $item->getDate() ) ?></pubDate><?php } ?>
-                       <?php if( $item->getAuthor() ) { ?><dc:creator><?php print $item->getAuthor() ?></dc:creator><?php }?>
-                       <?php if( $item->getComments() ) { ?><comments><?php print wfExpandUrl( $item->getComments(), PROTO_CURRENT ) ?></comments><?php }?>
+                       <?php if ( $item->getDate() ) { ?><pubDate><?php print $this->formatTime( $item->getDate() ); ?></pubDate><?php } ?>
+                       <?php if ( $item->getAuthor() ) { ?><dc:creator><?php print $item->getAuthor(); ?></dc:creator><?php }?>
+                       <?php if ( $item->getComments() ) { ?><comments><?php print wfExpandUrl( $item->getComments(), PROTO_CURRENT ); ?></comments><?php }?>
                </item>
 <?php
        }
@@ -392,15 +392,15 @@ class AtomFeed extends ChannelFeed {
                global $wgMimeType;
        ?>
        <entry>
-               <id><?php print $item->getUniqueId() ?></id>
-               <title><?php print $item->getTitle() ?></title>
-               <link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?>"/>
-               <?php if( $item->getDate() ) { ?>
-               <updated><?php print $this->formatTime( $item->getDate() ) ?>Z</updated>
+               <id><?php print $item->getUniqueId(); ?></id>
+               <title><?php print $item->getTitle(); ?></title>
+               <link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ); ?>"/>
+               <?php if ( $item->getDate() ) { ?>
+               <updated><?php print $this->formatTime( $item->getDate() ); ?>Z</updated>
                <?php } ?>
 
                <summary type="html"><?php print $item->getDescription() ?></summary>
-               <?php if( $item->getAuthor() ) { ?><author><name><?php print $item->getAuthor() ?></name></author><?php }?>
+               <?php if ( $item->getAuthor() ) { ?><author><name><?php print $item->getAuthor(); ?></name></author><?php }?>
        </entry>
 
 <?php /* @todo FIXME: Need to add comments
index 4842c38..6f3b42c 100644 (file)
@@ -59,7 +59,7 @@ class FeedUtils {
                        return false;
                }
 
-               if( !isset( $wgFeedClasses[$type] ) ) {
+               if ( !isset( $wgFeedClasses[$type] ) ) {
                        $wgOut->addWikiMsg( 'feed-invalid' );
                        return false;
                }
@@ -77,7 +77,7 @@ class FeedUtils {
                $titleObj = Title::makeTitle( $row->rc_namespace, $row->rc_title );
                $timestamp = wfTimestamp( TS_MW, $row->rc_timestamp );
                $actiontext = '';
-               if( $row->rc_type == RC_LOG ) {
+               if ( $row->rc_type == RC_LOG ) {
                        $rcRow = (array)$row; // newFromRow() only accepts arrays for RC rows
                        $actiontext = LogFormatter::newFromRow( $rcRow )->getActionText();
                }
@@ -121,12 +121,12 @@ class FeedUtils {
 
                // Can't diff special pages, unreadable pages or pages with no new revision
                // to compare against: just return the text.
-               if( $title->getNamespace() < 0 || $accErrors || !$newid ) {
+               if ( $title->getNamespace() < 0 || $accErrors || !$newid ) {
                        wfProfileOut( __METHOD__ );
                        return $completeText;
                }
 
-               if( $oldid ) {
+               if ( $oldid ) {
                        wfProfileIn( __METHOD__ . "-dodiff" );
 
                        #$diffText = $de->getDiff( wfMessage( 'revisionasof',
@@ -171,7 +171,7 @@ class FeedUtils {
                        wfProfileOut( __METHOD__ . "-dodiff" );
                } else {
                        $rev = Revision::newFromId( $newid );
-                       if( $wgFeedDiffCutoff <= 0 || is_null( $rev ) ) {
+                       if ( $wgFeedDiffCutoff <= 0 || is_null( $rev ) ) {
                                $newContent = ContentHandler::getForTitle( $title )->makeEmptyContent();
                        } else {
                                $newContent = $rev->getContent();
@@ -250,7 +250,7 @@ class FeedUtils {
                        'diffchange'       => 'font-weight: bold; text-decoration: none;',
                );
 
-               foreach( $styles as $class => $style ) {
+               foreach ( $styles as $class => $style ) {
                        $text = preg_replace( "/(<[^>]+)class=(['\"])$class\\2([^>]*>)/",
                                "\\1style=\"$style\"\\3", $text );
                }
index 9ce2f76..9fc70eb 100644 (file)
@@ -82,18 +82,18 @@ class FileDeleteForm {
                # Flag to hide all contents of the archived revisions
                $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed( 'suppressrevision' );
 
-               if( $this->oldimage ) {
+               if ( $this->oldimage ) {
                        $this->oldfile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->title, $this->oldimage );
                }
 
-               if( !self::haveDeletableFile( $this->file, $this->oldfile, $this->oldimage ) ) {
+               if ( !self::haveDeletableFile( $this->file, $this->oldfile, $this->oldimage ) ) {
                        $wgOut->addHTML( $this->prepareMessage( 'filedelete-nofile' ) );
                        $wgOut->addReturnTo( $this->title );
                        return;
                }
 
                // Perform the deletion if appropriate
-               if( $wgRequest->wasPosted() && $wgUser->matchEditToken( $token, $this->oldimage ) ) {
+               if ( $wgRequest->wasPosted() && $wgUser->matchEditToken( $token, $this->oldimage ) ) {
                        $deleteReasonList = $wgRequest->getText( 'wpDeleteReasonList' );
                        $deleteReason = $wgRequest->getText( 'wpReason' );
 
@@ -109,11 +109,11 @@ class FileDeleteForm {
 
                        $status = self::doDelete( $this->title, $this->file, $this->oldimage, $reason, $suppress, $wgUser );
 
-                       if( !$status->isGood() ) {
+                       if ( !$status->isGood() ) {
                                $wgOut->addHTML( '<h2>' . $this->prepareMessage( 'filedeleteerror-short' ) . "</h2>\n" );
                                $wgOut->addWikiText( '<div class="error">' . $status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' ) . '</div>' );
                        }
-                       if( $status->ok ) {
+                       if ( $status->ok ) {
                                $wgOut->setPageTitle( wfMessage( 'actioncomplete' ) );
                                $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) );
                                // Return to the main page if we just deleted all versions of the
@@ -153,13 +153,13 @@ class FileDeleteForm {
                        $user = $wgUser;
                }
 
-               if( $oldimage ) {
+               if ( $oldimage ) {
                        $page = null;
                        $status = $file->deleteOld( $oldimage, $reason, $suppress );
-                       if( $status->ok ) {
+                       if ( $status->ok ) {
                                // Need to do a log item
                                $logComment = wfMessage( 'deletedrevision', $oldimage )->inContentLanguage()->text();
-                               if( trim( $reason ) != '' ) {
+                               if ( trim( $reason ) != '' ) {
                                        $logComment .= wfMessage( 'colon-separator' )
                                                ->inContentLanguage()->text() . $reason;
                                }
@@ -187,7 +187,7 @@ class FileDeleteForm {
                                // or revision is missing, so check for isOK() rather than isGood()
                                if ( $deleteStatus->isOK() ) {
                                        $status = $file->delete( $reason, $suppress );
-                                       if( $status->isOK() ) {
+                                       if ( $status->isOK() ) {
                                                $dbw->commit( __METHOD__ );
                                        } else {
                                                $dbw->rollback( __METHOD__ );
@@ -213,7 +213,7 @@ class FileDeleteForm {
        private function showForm() {
                global $wgOut, $wgUser, $wgRequest;
 
-               if( $wgUser->isAllowed( 'suppressrevision' ) ) {
+               if ( $wgUser->isAllowed( 'suppressrevision' ) ) {
                        $suppress = "<tr id=\"wpDeleteSuppressRow\">
                                        <td></td>
                                        <td class='mw-input'><strong>" .
@@ -258,7 +258,7 @@ class FileDeleteForm {
                                "</td>
                        </tr>
                        {$suppress}";
-               if( $wgUser->isLoggedIn() ) {
+               if ( $wgUser->isLoggedIn() ) {
                        $form .= "
                        <tr>
                                <td></td>
@@ -314,7 +314,7 @@ class FileDeleteForm {
         */
        private function prepareMessage( $message ) {
                global $wgLang;
-               if( $this->oldimage ) {
+               if ( $this->oldimage ) {
                        return wfMessage(
                                "{$message}-old", # To ensure grep will find them: 'filedelete-intro-old', 'filedelete-nofile-old', 'filedelete-success-old'
                                wfEscapeWikiText( $this->title->getText() ),
@@ -375,7 +375,7 @@ class FileDeleteForm {
                $q = array();
                $q['action'] = 'delete';
 
-               if( $this->oldimage ) {
+               if ( $this->oldimage ) {
                        $q['oldimage'] = $this->oldimage;
                }
 
index 89ad955..ced45af 100644 (file)
@@ -121,7 +121,9 @@ class ForkController {
                        if ( function_exists( 'pcntl_signal_dispatch' ) ) {
                                pcntl_signal_dispatch();
                        } else {
-                               declare (ticks=1) { $status = $status; }
+                               declare( ticks = 1 ) {
+                                       $status = $status;
+                               }
                        }
                        // Respond to TERM signal
                        if ( $this->termReceived ) {
index 8477ed9..530b094 100644 (file)
@@ -290,15 +290,19 @@ class FormOptions implements ArrayAccess {
                        $default = $this->options[$name]['default'];
                        $type = $this->options[$name]['type'];
 
-                       switch( $type ) {
+                       switch ( $type ) {
                                case self::BOOL:
-                                       $value = $r->getBool( $name, $default ); break;
+                                       $value = $r->getBool( $name, $default );
+                                       break;
                                case self::INT:
-                                       $value = $r->getInt( $name, $default ); break;
+                                       $value = $r->getInt( $name, $default );
+                                       break;
                                case self::STRING:
-                                       $value = $r->getText( $name, $default ); break;
+                                       $value = $r->getText( $name, $default );
+                                       break;
                                case self::INTNULL:
-                                       $value = $r->getIntOrNull( $name ); break;
+                                       $value = $r->getIntOrNull( $name );
+                                       break;
                                default:
                                        throw new MWException( 'Unsupported datatype' );
                        }
index bf3bff7..a54b807 100644 (file)
@@ -177,7 +177,7 @@ class GitInfo {
                if ( isset( $configArray['remote origin'] ) ) {
                        $remote = $configArray['remote origin'];
                } else {
-                       foreach( $configArray as $sectionName => $sectionConf ) {
+                       foreach ( $configArray as $sectionName => $sectionConf ) {
                                if ( substr( $sectionName, 0, 6 ) == 'remote' ) {
                                        $remote = $sectionConf;
                                }
@@ -192,7 +192,7 @@ class GitInfo {
                if ( substr( $url, -4 ) !== '.git' ) {
                        $url .= '.git';
                }
-               foreach( self::getViewers() as $repo => $viewer ) {
+               foreach ( self::getViewers() as $repo => $viewer ) {
                        $pattern = '#^' . $repo . '$#';
                        if ( preg_match( $pattern, $url ) ) {
                                $viewerUrl = preg_replace( $pattern, $viewer, $url );
@@ -238,7 +238,7 @@ class GitInfo {
        protected static function getViewers() {
                global $wgGitRepositoryViewers;
 
-               if( self::$viewers === false ) {
+               if ( self::$viewers === false ) {
                        self::$viewers = $wgGitRepositoryViewers;
                        wfRunHooks( 'GitViewers', array( &self::$viewers ) );
                }
index 458ab54..320a57d 100644 (file)
@@ -2736,22 +2736,12 @@ function wfEscapeShellArg() {
 }
 
 /**
- * Execute a shell command, with time and memory limits mirrored from the PHP
- * configuration if supported.
- * @param string $cmd Command line, properly escaped for shell.
- * @param &$retval null|Mixed optional, will receive the program's exit code.
- *                 (non-zero is usually failure)
- * @param array $environ optional environment variables which should be
- *                 added to the executed command environment.
- * @param array $limits optional array with limits(filesize, memory, time, walltime)
- *                 this overwrites the global wgShellMax* limits.
- * @return string collected stdout as a string (trailing newlines stripped)
+ * Check if wfShellExec() is effectively disabled via php.ini config
+ * @return bool|string False or one of (safemode,disabled)
+ * @since 1.22
  */
-function wfShellExec( $cmd, &$retval = null, $environ = array(), $limits = array() ) {
-       global $IP, $wgMaxShellMemory, $wgMaxShellFileSize, $wgMaxShellTime,
-               $wgMaxShellWallClockTime, $wgShellCgroup;
-
-       static $disabled;
+function wfShellExecDisabled() {
+       static $disabled = null;
        if ( is_null( $disabled ) ) {
                $disabled = false;
                if ( wfIniGetBool( 'safe_mode' ) ) {
@@ -2767,6 +2757,26 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(), $limits = array
                        }
                }
        }
+       return $disabled;
+}
+
+/**
+ * Execute a shell command, with time and memory limits mirrored from the PHP
+ * configuration if supported.
+ * @param string $cmd Command line, properly escaped for shell.
+ * @param &$retval null|Mixed optional, will receive the program's exit code.
+ *                 (non-zero is usually failure)
+ * @param array $environ optional environment variables which should be
+ *                 added to the executed command environment.
+ * @param array $limits optional array with limits(filesize, memory, time, walltime)
+ *                 this overwrites the global wgShellMax* limits.
+ * @return string collected stdout as a string (trailing newlines stripped)
+ */
+function wfShellExec( $cmd, &$retval = null, $environ = array(), $limits = array() ) {
+       global $IP, $wgMaxShellMemory, $wgMaxShellFileSize, $wgMaxShellTime,
+               $wgMaxShellWallClockTime, $wgShellCgroup;
+
+       $disabled = wfShellExecDisabled();
        if ( $disabled ) {
                $retval = 1;
                return $disabled == 'safemode' ?
@@ -3750,7 +3760,7 @@ function wfShorthandToInteger( $string = '' ) {
        }
        $last = $string[strlen( $string ) - 1];
        $val = intval( $string );
-       switch( $last ) {
+       switch ( $last ) {
                case 'g':
                case 'G':
                        $val *= 1024;
index e204087..c08206d 100644 (file)
@@ -83,9 +83,8 @@
  * $form = new HTMLForm( $someFields );
  * $form->setMethod( 'get' )
  *      ->setWrapperLegendMsg( 'message-key' )
- *      ->suppressReset()
  *      ->prepareForm()
- *      ->displayForm();
+ *      ->displayForm( '' );
  * @endcode
  * Note that you will have prepareForm and displayForm at the end. Other
  * methods call done after that would simply not be part of the form :(
@@ -277,7 +276,9 @@ class HTMLForm extends ContextSource {
         * done already.
         * @deprecated since 1.18 load modules with ResourceLoader instead
         */
-       static function addJS() { wfDeprecated( __METHOD__, '1.18' ); }
+       static function addJS() {
+               wfDeprecated( __METHOD__, '1.18' );
+       }
 
        /**
         * Initialise a new Object for the field
@@ -1978,10 +1979,11 @@ class HTMLSelectField extends HTMLFormField {
 
                $validOptions = HTMLFormField::flattenOptions( $this->mParams['options'] );
 
-               if ( in_array( $value, $validOptions ) )
+               if ( in_array( $value, $validOptions ) ) {
                        return true;
-               else
+               } else {
                        return $this->msg( 'htmlform-select-badoption' )->parse();
+               }
        }
 
        function getInputHTML( $value ) {
@@ -2530,14 +2532,28 @@ class HTMLHiddenField extends HTMLFormField {
                return $this->getTableRow( $value );
        }
 
-       public function getInputHTML( $value ) { return ''; }
+       public function getInputHTML( $value ) {
+               return '';
+       }
 }
 
 /**
  * Add a submit button inline in the form (as opposed to
  * HTMLForm::addButton(), which will add it at the end).
  */
-class HTMLSubmitField extends HTMLFormField {
+class HTMLSubmitField extends HTMLButtonField {
+       protected $buttonType = 'submit';
+}
+
+/**
+ * Adds a generic button inline to the form. Does not do anything, you must add
+ * click handling code in JavaScript. Use a HTMLSubmitField if you merely
+ * wish to add a submit button to a form.
+ *
+ * @since 1.22
+ */
+class HTMLButtonField extends HTMLFormField {
+       protected $buttonType = 'button';
 
        public function __construct( $info ) {
                $info['nodata'] = true;
@@ -2547,7 +2563,6 @@ class HTMLSubmitField extends HTMLFormField {
        public function getInputHTML( $value ) {
                $attr = array(
                        'class' => 'mw-htmlform-submit ' . $this->mClass,
-                       'name' => $this->mName,
                        'id' => $this->mID,
                );
 
@@ -2555,7 +2570,12 @@ class HTMLSubmitField extends HTMLFormField {
                        $attr['disabled'] = 'disabled';
                }
 
-               return Xml::submitButton( $value, $attr );
+               return Html::input(
+                       $this->mName,
+                       $value,
+                       $this->buttonType,
+                       $attr
+               );
        }
 
        protected function needsLabel() {
index 976d36d..227a287 100644 (file)
@@ -30,7 +30,7 @@ class HashRing {
        /** @var Array (location => (start, end)) */
        protected $ring = array();
 
-       const RING_SIZE = 16777216; // 2^24
+       const RING_SIZE = 268435456; // 2^28
 
        /**
         * @param array $map (location => weight)
@@ -51,7 +51,7 @@ class HashRing {
                // Fit the map to weight-proportionate one with a space of size RING_SIZE
                $standardMap = array();
                foreach ( $map as $location => $weight ) {
-                       $standardMap[$location] = (int)floor( $weight/$sum * self::RING_SIZE );
+                       $standardMap[$location] = (int)floor( $weight / $sum * self::RING_SIZE );
                }
                // Build a ring of RING_SIZE spots, with each location at a spot in location hash order
                $index = 0;
@@ -86,7 +86,7 @@ class HashRing {
        public function getLocations( $item, $limit ) {
                $locations = array();
                $primaryLocation = null;
-               $spot = hexdec( substr( sha1( $item ), 0, 6 ) ); // first 24 bits
+               $spot = hexdec( substr( sha1( $item ), 0, 7 ) ); // first 28 bits
                foreach ( $this->ring as $location => $range ) {
                        if ( count( $locations ) >= $limit ) {
                                break;
index 1af733a..8d83751 100644 (file)
@@ -231,16 +231,16 @@ class HistoryBlobStub {
         * @return string
         */
        function getText() {
-               if( isset( self::$blobCache[$this->mOldId] ) ) {
+               if ( isset( self::$blobCache[$this->mOldId] ) ) {
                        $obj = self::$blobCache[$this->mOldId];
                } else {
                        $dbr = wfGetDB( DB_SLAVE );
                        $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) );
-                       if( !$row ) {
+                       if ( !$row ) {
                                return false;
                        }
                        $flags = explode( ',', $row->old_flags );
-                       if( in_array( 'external', $flags ) ) {
+                       if ( in_array( 'external', $flags ) ) {
                                $url = $row->old_text;
                                $parts = explode( '://', $url, 2 );
                                if ( !isset( $parts[1] ) || $parts[1] == '' ) {
@@ -249,11 +249,11 @@ class HistoryBlobStub {
                                $row->old_text = ExternalStore::fetchFromUrl( $url );
 
                        }
-                       if( !in_array( 'object', $flags ) ) {
+                       if ( !in_array( 'object', $flags ) ) {
                                return false;
                        }
 
-                       if( in_array( 'gzip', $flags ) ) {
+                       if ( in_array( 'gzip', $flags ) ) {
                                // This shouldn't happen, but a bug in the compress script
                                // may at times gzip-compress a HistoryBlob object row.
                                $obj = unserialize( gzinflate( $row->old_text ) );
@@ -261,7 +261,7 @@ class HistoryBlobStub {
                                $obj = unserialize( $row->old_text );
                        }
 
-                       if( !is_object( $obj ) ) {
+                       if ( !is_object( $obj ) ) {
                                // Correct for old double-serialization bug.
                                $obj = unserialize( $obj );
                        }
@@ -318,7 +318,7 @@ class HistoryBlobCurStub {
        function getText() {
                $dbr = wfGetDB( DB_SLAVE );
                $row = $dbr->selectRow( 'cur', array( 'cur_text' ), array( 'cur_id' => $this->mCurId ) );
-               if( !$row ) {
+               if ( !$row ) {
                        return false;
                }
                return $row->cur_text;
index 740abf7..5d8a4a7 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * A tool for running hook functions.
  *
@@ -37,40 +38,43 @@ class MWHookException extends MWException {}
  */
 class Hooks {
 
+       /**
+        * Array of events mapped to an array of callbacks to be run
+        * when that event is triggered.
+        */
        protected static $handlers = array();
 
        /**
-        * Clears hooks registered via Hooks::register(). Does not touch $wgHooks.
-        * This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
+        * Attach an event handler to a given hook.
         *
-        * @since 1.21
-        *
-        * @param string $name the name of the hook to clear.
+        * @param string $name Name of hook
+        * @param mixed $callback Callback function to attach
         *
-        * @throws MWException if not in testing mode.
+        * @since 1.18
         */
-       public static function clear( $name ) {
-               if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
-                       throw new MWException( 'can not reset hooks in operation.' );
+       public static function register( $name, $callback ) {
+               if( !isset( self::$handlers[$name] ) ) {
+                       self::$handlers[$name] = array();
                }
 
-               unset( self::$handlers[$name] );
+               self::$handlers[$name][] = $callback;
        }
 
        /**
-        * Attach an event handler to a given hook
+        * Clears hooks registered via Hooks::register(). Does not touch $wgHooks.
+        * This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
         *
-        * @since 1.18
+        * @param string $name the name of the hook to clear.
         *
-        * @param string $name name of hook
-        * @param $callback Mixed: callback function to attach
+        * @since 1.21
+        * @throws MWException if not in testing mode.
         */
-       public static function register( $name, $callback ) {
-               if( !isset( self::$handlers[$name] ) ) {
-                       self::$handlers[$name] = array();
+       public static function clear( $name ) {
+               if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
+                       throw new MWException( 'Cannot reset hooks in operation.' );
                }
 
-               self::$handlers[$name][] = $callback;
+               unset( self::$handlers[$name] );
        }
 
        /**
@@ -79,221 +83,143 @@ class Hooks {
         *
         * @since 1.18
         *
-        * @param string $name name of hook
-        * @return Boolean: true if the hook has a function registered to it
+        * @param string $name Name of hook
+        * @return bool True if the hook has a function registered to it
         */
        public static function isRegistered( $name ) {
                global $wgHooks;
-
                return !empty( $wgHooks[$name] ) || !empty( self::$handlers[$name] );
        }
 
        /**
         * Returns an array of all the event functions attached to a hook
         * This combines functions registered via Hooks::register and with $wgHooks.
-        * @since 1.18
         *
-        * @throws MWException
-        * @throws FatalError
-        * @param string $name name of the hook
+        * @since 1.18
         *
+        * @param string $name Name of the hook
         * @return array
         */
        public static function getHandlers( $name ) {
                global $wgHooks;
 
-               // Return quickly in the most common case
-               if ( empty( self::$handlers[$name] ) && empty( $wgHooks[$name] ) ) {
+               if ( !self::isRegistered( $name ) ) {
                        return array();
-               }
-
-               if ( !is_array( self::$handlers ) ) {
-                       throw new MWException( "Local hooks array is not an array!\n" );
-               }
-
-               if ( !is_array( $wgHooks ) ) {
-                       throw new MWException( "Global hooks array is not an array!\n" );
-               }
-
-               if ( empty( Hooks::$handlers[$name] ) ) {
-                       $hooks = $wgHooks[$name];
-               } elseif ( empty( $wgHooks[$name] ) ) {
-                       $hooks = Hooks::$handlers[$name];
+               } elseif ( !isset( self::$handlers[$name] ) ) {
+                       return $wgHooks[$name];
+               } elseif ( !isset( $wgHooks[$name] ) ) {
+                       return self::$handlers[$name];
                } else {
-                       // so they are both not empty...
-                       $hooks = array_merge( Hooks::$handlers[$name], $wgHooks[$name] );
+                       return array_merge( self::$handlers[$name], $wgHooks[$name] );
                }
-
-               if ( !is_array( $hooks ) ) {
-                       throw new MWException( "Hooks array for event '$name' is not an array!\n" );
-               }
-
-               return $hooks;
        }
 
        /**
-        * Call hook functions defined in Hooks::register
+        * Call hook functions defined in Hooks::register and $wgHooks.
+        *
+        * For a certain hook event, fetch the array of hook events and
+        * process them. Determine the proper callback for each hook and
+        * then call the actual hook using the appropriate arguments.
+        * Finally, process the return value and return/throw accordingly.
         *
-        * @param string $event event name
-        * @param $args  Array: parameters passed to hook functions
+        * @param string $event Event name
+        * @param array $args  Array of parameters passed to hook functions
+        * @return bool True if no handler aborted the hook
         *
         * @throws MWException
         * @throws FatalError
-        * @return Boolean True if no handler aborted the hook
         */
-       public static function run( $event, $args = array() ) {
-               global $wgHooks;
-
-               // Return quickly in the most common case
-               if ( empty( self::$handlers[$event] ) && empty( $wgHooks[$event] ) ) {
-                       return true;
-               }
-
+       public static function run( $event, array $args = array() ) {
                wfProfileIn( 'hook: ' . $event );
-               $hooks = self::getHandlers( $event );
+               foreach ( self::getHandlers( $event ) as $hook ) {
+                       // Turn non-array values into an array. (Can't use casting because of objects.)
+                       if ( !is_array( $hook ) ) {
+                               $hook = array( $hook );
+                       }
 
-               foreach ( $hooks as $hook ) {
-                       $object = null;
-                       $method = null;
-                       $func = null;
-                       $data = null;
-                       $have_data = false;
-                       $closure = false;
-                       $badhookmsg = false;
+                       if ( !array_filter( $hook ) ) {
+                               // Either array is empty or it's an array filled with null/false/empty.
+                               continue;
+                       } elseif ( is_array( $hook[0] ) ) {
+                               // First element is an array, meaning the developer intended
+                               // the first element to be a callback. Merge it in so that
+                               // processing can be uniform.
+                               $hook = array_merge( $hook[0], array_slice( $hook, 1 ) );
+                       }
 
                        /**
                         * $hook can be: a function, an object, an array of $function and
                         * $data, an array of just a function, an array of object and
                         * method, or an array of object, method, and data.
                         */
-                       if ( is_array( $hook ) ) {
-                               if ( count( $hook ) < 1 ) {
-                                       wfProfileOut( 'hook: ' . $event );
-                                       throw new MWException( 'Empty array in hooks for ' . $event . "\n" );
-                               } elseif ( is_object( $hook[0] ) ) {
-                                       $object = $hook[0];
-                                       if ( $object instanceof Closure ) {
-                                               $closure = true;
-                                               if ( count( $hook ) > 1 ) {
-                                                       $data = $hook[1];
-                                                       $have_data = true;
-                                               }
-                                       } else {
-                                               if ( count( $hook ) < 2 ) {
-                                                       $method = 'on' . $event;
-                                               } else {
-                                                       $method = $hook[1];
-                                                       if ( count( $hook ) > 2 ) {
-                                                               $data = $hook[2];
-                                                               $have_data = true;
-                                                       }
-                                               }
-                                       }
-                               } elseif ( is_string( $hook[0] ) ) {
-                                       $func = $hook[0];
-                                       if ( count( $hook ) > 1 ) {
-                                               $data = $hook[1];
-                                               $have_data = true;
-                                       }
-                               } else {
-                                       wfProfileOut( 'hook: ' . $event );
-                                       throw new MWException( 'Unknown datatype in hooks for ' . $event . "\n" );
-                               }
-                       } elseif ( is_string( $hook ) ) { # functions look like strings, too
-                               $func = $hook;
-                       } elseif ( is_object( $hook ) ) {
-                               $object = $hook;
-                               if ( $object instanceof Closure ) {
-                                       $closure = true;
-                               } else {
-                                       $method = "on" . $event;
+                       if ( $hook[0] instanceof Closure ) {
+                               $func = "hook-$event-closure";
+                               $callback = array_shift( $hook );
+                       } elseif ( is_object( $hook[0] ) ) {
+                               $object = array_shift( $hook );
+                               $method = array_shift( $hook );
+
+                               // If no method was specified, default to on$event.
+                               if ( $method === null ) {
+                                       $method = "on$event";
                                }
-                       } else {
-                               wfProfileOut( 'hook: ' . $event );
-                               throw new MWException( 'Unknown datatype in hooks for ' . $event . "\n" );
-                       }
 
-                       /* We put the first data element on, if needed. */
-                       if ( $have_data ) {
-                               $hook_args = array_merge( array( $data ), $args );
-                       } else {
-                               $hook_args = $args;
-                       }
-
-                       if ( $closure ) {
-                               $callback = $object;
-                               $func = "hook-$event-closure";
-                       } elseif ( isset( $object ) ) {
                                $func = get_class( $object ) . '::' . $method;
                                $callback = array( $object, $method );
+                       } elseif ( is_string( $hook[0] ) ) {
+                               $func = $callback = array_shift( $hook );
                        } else {
-                               $callback = $func;
+                               throw new MWException( 'Unknown datatype in hooks for ' . $event . "\n" );
                        }
 
                        // Run autoloader (workaround for call_user_func_array bug)
-                       is_callable( $callback );
+                       // and throw error if not callable.
+                       if( !is_callable( $callback ) ) {
+                               throw new MWException( 'Invalid callback in hooks for ' . $event . "\n" );
+                       }
 
-                       /**
-                        * Call the hook. The documentation of call_user_func_array clearly
-                        * states that FALSE is returned on failure. However this is not
-                        * case always. In some version of PHP if the function signature
-                        * does not match the call signature, PHP will issue an warning:
-                        * Param y in x expected to be a reference, value given.
-                        *
-                        * In that case the call will also return null. The following code
-                        * catches that warning and provides better error message. The
-                        * function documentation also says that:
-                        *     In other words, it does not depend on the function signature
-                        *     whether the parameter is passed by a value or by a reference.
-                        * There is also PHP bug http://bugs.php.net/bug.php?id=47554 which
-                        * is unsurprisingly marked as bogus. In short handling of failures
-                        * with call_user_func_array is a failure, the documentation for that
-                        * function is wrong and misleading and PHP developers don't see any
-                        * problem here.
+                       /*
+                        * Call the hook. The documentation of call_user_func_array says
+                        * false is returned on failure. However, if the function signature
+                        * does not match the call signature, PHP will issue an warning and
+                        * return null instead. The following code catches that warning and
+                        * provides better error message.
                         */
                        $retval = null;
-                       set_error_handler( 'Hooks::hookErrorHandler' );
+                       $badhookmsg = null;
+                       $hook_args = array_merge( $hook, $args );
+
+                       // Profile first in case the Profiler causes errors.
                        wfProfileIn( $func );
+                       set_error_handler( 'Hooks::hookErrorHandler' );
                        try {
                                $retval = call_user_func_array( $callback, $hook_args );
                        } catch ( MWHookException $e ) {
                                $badhookmsg = $e->getMessage();
                        }
-                       wfProfileOut( $func );
                        restore_error_handler();
+                       wfProfileOut( $func );
 
-                       /* String return is an error; false return means stop processing. */
+                       // Process the return value.
                        if ( is_string( $retval ) ) {
+                               // String returned means error.
                                throw new FatalError( $retval );
-                       } elseif( $retval === null ) {
-                               if ( $closure ) {
-                                       $prettyFunc = "$event closure";
-                               } elseif( is_array( $callback ) ) {
-                                       if( is_object( $callback[0] ) ) {
-                                               $prettyClass = get_class( $callback[0] );
-                                       } else {
-                                               $prettyClass = strval( $callback[0] );
-                                       }
-                                       $prettyFunc = $prettyClass . '::' . strval( $callback[1] );
-                               } else {
-                                       $prettyFunc = strval( $callback );
-                               }
-                               if ( $badhookmsg ) {
-                                       wfProfileOut( 'hook: ' . $event );
-                                       throw new MWException(
-                                               'Detected bug in an extension! ' .
-                                               "Hook $prettyFunc has invalid call signature; " . $badhookmsg
-                                       );
-                               } else {
-                                       wfProfileOut( 'hook: ' . $event );
-                                       throw new MWException(
-                                               'Detected bug in an extension! ' .
-                                               "Hook $prettyFunc failed to return a value; " .
-                                               'should return true to continue hook processing or false to abort.'
-                                       );
-                               }
+                       } elseif ( $badhookmsg !== null ) {
+                               // Exception was thrown from Hooks::hookErrorHandler.
+                               throw new MWException(
+                                       'Detected bug in an extension! ' .
+                                       "Hook $func has invalid call signature; " . $badhookmsg
+                               );
+                       } elseif ( $retval === null ) {
+                               // Null was returned. Error.
+                               throw new MWException(
+                                       'Detected bug in an extension! ' .
+                                       "Hook $func failed to return a value; " .
+                                       'should return true to continue hook processing or false to abort.'
+                               );
                        } elseif ( !$retval ) {
                                wfProfileOut( 'hook: ' . $event );
+                               // False was returned. Stop processing, but no error.
                                return false;
                        }
                }
@@ -303,18 +229,21 @@ class Hooks {
        }
 
        /**
+        * Handle PHP errors issued inside a hook. Catch errors that have to do with
+        * a function expecting a reference, and let all others pass through.
+        *
         * This REALLY should be protected... but it's public for compatibility
         *
         * @since 1.18
         *
-        * @param int $errno Unused
-        * @param string $errstr error message
-        * @throws MWHookException
-        * @return Boolean: false
+        * @param int $errno Error number (unused)
+        * @param string $errstr Error message
+        * @throws MWHookException If the error has to do with the function signature
+        * @return bool Always returns false
         */
        public static function hookErrorHandler( $errno, $errstr ) {
                if ( strpos( $errstr, 'expected to be a reference, value given' ) !== false ) {
-                       throw new MWHookException( $errstr );
+                       throw new MWHookException( $errstr, $errno );
                }
                return false;
        }
index 07bb42b..cb082a1 100644 (file)
@@ -207,7 +207,7 @@ class Html {
                        );
 
                        // Allow more input types in HTML5 mode
-                       if( $wgHtml5 ) {
+                       if ( $wgHtml5 ) {
                                $validTypes = array_merge( $validTypes, array(
                                        'datetime',
                                        'datetime-local',
@@ -340,7 +340,7 @@ class Html {
 
                foreach ( $attribs as $attrib => $value ) {
                        $lcattrib = strtolower( $attrib );
-                       if( is_array( $value ) ) {
+                       if ( is_array( $value ) ) {
                                $value = implode( ' ', $value );
                        } else {
                                $value = strval( $value );
@@ -962,7 +962,7 @@ class Html {
         */
        static function srcSet( $urls ) {
                $candidates = array();
-               foreach( $urls as $density => $url ) {
+               foreach ( $urls as $density => $url ) {
                        // Image candidate syntax per current whatwg live spec, 2012-09-23:
                        // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-srcset
                        $candidates[] = "{$url} {$density}x";
index 489a83a..2da368c 100644 (file)
@@ -232,7 +232,7 @@ class MWHttpRequest {
                } else {
                        $this->timeout = $wgHTTPTimeout;
                }
-               if( isset( $options['userAgent'] ) ) {
+               if ( isset( $options['userAgent'] ) ) {
                        $this->setUserAgent( $options['userAgent'] );
                }
 
@@ -280,7 +280,7 @@ class MWHttpRequest {
                                ' Http::$httpEngine is set to "curl"' );
                }
 
-               switch( Http::$httpEngine ) {
+               switch ( Http::$httpEngine ) {
                        case 'curl':
                                return new CurlHttpRequest( $url, $options );
                        case 'php':
@@ -841,7 +841,7 @@ class PhpHttpRequest extends MWHttpRequest {
                if ( $this->method == 'POST' ) {
                        // Required for HTTP 1.0 POSTs
                        $this->reqHeaders['Content-Length'] = strlen( $this->postData );
-                       if( !isset( $this->reqHeaders['Content-Type'] ) ) {
+                       if ( !isset( $this->reqHeaders['Content-Type'] ) ) {
                                $this->reqHeaders['Content-Type'] = "application/x-www-form-urlencoded";
                        }
                }
index 72b9a52..0a8faa2 100644 (file)
@@ -33,7 +33,7 @@ define( 'RE_IP_BLOCK', RE_IP_ADD . '\/' . RE_IP_PREFIX );
 // An IPv6 address is made up of 8 words (each x0000 to xFFFF).
 // However, the "::" abbreviation can be used on consecutive x0000 words.
 define( 'RE_IPV6_WORD', '([0-9A-Fa-f]{1,4})' );
-define( 'RE_IPV6_PREFIX', '(12[0-8]|1[01][0-9]|[1-9]?\d)');
+define( 'RE_IPV6_PREFIX', '(12[0-8]|1[01][0-9]|[1-9]?\d)' );
 define( 'RE_IPV6_ADD',
        '(?:' . // starts with "::" (including "::")
                ':(?::|(?::' . RE_IPV6_WORD . '){1,7})' .
@@ -392,11 +392,11 @@ class IP {
                static $privateRanges = false;
                if ( !$privateRanges ) {
                        $privateRanges = array(
-                               array( '10.0.0.0',    '10.255.255.255' ),   # RFC 1918 (private)
-                               array( '172.16.0.0',  '172.31.255.255' ),   #     "
-                               array( '192.168.0.0', '192.168.255.255' ),  #     "
-                               array( '0.0.0.0',     '0.255.255.255' ),    # this network
-                               array( '127.0.0.0',   '127.255.255.255' ),  # loopback
+                               array( '10.0.0.0', '10.255.255.255' ), # RFC 1918 (private)
+                               array( '172.16.0.0', '172.31.255.255' ), # RFC 1918 (private)
+                               array( '192.168.0.0', '192.168.255.255' ), # RFC 1918 (private)
+                               array( '0.0.0.0', '0.255.255.255' ), # this network
+                               array( '127.0.0.0', '127.255.255.255' ), # loopback
                        );
                }
 
index 8f8022f..43cf7f6 100644 (file)
@@ -282,11 +282,11 @@ class ImageGallery {
                                $img = false;
                        }
 
-                       if( !$img ) {
+                       if ( !$img ) {
                                # We're dealing with a non-image, spit out the name and be done with it.
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">'
                                        . htmlspecialchars( $nt->getText() ) . '</div>';
-                       } elseif( $this->mHideBadImages && wfIsBadImage( $nt->getDBkey(), $this->getContextTitle() ) ) {
+                       } elseif ( $this->mHideBadImages && wfIsBadImage( $nt->getDBkey(), $this->getContextTitle() ) ) {
                                # The image is blacklisted, just show it as a text link.
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">' .
                                        Linker::link(
@@ -297,7 +297,7 @@ class ImageGallery {
                                                array( 'known', 'noclasses' )
                                        ) .
                                        '</div>';
-                       } elseif( !( $thumb = $img->transform( $params ) ) ) {
+                       } elseif ( !( $thumb = $img->transform( $params ) ) ) {
                                # Error generating thumbnail.
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">'
                                        . htmlspecialchars( $img->getLastError() ) . '</div>';
@@ -334,8 +334,8 @@ class ImageGallery {
                        // $linkTarget = Title::newFromText( $wgContLang->getNsText( MWNamespace::getUser() ) . ":{$ut}" );
                        // $ul = Linker::link( $linkTarget, $ut );
 
-                       if( $this->mShowBytes ) {
-                               if( $img ) {
+                       if ( $this->mShowBytes ) {
+                               if ( $img ) {
                                        $fileSize = htmlspecialchars( $lang->formatSize( $img->getSize() ) );
                                } else {
                                        $fileSize = wfMessage( 'filemissing' )->escaped();
index 5e51878..e687046 100644 (file)
@@ -206,7 +206,7 @@ class ImagePage extends Article {
                }
 
                // Add remote Filepage.css
-               if( !$this->repo->isLocal() ) {
+               if ( !$this->repo->isLocal() ) {
                        $css = $this->repo->getDescriptionStylesheetUrl();
                        if ( $css ) {
                                $out->addStyle( $css );
@@ -597,7 +597,7 @@ EOT
                $descText = $this->mPage->getFile()->getDescriptionText();
 
                /* Add canonical to head if there is no local page for this shared file */
-               if( $descUrl && $this->mPage->getID() == 0 ) {
+               if ( $descUrl && $this->mPage->getID() == 0 ) {
                        $out->setCanonicalUrl( $descUrl );
                }
 
@@ -753,7 +753,7 @@ EOT
 
                // Create links for every element
                $currentCount = 0;
-               foreach( $rows as $element ) {
+               foreach ( $rows as $element ) {
                        $currentCount++;
                        if ( $currentCount > $limit ) {
                                break;
index b9ec6e0..eeec5cd 100644 (file)
@@ -41,12 +41,12 @@ abstract class ImageQueryPage extends QueryPage {
         * @param int $offset Paging offset
         */
        protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
-               if( $num > 0 ) {
+               if ( $num > 0 ) {
                        $gallery = new ImageGallery();
 
                        # $res might contain the whole 1,000 rows, so we read up to
                        # $num [should update this to use a Pager]
-                       for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
+                       for ( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
                                $namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE;
                                $title = Title::makeTitleSafe( $namespace, $row->title );
                                if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {
index 0e12e6d..bf5a3fb 100644 (file)
@@ -66,7 +66,7 @@ class WikiImporter {
        }
 
        private function debug( $data ) {
-               if( $this->mDebug ) {
+               if ( $this->mDebug ) {
                        wfDebug( "IMPORT: $data\n" );
                }
        }
@@ -188,10 +188,10 @@ class WikiImporter {
         * @return bool
         */
        public function setTargetNamespace( $namespace ) {
-               if( is_null( $namespace ) ) {
+               if ( is_null( $namespace ) ) {
                        // Don't override namespaces
                        $this->mTargetNamespace = null;
-               } elseif( $namespace >= 0 ) {
+               } elseif ( $namespace >= 0 ) {
                        // @todo FIXME: Check for validity
                        $this->mTargetNamespace = intval( $namespace );
                } else {
@@ -206,16 +206,16 @@ class WikiImporter {
         */
        public function setTargetRootPage( $rootpage ) {
                $status = Status::newGood();
-               if( is_null( $rootpage ) ) {
+               if ( is_null( $rootpage ) ) {
                        // No rootpage
                        $this->mTargetRootPage = null;
-               } elseif( $rootpage !== '' ) {
+               } elseif ( $rootpage !== '' ) {
                        $rootpage = rtrim( $rootpage, '/' ); //avoid double slashes
                        $title = Title::newFromText( $rootpage, !is_null( $this->mTargetNamespace ) ? $this->mTargetNamespace : NS_MAIN );
-                       if( !$title || $title->isExternal() ) {
+                       if ( !$title || $title->isExternal() ) {
                                $status->fatal( 'import-rootpage-invalid' );
                        } else {
-                               if( !MWNamespace::hasSubpages( $title->getNamespace() ) ) {
+                               if ( !MWNamespace::hasSubpages( $title->getNamespace() ) ) {
                                        global $wgContLang;
 
                                        $displayNSText = $title->getNamespace() == NS_MAIN
@@ -304,7 +304,7 @@ class WikiImporter {
         */
        public function debugRevisionHandler( &$revision ) {
                $this->debug( "Got revision:" );
-               if( is_object( $revision->title ) ) {
+               if ( is_object( $revision->title ) ) {
                        $this->debug( "-- Title: " . $revision->title->getPrefixedText() );
                } else {
                        $this->debug( "-- Title: <invalid>" );
@@ -320,7 +320,7 @@ class WikiImporter {
         * @param $title Title
         */
        function pageCallback( $title ) {
-               if( isset( $this->mPageCallback ) ) {
+               if ( isset( $this->mPageCallback ) ) {
                        call_user_func( $this->mPageCallback, $title );
                }
        }
@@ -334,7 +334,7 @@ class WikiImporter {
         * @param array $pageInfo associative array of page information
         */
        private function pageOutCallback( $title, $origTitle, $revCount, $sucCount, $pageInfo ) {
-               if( isset( $this->mPageOutCallback ) ) {
+               if ( isset( $this->mPageOutCallback ) ) {
                        $args = func_get_args();
                        call_user_func_array( $this->mPageOutCallback, $args );
                }
@@ -376,12 +376,12 @@ class WikiImporter {
         * @access private
         */
        private function nodeContents() {
-               if( $this->reader->isEmptyElement ) {
+               if ( $this->reader->isEmptyElement ) {
                        return "";
                }
                $buffer = "";
-               while( $this->reader->read() ) {
-                       switch( $this->reader->nodeType ) {
+               while ( $this->reader->read() ) {
+                       switch ( $this->reader->nodeType ) {
                        case XmlReader::TEXT:
                        case XmlReader::SIGNIFICANT_WHITESPACE:
                                $buffer .= $this->reader->value;
@@ -420,11 +420,11 @@ class WikiImporter {
                                "END_ELEMENT",
                                "END_ENTITY",
                                "XML_DECLARATION",
-                               );
+                       );
                        $lookup = array();
 
-                       foreach( $xmlReaderConstants as $name ) {
-                               $lookup[constant("XmlReader::$name")] = $name;
+                       foreach ( $xmlReaderConstants as $name ) {
+                               $lookup[constant( "XmlReader::$name" )] = $name;
                        }
                }
 
@@ -666,7 +666,7 @@ class WikiImporter {
        private function processRevision( $pageInfo, $revisionInfo ) {
                $revision = new WikiRevision;
 
-               if( isset( $revisionInfo['id'] ) ) {
+               if ( isset( $revisionInfo['id'] ) ) {
                        $revision->setID( $revisionInfo['id'] );
                }
                if ( isset( $revisionInfo['text'] ) ) {
@@ -840,33 +840,33 @@ class WikiImporter {
                $workTitle = $text;
                $origTitle = Title::newFromText( $workTitle );
 
-               if( !is_null( $this->mTargetNamespace ) && !is_null( $origTitle ) ) {
+               if ( !is_null( $this->mTargetNamespace ) && !is_null( $origTitle ) ) {
                        # makeTitleSafe, because $origTitle can have a interwiki (different setting of interwiki map)
                        # and than dbKey can begin with a lowercase char
                        $title = Title::makeTitleSafe( $this->mTargetNamespace,
                                $origTitle->getDBkey() );
                } else {
-                       if( !is_null( $this->mTargetRootPage ) ) {
+                       if ( !is_null( $this->mTargetRootPage ) ) {
                                $workTitle = $this->mTargetRootPage . '/' . $workTitle;
                        }
                        $title = Title::newFromText( $workTitle );
                }
 
-               if( is_null( $title ) ) {
+               if ( is_null( $title ) ) {
                        # Invalid page title? Ignore the page
                        $this->notice( 'import-error-invalid', $workTitle );
                        return false;
-               } elseif( $title->isExternal() ) {
+               } elseif ( $title->isExternal() ) {
                        $this->notice( 'import-error-interwiki', $title->getPrefixedText() );
                        return false;
-               } elseif( !$title->canExist() ) {
+               } elseif ( !$title->canExist() ) {
                        $this->notice( 'import-error-special', $title->getPrefixedText() );
                        return false;
-               } elseif( !$title->userCan( 'edit' ) && !$wgCommandLineMode ) {
+               } elseif ( !$title->userCan( 'edit' ) && !$wgCommandLineMode ) {
                        # Do not import if the importing wiki user cannot edit this page
                        $this->notice( 'import-error-edit', $title->getPrefixedText() );
                        return false;
-               } elseif( !$title->exists() && !$title->userCan( 'create' ) && !$wgCommandLineMode ) {
+               } elseif ( !$title->exists() && !$title->userCan( 'create' ) && !$wgCommandLineMode ) {
                        # Do not import if the importing wiki user cannot create this page
                        $this->notice( 'import-error-create', $title->getPrefixedText() );
                        return false;
@@ -997,12 +997,12 @@ class XMLReader2 extends XMLReader {
         * @return bool|string
         */
        function nodeContents() {
-               if( $this->isEmptyElement ) {
+               if ( $this->isEmptyElement ) {
                        return "";
                }
                $buffer = "";
-               while( $this->read() ) {
-                       switch( $this->nodeType ) {
+               while ( $this->read() ) {
+                       switch ( $this->nodeType ) {
                        case XmlReader::TEXT:
                        case XmlReader::SIGNIFICANT_WHITESPACE:
                                $buffer .= $this->value;
@@ -1051,9 +1051,9 @@ class WikiRevision {
         * @throws MWException
         */
        function setTitle( $title ) {
-               if( is_object( $title ) ) {
+               if ( is_object( $title ) ) {
                        $this->title = $title;
-               } elseif( is_null( $title ) ) {
+               } elseif ( is_null( $title ) ) {
                        throw new MWException( "WikiRevision given a null title in import. You may need to adjust \$wgLegalTitleChars." );
                } else {
                        throw new MWException( "WikiRevision given non-object title in import." );
@@ -1369,7 +1369,7 @@ class WikiRevision {
 
                # Sneak a single revision into place
                $user = User::newFromName( $this->getUser() );
-               if( $user ) {
+               if ( $user ) {
                        $userId = intval( $user->getId() );
                        $userText = $user->getName();
                        $userObj = $user;
@@ -1384,7 +1384,7 @@ class WikiRevision {
                $linkCache->clear();
 
                $page = WikiPage::factory( $this->title );
-               if( !$page->exists() ) {
+               if ( !$page->exists() ) {
                        # must create the page...
                        $pageId = $page->insertOn( $dbw );
                        $created = true;
@@ -1400,7 +1400,7 @@ class WikiRevision {
                                        'rev_comment' => $this->getComment() ),
                                __METHOD__
                        );
-                       if( $prior ) {
+                       if ( $prior ) {
                                // @todo FIXME: This could fail slightly for multiple matches :P
                                wfDebug( __METHOD__ . ": skipping existing revision for [[" .
                                        $this->title->getPrefixedText() . "]], timestamp " . $this->timestamp . "\n" );
@@ -1440,7 +1440,7 @@ class WikiRevision {
        function importLogItem() {
                $dbw = wfGetDB( DB_MASTER );
                # @todo FIXME: This will not record autoblocks
-               if( !$this->getTitle() ) {
+               if ( !$this->getTitle() ) {
                        wfDebug( __METHOD__ . ": skipping invalid {$this->type}/{$this->action} log time, timestamp " .
                                $this->timestamp . "\n" );
                        return;
@@ -1459,7 +1459,7 @@ class WikiRevision {
                        __METHOD__
                );
                // @todo FIXME: This could fail slightly for multiple matches :P
-               if( $prior ) {
+               if ( $prior ) {
                        wfDebug( __METHOD__ . ": skipping existing item for Log:{$this->type}/{$this->action}, timestamp " .
                                $this->timestamp . "\n" );
                        return;
@@ -1500,7 +1500,7 @@ class WikiRevision {
                                wfDebug( __METHOD__ . "File already exists; importing as $archiveName\n" );
                        }
                }
-               if( !$file ) {
+               if ( !$file ) {
                        wfDebug( __METHOD__ . ': Bad file for ' . $this->getTitle() . "\n" );
                        return false;
                }
@@ -1512,7 +1512,7 @@ class WikiRevision {
                        $source = $this->downloadSource();
                        $flags |= File::DELETE_SOURCE;
                }
-               if( !$source ) {
+               if ( !$source ) {
                        wfDebug( __METHOD__ . ": Could not fetch remote file.\n" );
                        return false;
                }
@@ -1551,13 +1551,13 @@ class WikiRevision {
         */
        function downloadSource() {
                global $wgEnableUploads;
-               if( !$wgEnableUploads ) {
+               if ( !$wgEnableUploads ) {
                        return false;
                }
 
                $tempo = tempnam( wfTempDir(), 'download' );
                $f = fopen( $tempo, 'wb' );
-               if( !$f ) {
+               if ( !$f ) {
                        wfDebug( "IMPORT: couldn't write to temp file $tempo\n" );
                        return false;
                }
@@ -1565,7 +1565,7 @@ class WikiRevision {
                // @todo FIXME!
                $src = $this->getSrc();
                $data = Http::get( $src );
-               if( !$data ) {
+               if ( !$data ) {
                        wfDebug( "IMPORT: couldn't fetch source $src\n" );
                        fclose( $f );
                        unlink( $tempo );
@@ -1601,7 +1601,7 @@ class ImportStringSource {
         * @return bool|string
         */
        function readChunk() {
-               if( $this->atEnd() ) {
+               if ( $this->atEnd() ) {
                        return false;
                }
                $this->mRead = true;
@@ -1640,7 +1640,7 @@ class ImportStreamSource {
                wfSuppressWarnings();
                $file = fopen( $filename, 'rt' );
                wfRestoreWarnings();
-               if( !$file ) {
+               if ( !$file ) {
                        return Status::newFatal( "importcantopen" );
                }
                return Status::newGood( new ImportStreamSource( $file ) );
@@ -1653,11 +1653,11 @@ class ImportStreamSource {
        static function newFromUpload( $fieldname = "xmlimport" ) {
                $upload =& $_FILES[$fieldname];
 
-               if( $upload === null || !$upload['name'] ) {
+               if ( $upload === null || !$upload['name'] ) {
                        return Status::newFatal( 'importnofile' );
                }
-               if( !empty( $upload['error'] ) ) {
-                       switch( $upload['error'] ) {
+               if ( !empty( $upload['error'] ) ) {
+                       switch ( $upload['error'] ) {
                                case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini.
                                        return Status::newFatal( 'importuploaderrorsize' );
                                case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
@@ -1671,7 +1671,7 @@ class ImportStreamSource {
 
                }
                $fname = $upload['tmp_name'];
-               if( is_uploaded_file( $fname ) ) {
+               if ( is_uploaded_file( $fname ) ) {
                        return ImportStreamSource::newFromFile( $fname );
                } else {
                        return Status::newFatal( 'importnofile' );
@@ -1690,7 +1690,7 @@ class ImportStreamSource {
                # otherwise prevent importing from large sites, such
                # as the Wikimedia cluster, etc.
                $data = Http::request( $method, $url, array( 'followRedirects' => true ) );
-               if( $data !== false ) {
+               if ( $data !== false ) {
                        $file = tmpfile();
                        fwrite( $file, $data );
                        fflush( $file );
@@ -1710,17 +1710,23 @@ class ImportStreamSource {
         * @return Status
         */
        public static function newFromInterwiki( $interwiki, $page, $history = false, $templates = false, $pageLinkDepth = 0 ) {
-               if( $page == '' ) {
+               if ( $page == '' ) {
                        return Status::newFatal( 'import-noarticle' );
                }
                $link = Title::newFromText( "$interwiki:Special:Export/$page" );
-               if( is_null( $link ) || $link->getInterwiki() == '' ) {
+               if ( is_null( $link ) || $link->getInterwiki() == '' ) {
                        return Status::newFatal( 'importbadinterwiki' );
                } else {
                        $params = array();
-                       if ( $history ) $params['history'] = 1;
-                       if ( $templates ) $params['templates'] = 1;
-                       if ( $pageLinkDepth ) $params['pagelink-depth'] = $pageLinkDepth;
+                       if ( $history ) {
+                               $params['history'] = 1;
+                       }
+                       if ( $templates ) {
+                               $params['templates'] = 1;
+                       }
+                       if ( $pageLinkDepth ) {
+                               $params['pagelink-depth'] = $pageLinkDepth;
+                       }
                        $url = $link->getFullURL( $params );
                        # For interwikis, use POST to avoid redirects.
                        return ImportStreamSource::newFromURL( $url, "POST" );
index e8aee0b..6c582aa 100644 (file)
@@ -105,7 +105,7 @@ class Licenses extends HTMLFormField {
        protected function stackItem( &$list, $path, $item ) {
                $position =& $list;
                if ( $path ) {
-                       foreach( $path as $key ) {
+                       foreach ( $path as $key ) {
                                $position =& $position[$key];
                        }
                }
index 11b6559..d552c69 100644 (file)
@@ -152,11 +152,11 @@ class LinkFilter {
         * @return array filtered array
         */
        public static function keepOneWildcard( $arr ) {
-               if( !is_array( $arr ) ) {
+               if ( !is_array( $arr ) ) {
                        return $arr;
                }
 
-               foreach( $arr as $key => $value ) {
+               foreach ( $arr as $key => $value ) {
                        if ( $value instanceof LikeMatch ) {
                                return array_slice( $arr, 0, $key + 1 );
                        }
index 3e8a3c9..5e4675a 100644 (file)
@@ -199,7 +199,7 @@ class Linker {
                        return "<!-- ERROR -->$html";
                }
 
-               if( is_string( $query ) ) {
+               if ( is_string( $query ) ) {
                        // some functions withing core using this still hand over query strings
                        wfDeprecated( __METHOD__ . ' with parameter $query as string (should be array)', '1.20' );
                        $query = wfCgiToArray( $query );
@@ -644,7 +644,7 @@ class Linker {
                        # If a thumbnail width has not been provided, it is set
                        # to the default user option as specified in Language*.php
                        if ( $fp['align'] == '' ) {
-                               if( $parser instanceof Parser ) {
+                               if ( $parser instanceof Parser ) {
                                        $fp['align'] = $parser->getTargetLanguage()->alignEnd();
                                } else {
                                        # backwards compatibility, remove with makeImageLink2()
@@ -786,10 +786,18 @@ class Linker {
                $hp =& $handlerParams;
 
                $page = isset( $hp['page'] ) ? $hp['page'] : false;
-               if ( !isset( $fp['align'] ) ) $fp['align'] = 'right';
-               if ( !isset( $fp['alt'] ) ) $fp['alt'] = '';
-               if ( !isset( $fp['title'] ) ) $fp['title'] = '';
-               if ( !isset( $fp['caption'] ) ) $fp['caption'] = '';
+               if ( !isset( $fp['align'] ) ) {
+                       $fp['align'] = 'right';
+               }
+               if ( !isset( $fp['alt'] ) ) {
+                       $fp['alt'] = '';
+               }
+               if ( !isset( $fp['title'] ) ) {
+                       $fp['title'] = '';
+               }
+               if ( !isset( $fp['caption'] ) ) {
+                       $fp['caption'] = '';
+               }
 
                if ( empty( $hp['width'] ) ) {
                        // Reduce width for upright images when parameter 'upright' is used
@@ -970,12 +978,13 @@ class Linker {
        protected static function getUploadUrl( $destFile, $query = '' ) {
                global $wgUploadMissingFileUrl, $wgUploadNavigationUrl;
                $q = 'wpDestFile=' . $destFile->getPartialURL();
-               if ( $query != '' )
+               if ( $query != '' ) {
                        $q .= '&' . $query;
+               }
 
                if ( $wgUploadMissingFileUrl ) {
                        return wfAppendQuery( $wgUploadMissingFileUrl, $q );
-               } elseif( $wgUploadNavigationUrl ) {
+               } elseif ( $wgUploadNavigationUrl ) {
                        return wfAppendQuery( $wgUploadNavigationUrl, $q );
                } else {
                        $upload = SpecialPage::getTitleFor( 'Upload' );
@@ -1450,8 +1459,9 @@ class Linker {
                                $trail = "";
                        }
                        $linkRegexp = '/\[\[(.*?)\]\]' . preg_quote( $trail, '/' ) . '/';
-                       if ( isset( $match[1][0] ) && $match[1][0] == ':' )
+                       if ( isset( $match[1][0] ) && $match[1][0] == ':' ) {
                                $match[1] = substr( $match[1], 1 );
+                       }
                        list( $inside, $trail ) = self::splitTrail( $trail );
 
                        $linkText = $text;
@@ -1695,13 +1705,14 @@ class Linker {
                $toc = '';
                $lastLevel = 0;
                foreach ( $tree as $section ) {
-                       if ( $section['toclevel'] > $lastLevel )
+                       if ( $section['toclevel'] > $lastLevel ) {
                                $toc .= self::tocIndent();
-                       elseif ( $section['toclevel'] < $lastLevel )
+                       } elseif ( $section['toclevel'] < $lastLevel ) {
                                $toc .= self::tocUnindent(
                                        $lastLevel - $section['toclevel'] );
-                       else
+                       } else {
                                $toc .= self::tocLineEnd();
+                       }
 
                        $toc .= self::tocLine( $section['anchor'],
                                $section['line'], $section['number'],
@@ -1895,21 +1906,21 @@ class Linker {
                }
 
                $disableRollbackEditCount = false;
-               if( $wgMiserMode ) {
-                       foreach( $disableRollbackEditCountSpecialPage as $specialPage ) {
-                               if( $context->getTitle()->isSpecial( $specialPage ) ) {
+               if ( $wgMiserMode ) {
+                       foreach ( $disableRollbackEditCountSpecialPage as $specialPage ) {
+                               if ( $context->getTitle()->isSpecial( $specialPage ) ) {
                                        $disableRollbackEditCount = true;
                                        break;
                                }
                        }
                }
 
-               if( !$disableRollbackEditCount && is_int( $wgShowRollbackEditCount ) && $wgShowRollbackEditCount > 0 ) {
+               if ( !$disableRollbackEditCount && is_int( $wgShowRollbackEditCount ) && $wgShowRollbackEditCount > 0 ) {
                        if ( !is_numeric( $editCount ) ) {
                                $editCount = self::getRollbackEditCount( $rev, false );
                        }
 
-                       if( $editCount > $wgShowRollbackEditCount ) {
+                       if ( $editCount > $wgShowRollbackEditCount ) {
                                $editCount_output = $context->msg( 'rollbacklinkcount-morethan' )->numParams( $wgShowRollbackEditCount )->parse();
                        } else {
                                $editCount_output = $context->msg( 'rollbacklinkcount' )->numParams( $editCount )->parse();
index f54487a..8c6d762 100644 (file)
@@ -354,7 +354,7 @@ class LinksUpdate extends SqlDataUpdate {
         */
        private function getLinkInsertions( $existing = array() ) {
                $arr = array();
-               foreach( $this->mLinks as $ns => $dbkeys ) {
+               foreach ( $this->mLinks as $ns => $dbkeys ) {
                        $diffs = isset( $existing[$ns] )
                                ? array_diff_key( $dbkeys, $existing[$ns] )
                                : $dbkeys;
@@ -376,7 +376,7 @@ class LinksUpdate extends SqlDataUpdate {
         */
        private function getTemplateInsertions( $existing = array() ) {
                $arr = array();
-               foreach( $this->mTemplates as $ns => $dbkeys ) {
+               foreach ( $this->mTemplates as $ns => $dbkeys ) {
                        $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
                        foreach ( $diffs as $dbk => $id ) {
                                $arr[] = array(
@@ -398,7 +398,7 @@ class LinksUpdate extends SqlDataUpdate {
        private function getImageInsertions( $existing = array() ) {
                $arr = array();
                $diffs = array_diff_key( $this->mImages, $existing );
-               foreach( $diffs as $iname => $dummy ) {
+               foreach ( $diffs as $iname => $dummy ) {
                        $arr[] = array(
                                'il_from' => $this->mId,
                                'il_to' => $iname
@@ -415,8 +415,8 @@ class LinksUpdate extends SqlDataUpdate {
        private function getExternalInsertions( $existing = array() ) {
                $arr = array();
                $diffs = array_diff_key( $this->mExternals, $existing );
-               foreach( $diffs as $url => $dummy ) {
-                       foreach( wfMakeUrlIndexes( $url ) as $index ) {
+               foreach ( $diffs as $url => $dummy ) {
+                       foreach ( wfMakeUrlIndexes( $url ) as $index ) {
                                $arr[] = array(
                                        'el_from' => $this->mId,
                                        'el_to' => $url,
@@ -481,7 +481,7 @@ class LinksUpdate extends SqlDataUpdate {
        private function getInterlangInsertions( $existing = array() ) {
                $diffs = array_diff_assoc( $this->mInterlangs, $existing );
                $arr = array();
-               foreach( $diffs as $lang => $title ) {
+               foreach ( $diffs as $lang => $title ) {
                        $arr[] = array(
                                'll_from' => $this->mId,
                                'll_lang' => $lang,
@@ -517,7 +517,7 @@ class LinksUpdate extends SqlDataUpdate {
         */
        private function getInterwikiInsertions( $existing = array() ) {
                $arr = array();
-               foreach( $this->mInterwikis as $prefix => $dbkeys ) {
+               foreach ( $this->mInterwikis as $prefix => $dbkeys ) {
                        $diffs = isset( $existing[$prefix] ) ? array_diff_key( $dbkeys, $existing[$prefix] ) : $dbkeys;
                        foreach ( $diffs as $dbk => $id ) {
                                $arr[] = array(
diff --git a/includes/MWCryptRand.php b/includes/MWCryptRand.php
new file mode 100644 (file)
index 0000000..bac018e
--- /dev/null
@@ -0,0 +1,497 @@
+<?php
+/**
+ * A cryptographic random generator class used for generating secret keys
+ *
+ * This is based in part on Drupal code as well as what we used in our own code
+ * prior to introduction of this class.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @author Daniel Friesen
+ * @file
+ */
+
+class MWCryptRand {
+
+       /**
+        * Minimum number of iterations we want to make in our drift calculations.
+        */
+       const MIN_ITERATIONS = 1000;
+
+       /**
+        * Number of milliseconds we want to spend generating each separate byte
+        * of the final generated bytes.
+        * This is used in combination with the hash length to determine the duration
+        * we should spend doing drift calculations.
+        */
+       const MSEC_PER_BYTE = 0.5;
+
+       /**
+        * Singleton instance for public use
+        */
+       protected static $singleton = null;
+
+       /**
+        * The hash algorithm being used
+        */
+       protected $algo = null;
+
+       /**
+        * The number of bytes outputted by the hash algorithm
+        */
+       protected $hashLength = null;
+
+       /**
+        * A boolean indicating whether the previous random generation was done using
+        * cryptographically strong random number generator or not.
+        */
+       protected $strong = null;
+
+       /**
+        * Initialize an initial random state based off of whatever we can find
+        */
+       protected function initialRandomState() {
+               // $_SERVER contains a variety of unstable user and system specific information
+               // It'll vary a little with each page, and vary even more with separate users
+               // It'll also vary slightly across different machines
+               $state = serialize( $_SERVER );
+
+               // To try vary the system information of the state a bit more
+               // by including the system's hostname into the state
+               $state .= wfHostname();
+
+               // Try to gather a little entropy from the different php rand sources
+               $state .= rand() . uniqid( mt_rand(), true );
+
+               // Include some information about the filesystem's current state in the random state
+               $files = array();
+
+               // We know this file is here so grab some info about ourselves
+               $files[] = __FILE__;
+
+               // We must also have a parent folder, and with the usual file structure, a grandparent
+               $files[] = __DIR__;
+               $files[] = dirname( __DIR__ );
+
+               // The config file is likely the most often edited file we know should be around
+               // so include its stat info into the state.
+               // The constant with its location will almost always be defined, as WebStart.php defines
+               // MW_CONFIG_FILE to $IP/LocalSettings.php unless being configured with MW_CONFIG_CALLBACK (eg. the installer)
+               if ( defined( 'MW_CONFIG_FILE' ) ) {
+                       $files[] = MW_CONFIG_FILE;
+               }
+
+               foreach ( $files as $file ) {
+                       wfSuppressWarnings();
+                       $stat = stat( $file );
+                       wfRestoreWarnings();
+                       if ( $stat ) {
+                               // stat() duplicates data into numeric and string keys so kill off all the numeric ones
+                               foreach ( $stat as $k => $v ) {
+                                       if ( is_numeric( $k ) ) {
+                                               unset( $k );
+                                       }
+                               }
+                               // The absolute filename itself will differ from install to install so don't leave it out
+                               if ( ( $path = realpath( $file ) ) !== false ) {
+                                       $state .= $path;
+                               } else {
+                                       $state .= $file;
+                               }
+                               $state .= implode( '', $stat );
+                       } else {
+                               // The fact that the file isn't there is worth at least a
+                               // minuscule amount of entropy.
+                               $state .= '0';
+                       }
+               }
+
+               // Try and make this a little more unstable by including the varying process
+               // id of the php process we are running inside of if we are able to access it
+               if ( function_exists( 'getmypid' ) ) {
+                       $state .= getmypid();
+               }
+
+               // If available try to increase the instability of the data by throwing in
+               // the precise amount of memory that we happen to be using at the moment.
+               if ( function_exists( 'memory_get_usage' ) ) {
+                       $state .= memory_get_usage( true );
+               }
+
+               // It's mostly worthless but throw the wiki's id into the data for a little more variance
+               $state .= wfWikiID();
+
+               // If we have a secret key or proxy key set then throw it into the state as well
+               global $wgSecretKey, $wgProxyKey;
+               if ( $wgSecretKey ) {
+                       $state .= $wgSecretKey;
+               } elseif ( $wgProxyKey ) {
+                       $state .= $wgProxyKey;
+               }
+
+               return $state;
+       }
+
+       /**
+        * Randomly hash data while mixing in clock drift data for randomness
+        *
+        * @param string $data The data to randomly hash.
+        * @return String The hashed bytes
+        * @author Tim Starling
+        */
+       protected function driftHash( $data ) {
+               // Minimum number of iterations (to avoid slow operations causing the loop to gather little entropy)
+               $minIterations = self::MIN_ITERATIONS;
+               // Duration of time to spend doing calculations (in seconds)
+               $duration = ( self::MSEC_PER_BYTE / 1000 ) * $this->hashLength();
+               // Create a buffer to use to trigger memory operations
+               $bufLength = 10000000;
+               $buffer = str_repeat( ' ', $bufLength );
+               $bufPos = 0;
+
+               // Iterate for $duration seconds or at least $minIterations number of iterations
+               $iterations = 0;
+               $startTime = microtime( true );
+               $currentTime = $startTime;
+               while ( $iterations < $minIterations || $currentTime - $startTime < $duration ) {
+                       // Trigger some memory writing to trigger some bus activity
+                       // This may create variance in the time between iterations
+                       $bufPos = ( $bufPos + 13 ) % $bufLength;
+                       $buffer[$bufPos] = ' ';
+                       // Add the drift between this iteration and the last in as entropy
+                       $nextTime = microtime( true );
+                       $delta = (int)( ( $nextTime - $currentTime ) * 1000000 );
+                       $data .= $delta;
+                       // Every 100 iterations hash the data and entropy
+                       if ( $iterations % 100 === 0 ) {
+                               $data = sha1( $data );
+                       }
+                       $currentTime = $nextTime;
+                       $iterations++;
+               }
+               $timeTaken = $currentTime - $startTime;
+               $data = $this->hash( $data );
+
+               wfDebug( __METHOD__ . ": Clock drift calculation " .
+                       "(time-taken=" . ( $timeTaken * 1000 ) . "ms, " .
+                       "iterations=$iterations, " .
+                       "time-per-iteration=" . ( $timeTaken / $iterations * 1e6 ) . "us)\n" );
+               return $data;
+       }
+
+       /**
+        * Return a rolling random state initially build using data from unstable sources
+        * @return string A new weak random state
+        */
+       protected function randomState() {
+               static $state = null;
+               if ( is_null( $state ) ) {
+                       // Initialize the state with whatever unstable data we can find
+                       // It's important that this data is hashed right afterwards to prevent
+                       // it from being leaked into the output stream
+                       $state = $this->hash( $this->initialRandomState() );
+               }
+               // Generate a new random state based on the initial random state or previous
+               // random state by combining it with clock drift
+               $state = $this->driftHash( $state );
+               return $state;
+       }
+
+       /**
+        * Decide on the best acceptable hash algorithm we have available for hash()
+        * @throws MWException
+        * @return String A hash algorithm
+        */
+       protected function hashAlgo() {
+               if ( !is_null( $this->algo ) ) {
+                       return $this->algo;
+               }
+
+               $algos = hash_algos();
+               $preference = array( 'whirlpool', 'sha256', 'sha1', 'md5' );
+
+               foreach ( $preference as $algorithm ) {
+                       if ( in_array( $algorithm, $algos ) ) {
+                               $this->algo = $algorithm;
+                               wfDebug( __METHOD__ . ": Using the {$this->algo} hash algorithm.\n" );
+                               return $this->algo;
+                       }
+               }
+
+               // We only reach here if no acceptable hash is found in the list, this should
+               // be a technical impossibility since most of php's hash list is fixed and
+               // some of the ones we list are available as their own native functions
+               // But since we already require at least 5.2 and hash() was default in
+               // 5.1.2 we don't bother falling back to methods like sha1 and md5.
+               throw new MWException( "Could not find an acceptable hashing function in hash_algos()" );
+       }
+
+       /**
+        * Return the byte-length output of the hash algorithm we are
+        * using in self::hash and self::hmac.
+        *
+        * @return int Number of bytes the hash outputs
+        */
+       protected function hashLength() {
+               if ( is_null( $this->hashLength ) ) {
+                       $this->hashLength = strlen( $this->hash( '' ) );
+               }
+               return $this->hashLength;
+       }
+
+       /**
+        * Generate an acceptably unstable one-way-hash of some text
+        * making use of the best hash algorithm that we have available.
+        *
+        * @param $data string
+        * @return String A raw hash of the data
+        */
+       protected function hash( $data ) {
+               return hash( $this->hashAlgo(), $data, true );
+       }
+
+       /**
+        * Generate an acceptably unstable one-way-hmac of some text
+        * making use of the best hash algorithm that we have available.
+        *
+        * @param $data string
+        * @param $key string
+        * @return String A raw hash of the data
+        */
+       protected function hmac( $data, $key ) {
+               return hash_hmac( $this->hashAlgo(), $data, $key, true );
+       }
+
+       /**
+        * @see self::wasStrong()
+        */
+       public function realWasStrong() {
+               if ( is_null( $this->strong ) ) {
+                       throw new MWException( __METHOD__ . ' called before generation of random data' );
+               }
+               return $this->strong;
+       }
+
+       /**
+        * @see self::generate()
+        */
+       public function realGenerate( $bytes, $forceStrong = false ) {
+               wfProfileIn( __METHOD__ );
+
+               wfDebug( __METHOD__ . ": Generating cryptographic random bytes for " . wfGetAllCallers( 5 ) . "\n" );
+
+               $bytes = floor( $bytes );
+               static $buffer = '';
+               if ( is_null( $this->strong ) ) {
+                       // Set strength to false initially until we know what source data is coming from
+                       $this->strong = true;
+               }
+
+               if ( strlen( $buffer ) < $bytes ) {
+                       // If available make use of mcrypt_create_iv URANDOM source to generate randomness
+                       // On unix-like systems this reads from /dev/urandom but does it without any buffering
+                       // and bypasses openbasedir restrictions, so it's preferable to reading directly
+                       // On Windows starting in PHP 5.3.0 Windows' native CryptGenRandom is used to generate
+                       // entropy so this is also preferable to just trying to read urandom because it may work
+                       // on Windows systems as well.
+                       if ( function_exists( 'mcrypt_create_iv' ) ) {
+                               wfProfileIn( __METHOD__ . '-mcrypt' );
+                               $rem = $bytes - strlen( $buffer );
+                               $iv = mcrypt_create_iv( $rem, MCRYPT_DEV_URANDOM );
+                               if ( $iv === false ) {
+                                       wfDebug( __METHOD__ . ": mcrypt_create_iv returned false.\n" );
+                               } else {
+                                       $buffer .= $iv;
+                                       wfDebug( __METHOD__ . ": mcrypt_create_iv generated " . strlen( $iv ) . " bytes of randomness.\n" );
+                               }
+                               wfProfileOut( __METHOD__ . '-mcrypt' );
+                       }
+               }
+
+               if ( strlen( $buffer ) < $bytes ) {
+                       // If available make use of openssl's random_pseudo_bytes method to attempt to generate randomness.
+                       // However don't do this on Windows with PHP < 5.3.4 due to a bug:
+                       // http://stackoverflow.com/questions/1940168/openssl-random-pseudo-bytes-is-slow-php
+                       // http://git.php.net/?p=php-src.git;a=commitdiff;h=cd62a70863c261b07f6dadedad9464f7e213cad5
+                       if ( function_exists( 'openssl_random_pseudo_bytes' )
+                               && ( !wfIsWindows() || version_compare( PHP_VERSION, '5.3.4', '>=' ) )
+                       ) {
+                               wfProfileIn( __METHOD__ . '-openssl' );
+                               $rem = $bytes - strlen( $buffer );
+                               $openssl_bytes = openssl_random_pseudo_bytes( $rem, $openssl_strong );
+                               if ( $openssl_bytes === false ) {
+                                       wfDebug( __METHOD__ . ": openssl_random_pseudo_bytes returned false.\n" );
+                               } else {
+                                       $buffer .= $openssl_bytes;
+                                       wfDebug( __METHOD__ . ": openssl_random_pseudo_bytes generated " . strlen( $openssl_bytes ) . " bytes of " . ( $openssl_strong ? "strong" : "weak" ) . " randomness.\n" );
+                               }
+                               if ( strlen( $buffer ) >= $bytes ) {
+                                       // openssl tells us if the random source was strong, if some of our data was generated
+                                       // using it use it's say on whether the randomness is strong
+                                       $this->strong = !!$openssl_strong;
+                               }
+                               wfProfileOut( __METHOD__ . '-openssl' );
+                       }
+               }
+
+               // Only read from urandom if we can control the buffer size or were passed forceStrong
+               if ( strlen( $buffer ) < $bytes && ( function_exists( 'stream_set_read_buffer' ) || $forceStrong ) ) {
+                       wfProfileIn( __METHOD__ . '-fopen-urandom' );
+                       $rem = $bytes - strlen( $buffer );
+                       if ( !function_exists( 'stream_set_read_buffer' ) && $forceStrong ) {
+                               wfDebug( __METHOD__ . ": Was forced to read from /dev/urandom without control over the buffer size.\n" );
+                       }
+                       // /dev/urandom is generally considered the best possible commonly
+                       // available random source, and is available on most *nix systems.
+                       wfSuppressWarnings();
+                       $urandom = fopen( "/dev/urandom", "rb" );
+                       wfRestoreWarnings();
+
+                       // Attempt to read all our random data from urandom
+                       // php's fread always does buffered reads based on the stream's chunk_size
+                       // so in reality it will usually read more than the amount of data we're
+                       // asked for and not storing that risks depleting the system's random pool.
+                       // If stream_set_read_buffer is available set the chunk_size to the amount
+                       // of data we need. Otherwise read 8k, php's default chunk_size.
+                       if ( $urandom ) {
+                               // php's default chunk_size is 8k
+                               $chunk_size = 1024 * 8;
+                               if ( function_exists( 'stream_set_read_buffer' ) ) {
+                                       // If possible set the chunk_size to the amount of data we need
+                                       stream_set_read_buffer( $urandom, $rem );
+                                       $chunk_size = $rem;
+                               }
+                               $random_bytes = fread( $urandom, max( $chunk_size, $rem ) );
+                               $buffer .= $random_bytes;
+                               fclose( $urandom );
+                               wfDebug( __METHOD__ . ": /dev/urandom generated " . strlen( $random_bytes ) . " bytes of randomness.\n" );
+                               if ( strlen( $buffer ) >= $bytes ) {
+                                       // urandom is always strong, set to true if all our data was generated using it
+                                       $this->strong = true;
+                               }
+                       } else {
+                               wfDebug( __METHOD__ . ": /dev/urandom could not be opened.\n" );
+                       }
+                       wfProfileOut( __METHOD__ . '-fopen-urandom' );
+               }
+
+               // If we cannot use or generate enough data from a secure source
+               // use this loop to generate a good set of pseudo random data.
+               // This works by initializing a random state using a pile of unstable data
+               // and continually shoving it through a hash along with a variable salt.
+               // 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" );
+               }
+               while ( strlen( $buffer ) < $bytes ) {
+                       wfProfileIn( __METHOD__ . '-fallback' );
+                       $buffer .= $this->hmac( $this->randomState(), mt_rand() );
+                       // This code is never really cryptographically strong, if we use it
+                       // at all, then set strong to false.
+                       $this->strong = false;
+                       wfProfileOut( __METHOD__ . '-fallback' );
+               }
+
+               // Once the buffer has been filled up with enough random data to fulfill
+               // the request shift off enough data to handle the request and leave the
+               // unused portion left inside the buffer for the next request for random data
+               $generated = substr( $buffer, 0, $bytes );
+               $buffer = substr( $buffer, $bytes );
+
+               wfDebug( __METHOD__ . ": " . strlen( $buffer ) . " bytes of randomness leftover in the buffer.\n" );
+
+               wfProfileOut( __METHOD__ );
+               return $generated;
+       }
+
+       /**
+        * @see self::generateHex()
+        */
+       public function realGenerateHex( $chars, $forceStrong = false ) {
+               // hex strings are 2x the length of raw binary so we divide the length in half
+               // odd numbers will result in a .5 that leads the generate() being 1 character
+               // short, so we use ceil() to ensure that we always have enough bytes
+               $bytes = ceil( $chars / 2 );
+               // Generate the data and then convert it to a hex string
+               $hex = bin2hex( $this->generate( $bytes, $forceStrong ) );
+               // A bit of paranoia here, the caller asked for a specific length of string
+               // here, and it's possible (eg when given an odd number) that we may actually
+               // have at least 1 char more than they asked for. Just in case they made this
+               // call intending to insert it into a database that does truncation we don't
+               // want to give them too much and end up with their database and their live
+               // code having two different values because part of what we gave them is truncated
+               // hence, we strip out any run of characters longer than what we were asked for.
+               return substr( $hex, 0, $chars );
+       }
+
+       /** Publicly exposed static methods **/
+
+       /**
+        * Return a singleton instance of MWCryptRand
+        * @return MWCryptRand
+        */
+       protected static function singleton() {
+               if ( is_null( self::$singleton ) ) {
+                       self::$singleton = new self;
+               }
+               return self::$singleton;
+       }
+
+       /**
+        * Return a boolean indicating whether or not the source used for cryptographic
+        * random bytes generation in the previously run generate* call
+        * was cryptographically strong.
+        *
+        * @return bool Returns true if the source was strong, false if not.
+        */
+       public static function wasStrong() {
+               return self::singleton()->realWasStrong();
+       }
+
+       /**
+        * Generate a run of (ideally) cryptographically random data and return
+        * it in raw binary form.
+        * You can use MWCryptRand::wasStrong() if you wish to know if the source used
+        * was cryptographically strong.
+        *
+        * @param int $bytes the number of bytes of random data to generate
+        * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
+        *                          strong sources of entropy even if reading from them may steal
+        *                          more entropy from the system than optimal.
+        * @return String Raw binary random data
+        */
+       public static function generate( $bytes, $forceStrong = false ) {
+               return self::singleton()->realGenerate( $bytes, $forceStrong );
+       }
+
+       /**
+        * Generate a run of (ideally) cryptographically random data and return
+        * it in hexadecimal string format.
+        * You can use MWCryptRand::wasStrong() if you wish to know if the source used
+        * was cryptographically strong.
+        *
+        * @param int $chars the number of hex chars of random data to generate
+        * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
+        *                          strong sources of entropy even if reading from them may steal
+        *                          more entropy from the system than optimal.
+        * @return String Hexadecimal random data
+        */
+       public static function generateHex( $chars, $forceStrong = false ) {
+               return self::singleton()->realGenerateHex( $chars, $forceStrong );
+       }
+
+}
index 240a6d3..3eaa8fe 100644 (file)
@@ -28,7 +28,7 @@ class MWFunction {
         * @throws MWException
         */
        protected static function cleanCallback( $callback ) {
-               if( is_string( $callback ) ) {
+               if ( is_string( $callback ) ) {
                        if ( strpos( $callback, '::' ) !== false ) {
                                // PHP 5.1 cannot use call_user_func( 'Class::Method' )
                                // It can only handle only call_user_func( array( 'Class', 'Method' ) )
@@ -36,7 +36,7 @@ class MWFunction {
                        }
                }
 
-               if( count( $callback ) == 2 && $callback[0] == 'self' || $callback[0] == 'parent' ) {
+               if ( count( $callback ) == 2 && $callback[0] == 'self' || $callback[0] == 'parent' ) {
                        throw new MWException( 'MWFunction cannot call self::method() or parent::method()' );
                }
 
@@ -74,7 +74,7 @@ class MWFunction {
         * @return object
         */
        public static function newObj( $class, $args = array() ) {
-               if( !count( $args ) ) {
+               if ( !count( $args ) ) {
                        return new $class;
                }
 
index 86508ec..f9457c3 100644 (file)
@@ -138,6 +138,8 @@ class MagicWord {
                'numberofactiveusers',
                'numberofpages',
                'currentversion',
+               'rootpagename',
+               'rootpagenamee',
                'basepagename',
                'basepagenamee',
                'currenttimestamp',
@@ -327,9 +329,10 @@ class MagicWord {
                usort( $synonyms, array( $this, 'compareStringLength' ) );
 
                $escSyn = array();
-               foreach ( $synonyms as $synonym )
+               foreach ( $synonyms as $synonym ) {
                        // In case a magic word contains /, like that's going to happen;)
                        $escSyn[] = preg_quote( $synonym, '/' );
+               }
                $this->mBaseRegex = implode( '|', $escSyn );
 
                $case = $this->mCaseSensitive ? '' : 'iu';
@@ -382,8 +385,9 @@ class MagicWord {
         * @return string
         */
        function getRegexCase() {
-               if ( $this->mRegex === '' )
+               if ( $this->mRegex === '' ) {
                        $this->initRegex();
+               }
 
                return $this->mCaseSensitive ? '' : 'iu';
        }
@@ -598,7 +602,7 @@ class MagicWord {
        function replaceMultiple( $magicarr, $subject, &$result ) {
                $search = array();
                $replace = array();
-               foreach( $magicarr as $id => $replacement ) {
+               foreach ( $magicarr as $id => $replacement ) {
                        $mw = MagicWord::get( $id );
                        $search[] = $mw->getRegex();
                        $replace[] = $replacement;
index 5719f83..531551d 100644 (file)
@@ -326,7 +326,7 @@ class Message {
                if ( isset( $params[0] ) && is_array( $params[0] ) ) {
                        $params = $params[0];
                }
-               foreach( $params as $param ) {
+               foreach ( $params as $param ) {
                        $this->parameters[] = self::rawParam( $param );
                }
                return $this;
@@ -344,7 +344,7 @@ class Message {
                if ( isset( $params[0] ) && is_array( $params[0] ) ) {
                        $params = $params[0];
                }
-               foreach( $params as $param ) {
+               foreach ( $params as $param ) {
                        $this->parameters[] = self::numParam( $param );
                }
                return $this;
@@ -377,7 +377,7 @@ class Message {
                if ( $lang instanceof Language || $lang instanceof StubUserLang ) {
                        $this->language = $lang;
                } elseif ( is_string( $lang ) ) {
-                       if( $this->language->getCode() != $lang ) {
+                       if ( $this->language->getCode() != $lang ) {
                                $this->language = Language::factory( $lang );
                        }
                } else {
@@ -484,17 +484,17 @@ class Message {
                $string = $this->replaceParameters( $string, 'before' );
 
                # Maybe transform using the full parser
-               if( $this->format === 'parse' ) {
+               if ( $this->format === 'parse' ) {
                        $string = $this->parseText( $string );
                        $m = array();
-                       if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
+                       if ( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
                                $string = $m[1];
                        }
-               } elseif( $this->format === 'block-parse' ) {
+               } elseif ( $this->format === 'block-parse' ) {
                        $string = $this->parseText( $string );
-               } elseif( $this->format === 'text' ) {
+               } elseif ( $this->format === 'text' ) {
                        $string = $this->transformText( $string );
-               } elseif( $this->format === 'escaped' ) {
+               } elseif ( $this->format === 'escaped' ) {
                        $string = $this->transformText( $string );
                        $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8', false );
                }
@@ -641,7 +641,7 @@ class Message {
         */
        protected function replaceParameters( $message, $type = 'before' ) {
                $replacementKeys = array();
-               foreach( $this->parameters as $n => $param ) {
+               foreach ( $this->parameters as $n => $param ) {
                        list( $paramType, $value ) = $this->extractParam( $param );
                        if ( $type === $paramType ) {
                                $replacementKeys['$' . ($n + 1)] = $value;
@@ -760,7 +760,7 @@ class RawMessage extends Message {
         */
        public function fetchMessage() {
                // Just in case the message is unset somewhere.
-               if( !isset( $this->message ) ) {
+               if ( !isset( $this->message ) ) {
                        $this->message = $this->key;
                }
                return $this->message;
index 96d00ae..cd77ef8 100644 (file)
@@ -42,7 +42,7 @@ abstract class RdfMetaData {
                $httpaccept = isset( $_SERVER['HTTP_ACCEPT'] ) ? $_SERVER['HTTP_ACCEPT'] : null;
                $rdftype = wfNegotiateType( wfAcceptToPrefs( $httpaccept ), wfAcceptToPrefs( self::RDF_TYPE_PREFS ) );
 
-               if( !$rdftype ) {
+               if ( !$rdftype ) {
                        throw new HttpError( 406, wfMessage( 'notacceptable' ) );
                }
 
@@ -70,7 +70,7 @@ abstract class RdfMetaData {
                $lastEditor = User::newFromId( $this->mArticle->getUser() );
                $this->person( 'creator', $lastEditor );
 
-               foreach( $this->mArticle->getContributors() as $user ) {
+               foreach ( $this->mArticle->getContributors() as $user ) {
                        $this->person( 'contributor', $user );
                }
 
@@ -89,13 +89,13 @@ abstract class RdfMetaData {
        }
 
        protected function pageOrString( $name, $page, $str ) {
-               if( $page instanceof Title ) {
+               if ( $page instanceof Title ) {
                        $nt = $page;
                } else {
                        $nt = Title::newFromText( $page );
                }
 
-               if( !$nt || $nt->getArticleID() == 0 ) {
+               if ( !$nt || $nt->getArticleID() == 0 ) {
                        $this->element( $name, $str );
                } else {
                        $this->page( $name, $nt );
@@ -116,11 +116,11 @@ abstract class RdfMetaData {
        }
 
        protected function person( $name, User $user ) {
-               if( $user->isAnon() ) {
+               if ( $user->isAnon() ) {
                        $this->element( $name, wfMessage( 'anonymous' )->numParams( 1 )->text() );
                } else {
                        $real = $user->getRealName();
-                       if( $real ) {
+                       if ( $real ) {
                                $this->element( $name, $real );
                        } else {
                                $userName = $user->getName();
@@ -140,12 +140,12 @@ abstract class RdfMetaData {
        protected function rights() {
                global $wgRightsPage, $wgRightsUrl, $wgRightsText;
 
-               if( $wgRightsPage && ( $nt = Title::newFromText( $wgRightsPage ) )
+               if ( $wgRightsPage && ( $nt = Title::newFromText( $wgRightsPage ) )
                        && ( $nt->getArticleID() != 0 ) ) {
                        $this->page( 'rights', $nt );
-               } elseif( $wgRightsUrl ) {
+               } elseif ( $wgRightsUrl ) {
                        $this->url( 'rights', $wgRightsUrl );
-               } elseif( $wgRightsText ) {
+               } elseif ( $wgRightsText ) {
                        $this->element( 'rights', $wgRightsText );
                }
        }
@@ -153,11 +153,11 @@ abstract class RdfMetaData {
        protected function getTerms( $url ) {
                global $wgLicenseTerms;
 
-               if( $wgLicenseTerms ) {
+               if ( $wgLicenseTerms ) {
                        return $wgLicenseTerms;
                } else {
                        $known = $this->getKnownLicenses();
-                       if( isset( $known[$url] ) ) {
+                       if ( isset( $known[$url] ) ) {
                                return $known[$url];
                        } else {
                                return array();
@@ -173,7 +173,7 @@ abstract class RdfMetaData {
 
                foreach ( $ccVersions as $version ) {
                        foreach ( $ccLicenses as $license ) {
-                               if( $version == '2.0' && substr( $license, 0, 2 ) != 'by' ) {
+                               if ( $version == '2.0' && substr( $license, 0, 2 ) != 'by' ) {
                                        # 2.0 dropped the non-attribs licenses
                                        continue;
                                }
index 11fc574..44fafca 100644 (file)
@@ -39,7 +39,7 @@
  * appending MM_WELL_KNOWN_MIME_TYPES behind $wgMimeTypeFile, but who knows
  * what will break? In practice this probably isn't a problem anyway -- Bryan)
  */
-define('MM_WELL_KNOWN_MIME_TYPES', <<<END_STRING
+define( 'MM_WELL_KNOWN_MIME_TYPES', <<<END_STRING
 application/ogg ogx ogg ogm ogv oga spx
 application/pdf pdf
 application/vnd.oasis.opendocument.chart odc
@@ -91,7 +91,7 @@ END_STRING
  * An extensive list of well known mime types is provided by
  * the file mime.info in the includes directory.
  */
-define('MM_WELL_KNOWN_MIME_INFO', <<<END_STRING
+define( 'MM_WELL_KNOWN_MIME_INFO', <<<END_STRING
 application/pdf [OFFICE]
 application/vnd.oasis.opendocument.chart [OFFICE]
 application/vnd.oasis.opendocument.chart-template [OFFICE]
@@ -560,7 +560,7 @@ class MimeMagic {
 
                $mime = $this->doGuessMimeType( $file, $ext );
 
-               if( !$mime ) {
+               if ( !$mime ) {
                        wfDebug( __METHOD__ . ": internal type detection failed for $file (.$ext)...\n" );
                        $mime = $this->detectMimeType( $file, $ext );
                }
@@ -587,7 +587,7 @@ class MimeMagic {
                $f = fopen( $file, 'rt' );
                wfRestoreWarnings();
 
-               if( !$f ) {
+               if ( !$f ) {
                        return 'unknown/unknown';
                }
                $head = fread( $f, 1024 );
@@ -642,7 +642,7 @@ class MimeMagic {
                }
 
                /* Look for WebP */
-               if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8), "WEBPVP8 ", 8 ) == 0 ) {
+               if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8 ), "WEBPVP8 ", 8 ) == 0 ) {
                        wfDebug( __METHOD__ . ": recognized file as image/webp\n" );
                        return "image/webp";
                }
@@ -705,8 +705,8 @@ class MimeMagic {
                                $pack = array( 'UTF-16BE' => 'n*', 'UTF-16LE' => 'v*' );
                                $chars = unpack( $pack[$script_type], substr( $head, 2 ) );
                                $head = '';
-                               foreach( $chars as $codepoint ) {
-                                       if( $codepoint < 128 ) {
+                               foreach ( $chars as $codepoint ) {
+                                       if ( $codepoint < 128 ) {
                                                $head .= chr( $codepoint );
                                        } else {
                                                $head .= '?';
@@ -733,7 +733,7 @@ class MimeMagic {
                $gis = getimagesize( $file );
                wfRestoreWarnings();
 
-               if( $gis && isset( $gis['mime'] ) ) {
+               if ( $gis && isset( $gis['mime'] ) ) {
                        $mime = $gis['mime'];
                        wfDebug( __METHOD__ . ": getimagesize detected $file as $mime\n" );
                        return $mime;
@@ -741,7 +741,7 @@ class MimeMagic {
 
                // Also test DjVu
                $deja = new DjVuImage( $file );
-               if( $deja->isValid() ) {
+               if ( $deja->isValid() ) {
                        wfDebug( __METHOD__ . ": detected $file as image/vnd.djvu\n" );
                        return 'image/vnd.djvu';
                }
@@ -763,7 +763,7 @@ class MimeMagic {
         * @return string
         */
        function detectZipType( $header, $tail = null, $ext = false ) {
-               if( $ext ) { # TODO: remove $ext param
+               if ( $ext ) { # TODO: remove $ext param
                        wfDebug( __METHOD__ . ": WARNING: use of the \$ext parameter is deprecated. " .
                                "Use improveTypeFromExtension(\$mime, \$ext) instead.\n" );
                }
@@ -815,12 +815,12 @@ class MimeMagic {
                        }
                        wfDebug( __METHOD__ . ": detected an Open Packaging Conventions archive: $mime\n" );
                } elseif ( substr( $header, 0, 8 ) == "\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1" &&
-                               ($headerpos = strpos( $tail, "PK\x03\x04" ) ) !== false &&
+                               ( $headerpos = strpos( $tail, "PK\x03\x04" ) ) !== false &&
                                preg_match( $openxmlRegex, substr( $tail, $headerpos + 30 ) ) ) {
                        if ( substr( $header, 512, 4 ) == "\xEC\xA5\xC1\x00" ) {
                                $mime = "application/msword";
                        }
-                       switch( substr( $header, 512, 6 ) ) {
+                       switch ( substr( $header, 512, 6 ) ) {
                                case "\xEC\xA5\xC1\x00\x0E\x00":
                                case "\xEC\xA5\xC1\x00\x1C\x00":
                                case "\xEC\xA5\xC1\x00\x43\x00":
@@ -876,9 +876,8 @@ class MimeMagic {
 
                $m = null;
                if ( $wgMimeDetectorCommand ) {
-                       // @todo FIXME: Use wfShellExec
-                       $fn = wfEscapeShellArg( $file );
-                       $m = `$wgMimeDetectorCommand $fn`;
+                       $args = wfEscapeShellArg( $file );
+                       $m = wfShellExec( "$wgMimeDetectorCommand $args" );
                } elseif ( function_exists( "finfo_open" ) && function_exists( "finfo_file" ) ) {
 
                        # This required the fileinfo extension by PECL,
@@ -935,7 +934,7 @@ class MimeMagic {
                        $ext = strtolower( $i ? substr( $file, $i + 1 ) : '' );
                }
                if ( $ext ) {
-                       if( $this->isRecognizableExtension( $ext ) ) {
+                       if ( $this->isRecognizableExtension( $ext ) ) {
                                wfDebug( __METHOD__ . ": refusing to guess mime type for .$ext file, we should have recognized it\n" );
                        } else {
                                $m = $this->guessTypesForExtension( $ext );
@@ -968,12 +967,12 @@ class MimeMagic {
         * @return (int?string?) a value to be used with the MEDIATYPE_xxx constants.
         */
        function getMediaType( $path = null, $mime = null ) {
-               if( !$mime && !$path ) {
+               if ( !$mime && !$path ) {
                        return MEDIATYPE_UNKNOWN;
                }
 
                // If mime type is unknown, guess it
-               if( !$mime ) {
+               if ( !$mime ) {
                        $mime = $this->guessMimeType( $path, false );
                }
 
@@ -983,22 +982,30 @@ class MimeMagic {
 
                        // Read a chunk of the file
                        $f = fopen( $path, "rt" );
-                       if ( !$f ) return MEDIATYPE_UNKNOWN;
+                       if ( !$f ) {
+                               return MEDIATYPE_UNKNOWN;
+                       }
                        $head = fread( $f, 256 );
                        fclose( $f );
 
                        $head = strtolower( $head );
 
                        // This is an UGLY HACK, file should be parsed correctly
-                       if ( strpos( $head, 'theora' ) !== false ) return MEDIATYPE_VIDEO;
-                       elseif ( strpos( $head, 'vorbis' ) !== false ) return MEDIATYPE_AUDIO;
-                       elseif ( strpos( $head, 'flac' ) !== false ) return MEDIATYPE_AUDIO;
-                       elseif ( strpos( $head, 'speex' ) !== false ) return MEDIATYPE_AUDIO;
-                       else return MEDIATYPE_MULTIMEDIA;
+                       if ( strpos( $head, 'theora' ) !== false ) {
+                               return MEDIATYPE_VIDEO;
+                       } elseif ( strpos( $head, 'vorbis' ) !== false ) {
+                               return MEDIATYPE_AUDIO;
+                       } elseif ( strpos( $head, 'flac' ) !== false ) {
+                               return MEDIATYPE_AUDIO;
+                       } elseif ( strpos( $head, 'speex' ) !== false ) {
+                               return MEDIATYPE_AUDIO;
+                       } else {
+                               return MEDIATYPE_MULTIMEDIA;
+                       }
                }
 
                // Check for entry for full mime type
-               if( $mime ) {
+               if ( $mime ) {
                        $type = $this->findMediaType( $mime );
                        if ( $type !== MEDIATYPE_UNKNOWN ) {
                                return $type;
@@ -1029,7 +1036,7 @@ class MimeMagic {
                        }
                }
 
-               if( !$type ) {
+               if ( !$type ) {
                        $type = MEDIATYPE_UNKNOWN;
                }
 
index 6b40c30..e7928cc 100644 (file)
@@ -64,10 +64,10 @@ function wfOutputHandler( $s ) {
  */
 function wfRequestExtension() {
        /// @todo FIXME: this sort of dupes some code in WebRequest::getRequestUrl()
-       if( isset( $_SERVER['REQUEST_URI'] ) ) {
+       if ( isset( $_SERVER['REQUEST_URI'] ) ) {
                // Strip the query string...
                list( $path ) = explode( '?', $_SERVER['REQUEST_URI'], 2 );
-       } elseif( isset( $_SERVER['SCRIPT_NAME'] ) ) {
+       } elseif ( isset( $_SERVER['SCRIPT_NAME'] ) ) {
                // Probably IIS. QUERY_STRING appears separately.
                $path = $_SERVER['SCRIPT_NAME'];
        } else {
@@ -76,7 +76,7 @@ function wfRequestExtension() {
        }
 
        $period = strrpos( $path, '.' );
-       if( $period !== false ) {
+       if ( $period !== false ) {
                return strtolower( substr( $path, $period ) );
        }
        return '';
@@ -91,17 +91,17 @@ function wfRequestExtension() {
  * @return string
  */
 function wfGzipHandler( $s ) {
-       if( !function_exists( 'gzencode' ) ) {
+       if ( !function_exists( 'gzencode' ) ) {
                wfDebug( __FUNCTION__ . "() skipping compression (gzencode unavailable)\n" );
                return $s;
        }
-       if( headers_sent() ) {
+       if ( headers_sent() ) {
                wfDebug( __FUNCTION__ . "() skipping compression (headers already sent)\n" );
                return $s;
        }
 
        $ext = wfRequestExtension();
-       if( $ext == '.gz' || $ext == '.tgz' ) {
+       if ( $ext == '.gz' || $ext == '.tgz' ) {
                // Don't do gzip compression if the URL path ends in .gz or .tgz
                // This confuses Safari and triggers a download of the page,
                // even though it's pretty clearly labeled as viewable HTML.
@@ -109,7 +109,7 @@ function wfGzipHandler( $s ) {
                return $s;
        }
 
-       if( wfClientAcceptsGzip() ) {
+       if ( wfClientAcceptsGzip() ) {
                wfDebug( __FUNCTION__ . "() is compressing output\n" );
                header( 'Content-Encoding: gzip' );
                $s = gzencode( $s, 6 );
index 8058c09..d70734c 100644 (file)
@@ -155,13 +155,13 @@ abstract class IndexPager extends ContextSource implements Pager {
                $index = $this->getIndexField(); // column to sort on
                $extraSort = $this->getExtraSortFields(); // extra columns to sort on for query planning
                $order = $this->mRequest->getVal( 'order' );
-               if( is_array( $index ) && isset( $index[$order] ) ) {
+               if ( is_array( $index ) && isset( $index[$order] ) ) {
                        $this->mOrderType = $order;
                        $this->mIndexField = $index[$order];
                        $this->mExtraSortFields = isset( $extraSort[$order] )
                                ? (array)$extraSort[$order]
                                : array();
-               } elseif( is_array( $index ) ) {
+               } elseif ( is_array( $index ) ) {
                        # First element is the default
                        reset( $index );
                        list( $this->mOrderType, $this->mIndexField ) = each( $index );
@@ -175,7 +175,7 @@ abstract class IndexPager extends ContextSource implements Pager {
                        $this->mExtraSortFields = (array)$extraSort;
                }
 
-               if( !isset( $this->mDefaultDirection ) ) {
+               if ( !isset( $this->mDefaultDirection ) ) {
                        $dir = $this->getDefaultDirections();
                        $this->mDefaultDirection = is_array( $dir )
                                ? $dir[$this->mOrderType]
@@ -443,12 +443,12 @@ abstract class IndexPager extends ContextSource implements Pager {
                }
 
                $attrs = array();
-               if( in_array( $type, array( 'first', 'prev', 'next', 'last' ) ) ) {
+               if ( in_array( $type, array( 'first', 'prev', 'next', 'last' ) ) ) {
                        # HTML5 rel attributes
                        $attrs['rel'] = $type;
                }
 
-               if( $type ) {
+               if ( $type ) {
                        $attrs['class'] = "mw-{$type}link";
                }
 
@@ -685,7 +685,9 @@ abstract class IndexPager extends ContextSource implements Pager {
         *
         * @return Array
         */
-       protected function getExtraSortFields() { return array(); }
+       protected function getExtraSortFields() {
+               return array();
+       }
 
        /**
         * Return the default sorting direction: false for ascending, true for
@@ -706,7 +708,9 @@ abstract class IndexPager extends ContextSource implements Pager {
         *
         * @return Boolean
         */
-       protected function getDefaultDirections() { return false; }
+       protected function getDefaultDirections() {
+               return false;
+       }
 }
 
 /**
@@ -726,7 +730,7 @@ abstract class AlphabeticPager extends IndexPager {
                        return '';
                }
 
-               if( isset( $this->mNavigationBar ) ) {
+               if ( isset( $this->mNavigationBar ) ) {
                        return $this->mNavigationBar;
                }
 
@@ -749,7 +753,7 @@ abstract class AlphabeticPager extends IndexPager {
                        $this->msg( 'viewprevnext' )->rawParams( $pagingLinks['prev'],
                                $pagingLinks['next'], $limits )->escaped();
 
-               if( !is_array( $this->getIndexField() ) ) {
+               if ( !is_array( $this->getIndexField() ) ) {
                        # Early return to avoid undue nesting
                        return $this->mNavigationBar;
                }
@@ -757,14 +761,14 @@ abstract class AlphabeticPager extends IndexPager {
                $extra = '';
                $first = true;
                $msgs = $this->getOrderTypeMessages();
-               foreach( array_keys( $msgs ) as $order ) {
-                       if( $first ) {
+               foreach ( array_keys( $msgs ) as $order ) {
+                       if ( $first ) {
                                $first = false;
                        } else {
                                $extra .= $this->msg( 'pipe-separator' )->escaped();
                        }
 
-                       if( $order == $this->mOrderType ) {
+                       if ( $order == $this->mOrderType ) {
                                $extra .= $this->msg( $msgs[$order] )->escaped();
                        } else {
                                $extra .= $this->makeLink(
@@ -774,7 +778,7 @@ abstract class AlphabeticPager extends IndexPager {
                        }
                }
 
-               if( $extra !== '' ) {
+               if ( $extra !== '' ) {
                        $extra = ' ' . $this->msg( 'parentheses' )->rawParams( $extra )->escaped();
                        $this->mNavigationBar .= $extra;
                }
@@ -857,7 +861,7 @@ abstract class ReverseChronologicalPager extends IndexPager {
                        // If no year given, assume the current one
                        $year = gmdate( 'Y' );
                        // If this month hasn't happened yet this year, go back to last year's month
-                       if( $this->mMonth > gmdate( 'n' ) ) {
+                       if ( $this->mMonth > gmdate( 'n' ) ) {
                                $year--;
                        }
                }
@@ -1125,7 +1129,7 @@ abstract class TablePager extends IndexPager {
                        'next' => 'arrow_disabled_right_25.png',
                        'last' => 'arrow_disabled_last_25.png',
                );
-               if( $this->getLanguage()->isRTL() ) {
+               if ( $this->getLanguage()->isRTL() ) {
                        $keys = array_keys( $labels );
                        $images = array_combine( $keys, array_reverse( $images ) );
                        $disabledImages = array_combine( $keys, array_reverse( $disabledImages ) );
@@ -1169,7 +1173,7 @@ abstract class TablePager extends IndexPager {
                        # The pair is either $index => $limit, in which case the $value
                        # will be numeric, or $limit => $text, in which case the $value
                        # will be a string.
-                       if( is_int( $value ) ) {
+                       if ( is_int( $value ) ) {
                                $limit = $value;
                                $text = $this->getLanguage()->formatNum( $limit );
                        } else {
index fc891bb..435e09e 100644 (file)
@@ -141,10 +141,10 @@ class PathRouter {
                }
 
                $pattern = (object)array(
-                       'path'    => $path,
-                       'params'  => $params,
+                       'path' => $path,
+                       'params' => $params,
                        'options' => $options,
-                       'key'     => $key,
+                       'key' => $key,
                );
                $pattern->weight = self::makeWeight( $pattern );
                $this->patterns[] = $pattern;
@@ -185,7 +185,7 @@ class PathRouter {
         */
        protected function sortByWeight() {
                $weights = array();
-               foreach( $this->patterns as $key => $pattern ) {
+               foreach ( $this->patterns as $key => $pattern ) {
                        $weights[$key] = $pattern->weight;
                }
                array_multisort( $weights, SORT_DESC, SORT_NUMERIC, $this->patterns );
@@ -203,7 +203,7 @@ class PathRouter {
                $path = explode( '/', $pattern->path );
 
                # For each level of the path
-               foreach( $path as $piece ) {
+               foreach ( $path as $piece ) {
                        if ( preg_match( '/^\$(\d+|key)$/u', $piece ) ) {
                                # For a piece that is only a $1 variable add 1 points of weight
                                $weight += 1;
index 38c6f04..2dac938 100644 (file)
@@ -190,9 +190,19 @@ abstract class PoolCounterWork {
        }
 
        /**
-        * Get the result of the work (whatever it is), or false.
+        * Get the result of the work (whatever it is), or the result of the error() function.
+        * This returns the result of the first applicable method that returns a non-false value,
+        * where the methods are checked in the following order:
+        *   - a) doWork()       : Applies if the work is exclusive or no another process
+        *                         is doing it, and on the condition that either this process
+        *                         successfully entered the pool or the pool counter is down.
+        *   - b) doCachedWork() : Applies if the work is cacheable and this blocked on another
+        *                         process which finished the work.
+        *   - c) fallback()     : Applies for all remaining cases.
+        * If these all fall through (by returning false), then the result of error() is returned.
+        *
         * @param $skipcache bool
-        * @return bool|mixed
+        * @return mixed
         */
        public function execute( $skipcache = false ) {
                if ( $this->cacheable && !$skipcache ) {
index 79c3dd3..5518eb3 100644 (file)
@@ -310,23 +310,23 @@ class Preferences {
                        'label-message' => 'yourlanguage',
                );
 
-               /* see if there are multiple language variants to choose from*/
-               $variantArray = array();
+               // see if there are multiple language variants to choose from
                if ( !$wgDisableLangConversion ) {
                        $variants = $wgContLang->getVariants();
 
-                       foreach ( $variants as $v ) {
-                               $v = str_replace( '_', '-', strtolower( $v ) );
-                               $variantArray[$v] = $wgContLang->getVariantname( $v, false );
-                       }
+                       if ( count( $variants ) > 1 ) {
+                               $variantArray = array();
+                               foreach ( $variants as $v ) {
+                                       $v = str_replace( '_', '-', strtolower( $v ) );
+                                       $variantArray[$v] = $wgContLang->getVariantname( $v, false );
+                               }
 
-                       $options = array();
-                       foreach ( $variantArray as $code => $name ) {
-                               $display = wfBCP47( $code ) . ' - ' . $name;
-                               $options[$display] = $code;
-                       }
+                               $options = array();
+                               foreach ( $variantArray as $code => $name ) {
+                                       $display = wfBCP47( $code ) . ' - ' . $name;
+                                       $options[$display] = $code;
+                               }
 
-                       if ( count( $variantArray ) > 1 ) {
                                $defaultPreferences['variant'] = array(
                                        'label-message' => 'yourvariant',
                                        'type' => 'select',
@@ -334,16 +334,16 @@ class Preferences {
                                        'section' => 'personal/i18n',
                                        'help-message' => 'prefs-help-variant',
                                );
-                       }
-               }
 
-               if ( count( $variantArray ) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion ) {
-                       $defaultPreferences['noconvertlink'] =
-                               array(
-                               'type' => 'toggle',
-                               'section' => 'personal/i18n',
-                               'label-message' => 'tog-noconvertlink',
-                       );
+                               if ( !$wgDisableTitleConversion ) {
+                                       $defaultPreferences['noconvertlink'] =
+                                               array(
+                                               'type' => 'toggle',
+                                               'section' => 'personal/i18n',
+                                               'label-message' => 'tog-noconvertlink',
+                                       );
+                               }
+                       }
                }
 
                // show a preview of the old signature first
@@ -378,7 +378,7 @@ class Preferences {
                                        ? 'prefs-help-email-required'
                                        : 'prefs-help-email';
 
-                       if( $wgEnableUserEmail ) {
+                       if ( $wgEnableUserEmail ) {
                                // additional messages when users can send email to each other
                                $helpMessages[] = 'prefs-help-email-others';
                        }
@@ -1012,8 +1012,9 @@ class Preferences {
                $nsOptions = $wgContLang->getFormattedNamespaces();
                $nsOptions[0] = $context->msg( 'blanknamespace' )->text();
                foreach ( $nsOptions as $ns => $name ) {
-                       if ( $ns < 0 )
+                       if ( $ns < 0 ) {
                                unset( $nsOptions[$ns] );
+                       }
                }
 
                $defaultPreferences['searchnamespaces'] = array(
@@ -1351,7 +1352,9 @@ class Preferences {
                                        $data[0] = intval( $data[0] );
                                        $data[1] = intval( $data[1] );
                                        $minDiff = abs( $data[0] ) * 60 + $data[1];
-                                       if ( $data[0] < 0 ) $minDiff = - $minDiff;
+                                       if ( $data[0] < 0 ) {
+                                               $minDiff = - $minDiff;
+                                       }
                                } else {
                                        $minDiff = intval( $data[0] ) * 60;
                                }
@@ -1406,7 +1409,7 @@ class Preferences {
                # via $wgHiddenPrefs, we don't want to destroy that setting in case the preference
                # is subsequently re-enabled
                # TODO: maintenance script to actually delete these
-               foreach( $wgHiddenPrefs as $pref ) {
+               foreach ( $wgHiddenPrefs as $pref ) {
                        # If the user has not set a non-default value here, the default will be returned
                        # and subsequently discarded
                        $formData[$pref] = $user->getOption( $pref, null, true );
index e422a3b..3c464c5 100644 (file)
@@ -37,16 +37,16 @@ class PrefixSearch {
         */
        public static function titleSearch( $search, $limit, $namespaces = array() ) {
                $search = trim( $search );
-               if( $search == '' ) {
+               if ( $search == '' ) {
                        return array(); // Return empty result
                }
                $namespaces = self::validateNamespaces( $namespaces );
 
                // Find a Title which is not an interwiki and is in NS_MAIN
                $title = Title::newFromText( $search );
-               if( $title && $title->getInterwiki() == '' ) {
+               if ( $title && $title->getInterwiki() == '' ) {
                        $ns = array( $title->getNamespace() );
-                       if( $ns[0] == NS_MAIN ) {
+                       if ( $ns[0] == NS_MAIN ) {
                                $ns = $namespaces; // no explicit prefix, use default namespaces
                        }
                        return self::searchBackend(
@@ -55,7 +55,7 @@ class PrefixSearch {
 
                // Is this a namespace prefix?
                $title = Title::newFromText( $search . 'Dummy' );
-               if( $title && $title->getText() == 'Dummy'
+               if ( $title && $title->getText() == 'Dummy'
                        && $title->getNamespace() != NS_MAIN
                        && $title->getInterwiki() == '' ) {
                        return self::searchBackend(
@@ -73,16 +73,16 @@ class PrefixSearch {
         * @return Array of strings
         */
        protected static function searchBackend( $namespaces, $search, $limit ) {
-               if( count( $namespaces ) == 1 ) {
+               if ( count( $namespaces ) == 1 ) {
                        $ns = $namespaces[0];
-                       if( $ns == NS_MEDIA ) {
+                       if ( $ns == NS_MEDIA ) {
                                $namespaces = array( NS_FILE );
-                       } elseif( $ns == NS_SPECIAL ) {
+                       } elseif ( $ns == NS_SPECIAL ) {
                                return self::specialSearch( $search, $limit );
                        }
                }
                $srchres = array();
-               if( wfRunHooks( 'PrefixSearchBackend', array( $namespaces, $search, $limit, &$srchres ) ) ) {
+               if ( wfRunHooks( 'PrefixSearchBackend', array( $namespaces, $search, $limit, &$srchres ) ) ) {
                        return self::defaultSearchBackend( $namespaces, $search, $limit );
                }
                return $srchres;
@@ -106,24 +106,24 @@ class PrefixSearch {
                // Unlike SpecialPage itself, we want the canonical forms of both
                // canonical and alias title forms...
                $keys = array();
-               foreach( SpecialPageFactory::getList() as $page => $class ) {
+               foreach ( SpecialPageFactory::getList() as $page => $class ) {
                        $keys[$wgContLang->caseFold( $page )] = $page;
                }
 
-               foreach( $wgContLang->getSpecialPageAliases() as $page => $aliases ) {
-                       if( !array_key_exists( $page, SpecialPageFactory::getList() ) ) {# bug 20885
+               foreach ( $wgContLang->getSpecialPageAliases() as $page => $aliases ) {
+                       if ( !array_key_exists( $page, SpecialPageFactory::getList() ) ) {# bug 20885
                                continue;
                        }
 
-                       foreach( $aliases as $alias ) {
+                       foreach ( $aliases as $alias ) {
                                $keys[$wgContLang->caseFold( $alias )] = $alias;
                        }
                }
                ksort( $keys );
 
                $srchres = array();
-               foreach( $keys as $pageKey => $page ) {
-                       if( $searchKey === '' || strpos( $pageKey, $searchKey ) === 0 ) {
+               foreach ( $keys as $pageKey => $page ) {
+                       if ( $searchKey === '' || strpos( $pageKey, $searchKey ) === 0 ) {
                                wfSuppressWarnings();
                                // bug 27671: Don't use SpecialPage::getTitleFor() here because it
                                // localizes its input leading to searches for e.g. Special:All
@@ -133,7 +133,7 @@ class PrefixSearch {
                                wfRestoreWarnings();
                        }
 
-                       if( count( $srchres ) >= $limit ) {
+                       if ( count( $srchres ) >= $limit ) {
                                break;
                        }
                }
@@ -154,7 +154,7 @@ class PrefixSearch {
         */
        protected static function defaultSearchBackend( $namespaces, $search, $limit ) {
                $ns = array_shift( $namespaces ); // support only one namespace
-               if( in_array( NS_MAIN, $namespaces ) ) {
+               if ( in_array( NS_MAIN, $namespaces ) ) {
                        $ns = NS_MAIN; // if searching on many always default to main
                }
 
@@ -196,14 +196,14 @@ class PrefixSearch {
 
                // We will look at each given namespace against wgContLang namespaces
                $validNamespaces = $wgContLang->getNamespaces();
-               if( is_array( $namespaces ) && count( $namespaces ) > 0 ) {
+               if ( is_array( $namespaces ) && count( $namespaces ) > 0 ) {
                        $valid = array();
                        foreach ( $namespaces as $ns ) {
-                               if( is_numeric( $ns ) && array_key_exists( $ns, $validNamespaces ) ) {
+                               if ( is_numeric( $ns ) && array_key_exists( $ns, $validNamespaces ) ) {
                                        $valid[] = $ns;
                                }
                        }
-                       if( count( $valid ) > 0 ) {
+                       if ( count( $valid ) > 0 ) {
                                return $valid;
                        }
                }
index de5e9db..9439b90 100644 (file)
@@ -91,7 +91,7 @@ class ProtectionForm {
                $this->mReasonSelection = $wgRequest->getText( 'wpProtectReasonSelection' );
                $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade', $this->mCascade );
 
-               foreach( $this->mApplicableTypes as $action ) {
+               foreach ( $this->mApplicableTypes as $action ) {
                        // @todo FIXME: This form currently requires individual selections,
                        // but the db allows multiples separated by commas.
 
@@ -132,15 +132,15 @@ class ProtectionForm {
                        }
 
                        $val = $wgRequest->getVal( "mwProtect-level-$action" );
-                       if( isset( $val ) && in_array( $val, $wgRestrictionLevels ) ) {
+                       if ( isset( $val ) && in_array( $val, $wgRestrictionLevels ) ) {
                                // Prevent users from setting levels that they cannot later unset
-                               if( $val == 'sysop' ) {
+                               if ( $val == 'sysop' ) {
                                        // Special case, rewrite sysop to either protect and editprotected
-                                       if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) )
-                                               continue;
-                               } else {
-                                       if( !$wgUser->isAllowed( $val ) )
+                                       if ( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) ) {
                                                continue;
+                                       }
+                               } elseif ( !$wgUser->isAllowed( $val ) ) {
+                                       continue;
                                }
                                $this->mRestrictions[$action] = $val;
                        }
@@ -188,8 +188,8 @@ class ProtectionForm {
                        throw new ErrorPageError( 'protect-badnamespace-title', 'protect-badnamespace-text' );
                }
 
-               if( $wgRequest->wasPosted() ) {
-                       if( $this->save() ) {
+               if ( $wgRequest->wasPosted() ) {
+                       if ( $this->save() ) {
                                $q = $this->mArticle->isRedirect() ? 'redirect=no' : '';
                                $wgOut->redirect( $this->mTitle->getFullURL( $q ) );
                        }
@@ -282,10 +282,11 @@ class ProtectionForm {
                        $reasonstr = $this->mReason;
                }
                $expiry = array();
-               foreach( $this->mApplicableTypes as $action ) {
+               foreach ( $this->mApplicableTypes as $action ) {
                        $expiry[$action] = $this->getExpiry( $action );
-                       if( empty( $this->mRestrictions[$action] ) )
+                       if ( empty( $this->mRestrictions[$action] ) ) {
                                continue; // unprotected
+                       }
                        if ( !$expiry[$action] ) {
                                $this->show( array( 'protect_expiry_invalid' ) );
                                return false;
@@ -300,9 +301,10 @@ class ProtectionForm {
                #  to a semi-protected page.
                $edit_restriction = isset( $this->mRestrictions['edit'] ) ? $this->mRestrictions['edit'] : '';
                $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade' );
-               if ( $this->mCascade && ($edit_restriction != 'protect') &&
-                       !User::groupHasPermission( $edit_restriction, 'protect' ) )
+               if ( $this->mCascade && ( $edit_restriction != 'protect' ) &&
+                       !User::groupHasPermission( $edit_restriction, 'protect' ) ) {
                        $this->mCascade = false;
+               }
 
                $status = $this->mArticle->doUpdateRestrictions( $this->mRestrictions, $expiry, $this->mCascade, $reasonstr, $wgUser );
 
@@ -318,12 +320,12 @@ class ProtectionForm {
                 *             you can also return an array of message name and its parameters
                 */
                $errorMsg = '';
-               if( !wfRunHooks( 'ProtectionForm::save', array( $this->mArticle, &$errorMsg ) ) ) {
+               if ( !wfRunHooks( 'ProtectionForm::save', array( $this->mArticle, &$errorMsg ) ) ) {
                        if ( $errorMsg == '' ) {
                                $errorMsg = array( 'hookaborted' );
                        }
                }
-               if( $errorMsg != '' ) {
+               if ( $errorMsg != '' ) {
                        $this->show( $errorMsg );
                        return false;
                }
@@ -356,7 +358,7 @@ class ProtectionForm {
                );
 
                $out = '';
-               if( !$this->disabled ) {
+               if ( !$this->disabled ) {
                        $wgOut->addModules( 'mediawiki.legacy.protect' );
                        $out .= Xml::openElement( 'form', array( 'method' => 'post',
                                'action' => $this->mTitle->getLocalURL( 'action=protect' ),
@@ -368,7 +370,7 @@ class ProtectionForm {
                        Xml::openElement( 'table', array( 'id' => 'mwProtectSet' ) ) .
                        Xml::openElement( 'tbody' );
 
-               foreach( $this->mRestrictions as $action => $selected ) {
+               foreach ( $this->mRestrictions as $action => $selected ) {
                        /* Not all languages have V_x <-> N_x relation */
                        $msg = wfMessage( 'restriction-' . $action );
                        $out .= "<tr><td>" .
@@ -412,7 +414,7 @@ class ProtectionForm {
                                wfMessage( 'protect-othertime-op' )->text(),
                                "othertime"
                        ) . "\n";
-                       foreach( explode( ',', $scExpiryOptions ) as $option ) {
+                       foreach ( explode( ',', $scExpiryOptions ) as $option ) {
                                if ( strpos( $option, ":" ) === false ) {
                                        $show = $value = $option;
                                } else {
@@ -423,7 +425,7 @@ class ProtectionForm {
                                $expiryFormOptions .= Xml::option( $show, $value, $this->mExpirySelection[$action] === $value ) . "\n";
                        }
                        # Add expiry dropdown
-                       if( $showProtectOptions && !$this->disabled ) {
+                       if ( $showProtectOptions && !$this->disabled ) {
                                $out .= "
                                        <table><tr>
                                                <td class='mw-label'>
@@ -463,7 +465,7 @@ class ProtectionForm {
                $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
 
                // JavaScript will add another row with a value-chaining checkbox
-               if( $this->mTitle->exists() ) {
+               if ( $this->mTitle->exists() ) {
                        $out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table2' ) ) .
                                Xml::openElement( 'tbody' );
                        $out .= '<tr>
@@ -481,7 +483,7 @@ class ProtectionForm {
                }
 
                # Add manual and custom reason field/selects as well as submit
-               if( !$this->disabled ) {
+               if ( !$this->disabled ) {
                        $out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table3' ) ) .
                                Xml::openElement( 'tbody' );
                        $out .= "
@@ -506,7 +508,7 @@ class ProtectionForm {
                                        "</td>
                                </tr>";
                        # Disallow watching is user is not logged in
-                       if( $wgUser->isLoggedIn() ) {
+                       if ( $wgUser->isLoggedIn() ) {
                                $out .= "
                                <tr>
                                        <td></td>
@@ -562,15 +564,17 @@ class ProtectionForm {
                global $wgRestrictionLevels, $wgUser;
 
                $levels = array();
-               foreach( $wgRestrictionLevels as $key ) {
+               foreach ( $wgRestrictionLevels as $key ) {
                        //don't let them choose levels above their own (aka so they can still unprotect and edit the page). but only when the form isn't disabled
-                       if( $key == 'sysop' ) {
+                       if ( $key == 'sysop' ) {
                                //special case, rewrite sysop to protect and editprotected
-                               if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) && !$this->disabled )
+                               if ( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) && !$this->disabled ) {
                                        continue;
+                               }
                        } else {
-                               if( !$wgUser->isAllowed( $key ) && !$this->disabled )
+                               if ( !$wgUser->isAllowed( $key ) && !$this->disabled ) {
                                        continue;
+                               }
                        }
                        $levels[] = $key;
                }
@@ -584,7 +588,7 @@ class ProtectionForm {
                        ) + $this->disabledAttrib;
 
                $out = Xml::openElement( 'select', $attribs );
-               foreach( $levels as $key ) {
+               foreach ( $levels as $key ) {
                        $out .= Xml::option( $this->getOptionLabel( $key ), $key, $key == $selected );
                }
                $out .= Xml::closeElement( 'select' );
@@ -598,11 +602,11 @@ class ProtectionForm {
         * @return String
         */
        private function getOptionLabel( $permission ) {
-               if( $permission == '' ) {
+               if ( $permission == '' ) {
                        return wfMessage( 'protect-default' )->text();
                } else {
                        $msg = wfMessage( "protect-level-{$permission}" );
-                       if( $msg->exists() ) {
+                       if ( $msg->exists() ) {
                                return $msg->text();
                        }
                        return wfMessage( 'protect-fallback', $permission )->text();
@@ -613,7 +617,7 @@ class ProtectionForm {
                global $wgRestrictionLevels, $wgOut;
 
                $cascadeableLevels = array();
-               foreach( $wgRestrictionLevels as $key ) {
+               foreach ( $wgRestrictionLevels as $key ) {
                        if ( User::groupHasPermission( $key, 'protect' )
                                || $key == 'protect'
                        ) {
index a4a1ffb..a93639a 100644 (file)
@@ -69,8 +69,9 @@ $wgQueryPages = array(
 wfRunHooks( 'wgQueryPages', array( &$wgQueryPages ) );
 
 global $wgDisableCounters;
-if ( !$wgDisableCounters )
+if ( !$wgDisableCounters ) {
        $wgQueryPages[] = array( 'PopularPagesPage', 'Popularpages' );
+}
 
 /**
  * This is a class for doing query pages; since they're almost all the same,
index faad391..b5d4a1c 100644 (file)
@@ -825,6 +825,29 @@ class RecentChange {
                return ChangesList::showCharacterDifference( $old, $new );
        }
 
+       /**
+        * Purge expired changes from the recentchanges table
+        * @since 1.22
+        */
+       public static function purgeExpiredChanges() {
+               if ( wfReadOnly() ) {
+                       return;
+               }
+
+               $method = __METHOD__;
+               $dbw = wfGetDB( DB_MASTER );
+               $dbw->onTransactionIdle( function() use ( $dbw, $method ) {
+                       global $wgRCMaxAge;
+
+                       $cutoff = $dbw->timestamp( time() - $wgRCMaxAge );
+                       $dbw->delete(
+                               'recentchanges',
+                               array( 'rc_timestamp < ' . $dbw->addQuotes( $cutoff ) ),
+                               $method
+                       );
+               } );
+       }
+
        private static function checkIPAddress( $ip ) {
                global $wgRequest;
                if ( $ip ) {
index 3ea5da4..1a7d825 100644 (file)
@@ -106,7 +106,7 @@ class Revision implements IDBAccessObject {
        public static function newFromTitle( $title, $id = 0, $flags = 0 ) {
                $conds = array(
                        'page_namespace' => $title->getNamespace(),
-                       'page_title'     => $title->getDBkey()
+                       'page_title' => $title->getDBkey()
                );
                if ( $id ) {
                        // Use the specified ID
@@ -228,8 +228,8 @@ class Revision implements IDBAccessObject {
         * @return Revision or null
         */
        public static function loadFromPageId( $db, $pageid, $id = 0 ) {
-               $conds = array( 'rev_page' => intval( $pageid ), 'page_id'  => intval( $pageid ) );
-               if( $id ) {
+               $conds = array( 'rev_page' => intval( $pageid ), 'page_id' => intval( $pageid ) );
+               if ( $id ) {
                        $conds['rev_id'] = intval( $id );
                } else {
                        $conds[] = 'rev_id=page_latest';
@@ -248,7 +248,7 @@ class Revision implements IDBAccessObject {
         * @return Revision or null
         */
        public static function loadFromTitle( $db, $title, $id = 0 ) {
-               if( $id ) {
+               if ( $id ) {
                        $matchId = intval( $id );
                } else {
                        $matchId = 'page_latest';
@@ -257,7 +257,7 @@ class Revision implements IDBAccessObject {
                        array(
                                "rev_id=$matchId",
                                'page_namespace' => $title->getNamespace(),
-                               'page_title'     => $title->getDBkey()
+                               'page_title' => $title->getDBkey()
                        )
                );
        }
@@ -275,9 +275,9 @@ class Revision implements IDBAccessObject {
        public static function loadFromTimestamp( $db, $title, $timestamp ) {
                return self::loadFromConds( $db,
                        array(
-                               'rev_timestamp'  => $db->timestamp( $timestamp ),
+                               'rev_timestamp' => $db->timestamp( $timestamp ),
                                'page_namespace' => $title->getNamespace(),
-                               'page_title'     => $title->getDBkey()
+                               'page_title' => $title->getDBkey()
                        )
                );
        }
@@ -312,9 +312,9 @@ class Revision implements IDBAccessObject {
         */
        private static function loadFromConds( $db, $conditions, $flags = 0 ) {
                $res = self::fetchFromConds( $db, $conditions, $flags );
-               if( $res ) {
+               if ( $res ) {
                        $row = $res->fetchObject();
-                       if( $row ) {
+                       if ( $row ) {
                                $ret = new Revision( $row );
                                return $ret;
                        }
@@ -337,7 +337,7 @@ class Revision implements IDBAccessObject {
                        array(
                                'rev_id=page_latest',
                                'page_namespace' => $title->getNamespace(),
-                               'page_title'     => $title->getDBkey()
+                               'page_title' => $title->getDBkey()
                        )
                );
        }
@@ -489,7 +489,7 @@ class Revision implements IDBAccessObject {
         * @access private
         */
        function __construct( $row ) {
-               if( is_object( $row ) ) {
+               if ( is_object( $row ) ) {
                        $this->mId        = intval( $row->rev_id );
                        $this->mPage      = intval( $row->rev_page );
                        $this->mTextId    = intval( $row->rev_text_id );
@@ -517,7 +517,7 @@ class Revision implements IDBAccessObject {
                                $this->mSha1 = $row->rev_sha1;
                        }
 
-                       if( isset( $row->page_latest ) ) {
+                       if ( isset( $row->page_latest ) ) {
                                $this->mCurrent = ( $row->rev_id == $row->page_latest );
                                $this->mTitle = Title::newFromRow( $row );
                        } else {
@@ -525,13 +525,13 @@ class Revision implements IDBAccessObject {
                                $this->mTitle = null;
                        }
 
-                       if( !isset( $row->rev_content_model ) || is_null( $row->rev_content_model ) ) {
+                       if ( !isset( $row->rev_content_model ) || is_null( $row->rev_content_model ) ) {
                                $this->mContentModel = null; # determine on demand if needed
                        } else {
                                $this->mContentModel = strval( $row->rev_content_model );
                        }
 
-                       if( !isset( $row->rev_content_format ) || is_null( $row->rev_content_format ) ) {
+                       if ( !isset( $row->rev_content_format ) || is_null( $row->rev_content_format ) ) {
                                $this->mContentFormat = null; # determine on demand if needed
                        } else {
                                $this->mContentFormat = strval( $row->rev_content_format );
@@ -539,7 +539,7 @@ class Revision implements IDBAccessObject {
 
                        // Lazy extraction...
                        $this->mText = null;
-                       if( isset( $row->old_text ) ) {
+                       if ( isset( $row->old_text ) ) {
                                $this->mTextRow = $row;
                        } else {
                                // 'text' table row entry will be lazy-loaded
@@ -554,7 +554,7 @@ class Revision implements IDBAccessObject {
                                $this->mUserText = $row->user_name; // logged-in user
                        }
                        $this->mOrigUserText = $row->rev_user_text;
-               } elseif( is_array( $row ) ) {
+               } elseif ( is_array( $row ) ) {
                        // Build a new revision to be saved...
                        global $wgUser; // ugh
 
@@ -714,10 +714,10 @@ class Revision implements IDBAccessObject {
         * @return Title|null
         */
        public function getTitle() {
-               if( isset( $this->mTitle ) ) {
+               if ( isset( $this->mTitle ) ) {
                        return $this->mTitle;
                }
-               if( !is_null( $this->mId ) ) { //rev_id is defined as NOT NULL, but this revision may not yet have been inserted.
+               if ( !is_null( $this->mId ) ) { //rev_id is defined as NOT NULL, but this revision may not yet have been inserted.
                        $dbr = wfGetDB( DB_SLAVE );
                        $row = $dbr->selectRow(
                                array( 'page', 'revision' ),
@@ -769,9 +769,9 @@ class Revision implements IDBAccessObject {
         * @return Integer
         */
        public function getUser( $audience = self::FOR_PUBLIC, User $user = null ) {
-               if( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
+               if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
                        return 0;
-               } elseif( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $user ) ) {
+               } elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $user ) ) {
                        return 0;
                } else {
                        return $this->mUser;
@@ -801,9 +801,9 @@ class Revision implements IDBAccessObject {
         * @return string
         */
        public function getUserText( $audience = self::FOR_PUBLIC, User $user = null ) {
-               if( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
+               if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
                        return '';
-               } elseif( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $user ) ) {
+               } elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $user ) ) {
                        return '';
                } else {
                        return $this->getRawUserText();
@@ -841,9 +841,9 @@ class Revision implements IDBAccessObject {
         * @return String
         */
        function getComment( $audience = self::FOR_PUBLIC, User $user = null ) {
-               if( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
+               if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
                        return '';
-               } elseif( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_COMMENT, $user ) ) {
+               } elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_COMMENT, $user ) ) {
                        return '';
                } else {
                        return $this->mComment;
@@ -870,17 +870,17 @@ class Revision implements IDBAccessObject {
         * @return Integer rcid of the unpatrolled row, zero if there isn't one
         */
        public function isUnpatrolled() {
-               if( $this->mUnpatrolled !== null ) {
+               if ( $this->mUnpatrolled !== null ) {
                        return $this->mUnpatrolled;
                }
                $dbr = wfGetDB( DB_SLAVE );
                $this->mUnpatrolled = $dbr->selectField( 'recentchanges',
                        'rc_id',
                        array( // Add redundant user,timestamp condition so we can use the existing index
-                               'rc_user_text'  => $this->getRawUserText(),
-                               'rc_timestamp'  => $dbr->timestamp( $this->getTimestamp() ),
+                               'rc_user_text' => $this->getRawUserText(),
+                               'rc_timestamp' => $dbr->timestamp( $this->getTimestamp() ),
                                'rc_this_oldid' => $this->getId(),
-                               'rc_patrolled'  => 0
+                               'rc_patrolled' => 0
                        ),
                        __METHOD__
                );
@@ -943,9 +943,9 @@ class Revision implements IDBAccessObject {
         * @return Content|null
         */
        public function getContent( $audience = self::FOR_PUBLIC, User $user = null ) {
-               if( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_TEXT ) ) {
+               if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_TEXT ) ) {
                        return null;
-               } elseif( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_TEXT, $user ) ) {
+               } elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_TEXT, $user ) ) {
                        return null;
                } else {
                        return $this->getContentInternal();
@@ -996,9 +996,9 @@ class Revision implements IDBAccessObject {
         * @return Content|null the Revision's content, or null on failure.
         */
        protected function getContentInternal() {
-               if( is_null( $this->mContent ) ) {
+               if ( is_null( $this->mContent ) ) {
                        // Revision is immutable. Load on demand:
-                       if( is_null( $this->mText ) ) {
+                       if ( is_null( $this->mText ) ) {
                                $this->mText = $this->loadText();
                        }
 
@@ -1097,9 +1097,9 @@ class Revision implements IDBAccessObject {
         * @return Revision|null
         */
        public function getPrevious() {
-               if( $this->getTitle() ) {
+               if ( $this->getTitle() ) {
                        $prev = $this->getTitle()->getPreviousRevisionID( $this->getId() );
-                       if( $prev ) {
+                       if ( $prev ) {
                                return self::newFromTitle( $this->getTitle(), $prev );
                        }
                }
@@ -1112,7 +1112,7 @@ class Revision implements IDBAccessObject {
         * @return Revision or null
         */
        public function getNext() {
-               if( $this->getTitle() ) {
+               if ( $this->getTitle() ) {
                        $next = $this->getTitle()->getNextRevisionID( $this->getId() );
                        if ( $next ) {
                                return self::newFromTitle( $this->getTitle(), $next );
@@ -1129,11 +1129,11 @@ class Revision implements IDBAccessObject {
         * @return Integer
         */
        private function getPreviousRevisionId( $db ) {
-               if( is_null( $this->mPage ) ) {
+               if ( is_null( $this->mPage ) ) {
                        return 0;
                }
                # Use page_latest if ID is not given
-               if( !$this->mId ) {
+               if ( !$this->mId ) {
                        $prevId = $db->selectField( 'page', 'page_latest',
                                array( 'page_id' => $this->mPage ),
                                __METHOD__ );
@@ -1166,13 +1166,13 @@ class Revision implements IDBAccessObject {
                $textField = $prefix . 'text';
                $flagsField = $prefix . 'flags';
 
-               if( isset( $row->$flagsField ) ) {
+               if ( isset( $row->$flagsField ) ) {
                        $flags = explode( ',', $row->$flagsField );
                } else {
                        $flags = array();
                }
 
-               if( isset( $row->$textField ) ) {
+               if ( isset( $row->$textField ) ) {
                        $text = $row->$textField;
                } else {
                        wfProfileOut( __METHOD__ );
@@ -1183,7 +1183,7 @@ class Revision implements IDBAccessObject {
                if ( in_array( 'external', $flags ) ) {
                        $url = $text;
                        $parts = explode( '://', $url, 2 );
-                       if( count( $parts ) == 1 || $parts[1] == '' ) {
+                       if ( count( $parts ) == 1 || $parts[1] == '' ) {
                                wfProfileOut( __METHOD__ );
                                return false;
                        }
@@ -1192,14 +1192,14 @@ class Revision implements IDBAccessObject {
 
                // If the text was fetched without an error, convert it
                if ( $text !== false ) {
-                       if( in_array( 'gzip', $flags ) ) {
+                       if ( in_array( 'gzip', $flags ) ) {
                                # Deal with optional compression of archived pages.
                                # This can be done periodically via maintenance/compressOld.php, and
                                # as pages are saved if $wgCompressRevisions is set.
                                $text = gzinflate( $text );
                        }
 
-                       if( in_array( 'object', $flags ) ) {
+                       if ( in_array( 'object', $flags ) ) {
                                # Generic compressed storage
                                $obj = unserialize( $text );
                                if ( !is_object( $obj ) ) {
@@ -1211,7 +1211,7 @@ class Revision implements IDBAccessObject {
                        }
 
                        global $wgLegacyEncoding;
-                       if( $text !== false && $wgLegacyEncoding
+                       if ( $text !== false && $wgLegacyEncoding
                                && !in_array( 'utf-8', $flags ) && !in_array( 'utf8', $flags ) )
                        {
                                # Old revisions kept around in a legacy encoding?
@@ -1244,8 +1244,8 @@ class Revision implements IDBAccessObject {
                # on load if $wgLegacyCharset is set in the future.
                $flags[] = 'utf-8';
 
-               if( $wgCompressRevisions ) {
-                       if( function_exists( 'gzdeflate' ) ) {
+               if ( $wgCompressRevisions ) {
+                       if ( function_exists( 'gzdeflate' ) ) {
                                $text = gzdeflate( $text );
                                $flags[] = 'gzip';
                        } else {
@@ -1274,33 +1274,35 @@ class Revision implements IDBAccessObject {
                $flags = self::compressRevisionText( $data );
 
                # Write to external storage if required
-               if( $wgDefaultExternalStore ) {
+               if ( $wgDefaultExternalStore ) {
                        // Store and get the URL
                        $data = ExternalStore::insertToDefault( $data );
-                       if( !$data ) {
+                       if ( !$data ) {
                                wfProfileOut( __METHOD__ );
                                throw new MWException( "Unable to store text to external storage" );
                        }
-                       if( $flags ) {
+                       if ( $flags ) {
                                $flags .= ',';
                        }
                        $flags .= 'external';
                }
 
                # Record the text (or external storage URL) to the text table
-               if( !isset( $this->mTextId ) ) {
+               if ( !isset( $this->mTextId ) ) {
                        $old_id = $dbw->nextSequenceValue( 'text_old_id_seq' );
                        $dbw->insert( 'text',
                                array(
-                                       'old_id'    => $old_id,
-                                       'old_text'  => $data,
+                                       'old_id' => $old_id,
+                                       'old_text' => $data,
                                        'old_flags' => $flags,
                                ), __METHOD__
                        );
                        $this->mTextId = $dbw->insertId();
                }
 
-               if ( $this->mComment === null ) $this->mComment = "";
+               if ( $this->mComment === null ) {
+                       $this->mComment = "";
+               }
 
                # Record the edit in revisions
                $rev_id = isset( $this->mId )
@@ -1424,9 +1426,9 @@ class Revision implements IDBAccessObject {
                global $wgRevisionCacheExpiry, $wgMemc;
                $textId = $this->getTextId();
                $key = wfMemcKey( 'revisiontext', 'textid', $textId );
-               if( $wgRevisionCacheExpiry ) {
+               if ( $wgRevisionCacheExpiry ) {
                        $text = $wgMemc->get( $key );
-                       if( is_string( $text ) ) {
+                       if ( is_string( $text ) ) {
                                wfDebug( __METHOD__ . ": got id $textId from cache\n" );
                                wfProfileOut( __METHOD__ );
                                return $text;
@@ -1441,7 +1443,7 @@ class Revision implements IDBAccessObject {
                        $row = null;
                }
 
-               if( !$row ) {
+               if ( !$row ) {
                        // Text data is immutable; check slaves first.
                        $dbr = wfGetDB( DB_SLAVE );
                        $row = $dbr->selectRow( 'text',
@@ -1450,7 +1452,7 @@ class Revision implements IDBAccessObject {
                                __METHOD__ );
                }
 
-               if( !$row && wfGetLB()->getServerCount() > 1 ) {
+               if ( !$row && wfGetLB()->getServerCount() > 1 ) {
                        // Possible slave lag!
                        $dbw = wfGetDB( DB_MASTER );
                        $row = $dbw->selectRow( 'text',
@@ -1462,7 +1464,7 @@ class Revision implements IDBAccessObject {
                $text = self::getRevisionText( $row );
 
                # No negative caching -- negative hits on text rows may be due to corrupted slave servers
-               if( $wgRevisionCacheExpiry && $text !== false ) {
+               if ( $wgRevisionCacheExpiry && $text !== false ) {
                        $wgMemc->set( $key, $text, $wgRevisionCacheExpiry );
                }
 
@@ -1507,7 +1509,7 @@ class Revision implements IDBAccessObject {
                                ),
                        __METHOD__ );
 
-               if( $current ) {
+               if ( $current ) {
                        $row = array(
                                'page'       => $pageId,
                                'comment'    => $summary,
@@ -1560,7 +1562,7 @@ class Revision implements IDBAccessObject {
         * @return Boolean
         */
        public static function userCanBitfield( $bitfield, $field, User $user = null ) {
-               if( $bitfield & $field ) { // aspect is deleted
+               if ( $bitfield & $field ) { // aspect is deleted
                        if ( $bitfield & self::DELETED_RESTRICTED ) {
                                $permission = 'suppressrevision';
                        } elseif ( $field & self::DELETED_TEXT ) {
@@ -1613,7 +1615,7 @@ class Revision implements IDBAccessObject {
        static function countByPageId( $db, $id ) {
                $row = $db->selectRow( 'revision', array( 'revCount' => 'COUNT(*)' ),
                        array( 'rev_page' => $id ), __METHOD__ );
-               if( $row ) {
+               if ( $row ) {
                        return $row->revCount;
                }
                return 0;
@@ -1628,7 +1630,7 @@ class Revision implements IDBAccessObject {
         */
        static function countByTitle( $db, $title ) {
                $id = $title->getArticleID();
-               if( $id ) {
+               if ( $id ) {
                        return self::countByPageId( $db, $id );
                }
                return 0;
@@ -1650,7 +1652,9 @@ class Revision implements IDBAccessObject {
         * @return bool True if the given user was the only one to edit since the given timestamp
         */
        public static function userWasLastToEdit( $db, $pageId, $userId, $since ) {
-               if ( !$userId ) return false;
+               if ( !$userId ) {
+                       return false;
+               }
 
                if ( is_int( $db ) ) {
                        $db = wfGetDB( $db );
index 666df96..1b865bb 100644 (file)
@@ -105,7 +105,7 @@ abstract class RevisionListBase extends ContextSource {
         * @return int
         */
        public function length() {
-               if( !$this->res ) {
+               if ( !$this->res ) {
                        return 0;
                } else {
                        return $this->res->numRows();
index 3acb740..b9b0591 100644 (file)
@@ -405,7 +405,7 @@ class Sanitizer {
                                'td', 'th', 'tr',
                        );
                        $htmllist = array( # Tags used by list
-                               'ul','ol',
+                               'ul', 'ol',
                        );
                        $listtags = array( # Tags that can appear in a list
                                'li',
@@ -446,7 +446,7 @@ class Sanitizer {
                                # $params: String between element name and >
                                # $brace: Ending '>' or '/>'
                                # $rest: Everything until the next element of $bits
-                               if( preg_match( '!^(/?)(\\w+)([^>]*?)(/{0,1}>)([^<]*)$!', $x, $regs ) ) {
+                               if ( preg_match( '!^(/?)(\\w+)([^>]*?)(/{0,1}>)([^<]*)$!', $x, $regs ) ) {
                                        list( /* $qbar */, $slash, $t, $params, $brace, $rest ) = $regs;
                                } else {
                                        $slash = $t = $params = $brace = $rest = null;
@@ -537,7 +537,7 @@ class Sanitizer {
 
                                                # Replace any variables or template parameters with
                                                # plaintext results.
-                                               if( is_callable( $processCallback ) ) {
+                                               if ( is_callable( $processCallback ) ) {
                                                        call_user_func_array( $processCallback, array( &$params, $args ) );
                                                }
 
@@ -572,7 +572,7 @@ class Sanitizer {
                                @list( /* $qbar */, $slash, $t, $params, $brace, $rest ) = $regs;
                                $badtag = false;
                                if ( isset( $htmlelements[$t = strtolower( $t )] ) ) {
-                                       if( is_callable( $processCallback ) ) {
+                                       if ( is_callable( $processCallback ) ) {
                                                call_user_func_array( $processCallback, array( &$params, $args ) );
                                        }
 
@@ -623,8 +623,9 @@ class Sanitizer {
                                $spaceStart--;
                                $spaceLen++;
                        }
-                       while ( substr( $text, $spaceStart + $spaceLen, 1 ) === ' ' )
+                       while ( substr( $text, $spaceStart + $spaceLen, 1 ) === ' ' ) {
                                $spaceLen++;
+                       }
                        if ( substr( $text, $spaceStart, 1 ) === "\n" and substr( $text, $spaceStart + $spaceLen, 1 ) === "\n" ) {
                                # Remove the comment, leading and trailing
                                # spaces, and leave only one newline.
@@ -714,7 +715,7 @@ class Sanitizer {
                $hrefExp = '/^(' . wfUrlProtocols() . ')[^\s]+$/';
 
                $out = array();
-               foreach( $attribs as $attribute => $value ) {
+               foreach ( $attribs as $attribute => $value ) {
                        #allow XML namespace declaration if RDFa is enabled
                        if ( $wgAllowRdfaAttributes && preg_match( self::XMLNS_ATTRIBUTE_PATTERN, $attribute ) ) {
                                if ( !preg_match( self::EVIL_URI_PATTERN, $value ) ) {
@@ -731,7 +732,7 @@ class Sanitizer {
 
                        # Strip javascript "expression" from stylesheets.
                        # http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp
-                       if( $attribute == 'style' ) {
+                       if ( $attribute == 'style' ) {
                                $value = Sanitizer::checkCss( $value );
                        }
 
@@ -800,9 +801,10 @@ class Sanitizer {
         */
        static function mergeAttributes( $a, $b ) {
                $out = array_merge( $a, $b );
-               if( isset( $a['class'] ) && isset( $b['class'] )
-               && is_string( $a['class'] ) && is_string( $b['class'] )
-               && $a['class'] !== $b['class'] ) {
+               if ( isset( $a['class'] ) && isset( $b['class'] )
+                       && is_string( $a['class'] ) && is_string( $b['class'] )
+                       && $a['class'] !== $b['class']
+               ) {
                        $classes = preg_split( '/\s+/', "{$a['class']} {$b['class']}",
                                -1, PREG_SPLIT_NO_EMPTY );
                        $out['class'] = implode( ' ', array_unique( $classes ) );
@@ -925,7 +927,7 @@ class Sanitizer {
         * @return String
         */
        static function fixTagAttributes( $text, $element ) {
-               if( trim( $text ) == '' ) {
+               if ( trim( $text ) == '' ) {
                        return '';
                }
 
@@ -933,7 +935,7 @@ class Sanitizer {
                $stripped = Sanitizer::validateTagAttributes( $decoded, $element );
 
                $attribs = array();
-               foreach( $stripped as $attribute => $value ) {
+               foreach ( $stripped as $attribute => $value ) {
                        $encAttribute = htmlspecialchars( $attribute );
                        $encValue = Sanitizer::safeEncodeAttribute( $value );
 
@@ -1111,13 +1113,13 @@ class Sanitizer {
         * @return Array
         */
        public static function decodeTagAttributes( $text ) {
-               if( trim( $text ) == '' ) {
+               if ( trim( $text ) == '' ) {
                        return array();
                }
 
                $attribs = array();
                $pairs = array();
-               if( !preg_match_all(
+               if ( !preg_match_all(
                        self::getAttribsRegex(),
                        $text,
                        $pairs,
@@ -1125,7 +1127,7 @@ class Sanitizer {
                        return $attribs;
                }
 
-               foreach( $pairs as $set ) {
+               foreach ( $pairs as $set ) {
                        $attribute = strtolower( $set[1] );
                        $value = Sanitizer::getTagAttributeCallback( $set );
 
@@ -1148,19 +1150,19 @@ class Sanitizer {
         * @return String
         */
        private static function getTagAttributeCallback( $set ) {
-               if( isset( $set[6] ) ) {
+               if ( isset( $set[6] ) ) {
                        # Illegal #XXXXXX color with no quotes.
                        return $set[6];
-               } elseif( isset( $set[5] ) ) {
+               } elseif ( isset( $set[5] ) ) {
                        # No quotes.
                        return $set[5];
-               } elseif( isset( $set[4] ) ) {
+               } elseif ( isset( $set[4] ) ) {
                        # Single-quoted
                        return $set[4];
-               } elseif( isset( $set[3] ) ) {
+               } elseif ( isset( $set[3] ) ) {
                        # Double-quoted
                        return $set[3];
-               } elseif( !isset( $set[2] ) ) {
+               } elseif ( !isset( $set[2] ) ) {
                        # In XHTML, attributes must have a value.
                        # For 'reduced' form, return explicitly the attribute name here.
                        return $set[1];
@@ -1236,14 +1238,14 @@ class Sanitizer {
         */
        static function normalizeCharReferencesCallback( $matches ) {
                $ret = null;
-               if( $matches[1] != '' ) {
+               if ( $matches[1] != '' ) {
                        $ret = Sanitizer::normalizeEntity( $matches[1] );
-               } elseif( $matches[2] != '' ) {
+               } elseif ( $matches[2] != '' ) {
                        $ret = Sanitizer::decCharReference( $matches[2] );
-               } elseif( $matches[3] != '' ) {
+               } elseif ( $matches[3] != '' ) {
                        $ret = Sanitizer::hexCharReference( $matches[3] );
                }
-               if( is_null( $ret ) ) {
+               if ( is_null( $ret ) ) {
                        return htmlspecialchars( $matches[0] );
                } else {
                        return $ret;
@@ -1279,7 +1281,7 @@ class Sanitizer {
         */
        static function decCharReference( $codepoint ) {
                $point = intval( $codepoint );
-               if( Sanitizer::validateCodepoint( $point ) ) {
+               if ( Sanitizer::validateCodepoint( $point ) ) {
                        return sprintf( '&#%d;', $point );
                } else {
                        return null;
@@ -1292,7 +1294,7 @@ class Sanitizer {
         */
        static function hexCharReference( $codepoint ) {
                $point = hexdec( $codepoint );
-               if( Sanitizer::validateCodepoint( $point ) ) {
+               if ( Sanitizer::validateCodepoint( $point ) ) {
                        return sprintf( '&#x%x;', $point );
                } else {
                        return null;
@@ -1356,11 +1358,11 @@ class Sanitizer {
         * @return String
         */
        static function decodeCharReferencesCallback( $matches ) {
-               if( $matches[1] != '' ) {
+               if ( $matches[1] != '' ) {
                        return Sanitizer::decodeEntity( $matches[1] );
-               } elseif( $matches[2] != '' ) {
+               } elseif ( $matches[2] != '' ) {
                        return Sanitizer::decodeChar( intval( $matches[2] ) );
-               } elseif( $matches[3] != '' ) {
+               } elseif ( $matches[3] != '' ) {
                        return Sanitizer::decodeChar( hexdec( $matches[3] ) );
                }
                # Last case should be an ampersand by itself
@@ -1375,7 +1377,7 @@ class Sanitizer {
         * @private
         */
        static function decodeChar( $codepoint ) {
-               if( Sanitizer::validateCodepoint( $codepoint ) ) {
+               if ( Sanitizer::validateCodepoint( $codepoint ) ) {
                        return codepointToUtf8( $codepoint );
                } else {
                        return UTF8_REPLACEMENT;
@@ -1394,7 +1396,7 @@ class Sanitizer {
                if ( isset( self::$htmlEntityAliases[$name] ) ) {
                        $name = self::$htmlEntityAliases[$name];
                }
-               if( isset( self::$htmlEntities[$name] ) ) {
+               if ( isset( self::$htmlEntities[$name] ) ) {
                        return codepointToUtf8( self::$htmlEntities[$name] );
                } else {
                        return "&$name;";
@@ -1662,7 +1664,7 @@ class Sanitizer {
         */
        static function hackDocType() {
                $out = "<!DOCTYPE html [\n";
-               foreach( self::$htmlEntities as $entity => $codepoint ) {
+               foreach ( self::$htmlEntities as $entity => $codepoint ) {
                        $out .= "<!ENTITY $entity \"&#$codepoint;\">";
                }
                $out .= "]>\n";
@@ -1684,7 +1686,7 @@ class Sanitizer {
 
                # Validate hostname portion
                $matches = array();
-               if( preg_match( '!^([^:]+:)(//[^/]+)?(.*)$!iD', $url, $matches ) ) {
+               if ( preg_match( '!^([^:]+:)(//[^/]+)?(.*)$!iD', $url, $matches ) ) {
                        list( /* $whole */, $protocol, $host, $rest ) = $matches;
 
                        // Characters that will be ignored in IDNs.
@@ -1754,7 +1756,7 @@ class Sanitizer {
         */
        public static function validateEmail( $addr ) {
                $result = null;
-               if( !wfRunHooks( 'isValidEmailAddr', array( $addr, &$result ) ) ) {
+               if ( !wfRunHooks( 'isValidEmailAddr', array( $addr, &$result ) ) ) {
                        return $result;
                }
 
index 08ab143..1ceee49 100644 (file)
@@ -44,8 +44,12 @@ if ( !isset( $wgVersion ) ) {
 }
 
 // Set various default paths sensibly...
-if ( $wgScript === false ) $wgScript = "$wgScriptPath/index$wgScriptExtension";
-if ( $wgLoadScript === false ) $wgLoadScript = "$wgScriptPath/load$wgScriptExtension";
+if ( $wgScript === false ) {
+       $wgScript = "$wgScriptPath/index$wgScriptExtension";
+}
+if ( $wgLoadScript === false ) {
+       $wgLoadScript = "$wgScriptPath/load$wgScriptExtension";
+}
 
 if ( $wgArticlePath === false ) {
        if ( $wgUsePathInfo ) {
@@ -61,24 +65,38 @@ if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
        $wgActionPaths['view'] = $wgArticlePath;
 }
 
-if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
-       # 'view' is assumed the default action path everywhere in the code
-       # but is rarely filled in $wgActionPaths
-       $wgActionPaths['view'] = $wgArticlePath;
+if ( $wgStylePath === false ) {
+       $wgStylePath = "$wgScriptPath/skins";
+}
+if ( $wgLocalStylePath === false ) {
+       $wgLocalStylePath = "$wgScriptPath/skins";
+}
+if ( $wgStyleDirectory === false ) {
+       $wgStyleDirectory = "$IP/skins";
+}
+if ( $wgExtensionAssetsPath === false ) {
+       $wgExtensionAssetsPath = "$wgScriptPath/extensions";
 }
 
-if ( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins";
-if ( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins";
-if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins";
-if ( $wgExtensionAssetsPath === false ) $wgExtensionAssetsPath = "$wgScriptPath/extensions";
-
-if ( $wgLogo === false ) $wgLogo = "$wgStylePath/common/images/wiki.png";
+if ( $wgLogo === false ) {
+       $wgLogo = "$wgStylePath/common/images/wiki.png";
+}
 
-if ( $wgUploadPath === false ) $wgUploadPath = "$wgScriptPath/images";
-if ( $wgUploadDirectory === false ) $wgUploadDirectory = "$IP/images";
-if ( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
-if ( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
-if ( $wgDeletedDirectory === false ) $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
+if ( $wgUploadPath === false ) {
+       $wgUploadPath = "$wgScriptPath/images";
+}
+if ( $wgUploadDirectory === false ) {
+       $wgUploadDirectory = "$IP/images";
+}
+if ( $wgReadOnlyFile === false ) {
+       $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
+}
+if ( $wgFileCacheDirectory === false ) {
+       $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
+}
+if ( $wgDeletedDirectory === false ) {
+       $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
+}
 
 if ( isset( $wgFileStore['deleted']['directory'] ) ) {
        $wgDeletedDirectory = $wgFileStore['deleted']['directory'];
@@ -129,13 +147,13 @@ $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
  * Initialise $wgLockManagers to include basic FS version
  */
 $wgLockManagers[] = array(
-       'name'          => 'fsLockManager',
-       'class'         => 'FSLockManager',
+       'name' => 'fsLockManager',
+       'class' => 'FSLockManager',
        'lockDirectory' => "{$wgUploadDirectory}/lockdir",
 );
 $wgLockManagers[] = array(
-       'name'          => 'nullLockManager',
-       'class'         => 'NullLockManager',
+       'name' => 'nullLockManager',
+       'class' => 'NullLockManager',
 );
 
 /**
@@ -201,15 +219,15 @@ if ( $wgUseSharedUploads ) {
 }
 if ( $wgUseInstantCommons ) {
        $wgForeignFileRepos[] = array(
-               'class'                  => 'ForeignAPIRepo',
-               'name'                   => 'wikimediacommons',
-               'apibase'                => WebRequest::detectProtocol() === 'https' ?
+               'class' => 'ForeignAPIRepo',
+               'name' => 'wikimediacommons',
+               'apibase' => WebRequest::detectProtocol() === 'https' ?
                        'https://commons.wikimedia.org/w/api.php' :
                        'http://commons.wikimedia.org/w/api.php',
-               'hashLevels'             => 2,
-               'fetchDescription'       => true,
+               'hashLevels' => 2,
+               'fetchDescription' => true,
                'descriptionCacheExpiry' => 43200,
-               'apiThumbCacheExpiry'    => 86400,
+               'apiThumbCacheExpiry' => 86400,
        );
 }
 /*
@@ -300,7 +318,7 @@ $wgCanonicalNamespaceNames = array(
 );
 
 /// @todo UGLY UGLY
-if( is_array( $wgExtraNamespaces ) ) {
+if ( is_array( $wgExtraNamespaces ) ) {
        $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces;
 }
 
@@ -322,7 +340,7 @@ if ( !$wgEnotifMinorEdits ) {
 }
 
 # $wgDisabledActions is deprecated as of 1.18
-foreach( $wgDisabledActions as $action ) {
+foreach ( $wgDisabledActions as $action ) {
        $wgActions[$action] = false;
 }
 
@@ -432,7 +450,7 @@ if ( is_null( $wgLocaltimezone ) ) {
 }
 
 date_default_timezone_set( $wgLocaltimezone );
-if( is_null( $wgLocalTZoffset ) ) {
+if ( is_null( $wgLocalTZoffset ) ) {
        $wgLocalTZoffset = date( 'Z' ) / 60;
 }
 
@@ -538,10 +556,11 @@ foreach ( $wgExtensionFunctions as $func ) {
        if ( is_object( $func ) && $func instanceof Closure ) {
                $profName = $fname . '-extensions-closure';
        } elseif ( is_array( $func ) ) {
-               if ( is_object( $func[0] ) )
+               if ( is_object( $func[0] ) ) {
                        $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
-               else
+               } else {
                        $profName = $fname . '-extensions-' . implode( '::', $func );
+               }
        } else {
                $profName = $fname . '-extensions-' . strval( $func );
        }
index 2d250df..63c3d34 100644 (file)
@@ -191,11 +191,11 @@ class SiteConfiguration {
         */
        protected function getSetting( $settingName, $wiki, /*array*/ $params ) {
                $retval = null;
-               if( array_key_exists( $settingName, $this->settings ) ) {
+               if ( array_key_exists( $settingName, $this->settings ) ) {
                        $thisSetting =& $this->settings[$settingName];
                        do {
                                // Do individual wiki settings
-                               if( array_key_exists( $wiki, $thisSetting ) ) {
+                               if ( array_key_exists( $wiki, $thisSetting ) ) {
                                        $retval = $thisSetting[$wiki];
                                        break;
                                } elseif ( array_key_exists( "+$wiki", $thisSetting ) && is_array( $thisSetting["+$wiki"] ) ) {
@@ -203,16 +203,16 @@ class SiteConfiguration {
                                }
 
                                // Do tag settings
-                               foreach( $params['tags'] as $tag ) {
-                                       if( array_key_exists( $tag, $thisSetting ) ) {
+                               foreach ( $params['tags'] as $tag ) {
+                                       if ( array_key_exists( $tag, $thisSetting ) ) {
                                                if ( isset( $retval ) && is_array( $retval ) && is_array( $thisSetting[$tag] ) ) {
                                                        $retval = self::arrayMerge( $retval, $thisSetting[$tag] );
                                                } else {
                                                        $retval = $thisSetting[$tag];
                                                }
                                                break 2;
-                                       } elseif( array_key_exists( "+$tag", $thisSetting ) && is_array( $thisSetting["+$tag"] ) ) {
-                                               if( !isset( $retval ) ) {
+                                       } elseif ( array_key_exists( "+$tag", $thisSetting ) && is_array( $thisSetting["+$tag"] ) ) {
+                                               if ( !isset( $retval ) ) {
                                                        $retval = array();
                                                }
                                                $retval = self::arrayMerge( $retval, $thisSetting["+$tag"] );
@@ -220,8 +220,8 @@ class SiteConfiguration {
                                }
                                // Do suffix settings
                                $suffix = $params['suffix'];
-                               if( !is_null( $suffix ) ) {
-                                       if( array_key_exists( $suffix, $thisSetting ) ) {
+                               if ( !is_null( $suffix ) ) {
+                                       if ( array_key_exists( $suffix, $thisSetting ) ) {
                                                if ( isset( $retval ) && is_array( $retval ) && is_array( $thisSetting[$suffix] ) ) {
                                                        $retval = self::arrayMerge( $retval, $thisSetting[$suffix] );
                                                } else {
@@ -237,8 +237,8 @@ class SiteConfiguration {
                                }
 
                                // Fall back to default.
-                               if( array_key_exists( 'default', $thisSetting ) ) {
-                                       if( is_array( $retval ) && is_array( $thisSetting['default'] ) ) {
+                               if ( array_key_exists( 'default', $thisSetting ) ) {
+                                       if ( is_array( $retval ) && is_array( $thisSetting['default'] ) ) {
                                                $retval = self::arrayMerge( $retval, $thisSetting['default'] );
                                        } else {
                                                $retval = $thisSetting['default'];
@@ -248,7 +248,7 @@ class SiteConfiguration {
                        } while ( false );
                }
 
-               if( !is_null( $retval ) && count( $params['params'] ) ) {
+               if ( !is_null( $retval ) && count( $params['params'] ) ) {
                        foreach ( $params['params'] as $key => $value ) {
                                $retval = $this->doReplace( '$' . $key, $value, $retval );
                        }
@@ -266,10 +266,10 @@ class SiteConfiguration {
         * @return string
         */
        function doReplace( $from, $to, $in ) {
-               if( is_string( $in ) ) {
+               if ( is_string( $in ) ) {
                        return str_replace( $from, $to, $in );
-               } elseif( is_array( $in ) ) {
-                       foreach( $in as $key => $val ) {
+               } elseif ( is_array( $in ) ) {
+                       foreach ( $in as $key => $val ) {
                                $in[$key] = $this->doReplace( $from, $to, $val );
                        }
                        return $in;
@@ -289,7 +289,7 @@ class SiteConfiguration {
        public function getAll( $wiki, $suffix = null, $params = array(), $wikiTags = array() ) {
                $params = $this->mergeParams( $wiki, $suffix, $params, $wikiTags );
                $localSettings = array();
-               foreach( $this->settings as $varname => $stuff ) {
+               foreach ( $this->settings as $varname => $stuff ) {
                        $append = false;
                        $var = $varname;
                        if ( substr( $varname, 0, 1 ) == '+' ) {
@@ -409,18 +409,18 @@ class SiteConfiguration {
                        'params' => array(),
                );
 
-               if( !is_callable( $this->siteParamsCallback ) ) {
+               if ( !is_callable( $this->siteParamsCallback ) ) {
                        return $default;
                }
 
                $ret = call_user_func_array( $this->siteParamsCallback, array( $this, $wiki ) );
                # Validate the returned value
-               if( !is_array( $ret ) ) {
+               if ( !is_array( $ret ) ) {
                        return $default;
                }
 
-               foreach( $default as $name => $def ) {
-                       if( !isset( $ret[$name] ) || ( is_array( $default[$name] ) && !is_array( $ret[$name] ) ) ) {
+               foreach ( $default as $name => $def ) {
+                       if ( !isset( $ret[$name] ) || ( is_array( $default[$name] ) && !is_array( $ret[$name] ) ) ) {
                                $ret[$name] = $default[$name];
                        }
                }
@@ -443,7 +443,7 @@ class SiteConfiguration {
        protected function mergeParams( $wiki, $suffix, /*array*/ $params, /*array*/ $wikiTags ) {
                $ret = $this->getWikiParams( $wiki );
 
-               if( is_null( $ret['suffix'] ) ) {
+               if ( is_null( $ret['suffix'] ) ) {
                        $ret['suffix'] = $suffix;
                }
 
@@ -452,10 +452,10 @@ class SiteConfiguration {
                $ret['params'] += $params;
 
                // Automatically fill that ones if needed
-               if( !isset( $ret['params']['lang'] ) && !is_null( $ret['lang'] ) ) {
+               if ( !isset( $ret['params']['lang'] ) && !is_null( $ret['lang'] ) ) {
                        $ret['params']['lang'] = $ret['lang'];
                }
-               if( !isset( $ret['params']['site'] ) && !is_null( $ret['suffix'] ) ) {
+               if ( !isset( $ret['params']['site'] ) && !is_null( $ret['suffix'] ) ) {
                        $ret['params']['site'] = $ret['suffix'];
                }
 
@@ -471,7 +471,7 @@ class SiteConfiguration {
        public function siteFromDB( $db ) {
                // Allow override
                $def = $this->getWikiParams( $db );
-               if( !is_null( $def['suffix'] ) && !is_null( $def['lang'] ) ) {
+               if ( !is_null( $def['suffix'] ) && !is_null( $def['lang'] ) ) {
                        return array( $def['suffix'], $def['lang'] );
                }
 
@@ -574,8 +574,8 @@ class SiteConfiguration {
         */
        static function arrayMerge( $array1/* ... */ ) {
                $out = $array1;
-               for( $i = 1; $i < func_num_args(); $i++ ) {
-                       foreach( func_get_arg( $i ) as $key => $value ) {
+               for ( $i = 1; $i < func_num_args(); $i++ ) {
+                       foreach ( func_get_arg( $i ) as $key => $value ) {
                                if ( isset( $out[$key] ) && is_array( $out[$key] ) && is_array( $value ) ) {
                                        $out[$key] = self::arrayMerge( $out[$key], $value );
                                } elseif ( !isset( $out[$key] ) || !$out[$key] && !is_numeric( $key ) ) {
index 4de7333..66bc9ee 100644 (file)
@@ -61,13 +61,13 @@ class SiteStats {
                wfDebug( __METHOD__ . ": reading site_stats from slave\n" );
                $row = self::doLoad( wfGetDB( DB_SLAVE ) );
 
-               if( !self::isSane( $row ) ) {
+               if ( !self::isSane( $row ) ) {
                        // Might have just been initialized during this request? Underflow?
                        wfDebug( __METHOD__ . ": site_stats damaged or missing on slave\n" );
                        $row = self::doLoad( wfGetDB( DB_MASTER ) );
                }
 
-               if( !self::isSane( $row ) ) {
+               if ( !self::isSane( $row ) ) {
                        // Normally the site_stats table is initialized at install time.
                        // Some manual construction scenarios may leave the table empty or
                        // broken, however, for instance when importing from a dump into a
@@ -79,7 +79,7 @@ class SiteStats {
                        $row = self::doLoad( wfGetDB( DB_MASTER ) );
                }
 
-               if( !self::isSane( $row ) ) {
+               if ( !self::isSane( $row ) ) {
                        wfDebug( __METHOD__ . ": site_stats persistently nonsensical o_O\n" );
                }
                return $row;
@@ -205,7 +205,7 @@ class SiteStats {
         */
        static function pagesInNs( $ns ) {
                wfProfileIn( __METHOD__ );
-               if( !isset( self::$pageCount[$ns] ) ) {
+               if ( !isset( self::$pageCount[$ns] ) ) {
                        $dbr = wfGetDB( DB_SLAVE );
                        self::$pageCount[$ns] = (int)$dbr->selectField(
                                'page',
@@ -226,7 +226,7 @@ class SiteStats {
         * @return bool
         */
        private static function isSane( $row ) {
-               if(
+               if (
                        $row === false
                        || $row->ss_total_pages < $row->ss_good_articles
                        || $row->ss_total_edits < $row->ss_total_pages
@@ -234,9 +234,9 @@ class SiteStats {
                        return false;
                }
                // Now check for underflow/overflow
-               foreach( array( 'total_views', 'total_edits', 'good_articles',
+               foreach ( array( 'total_views', 'total_edits', 'good_articles',
                'total_pages', 'users', 'images' ) as $member ) {
-                       if(
+                       if (
                                $row->{"ss_$member"} > 2000000000
                                || $row->{"ss_$member"} < 0
                        ) {
@@ -592,19 +592,19 @@ class SiteStatsInit {
                $counter->files();
 
                // Only do views if we don't want to not count them
-               if( $options['views'] ) {
+               if ( $options['views'] ) {
                        $counter->views();
                }
 
                // Update/refresh
-               if( $options['update'] ) {
+               if ( $options['update'] ) {
                        $counter->update();
                } else {
                        $counter->refresh();
                }
 
                // Count active users if need be
-               if( $options['activeUsers'] ) {
+               if ( $options['activeUsers'] ) {
                        SiteStatsUpdate::cacheUpdate( wfGetDB( DB_MASTER ) );
                }
        }
index 117e6e2..24561d8 100644 (file)
@@ -81,7 +81,7 @@ abstract class Skin extends ContextSource {
         */
        static function getSkinNameMessages() {
                $messages = array();
-               foreach( self::getSkinNames() as $skinKey => $skinName ) {
+               foreach ( self::getSkinNames() as $skinKey => $skinName ) {
                        $messages[] = "skinname-$skinKey";
                }
                return $messages;
@@ -291,7 +291,7 @@ abstract class Skin extends ContextSource {
                        return $this->mRelevantUser;
                }
                $title = $this->getRelevantTitle();
-               if( $title->hasSubjectNamespace( NS_USER ) ) {
+               if ( $title->hasSubjectNamespace( NS_USER ) ) {
                        $rootUser = $title->getRootText();
                        if ( User::isIP( $rootUser ) ) {
                                $this->mRelevantUser = User::newFromName( $rootUser, false );
@@ -668,7 +668,7 @@ abstract class Skin extends ContextSource {
 
                                                if ( $c > 1 ) {
                                                        $subpages .= $wgLang->getDirMarkEntity() . $this->msg( 'pipe-separator' )->escaped();
-                                               } else  {
+                                               } else {
                                                        $subpages .= '&lt; ';
                                                }
 
@@ -1015,7 +1015,7 @@ abstract class Skin extends ContextSource {
         */
        static function makeSpecialUrl( $name, $urlaction = '', $proto = null ) {
                $title = SpecialPage::getSafeTitleFor( $name );
-               if( is_null( $proto ) ) {
+               if ( is_null( $proto ) ) {
                        return $title->getLocalURL( $urlaction );
                } else {
                        return $title->getFullURL( $urlaction, false, $proto );
@@ -1392,17 +1392,17 @@ abstract class Skin extends ContextSource {
 
                $needParse = false;
 
-               if( $name === 'default' ) {
+               if ( $name === 'default' ) {
                        // special case
                        global $wgSiteNotice;
                        $notice = $wgSiteNotice;
-                       if( empty( $notice ) ) {
+                       if ( empty( $notice ) ) {
                                wfProfileOut( __METHOD__ );
                                return false;
                        }
                } else {
                        $msg = $this->msg( $name )->inContentLanguage();
-                       if( $msg->isDisabled() ) {
+                       if ( $msg->isDisabled() ) {
                                wfProfileOut( __METHOD__ );
                                return false;
                        }
@@ -1412,8 +1412,8 @@ abstract class Skin extends ContextSource {
                // Use the extra hash appender to let eg SSL variants separately cache.
                $key = wfMemcKey( $name . $wgRenderHashAppend );
                $cachedNotice = $parserMemc->get( $key );
-               if( is_array( $cachedNotice ) ) {
-                       if( md5( $notice ) == $cachedNotice['hash'] ) {
+               if ( is_array( $cachedNotice ) ) {
+                       if ( md5( $notice ) == $cachedNotice['hash'] ) {
                                $notice = $cachedNotice['html'];
                        } else {
                                $needParse = true;
index ca49024..ae65b9d 100644 (file)
@@ -162,7 +162,7 @@ class LegacyTemplate extends BaseTemplate {
                $ret = array();
                $items = array( 'viewcount', 'credits', 'lastmod', 'numberofwatchingusers', 'copyright' );
 
-               foreach( $items as $item ) {
+               foreach ( $items as $item ) {
                        if ( $this->data[$item] !== false ) {
                                $ret[] = $this->data[$item];
                        }
@@ -694,7 +694,7 @@ class LegacyTemplate extends BaseTemplate {
 
                if ( $title->isTalkPage() ) {
                        $link = $title->getSubjectPage();
-                       switch( $link->getNamespace() ) {
+                       switch ( $link->getNamespace() ) {
                                case NS_MAIN:
                                        $text = wfMessage( 'articlepage' );
                                        break;
@@ -707,8 +707,9 @@ class LegacyTemplate extends BaseTemplate {
                                case NS_FILE:
                                        $text = wfMessage( 'imagepage' );
                                        # Make link known if image exists, even if the desc. page doesn't.
-                                       if ( wfFindFile( $link ) )
+                                       if ( wfFindFile( $link ) ) {
                                                $linkOptions[] = 'known';
+                                       }
                                        break;
                                case NS_MEDIAWIKI:
                                        $text = wfMessage( 'mediawikipage' );
index d8a1aad..e53d424 100644 (file)
@@ -43,7 +43,7 @@ class MediaWiki_I18N {
                $value = wfMessage( $value )->text();
                // interpolate variables
                $m = array();
-               while( preg_match( '/\$([0-9]*?)/sm', $value, $m ) ) {
+               while ( preg_match( '/\$([0-9]*?)/sm', $value, $m ) ) {
                        list( $src, $var ) = $m;
                        wfSuppressWarnings();
                        $varValue = $this->_context[$var];
@@ -136,7 +136,7 @@ class SkinTemplate extends Skin {
                $language_urls = array();
 
                if ( !$wgHideInterlanguageLinks ) {
-                       foreach( $out->getLanguageLinks() as $languageLinkText ) {
+                       foreach ( $out->getLanguageLinks() as $languageLinkText ) {
                                $languageLinkParts = explode( ':', $languageLinkText, 2 );
                                $class = 'interwiki-' . $languageLinkParts[0];
                                unset( $languageLinkParts );
@@ -272,9 +272,9 @@ class SkinTemplate extends Skin {
                }
 
                $tpl->set( 'catlinks', $this->getCategories() );
-               if( $out->isSyndicated() ) {
+               if ( $out->isSyndicated() ) {
                        $feeds = array();
-                       foreach( $out->getSyndicationLinks() as $format => $link ) {
+                       foreach ( $out->getSyndicationLinks() as $format => $link ) {
                                $feeds[$format] = array(
                                        'text' => $this->msg( "feed-$format" )->text(),
                                        'href' => $link
@@ -483,7 +483,7 @@ class SkinTemplate extends Skin {
                $tpl->set( 'reporttime', wfReportTime() );
 
                // original version by hansm
-               if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
+               if ( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
                        wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
                }
 
@@ -582,7 +582,7 @@ class SkinTemplate extends Skin {
                if ( strval( $page ) !== '' ) {
                        $a['returnto'] = $page;
                        $query = $request->getVal( 'returntoquery', $this->thisquery );
-                       if( $query != '' ) {
+                       if ( $query != '' ) {
                                $a['returntoquery'] = $query;
                        }
                }
@@ -592,7 +592,7 @@ class SkinTemplate extends Skin {
                }
 
                $returnto = wfArrayToCgi( $a );
-               if( $this->loggedin ) {
+               if ( $this->loggedin ) {
                        $personal_urls['userpage'] = array(
                                'text' => $this->username,
                                'href' => &$this->userpageUrlDetails['href'],
@@ -628,7 +628,7 @@ class SkinTemplate extends Skin {
                        # thickens, because the Title object is altered for special pages,
                        # so it doesn't contain the original alias-with-subpage.
                        $origTitle = Title::newFromText( $request->getText( 'title' ) );
-                       if( $origTitle instanceof Title && $origTitle->isSpecialPage() ) {
+                       if ( $origTitle instanceof Title && $origTitle->isSpecialPage() ) {
                                list( $spName, $spPar ) = SpecialPageFactory::resolveAlias( $origTitle->getText() );
                                $active = $spName == 'Contributions'
                                        && ( ( $spPar && $spPar == $this->username )
@@ -676,7 +676,7 @@ class SkinTemplate extends Skin {
                                'class' => $wgSecureLogin ? 'link-https' : ''
                        );
 
-                       if( $this->showIPinHeader() ) {
+                       if ( $this->showIPinHeader() ) {
                                $href = &$this->userpageUrlDetails['href'];
                                $personal_urls['anonuserpage'] = array(
                                        'text' => $this->username,
@@ -719,10 +719,10 @@ class SkinTemplate extends Skin {
         */
        function tabAction( $title, $message, $selected, $query = '', $checkEdit = false ) {
                $classes = array();
-               if( $selected ) {
+               if ( $selected ) {
                        $classes[] = 'selected';
                }
-               if( $checkEdit && !$title->isKnown() ) {
+               if ( $checkEdit && !$title->isKnown() ) {
                        $classes[] = 'new';
                        if ( $query !== '' ) {
                                $query = 'action=edit&redlink=1&' . $query;
@@ -747,7 +747,7 @@ class SkinTemplate extends Skin {
                }
 
                $result = array();
-               if( !wfRunHooks( 'SkinTemplateTabAction', array( &$this,
+               if ( !wfRunHooks( 'SkinTemplateTabAction', array( &$this,
                                $title, $message, $selected, $checkEdit,
                                &$classes, &$query, &$text, &$result ) ) ) {
                        return $result;
@@ -762,7 +762,7 @@ class SkinTemplate extends Skin {
 
        function makeTalkUrlDetails( $name, $urlaction = '' ) {
                $title = Title::newFromText( $name );
-               if( !is_object( $title ) ) {
+               if ( !is_object( $title ) ) {
                        throw new MWException( __METHOD__ . " given invalid pagename $name" );
                }
                $title = $title->getTalkPage();
@@ -845,7 +845,7 @@ class SkinTemplate extends Skin {
                wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) );
 
                // Checks if page is some kind of content
-               if( $title->canExist() ) {
+               if ( $title->canExist() ) {
                        // Gets page objects for the related namespaces
                        $subjectPage = $title->getSubjectPage();
                        $talkPage = $title->getTalkPage();
@@ -1032,7 +1032,7 @@ class SkinTemplate extends Skin {
                                                $params = array();
                                        }
                                        // Loops over each variant
-                                       foreach( $variants as $code ) {
+                                       foreach ( $variants as $code ) {
                                                // Gets variant name from language code
                                                $varname = $pageLang->getVariantname( $code );
                                                // Appends variant link
@@ -1165,9 +1165,9 @@ class SkinTemplate extends Skin {
 
                $nav_urls = array();
                $nav_urls['mainpage'] = array( 'href' => self::makeMainPageUrl() );
-               if( $wgUploadNavigationUrl ) {
+               if ( $wgUploadNavigationUrl ) {
                        $nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl );
-               } elseif( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getUser() ) === true ) {
+               } elseif ( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getUser() ) === true ) {
                        $nav_urls['upload'] = array( 'href' => self::makeSpecialUrl( 'Upload' ) );
                } else {
                        $nav_urls['upload'] = false;
@@ -1517,8 +1517,9 @@ abstract class BaseTemplate extends QuickTemplate {
                                $ptool['active'] = $plink['active'];
                        }
                        foreach ( array( 'href', 'class', 'text' ) as $k ) {
-                               if ( isset( $plink[$k] ) )
+                               if ( isset( $plink[$k] ) ) {
                                        $ptool['links'][0][$k] = $plink[$k];
+                               }
                        }
                        $personal_tools[$key] = $ptool;
                }
@@ -1557,39 +1558,39 @@ abstract class BaseTemplate extends QuickTemplate {
                        case 'SEARCH':
                                // Search is a special case, skins should custom implement this
                                $boxes[$boxName] = array(
-                                       'id'        => 'p-search',
-                                       'header'    => $this->getMsg( 'search' )->text(),
+                                       'id' => 'p-search',
+                                       'header' => $this->getMsg( 'search' )->text(),
                                        'generated' => false,
-                                       'content'   => true,
+                                       'content' => true,
                                );
                                break;
                        case 'TOOLBOX':
                                $msgObj = $this->getMsg( 'toolbox' );
                                $boxes[$boxName] = array(
-                                       'id'        => 'p-tb',
-                                       'header'    => $msgObj->exists() ? $msgObj->text() : 'toolbox',
+                                       'id' => 'p-tb',
+                                       'header' => $msgObj->exists() ? $msgObj->text() : 'toolbox',
                                        'generated' => false,
-                                       'content'   => $this->getToolbox(),
+                                       'content' => $this->getToolbox(),
                                );
                                break;
                        case 'LANGUAGES':
                                if ( $this->data['language_urls'] ) {
                                        $msgObj = $this->getMsg( 'otherlanguages' );
                                        $boxes[$boxName] = array(
-                                               'id'        => 'p-lang',
-                                               'header'    => $msgObj->exists() ? $msgObj->text() : 'otherlanguages',
+                                               'id' => 'p-lang',
+                                               'header' => $msgObj->exists() ? $msgObj->text() : 'otherlanguages',
                                                'generated' => false,
-                                               'content'   => $this->data['language_urls'],
+                                               'content' => $this->data['language_urls'],
                                        );
                                }
                                break;
                        default:
                                $msgObj = $this->getMsg( $boxName );
                                $boxes[$boxName] = array(
-                                       'id'        => "p-$boxName",
-                                       'header'    => $msgObj->exists() ? $msgObj->text() : $boxName,
+                                       'id' => "p-$boxName",
+                                       'header' => $msgObj->exists() ? $msgObj->text() : $boxName,
                                        'generated' => true,
-                                       'content'   => $content,
+                                       'content' => $content,
                                );
                                break;
                        }
@@ -1629,10 +1630,10 @@ abstract class BaseTemplate extends QuickTemplate {
                } else {
                        if ( $hookContents ) {
                                $boxes['TOOLBOXEND'] = array(
-                                       'id'        => 'p-toolboxend',
-                                       'header'    => $boxes['TOOLBOX']['header'],
+                                       'id' => 'p-toolboxend',
+                                       'header' => $boxes['TOOLBOX']['header'],
                                        'generated' => false,
-                                       'content'   => "<ul>{$hookContents}</ul>",
+                                       'content' => "<ul>{$hookContents}</ul>",
                                );
                                // HACK: Make sure that TOOLBOXEND is sorted next to TOOLBOX
                                $boxes2 = array();
@@ -1818,6 +1819,7 @@ abstract class BaseTemplate extends QuickTemplate {
                $realAttrs = array(
                        'type' => 'search',
                        'name' => 'search',
+                       'placeholder' => wfMessage( 'searchsuggest-search' )->text(),
                        'value' => isset( $this->data['search'] ) ? $this->data['search'] : '',
                );
                $realAttrs = array_merge( $realAttrs, Linker::tooltipAndAccesskeyAttribs( 'search' ), $attrs );
@@ -1825,7 +1827,7 @@ abstract class BaseTemplate extends QuickTemplate {
        }
 
        function makeSearchButton( $mode, $attrs = array() ) {
-               switch( $mode ) {
+               switch ( $mode ) {
                        case 'go':
                        case 'fulltext':
                                $realAttrs = array(
@@ -1881,10 +1883,10 @@ abstract class BaseTemplate extends QuickTemplate {
 
                // Reduce footer links down to only those which are being used
                $validFooterLinks = array();
-               foreach( $footerlinks as $category => $links ) {
+               foreach ( $footerlinks as $category => $links ) {
                        $validFooterLinks[$category] = array();
-                       foreach( $links as $link ) {
-                               if( isset( $this->data[$link] ) && $this->data[$link] ) {
+                       foreach ( $links as $link ) {
+                               if ( isset( $this->data[$link] ) && $this->data[$link] ) {
                                        $validFooterLinks[$category][] = $link;
                                }
                        }
index d8f6fd9..c2814e6 100644 (file)
@@ -445,7 +445,10 @@ class SpecialPage {
         * @return Mixed
         * @deprecated since 1.18
         */
-       function name( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mName, $x ); }
+       function name( $x = null ) {
+               wfDeprecated( __METHOD__, '1.18' );
+               return wfSetVar( $this->mName, $x );
+       }
 
        /**
         * These mutators are very evil, as the relevant variables should not mutate.  So
@@ -454,7 +457,10 @@ class SpecialPage {
         * @return Mixed
         * @deprecated since 1.18
         */
-       function restriction( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mRestriction, $x ); }
+       function restriction( $x = null ) {
+               wfDeprecated( __METHOD__, '1.18' );
+               return wfSetVar( $this->mRestriction, $x );
+       }
 
        /**
         * These mutators are very evil, as the relevant variables should not mutate.  So
@@ -463,7 +469,10 @@ class SpecialPage {
         * @return Mixed
         * @deprecated since 1.18
         */
-       function func( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFunction, $x ); }
+       function func( $x = null ) {
+               wfDeprecated( __METHOD__, '1.18' );
+               return wfSetVar( $this->mFunction, $x );
+       }
 
        /**
         * These mutators are very evil, as the relevant variables should not mutate.  So
@@ -472,7 +481,10 @@ class SpecialPage {
         * @return Mixed
         * @deprecated since 1.18
         */
-       function file( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFile, $x ); }
+       function file( $x = null ) {
+               wfDeprecated( __METHOD__, '1.18' );
+               return wfSetVar( $this->mFile, $x );
+       }
 
        /**
         * These mutators are very evil, as the relevant variables should not mutate.  So
@@ -481,7 +493,10 @@ class SpecialPage {
         * @return Mixed
         * @deprecated since 1.18
         */
-       function includable( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mIncludable, $x ); }
+       function includable( $x = null ) {
+               wfDeprecated( __METHOD__, '1.18' );
+               return wfSetVar( $this->mIncludable, $x );
+       }
 
        /**
         * Whether the special page is being evaluated via transclusion
@@ -917,11 +932,20 @@ abstract class FormSpecialPage extends SpecialPage {
        abstract protected function getFormFields();
 
        /**
-        * Add pre- or post-text to the form
+        * Add pre-text to the form
         * @return String HTML which will be sent to $form->addPreText()
         */
-       protected function preText() { return ''; }
-       protected function postText() { return ''; }
+       protected function preText() {
+               return '';
+       }
+
+       /**
+        * Add post-text to the form
+        * @return String HTML which will be sent to $form->addPostText()
+        */
+       protected function postText() {
+               return '';
+       }
 
        /**
         * Play with the HTMLForm if you need to more substantially
index a53b901..675fb83 100644 (file)
@@ -199,7 +199,7 @@ class SpecialPageFactory {
                                self::$mList['ChangeEmail'] = 'SpecialChangeEmail';
                        }
 
-                       if( $wgEnableJavaScriptTest ) {
+                       if ( $wgEnableJavaScriptTest ) {
                                self::$mList['JavaScriptTest'] = 'SpecialJavaScriptTest';
                        }
 
index 23a4e2b..374d5ca 100644 (file)
@@ -26,6 +26,7 @@
  *
  * @file
  * @ingroup StatCounter
+ * @author Aaron Schulz
  */
 
 /**
@@ -85,6 +86,10 @@ class StatCounter {
                $this->deltas = array();
        }
 
+       /**
+        * @param array $deltas
+        * @return void
+        */
        protected function sendDeltasUDP( array $deltas ) {
                global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID;
 
@@ -128,6 +133,10 @@ class StatCounter {
                }
        }
 
+       /**
+        * @param array $deltas
+        * @return void
+        */
        protected function sendDeltasMemc( array $deltas ) {
                global $wgMemc;
 
index d8ea24a..64a3c60 100644 (file)
@@ -212,7 +212,7 @@ class Status {
         */
        protected function getErrorMessage( $error ) {
                if ( is_array( $error ) ) {
-                       if( isset( $error['message'] ) && $error['message'] instanceof Message ) {
+                       if ( isset( $error['message'] ) && $error['message'] instanceof Message ) {
                                $msg = $error['message'];
                        } elseif ( isset( $error['message'] ) && isset( $error['params'] ) ) {
                                $msg = wfMessage( $error['message'],
@@ -294,9 +294,9 @@ class Status {
                $result = array();
                foreach ( $this->errors as $error ) {
                        if ( $error['type'] === $type ) {
-                               if( $error['message'] instanceof Message ) {
+                               if ( $error['message'] instanceof Message ) {
                                        $result[] = $error['message'];
-                               } elseif( $error['params'] ) {
+                               } elseif ( $error['params'] ) {
                                        $result[] = array_merge( array( $error['message'] ), $error['params'] );
                                } else {
                                        $result[] = array( $error['message'] );
index 21a392a..05b78e0 100644 (file)
@@ -233,7 +233,7 @@ class StringUtils {
 
                // Explode, then put the replaced separators back in
                $items = explode( $separator, $cleaned );
-               foreach( $items as $i => $str ) {
+               foreach ( $items as $i => $str ) {
                        $items[$i] = str_replace( $placeholder, $separator, $str );
                }
 
@@ -440,7 +440,7 @@ class ReplacementArray {
         * @param $data array
         */
        function removeArray( $data ) {
-               foreach( $data as $from => $to ) {
+               foreach ( $data as $from => $to ) {
                        $this->removePair( $from );
                }
                $this->fss = false;
index 7dbfabf..92e914e 100644 (file)
@@ -45,26 +45,10 @@ class MWTimestamp {
        );
 
        /**
-        * Different units for human readable timestamps.
-        * @see MWTimestamp::getHumanTimestamp
+        * The actual timestamp being wrapped (DateTime object).
+        * @var DateTime
         */
-       private static $units = array(
-               "milliseconds" => 1,
-               "seconds" => 1000, // 1000 milliseconds per second
-               "minutes" => 60, // 60 seconds per minute
-               "hours" => 60, // 60 minutes per hour
-               "days" => 24, // 24 hours per day
-               "months" => 30, // approximately 30 days per month
-               "years" => 12, // 12 months per year
-       );
-
-       /**
-        * The actual timestamp being wrapped. Either a DateTime
-        * object or a string with a Unix timestamp depending on
-        * PHP.
-        * @var string|DateTime
-        */
-       private $timestamp;
+       public $timestamp;
 
        /**
         * Make a new timestamp and set it to the specified time,
@@ -133,7 +117,7 @@ class MWTimestamp {
                        throw new TimestampException( __METHOD__ . " : Invalid timestamp - $ts" );
                }
 
-               if( !$strtime ) {
+               if ( !$strtime ) {
                        $da = array_map( 'intval', $da );
                        $da[0] = "%04d-%02d-%02dT%02d:%02d:%02d.00+00:00";
                        $strtime = call_user_func_array( "sprintf", $da );
@@ -145,7 +129,7 @@ class MWTimestamp {
                        throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' );
                }
 
-               if( $final === false ) {
+               if ( $final === false ) {
                        throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' );
                }
                $this->timestamp = $final;
@@ -164,20 +148,11 @@ class MWTimestamp {
         * @return string The formatted timestamp
         */
        public function getTimestamp( $style = TS_UNIX ) {
-               if( !isset( self::$formats[$style] ) ) {
+               if ( !isset( self::$formats[$style] ) ) {
                        throw new TimestampException( __METHOD__ . ' : Illegal timestamp output type.' );
                }
 
-               if( is_object( $this->timestamp  ) ) {
-                       // DateTime object was used, call DateTime::format.
-                       $output = $this->timestamp->format( self::$formats[$style] );
-               } elseif( TS_UNIX == $style ) {
-                       // Unix timestamp was used and is wanted, just return it.
-                       $output = $this->timestamp;
-               } else {
-                       // Unix timestamp was used, use gmdate().
-                       $output = gmdate( self::$formats[$style], $this->timestamp );
-               }
+               $output = $this->timestamp->format( self::$formats[$style] );
 
                if ( ( $style == TS_RFC2822 ) || ( $style == TS_POSTGRES ) ) {
                        $output .= ' GMT';
@@ -194,31 +169,105 @@ class MWTimestamp {
         * largest possible unit is used.
         *
         * @since 1.20
+        * @since 1.22 Uses Language::getHumanTimestamp to produce the timestamp
         *
-        * @return Message Formatted timestamp
+        * @param MWTimestamp|null $relativeTo The base timestamp to compare to (defaults to now)
+        * @param User|null $user User the timestamp is being generated for (or null to use main context's user)
+        * @param Language|null $lang Language to use to make the human timestamp (or null to use main context's language)
+        * @return string Formatted timestamp
         */
-       public function getHumanTimestamp() {
-               $then = $this->getTimestamp( TS_UNIX );
-               $now = time();
-               $timeago = ($now - $then) * 1000;
-               $message = false;
-
-               foreach( self::$units as $unit => $factor ) {
-                       $next = $timeago / $factor;
-                       if( $next < 1 ) {
-                               break;
+       public function getHumanTimestamp( MWTimestamp $relativeTo = null, User $user = null, Language $lang = null ) {
+               if ( $relativeTo === null ) {
+                       $relativeTo = new self();
+               }
+               if ( $user === null ) {
+                       $user = RequestContext::getMain()->getUser();
+               }
+               if ( $lang === null ) {
+                       $lang = RequestContext::getMain()->getLanguage();
+               }
+
+               // Adjust for the user's timezone.
+               $offsetThis = $this->offsetForUser( $user );
+               $offsetRel = $relativeTo->offsetForUser( $user );
+
+               $ts = '';
+               if ( wfRunHooks( 'GetHumanTimestamp', array( &$ts, $this, $relativeTo, $user, $lang ) ) ) {
+                       $ts = $lang->getHumanTimestamp( $this, $relativeTo, $user );
+               }
+
+               // Reset the timezone on the objects.
+               $this->timestamp->sub( $offsetThis );
+               $relativeTo->timestamp->sub( $offsetRel );
+
+               return $ts;
+       }
+
+       /**
+        * Adjust the timestamp depending on the given user's preferences.
+        *
+        * @since 1.22
+        *
+        * @param User $user User to take preferences from
+        * @param[out] MWTimestamp $ts Timestamp to adjust
+        * @return DateInterval Offset that was applied to the timestamp
+        */
+       public function offsetForUser( User $user ) {
+               global $wgLocalTZoffset;
+
+               $option = $user->getOption( 'timecorrection' );
+               $data = explode( '|', $option, 3 );
+
+               // First handle the case of an actual timezone being specified.
+               if ( $data[0] == 'ZoneInfo' ) {
+                       try {
+                               $tz = new DateTimeZone( $data[2] );
+                       } catch ( Exception $e ) {
+                               $tz = false;
+                       }
+
+                       if ( $tz ) {
+                               $this->timestamp->setTimezone( $tz );
+                               return new DateInterval( 'P0Y' );
                        } else {
-                               $timeago = $next;
-                               $message = array( $unit, floor( $timeago ) );
+                               $data[0] = 'Offset';
                        }
                }
 
-               if( $message ) {
-                       $initial = call_user_func_array( 'wfMessage', $message );
-                       return wfMessage( 'ago', $initial->parse() );
+               $diff = 0;
+               // If $option is in fact a pipe-separated value, check the
+               // first value.
+               if ( $data[0] == 'System' ) {
+                       // First value is System, so use the system offset.
+                       if ( isset( $wgLocalTZoffset ) ) {
+                               $diff = $wgLocalTZoffset;
+                       }
+               } elseif ( $data[0] == 'Offset' ) {
+                       // First value is Offset, so use the specified offset
+                       $diff = (int)$data[1];
                } else {
-                       return wfMessage( 'just-now' );
+                       // $option actually isn't a pipe separated value, but instead
+                       // a comma separated value. Isn't MediaWiki fun?
+                       $data = explode( ':', $option );
+                       if ( count( $data ) >= 2 ) {
+                               // Combination hours and minutes.
+                               $diff = abs( (int)$data[0] ) * 60 + (int)$data[1];
+                               if ( (int) $data[0] < 0 ) {
+                                       $diff *= -1;
+                               }
+                       } else {
+                               // Just hours.
+                               $diff = (int)$data[0] * 60;
+                       }
                }
+
+               $interval = new DateInterval('PT' . abs( $diff ) . 'M');
+               if ( $diff < 1 ) {
+                       $interval->invert = 1;
+               }
+
+               $this->timestamp->add( $interval );
+               return $interval;
        }
 
        /**
@@ -229,6 +278,17 @@ class MWTimestamp {
        public function __toString() {
                return $this->getTimestamp();
        }
+
+       /**
+        * Calculate the difference between two MWTimestamp objects.
+        *
+        * @since 1.22
+        * @param MWTimestamp $relativeTo Base time to calculate difference from
+        * @return DateInterval|bool The DateInterval object representing the difference between the two dates or false on failure
+        */
+       public function diff( MWTimestamp $relativeTo ) {
+               return $this->timestamp->diff( $relativeTo->timestamp );
+       }
 }
 
 /**
index fda790f..739c52a 100644 (file)
@@ -757,7 +757,7 @@ class Title {
         */
        public function getTalkNsText() {
                global $wgContLang;
-               return( $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) ) );
+               return $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) );
        }
 
        /**
@@ -766,7 +766,7 @@ class Title {
         * @return Bool TRUE or FALSE
         */
        public function canTalk() {
-               return( MWNamespace::canTalk( $this->mNamespace ) );
+               return MWNamespace::canTalk( $this->mNamespace );
        }
 
        /**
@@ -1275,10 +1275,10 @@ class Title {
         */
        public function getSubpageText() {
                if ( !MWNamespace::hasSubpages( $this->mNamespace ) ) {
-                       return( $this->mTextform );
+                       return $this->mTextform;
                }
                $parts = explode( '/', $this->mTextform );
-               return( $parts[count( $parts ) - 1] );
+               return $parts[count( $parts ) - 1];
        }
 
        /**
@@ -1318,7 +1318,7 @@ class Title {
        public function getSubpageUrlForm() {
                $text = $this->getSubpageText();
                $text = wfUrlencode( str_replace( ' ', '_', $text ) );
-               return( $text );
+               return $text;
        }
 
        /**
@@ -2046,7 +2046,7 @@ class Title {
                        return $errors;
                }
 
-               global $wgContLang, $wgLang, $wgEmailConfirmToEdit;
+               global $wgEmailConfirmToEdit;
 
                if ( $wgEmailConfirmToEdit && !$user->isEmailConfirmed() ) {
                        $errors[] = array( 'confirmedittext' );
@@ -2056,38 +2056,8 @@ class Title {
                        // Don't block the user from editing their own talk page unless they've been
                        // explicitly blocked from that too.
                } elseif ( $user->isBlocked() && $user->mBlock->prevents( $action ) !== false ) {
-                       $block = $user->getBlock();
-
-                       // This is from OutputPage::blockedPage
-                       // Copied at r23888 by werdna
-
-                       $id = $user->blockedBy();
-                       $reason = $user->blockedFor();
-                       if ( $reason == '' ) {
-                               $reason = wfMessage( 'blockednoreason' )->text();
-                       }
-                       $ip = $user->getRequest()->getIP();
-
-                       if ( is_numeric( $id ) ) {
-                               $name = User::whoIs( $id );
-                       } else {
-                               $name = $id;
-                       }
-
-                       $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]";
-                       $blockid = $block->getId();
-                       $blockExpiry = $block->getExpiry();
-                       $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $block->mTimestamp ), true );
-                       if ( $blockExpiry == 'infinity' ) {
-                               $blockExpiry = wfMessage( 'infiniteblock' )->text();
-                       } else {
-                               $blockExpiry = $wgLang->timeanddate( wfTimestamp( TS_MW, $blockExpiry ), true );
-                       }
-
-                       $intended = strval( $block->getTarget() );
-
-                       $errors[] = array( ( $block->mAuto ? 'autoblockedtext' : 'blockedtext' ), $link, $reason, $ip, $name,
-                               $blockid, $blockExpiry, $intended, $blockTimestamp );
+                       // @todo FIXME: Pass the relevant context into this function.
+                       $errors[] = $user->getBlock()->getPermissionsError( RequestContext::getMain() );
                }
 
                return $errors;
@@ -4431,7 +4401,7 @@ class Title {
                        return true;  // any interwiki link might be viewable, for all we know
                }
 
-               switch( $this->mNamespace ) {
+               switch ( $this->mNamespace ) {
                        case NS_MEDIA:
                        case NS_FILE:
                                // file exists, possibly in a foreign repo
index eda8bc9..dd6407d 100644 (file)
@@ -286,7 +286,7 @@ class User {
                                $this->loadFromId();
                                break;
                        case 'session':
-                               if( !$this->loadFromSession() ) {
+                               if ( !$this->loadFromSession() ) {
                                        // Loading from session failed. Load defaults.
                                        $this->loadDefaults();
                                }
@@ -426,7 +426,7 @@ class User {
                        'user_email_token' => md5( $code ),
                        'user_email_token_expires > ' . $dbr->addQuotes( $dbr->timestamp() ),
                        ) );
-               if( $id !== false ) {
+               if ( $id !== false ) {
                        return User::newFromId( $id );
                } else {
                        return null;
@@ -495,7 +495,7 @@ class User {
         */
        public static function idFromName( $name ) {
                $nt = Title::makeTitleSafe( NS_USER, $name );
-               if( is_null( $nt ) ) {
+               if ( is_null( $nt ) ) {
                        # Illegal name
                        return null;
                }
@@ -576,7 +576,7 @@ class User {
                // Ensure that the name can't be misresolved as a different title,
                // such as with extra namespace keys at the start.
                $parsed = Title::newFromText( $name );
-               if( is_null( $parsed )
+               if ( is_null( $parsed )
                        || $parsed->getNamespace()
                        || strcmp( $name, $parsed->getPrefixedText() ) ) {
                        wfDebugLog( 'username', __METHOD__ .
@@ -594,7 +594,7 @@ class User {
                        '\x{3000}' .          # ideographic space
                        '\x{e000}-\x{f8ff}' . # private use
                        ']/u';
-               if( preg_match( $unicodeBlacklist, $name ) ) {
+               if ( preg_match( $unicodeBlacklist, $name ) ) {
                        wfDebugLog( 'username', __METHOD__ .
                                ": '$name' invalid due to blacklisted characters" );
                        return false;
@@ -657,15 +657,15 @@ class User {
                // Ensure that the username isn't longer than 235 bytes, so that
                // (at least for the builtin skins) user javascript and css files
                // will work. (bug 23080)
-               if( strlen( $name ) > 235 ) {
+               if ( strlen( $name ) > 235 ) {
                        wfDebugLog( 'username', __METHOD__ .
                                ": '$name' invalid due to length" );
                        return false;
                }
 
                // Preg yells if you try to give it an empty string
-               if( $wgInvalidUsernameCharacters !== '' ) {
-                       if( preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ) ) {
+               if ( $wgInvalidUsernameCharacters !== '' ) {
+                       if ( preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ) ) {
                                wfDebugLog( 'username', __METHOD__ .
                                        ": '$name' invalid due to wgInvalidUsernameCharacters" );
                                return false;
@@ -702,11 +702,12 @@ class User {
 
                $result = false; //init $result to false for the internal checks
 
-               if( !wfRunHooks( 'isValidPassword', array( $password, &$result, $this ) ) )
+               if ( !wfRunHooks( 'isValidPassword', array( $password, &$result, $this ) ) ) {
                        return $result;
+               }
 
                if ( $result === false ) {
-                       if( strlen( $password ) < $wgMinimalPasswordLength ) {
+                       if ( strlen( $password ) < $wgMinimalPasswordLength ) {
                                return 'passwordtooshort';
                        } elseif ( $wgContLang->lc( $password ) == $wgContLang->lc( $this->mName ) ) {
                                return 'password-name-match';
@@ -719,7 +720,7 @@ class User {
                                //a valid password.
                                return true;
                        }
-               } elseif( $result === true ) {
+               } elseif ( $result === true ) {
                        return true;
                } else {
                        return $result; //the isValidPassword hook set a string $result and returned true
@@ -779,14 +780,15 @@ class User {
                # Reject names containing '#'; these will be cleaned up
                # with title normalisation, but then it's too late to
                # check elsewhere
-               if( strpos( $name, '#' ) !== false )
+               if ( strpos( $name, '#' ) !== false ) {
                        return false;
+               }
 
                # Clean up name according to title rules
                $t = ( $validate === 'valid' ) ?
                        Title::newFromText( $name ) : Title::makeTitle( NS_USER, $name );
                # Check for invalid titles
-               if( is_null( $t ) ) {
+               if ( is_null( $t ) ) {
                        return false;
                }
 
@@ -870,7 +872,7 @@ class User {
                $this->mOptionsLoaded = false;
 
                $loggedOut = $this->getRequest()->getCookie( 'LoggedOut' );
-               if( $loggedOut !== null ) {
+               if ( $loggedOut !== null ) {
                        $this->mTouched = wfTimestamp( TS_MW, $loggedOut );
                } else {
                        $this->mTouched = '1'; # Allow any pages to be cached
@@ -934,7 +936,7 @@ class User {
 
                if ( $cookieId !== null ) {
                        $sId = intval( $cookieId );
-                       if( $sessId !== null && $cookieId != $sessId ) {
+                       if ( $sessId !== null && $cookieId != $sessId ) {
                                wfDebugLog( 'loginSessions', "Session user ID ($sessId) and
                                        cookie user ID ($sId) don't match!" );
                                return false;
@@ -962,7 +964,7 @@ class User {
                }
 
                global $wgBlockDisablesLogin;
-               if( $wgBlockDisablesLogin && $proposedUser->isBlocked() ) {
+               if ( $wgBlockDisablesLogin && $proposedUser->isBlocked() ) {
                        # User blocked and we've disabled blocked user logins
                        return false;
                }
@@ -1004,7 +1006,7 @@ class User {
                $this->mId = intval( $this->mId );
 
                /** Anonymous user */
-               if( !$this->mId ) {
+               if ( !$this->mId ) {
                        $this->loadDefaults();
                        return false;
                }
@@ -1228,7 +1230,7 @@ class User {
                # default language setting
                $defOpt['variant'] = $wgContLang->getCode();
                $defOpt['language'] = $wgContLang->getCode();
-               foreach( SearchEngine::searchableNamespaces() as $nsnum => $nsname ) {
+               foreach ( SearchEngine::searchableNamespaces() as $nsnum => $nsname ) {
                        $defOpt['searchNs' . $nsnum] = !empty( $wgNamespacesToBeSearchedDefault[$nsnum] );
                }
                $defOpt['skin'] = $wgDefaultSkin;
@@ -1246,7 +1248,7 @@ class User {
         */
        public static function getDefaultOption( $opt ) {
                $defOpts = self::getDefaultOptions();
-               if( isset( $defOpts[$opt] ) ) {
+               if ( isset( $defOpts[$opt] ) ) {
                        return $defOpts[$opt];
                } else {
                        return null;
@@ -1356,11 +1358,13 @@ class User {
                global $wgEnableSorbs, $wgEnableDnsBlacklist,
                        $wgSorbsUrl, $wgDnsBlacklistUrls, $wgProxyWhitelist;
 
-               if ( !$wgEnableDnsBlacklist && !$wgEnableSorbs )
+               if ( !$wgEnableDnsBlacklist && !$wgEnableSorbs ) {
                        return false;
+               }
 
-               if ( $checkWhitelist && in_array( $ip, $wgProxyWhitelist ) )
+               if ( $checkWhitelist && in_array( $ip, $wgProxyWhitelist ) ) {
                        return false;
+               }
 
                $urls = array_merge( $wgDnsBlacklistUrls, (array)$wgSorbsUrl );
                return $this->inDnsBlacklist( $ip, $urls );
@@ -1378,15 +1382,15 @@ class User {
 
                $found = false;
                // @todo FIXME: IPv6 ???  (http://bugs.php.net/bug.php?id=33170)
-               if( IP::isIPv4( $ip ) ) {
+               if ( IP::isIPv4( $ip ) ) {
                        # Reverse IP, bug 21255
                        $ipReversed = implode( '.', array_reverse( explode( '.', $ip ) ) );
 
-                       foreach( (array)$bases as $base ) {
+                       foreach ( (array)$bases as $base ) {
                                # Make hostname
                                # If we have an access key, use that too (ProjectHoneypot, etc.)
-                               if( is_array( $base ) ) {
-                                       if( count( $base ) >= 2 ) {
+                               if ( is_array( $base ) ) {
+                                       if ( count( $base ) >= 2 ) {
                                                # Access key is 1, base URL is 0
                                                $host = "{$base[1]}.$ipReversed.{$base[0]}";
                                        } else {
@@ -1399,7 +1403,7 @@ class User {
                                # Send query
                                $ipList = gethostbynamel( $host );
 
-                               if( $ipList ) {
+                               if ( $ipList ) {
                                        wfDebugLog( 'dnsblacklist', "Hostname $host is {$ipList[0]}, it's a proxy says $base!\n" );
                                        $found = true;
                                        break;
@@ -1454,7 +1458,7 @@ class User {
         */
        public function isPingLimitable() {
                global $wgRateLimitsExcludedIPs;
-               if( in_array( $this->getRequest()->getIP(), $wgRateLimitsExcludedIPs ) ) {
+               if ( in_array( $this->getRequest()->getIP(), $wgRateLimitsExcludedIPs ) ) {
                        // No other good way currently to disable rate limits
                        // for specific IPs. :P
                        // But this is a crappy hack and should die.
@@ -1476,18 +1480,19 @@ class User {
        public function pingLimiter( $action = 'edit' ) {
                # Call the 'PingLimiter' hook
                $result = false;
-               if( !wfRunHooks( 'PingLimiter', array( &$this, $action, &$result ) ) ) {
+               if ( !wfRunHooks( 'PingLimiter', array( &$this, $action, &$result ) ) ) {
                        return $result;
                }
 
                global $wgRateLimits;
-               if( !isset( $wgRateLimits[$action] ) ) {
+               if ( !isset( $wgRateLimits[$action] ) ) {
                        return false;
                }
 
                # Some groups shouldn't trigger the ping limiter, ever
-               if( !$this->isPingLimitable() )
+               if ( !$this->isPingLimitable() ) {
                        return false;
+               }
 
                global $wgMemc, $wgRateLimitLog;
                wfProfileIn( __METHOD__ );
@@ -1498,22 +1503,22 @@ class User {
                $ip = $this->getRequest()->getIP();
                $userLimit = false;
 
-               if( isset( $limits['anon'] ) && $id == 0 ) {
+               if ( isset( $limits['anon'] ) && $id == 0 ) {
                        $keys[wfMemcKey( 'limiter', $action, 'anon' )] = $limits['anon'];
                }
 
-               if( isset( $limits['user'] ) && $id != 0 ) {
+               if ( isset( $limits['user'] ) && $id != 0 ) {
                        $userLimit = $limits['user'];
                }
-               if( $this->isNewbie() ) {
-                       if( isset( $limits['newbie'] ) && $id != 0 ) {
+               if ( $this->isNewbie() ) {
+                       if ( isset( $limits['newbie'] ) && $id != 0 ) {
                                $keys[wfMemcKey( 'limiter', $action, 'user', $id )] = $limits['newbie'];
                        }
-                       if( isset( $limits['ip'] ) ) {
+                       if ( isset( $limits['ip'] ) ) {
                                $keys["mediawiki:limiter:$action:ip:$ip"] = $limits['ip'];
                        }
                        $matches = array();
-                       if( isset( $limits['subnet'] ) && preg_match( '/^(\d+\.\d+\.\d+)\.\d+$/', $ip, $matches ) ) {
+                       if ( isset( $limits['subnet'] ) && preg_match( '/^(\d+\.\d+\.\d+)\.\d+$/', $ip, $matches ) ) {
                                $subnet = $matches[1];
                                $keys["mediawiki:limiter:$action:subnet:$subnet"] = $limits['subnet'];
                        }
@@ -1529,20 +1534,21 @@ class User {
                }
                // Set the user limit key
                if ( $userLimit !== false ) {
-                       wfDebug( __METHOD__ . ": effective user limit: $userLimit\n" );
+                       list( $max, $period ) = $userLimit;
+                       wfDebug( __METHOD__ . ": effective user limit: $max in {$period}s\n" );
                        $keys[wfMemcKey( 'limiter', $action, 'user', $id )] = $userLimit;
                }
 
                $triggered = false;
-               foreach( $keys as $key => $limit ) {
+               foreach ( $keys as $key => $limit ) {
                        list( $max, $period ) = $limit;
                        $summary = "(limit $max in {$period}s)";
                        $count = $wgMemc->get( $key );
                        // Already pinged?
-                       if( $count ) {
-                               if( $count >= $max ) {
+                       if ( $count ) {
+                               if ( $count >= $max ) {
                                        wfDebug( __METHOD__ . ": tripped! $key at $count $summary\n" );
-                                       if( $wgRateLimitLog ) {
+                                       if ( $wgRateLimitLog ) {
                                                wfSuppressWarnings();
                                                file_put_contents( $wgRateLimitLog, wfTimestamp( TS_MW ) . ' ' . wfWikiID() . ': ' . $this->getName() . " tripped $key at $count $summary\n", FILE_APPEND );
                                                wfRestoreWarnings();
@@ -1645,13 +1651,13 @@ class User {
         * @return Bool True if blocked, false otherwise
         */
        public function isBlockedGlobally( $ip = '' ) {
-               if( $this->mBlockedGlobally !== null ) {
+               if ( $this->mBlockedGlobally !== null ) {
                        return $this->mBlockedGlobally;
                }
                // User is already an IP?
-               if( IP::isIPAddress( $this->getName() ) ) {
+               if ( IP::isIPAddress( $this->getName() ) ) {
                        $ip = $this->getName();
-               } elseif( !$ip ) {
+               } elseif ( !$ip ) {
                        $ip = $this->getRequest()->getIP();
                }
                $blocked = false;
@@ -1666,7 +1672,7 @@ class User {
         * @return Bool True if locked, false otherwise
         */
        public function isLocked() {
-               if( $this->mLocked !== null ) {
+               if ( $this->mLocked !== null ) {
                        return $this->mLocked;
                }
                global $wgAuth;
@@ -1681,11 +1687,11 @@ class User {
         * @return Bool True if hidden, false otherwise
         */
        public function isHidden() {
-               if( $this->mHideName !== null ) {
+               if ( $this->mHideName !== null ) {
                        return $this->mHideName;
                }
                $this->getBlockedStatus();
-               if( !$this->mHideName ) {
+               if ( !$this->mHideName ) {
                        global $wgAuth;
                        $authUser = $wgAuth->getUserInstance( $this );
                        $this->mHideName = (bool)$authUser->isHidden();
@@ -1698,11 +1704,10 @@ class User {
         * @return Int The user's ID; 0 if the user is anonymous or nonexistent
         */
        public function getId() {
-               if( $this->mId === null && $this->mName !== null
-               && User::isIP( $this->mName ) ) {
+               if ( $this->mId === null && $this->mName !== null && User::isIP( $this->mName ) ) {
                        // Special case, we know the user is anonymous
                        return 0;
-               } elseif( !$this->isItemLoaded( 'id' ) ) {
+               } elseif ( !$this->isItemLoaded( 'id' ) ) {
                        // Don't load if this was initialized from an ID
                        $this->load();
                }
@@ -1770,21 +1775,21 @@ class User {
                $this->load();
 
                # Load the newtalk status if it is unloaded (mNewtalk=-1)
-               if( $this->mNewtalk === -1 ) {
+               if ( $this->mNewtalk === -1 ) {
                        $this->mNewtalk = false; # reset talk page status
 
                        # Check memcached separately for anons, who have no
                        # entire User object stored in there.
-                       if( !$this->mId ) {
+                       if ( !$this->mId ) {
                                global $wgDisableAnonTalk;
-                               if( $wgDisableAnonTalk ) {
+                               if ( $wgDisableAnonTalk ) {
                                        // Anon newtalk disabled by configuration.
                                        $this->mNewtalk = false;
                                } else {
                                        global $wgMemc;
                                        $key = wfMemcKey( 'newtalk', 'ip', $this->getName() );
                                        $newtalk = $wgMemc->get( $key );
-                                       if( strval( $newtalk ) !== '' ) {
+                                       if ( strval( $newtalk ) !== '' ) {
                                                $this->mNewtalk = (bool)$newtalk;
                                        } else {
                                                // Since we are caching this, make sure it is up to date by getting it
@@ -1807,9 +1812,9 @@ class User {
         */
        public function getNewMessageLinks() {
                $talks = array();
-               if( !wfRunHooks( 'UserRetrieveNewTalks', array( &$this, &$talks ) ) ) {
+               if ( !wfRunHooks( 'UserRetrieveNewTalks', array( &$this, &$talks ) ) ) {
                        return $talks;
-               } elseif( !$this->getNewtalk() ) {
+               } elseif ( !$this->getNewtalk() ) {
                        return array();
                }
                $utp = $this->getTalkPage();
@@ -1895,14 +1900,14 @@ class User {
         * @param $curRev Revision new, as yet unseen revision of the user talk page. Ignored if null or !$val.
         */
        public function setNewtalk( $val, $curRev = null ) {
-               if( wfReadOnly() ) {
+               if ( wfReadOnly() ) {
                        return;
                }
 
                $this->load();
                $this->mNewtalk = $val;
 
-               if( $this->isAnon() ) {
+               if ( $this->isAnon() ) {
                        $field = 'user_ip';
                        $id = $this->getName();
                } else {
@@ -1911,13 +1916,13 @@ class User {
                }
                global $wgMemc;
 
-               if( $val ) {
+               if ( $val ) {
                        $changed = $this->updateNewtalk( $field, $id, $curRev );
                } else {
                        $changed = $this->deleteNewtalk( $field, $id );
                }
 
-               if( $this->isAnon() ) {
+               if ( $this->isAnon() ) {
                        // Anons have a separate memcached space, since
                        // user records aren't kept for them.
                        $key = wfMemcKey( 'newtalk', 'ip', $id );
@@ -1947,7 +1952,7 @@ class User {
         */
        private function clearSharedCache() {
                $this->load();
-               if( $this->mId ) {
+               if ( $this->mId ) {
                        global $wgMemc;
                        $wgMemc->delete( wfMemcKey( 'user', 'id', $this->mId ) );
                }
@@ -1969,7 +1974,8 @@ class User {
                        $dbw = wfGetDB( DB_MASTER );
                        $userid = $this->mId;
                        $touched = $this->mTouched;
-                       $dbw->onTransactionIdle( function() use ( $dbw, $userid, $touched ) {
+                       $method = __METHOD__;
+                       $dbw->onTransactionIdle( function() use ( $dbw, $userid, $touched, $method ) {
                                // Prevent contention slams by checking user_touched first
                                $encTouched = $dbw->addQuotes( $dbw->timestamp( $touched ) );
                                $needsPurge = $dbw->selectField( 'user', '1',
@@ -1978,7 +1984,7 @@ class User {
                                        $dbw->update( 'user',
                                                array( 'user_touched' => $dbw->timestamp( $touched ) ),
                                                array( 'user_id' => $userid, 'user_touched < ' . $encTouched ),
-                                               __METHOD__
+                                               $method
                                        );
                                }
                        } );
@@ -2025,12 +2031,12 @@ class User {
        public function setPassword( $str ) {
                global $wgAuth;
 
-               if( $str !== null ) {
-                       if( !$wgAuth->allowPasswordChange() ) {
+               if ( $str !== null ) {
+                       if ( !$wgAuth->allowPasswordChange() ) {
                                throw new PasswordError( wfMessage( 'password-change-forbidden' )->text() );
                        }
 
-                       if( !$this->isValidPassword( $str ) ) {
+                       if ( !$this->isValidPassword( $str ) ) {
                                global $wgMinimalPasswordLength;
                                $valid = $this->getPasswordValidity( $str );
                                if ( is_array( $valid ) ) {
@@ -2044,7 +2050,7 @@ class User {
                        }
                }
 
-               if( !$wgAuth->setPassword( $this, $str ) ) {
+               if ( !$wgAuth->setPassword( $this, $str ) ) {
                        throw new PasswordError( wfMessage( 'externaldberror' )->text() );
                }
 
@@ -2064,7 +2070,7 @@ class User {
                $this->load();
                $this->setToken();
 
-               if( $str === null ) {
+               if ( $str === null ) {
                        // Save an invalid hash...
                        $this->mPassword = '';
                } else {
@@ -2157,7 +2163,7 @@ class User {
         */
        public function setEmail( $str ) {
                $this->load();
-               if( $str == $this->mEmail ) {
+               if ( $str == $this->mEmail ) {
                        return;
                }
                $this->mEmail = $str;
@@ -2241,7 +2247,7 @@ class User {
                # set it, and then it was disabled removing their ability to change it).  But
                # we don't want to erase the preferences in the database in case the preference
                # is re-enabled again.  So don't touch $mOptions, just override the returned value
-               if( in_array( $oname, $wgHiddenPrefs ) && !$ignoreHidden ) {
+               if ( in_array( $oname, $wgHiddenPrefs ) && !$ignoreHidden ) {
                        return self::getDefaultOption( $oname );
                }
 
@@ -2267,9 +2273,9 @@ class User {
                # set it, and then it was disabled removing their ability to change it).  But
                # we don't want to erase the preferences in the database in case the preference
                # is re-enabled again.  So don't touch $mOptions, just override the returned value
-               foreach( $wgHiddenPrefs as $pref ) {
+               foreach ( $wgHiddenPrefs as $pref ) {
                        $default = self::getDefaultOption( $pref );
-                       if( $default !== null ) {
+                       if ( $default !== null ) {
                                $options[$pref] = $default;
                        }
                }
@@ -2298,7 +2304,7 @@ class User {
         */
        public function getIntOption( $oname, $defaultOverride = 0 ) {
                $val = $this->getOption( $oname );
-               if( $val == '' ) {
+               if ( $val == '' ) {
                        $val = $defaultOverride;
                }
                return intval( $val );
@@ -2314,7 +2320,7 @@ class User {
                $this->loadOptions();
 
                // Explicitly NULL values should refer to defaults
-               if( is_null( $val ) ) {
+               if ( is_null( $val ) ) {
                        $val = self::getDefaultOption( $oname );
                }
 
@@ -2410,9 +2416,9 @@ class User {
                foreach ( $options as $key => $value ) {
                        if ( isset( $prefs[$key] ) ) {
                                $mapping[$key] = 'registered';
-                       } elseif( isset( $multiselectOptions[$key] ) ) {
+                       } elseif ( isset( $multiselectOptions[$key] ) ) {
                                $mapping[$key] = 'registered-multiselect';
-                       } elseif( isset( $checkmatrixOptions[$key] ) ) {
+                       } elseif ( isset( $checkmatrixOptions[$key] ) ) {
                                $mapping[$key] = 'registered-checkmatrix';
                        } elseif ( substr( $key, 0, 7 ) === 'userjs-' ) {
                                $mapping[$key] = 'userjs';
@@ -2598,14 +2604,14 @@ class User {
         * @return array Names of the groups the user has belonged to.
         */
        public function getFormerGroups() {
-               if( is_null( $this->mFormerGroups ) ) {
+               if ( is_null( $this->mFormerGroups ) ) {
                        $dbr = wfGetDB( DB_MASTER );
                        $res = $dbr->select( 'user_former_groups',
                                array( 'ufg_group' ),
                                array( 'ufg_user' => $this->mId ),
                                __METHOD__ );
                        $this->mFormerGroups = array();
-                       foreach( $res as $row ) {
+                       foreach ( $res as $row ) {
                                $this->mFormerGroups[] = $row->ufg_group;
                        }
                }
@@ -2632,7 +2638,7 @@ class User {
                                __METHOD__
                        );
 
-                       if( $count === null ) {
+                       if ( $count === null ) {
                                // it has not been initialized. do so.
                                $count = $this->initEditCount();
                        }
@@ -2648,9 +2654,9 @@ class User {
         * @param string $group Name of the group to add
         */
        public function addGroup( $group ) {
-               if( wfRunHooks( 'UserAddGroup', array( $this, &$group ) ) ) {
+               if ( wfRunHooks( 'UserAddGroup', array( $this, &$group ) ) ) {
                        $dbw = wfGetDB( DB_MASTER );
-                       if( $this->getId() ) {
+                       if ( $this->getId() ) {
                                $dbw->insert( 'user_groups',
                                        array(
                                                'ug_user' => $this->getID(),
@@ -2662,6 +2668,9 @@ class User {
                }
                $this->loadGroups();
                $this->mGroups[] = $group;
+               // In case loadGroups was not called before, we now have the right twice.
+               // Get rid of the duplicate.
+               $this->mGroups = array_unique( $this->mGroups );
                $this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
 
                $this->invalidateCache();
@@ -2674,7 +2683,7 @@ class User {
         */
        public function removeGroup( $group ) {
                $this->load();
-               if( wfRunHooks( 'UserRemoveGroup', array( $this, &$group ) ) ) {
+               if ( wfRunHooks( 'UserRemoveGroup', array( $this, &$group ) ) ) {
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->delete( 'user_groups',
                                array(
@@ -2723,8 +2732,8 @@ class User {
         */
        public function isAllowedAny( /*...*/ ) {
                $permissions = func_get_args();
-               foreach( $permissions as $permission ) {
-                       if( $this->isAllowed( $permission ) ) {
+               foreach ( $permissions as $permission ) {
+                       if ( $this->isAllowed( $permission ) ) {
                                return true;
                        }
                }
@@ -2738,8 +2747,8 @@ class User {
         */
        public function isAllowedAll( /*...*/ ) {
                $permissions = func_get_args();
-               foreach( $permissions as $permission ) {
-                       if( !$this->isAllowed( $permission ) ) {
+               foreach ( $permissions as $permission ) {
+                       if ( !$this->isAllowed( $permission ) ) {
                                return false;
                        }
                }
@@ -2756,10 +2765,11 @@ class User {
                        return true; // In the spirit of DWIM
                }
                # Patrolling may not be enabled
-               if( $action === 'patrol' || $action === 'autopatrol' ) {
+               if ( $action === 'patrol' || $action === 'autopatrol' ) {
                        global $wgUseRCPatrol, $wgUseNPPatrol;
-                       if( !$wgUseRCPatrol && !$wgUseNPPatrol )
+                       if ( !$wgUseRCPatrol && !$wgUseNPPatrol ) {
                                return false;
+                       }
                }
                # Use strict parameter to avoid matching numeric 0 accidentally inserted
                # by misconfiguration: 0 == 'foo'
@@ -2867,22 +2877,23 @@ class User {
                global $wgUseEnotif, $wgShowUpdatedMarker;
 
                # Do nothing if the database is locked to writes
-               if( wfReadOnly() ) {
+               if ( wfReadOnly() ) {
                        return;
                }
 
-               if( $title->getNamespace() == NS_USER_TALK &&
+               if ( $title->getNamespace() == NS_USER_TALK &&
                        $title->getText() == $this->getName() ) {
-                       if( !wfRunHooks( 'UserClearNewTalkNotification', array( &$this ) ) )
+                       if ( !wfRunHooks( 'UserClearNewTalkNotification', array( &$this ) ) ) {
                                return;
+                       }
                        $this->setNewtalk( false );
                }
 
-               if( !$wgUseEnotif && !$wgShowUpdatedMarker ) {
+               if ( !$wgUseEnotif && !$wgShowUpdatedMarker ) {
                        return;
                }
 
-               if( $this->isAnon() ) {
+               if ( $this->isAnon() ) {
                        // Nothing else to do...
                        return;
                }
@@ -2917,7 +2928,7 @@ class User {
                        return;
                }
                $id = $this->getId();
-               if( $id != 0 ) {
+               if ( $id != 0 ) {
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->update( 'watchlist',
                                array( /* SET */
@@ -2939,8 +2950,9 @@ class User {
         */
        private function decodeOptions( $str ) {
                wfDeprecated( __METHOD__, '1.19' );
-               if( !$str )
+               if ( !$str ) {
                        return;
+               }
 
                $this->mOptionsLoaded = true;
                $this->mOptionOverrides = array();
@@ -3048,7 +3060,7 @@ class User {
         * Log this user out.
         */
        public function logout() {
-               if( wfRunHooks( 'UserLogout', array( &$this ) ) ) {
+               if ( wfRunHooks( 'UserLogout', array( &$this ) ) ) {
                        $this->doLogout();
                }
        }
@@ -3078,8 +3090,12 @@ class User {
                global $wgAuth;
 
                $this->load();
-               if ( wfReadOnly() ) { return; }
-               if ( 0 == $this->mId ) { return; }
+               if ( wfReadOnly() ) {
+                       return;
+               }
+               if ( 0 == $this->mId ) {
+                       return;
+               }
 
                $this->mTouched = self::newTouchedTimestamp();
                if ( !$wgAuth->allowSetLocalPassword() ) {
@@ -3118,7 +3134,9 @@ class User {
         */
        public function idForName() {
                $s = trim( $this->getName() );
-               if ( $s === '' ) return 0;
+               if ( $s === '' ) {
+                       return 0;
+               }
 
                $dbr = wfGetDB( DB_SLAVE );
                $id = $dbr->selectField( 'user', 'user_id', array( 'user_name' => $s ), __METHOD__ );
@@ -3308,7 +3326,7 @@ class User {
                wfDeprecated( __METHOD__, '1.17' );
 
                global $wgRenderHashAppend, $wgLang, $wgContLang;
-               if( $this->mHash ) {
+               if ( $this->mHash ) {
                        return $this->mHash;
                }
 
@@ -3346,7 +3364,7 @@ class User {
         */
        public function isBlockedFromCreateAccount() {
                $this->getBlockedStatus();
-               if( $this->mBlock && $this->mBlock->prevents( 'createaccount' ) ) {
+               if ( $this->mBlock && $this->mBlock->prevents( 'createaccount' ) ) {
                        return $this->mBlock;
                }
 
@@ -3420,16 +3438,16 @@ class User {
                // to. Certain authentication plugins do NOT want to save
                // domain passwords in a mysql database, so we should
                // check this (in case $wgAuth->strict() is false).
-               if( !$this->isValidPassword( $password ) ) {
+               if ( !$this->isValidPassword( $password ) ) {
                        return false;
                }
 
-               if( $wgAuth->authenticate( $this->getName(), $password ) ) {
+               if ( $wgAuth->authenticate( $this->getName(), $password ) ) {
                        return true;
-               } elseif( $wgAuth->strict() ) {
+               } elseif ( $wgAuth->strict() ) {
                        /* Auth plugin doesn't allow local authentication */
                        return false;
-               } elseif( $wgAuth->strictUserAuth( $this->getName() ) ) {
+               } elseif ( $wgAuth->strictUserAuth( $this->getName() ) ) {
                        /* Auth plugin doesn't allow local authentication for this user name */
                        return false;
                }
@@ -3460,7 +3478,7 @@ class User {
                global $wgNewPasswordExpiry;
 
                $this->load();
-               if( self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() ) ) {
+               if ( self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() ) ) {
                        if ( is_null( $this->mNewpassTime ) ) {
                                return true;
                        }
@@ -3509,7 +3527,7 @@ class User {
                                $token = MWCryptRand::generateHex( 32 );
                                $request->setSessionData( 'wsEditToken', $token );
                        }
-                       if( is_array( $salt ) ) {
+                       if ( is_array( $salt ) ) {
                                $salt = implode( '|', $salt );
                        }
                        return md5( $token . $salt ) . EDIT_TOKEN_SUFFIX;
@@ -3604,7 +3622,7 @@ class User {
         * @return Status
         */
        public function sendMail( $subject, $body, $from = null, $replyto = null ) {
-               if( is_null( $from ) ) {
+               if ( is_null( $from ) ) {
                        global $wgPasswordSender, $wgPasswordSenderName;
                        $sender = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
                } else {
@@ -3726,7 +3744,7 @@ class User {
         */
        public function canSendEmail() {
                global $wgEnableEmail, $wgEnableUserEmail;
-               if( !$wgEnableEmail || !$wgEnableUserEmail || !$this->isAllowed( 'sendemail' ) ) {
+               if ( !$wgEnableEmail || !$wgEnableUserEmail || !$this->isAllowed( 'sendemail' ) ) {
                        return false;
                }
                $canSend = $this->isEmailConfirmed();
@@ -3757,14 +3775,14 @@ class User {
                global $wgEmailAuthentication;
                $this->load();
                $confirmed = true;
-               if( wfRunHooks( 'EmailConfirmed', array( &$this, &$confirmed ) ) ) {
-                       if( $this->isAnon() ) {
+               if ( wfRunHooks( 'EmailConfirmed', array( &$this, &$confirmed ) ) ) {
+                       if ( $this->isAnon() ) {
                                return false;
                        }
-                       if( !Sanitizer::validateEmail( $this->mEmail ) ) {
+                       if ( !Sanitizer::validateEmail( $this->mEmail ) ) {
                                return false;
                        }
-                       if( $wgEmailAuthentication && !$this->getEmailAuthenticationTimestamp() ) {
+                       if ( $wgEmailAuthentication && !$this->getEmailAuthenticationTimestamp() ) {
                                return false;
                        }
                        return true;
@@ -3807,7 +3825,7 @@ class User {
         *     non-existent/anonymous user accounts.
         */
        public function getFirstEditTimestamp() {
-               if( $this->getId() == 0 ) {
+               if ( $this->getId() == 0 ) {
                        return false; // anons
                }
                $dbr = wfGetDB( DB_SLAVE );
@@ -3816,7 +3834,7 @@ class User {
                        __METHOD__,
                        array( 'ORDER BY' => 'rev_timestamp ASC' )
                );
-               if( !$time ) {
+               if ( !$time ) {
                        return false; // no edits
                }
                return wfTimestamp( TS_MW, $time );
@@ -3832,16 +3850,16 @@ class User {
                global $wgGroupPermissions, $wgRevokePermissions;
                $rights = array();
                // grant every granted permission first
-               foreach( $groups as $group ) {
-                       if( isset( $wgGroupPermissions[$group] ) ) {
+               foreach ( $groups as $group ) {
+                       if ( isset( $wgGroupPermissions[$group] ) ) {
                                $rights = array_merge( $rights,
                                        // array_filter removes empty items
                                        array_keys( array_filter( $wgGroupPermissions[$group] ) ) );
                        }
                }
                // now revoke the revoked permissions
-               foreach( $groups as $group ) {
-                       if( isset( $wgRevokePermissions[$group] ) ) {
+               foreach ( $groups as $group ) {
+                       if ( isset( $wgRevokePermissions[$group] ) ) {
                                $rights = array_diff( $rights,
                                        array_keys( array_filter( $wgRevokePermissions[$group] ) ) );
                        }
@@ -3953,10 +3971,11 @@ class User {
         */
        public static function getGroupPage( $group ) {
                $msg = wfMessage( 'grouppage-' . $group )->inContentLanguage();
-               if( $msg->exists() ) {
+               if ( $msg->exists() ) {
                        $title = Title::newFromText( $msg->text() );
-                       if( is_object( $title ) )
+                       if ( is_object( $title ) ) {
                                return $title;
+                       }
                }
                return false;
        }
@@ -3970,11 +3989,11 @@ class User {
         * @return String HTML link to the group
         */
        public static function makeGroupLinkHTML( $group, $text = '' ) {
-               if( $text == '' ) {
+               if ( $text == '' ) {
                        $text = self::getGroupName( $group );
                }
                $title = self::getGroupPage( $group );
-               if( $title ) {
+               if ( $title ) {
                        return Linker::link( $title, htmlspecialchars( $text ) );
                } else {
                        return $text;
@@ -3990,11 +4009,11 @@ class User {
         * @return String Wikilink to the group
         */
        public static function makeGroupLinkWiki( $group, $text = '' ) {
-               if( $text == '' ) {
+               if ( $text == '' ) {
                        $text = self::getGroupName( $group );
                }
                $title = self::getGroupPage( $group );
-               if( $title ) {
+               if ( $title ) {
                        $page = $title->getPrefixedText();
                        return "[[$page|$text]]";
                } else {
@@ -4015,53 +4034,53 @@ class User {
                global $wgAddGroups, $wgRemoveGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
 
                $groups = array( 'add' => array(), 'remove' => array(), 'add-self' => array(), 'remove-self' => array() );
-               if( empty( $wgAddGroups[$group] ) ) {
+               if ( empty( $wgAddGroups[$group] ) ) {
                        // Don't add anything to $groups
-               } elseif( $wgAddGroups[$group] === true ) {
+               } elseif ( $wgAddGroups[$group] === true ) {
                        // You get everything
                        $groups['add'] = self::getAllGroups();
-               } elseif( is_array( $wgAddGroups[$group] ) ) {
+               } elseif ( is_array( $wgAddGroups[$group] ) ) {
                        $groups['add'] = $wgAddGroups[$group];
                }
 
                // Same thing for remove
-               if( empty( $wgRemoveGroups[$group] ) ) {
-               } elseif( $wgRemoveGroups[$group] === true ) {
+               if ( empty( $wgRemoveGroups[$group] ) ) {
+               } elseif ( $wgRemoveGroups[$group] === true ) {
                        $groups['remove'] = self::getAllGroups();
-               } elseif( is_array( $wgRemoveGroups[$group] ) ) {
+               } elseif ( is_array( $wgRemoveGroups[$group] ) ) {
                        $groups['remove'] = $wgRemoveGroups[$group];
                }
 
                // Re-map numeric keys of AddToSelf/RemoveFromSelf to the 'user' key for backwards compatibility
-               if( empty( $wgGroupsAddToSelf['user'] ) || $wgGroupsAddToSelf['user'] !== true ) {
-                       foreach( $wgGroupsAddToSelf as $key => $value ) {
-                               if( is_int( $key ) ) {
+               if ( empty( $wgGroupsAddToSelf['user'] ) || $wgGroupsAddToSelf['user'] !== true ) {
+                       foreach ( $wgGroupsAddToSelf as $key => $value ) {
+                               if ( is_int( $key ) ) {
                                        $wgGroupsAddToSelf['user'][] = $value;
                                }
                        }
                }
 
-               if( empty( $wgGroupsRemoveFromSelf['user'] ) || $wgGroupsRemoveFromSelf['user'] !== true ) {
-                       foreach( $wgGroupsRemoveFromSelf as $key => $value ) {
-                               if( is_int( $key ) ) {
+               if ( empty( $wgGroupsRemoveFromSelf['user'] ) || $wgGroupsRemoveFromSelf['user'] !== true ) {
+                       foreach ( $wgGroupsRemoveFromSelf as $key => $value ) {
+                               if ( is_int( $key ) ) {
                                        $wgGroupsRemoveFromSelf['user'][] = $value;
                                }
                        }
                }
 
                // Now figure out what groups the user can add to him/herself
-               if( empty( $wgGroupsAddToSelf[$group] ) ) {
-               } elseif( $wgGroupsAddToSelf[$group] === true ) {
+               if ( empty( $wgGroupsAddToSelf[$group] ) ) {
+               } elseif ( $wgGroupsAddToSelf[$group] === true ) {
                        // No idea WHY this would be used, but it's there
                        $groups['add-self'] = User::getAllGroups();
-               } elseif( is_array( $wgGroupsAddToSelf[$group] ) ) {
+               } elseif ( is_array( $wgGroupsAddToSelf[$group] ) ) {
                        $groups['add-self'] = $wgGroupsAddToSelf[$group];
                }
 
-               if( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
-               } elseif( $wgGroupsRemoveFromSelf[$group] === true ) {
+               if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
+               } elseif ( $wgGroupsRemoveFromSelf[$group] === true ) {
                        $groups['remove-self'] = User::getAllGroups();
-               } elseif( is_array( $wgGroupsRemoveFromSelf[$group] ) ) {
+               } elseif ( is_array( $wgGroupsRemoveFromSelf[$group] ) ) {
                        $groups['remove-self'] = $wgGroupsRemoveFromSelf[$group];
                }
 
@@ -4076,7 +4095,7 @@ class User {
         *  'remove-self' => array( removable groups from self) )
         */
        public function changeableGroups() {
-               if( $this->isAllowed( 'userrights' ) ) {
+               if ( $this->isAllowed( 'userrights' ) ) {
                        // This group gives the right to modify everything (reverse-
                        // compatibility with old "userrights lets you change
                        // everything")
@@ -4099,7 +4118,7 @@ class User {
                );
                $addergroups = $this->getEffectiveGroups();
 
-               foreach( $addergroups as $addergroup ) {
+               foreach ( $addergroups as $addergroup ) {
                        $groups = array_merge_recursive(
                                $groups, $this->changeableByGroup( $addergroup )
                        );
@@ -4116,7 +4135,7 @@ class User {
         * Will have no effect for anonymous users.
         */
        public function incEditCount() {
-               if( !$this->isAnon() ) {
+               if ( !$this->isAnon() ) {
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->update(
                                'user',
@@ -4126,10 +4145,10 @@ class User {
                        );
 
                        // Lazy initialization check...
-                       if( $dbw->affectedRows() == 0 ) {
+                       if ( $dbw->affectedRows() == 0 ) {
                                // Now here's a goddamn hack...
                                $dbr = wfGetDB( DB_SLAVE );
-                               if( $dbr !== $dbw ) {
+                               if ( $dbr !== $dbw ) {
                                        // If we actually have a slave server, the count is
                                        // at least one behind because the current transaction
                                        // has not been committed and replicated.
@@ -4216,11 +4235,11 @@ class User {
                global $wgPasswordSalt;
 
                $hash = '';
-               if( !wfRunHooks( 'UserCryptPassword', array( &$password, &$salt, &$wgPasswordSalt, &$hash ) ) ) {
+               if ( !wfRunHooks( 'UserCryptPassword', array( &$password, &$salt, &$wgPasswordSalt, &$hash ) ) ) {
                        return $hash;
                }
 
-               if( $wgPasswordSalt ) {
+               if ( $wgPasswordSalt ) {
                        if ( $salt === false ) {
                                $salt = MWCryptRand::generateHex( 8 );
                        }
@@ -4244,7 +4263,7 @@ class User {
                $type = substr( $hash, 0, 3 );
 
                $result = false;
-               if( !wfRunHooks( 'UserComparePasswords', array( &$hash, &$password, &$userId, &$result ) ) ) {
+               if ( !wfRunHooks( 'UserComparePasswords', array( &$hash, &$password, &$userId, &$result ) ) ) {
                        return $result;
                }
 
@@ -4283,7 +4302,7 @@ class User {
         */
        public function addNewUserLogEntry( $action = false, $reason = '' ) {
                global $wgUser, $wgNewUserLog;
-               if( empty( $wgNewUserLog ) ) {
+               if ( empty( $wgNewUserLog ) ) {
                        return true; // disabled
                }
 
@@ -4363,11 +4382,11 @@ class User {
                // Maybe load from the object
                if ( !is_null( $this->mOptionOverrides ) ) {
                        wfDebug( "User: loading options for user " . $this->getId() . " from override cache.\n" );
-                       foreach( $this->mOptionOverrides as $key => $value ) {
+                       foreach ( $this->mOptionOverrides as $key => $value ) {
                                $this->mOptions[$key] = $value;
                        }
                } else {
-                       if( !is_array( $data ) ) {
+                       if ( !is_array( $data ) ) {
                                wfDebug( "User: loading options for user " . $this->getId() . " from database.\n" );
                                // Load from database
                                $dbr = wfGetDB( DB_SLAVE );
@@ -4407,13 +4426,13 @@ class User {
 
                // Allow hooks to abort, for instance to save to a global profile.
                // Reset options to default state before saving.
-               if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) ) {
+               if ( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) ) {
                        return;
                }
 
                $userId = $this->getId();
                $insert_rows = array();
-               foreach( $saveOptions as $key => $value ) {
+               foreach ( $saveOptions as $key => $value ) {
                        # Don't bother storing default values
                        $defaultOption = self::getDefaultOption( $key );
                        if ( ( is_null( $defaultOption ) &&
index 2eb8429..7eca76f 100644 (file)
@@ -119,7 +119,7 @@ class UserMailer {
         */
        static function arrayToHeaderString( $headers, $endl = "\n" ) {
                $strings = array();
-               foreach( $headers as $name => $value ) {
+               foreach ( $headers as $name => $value ) {
                        $strings[] = "$name: $value";
                }
                return implode( $endl, $strings );
@@ -338,7 +338,7 @@ class UserMailer {
                        #
                        # PHP mail()
                        #
-                       if( count( $to ) > 1 ) {
+                       if ( count( $to ) > 1 ) {
                                $headers['To'] = 'undisclosed-recipients:;';
                        }
                        $headers = self::arrayToHeaderString( $headers, $endl );
@@ -409,7 +409,7 @@ class UserMailer {
         */
        public static function quotedPrintable( $string, $charset = '' ) {
                # Probably incomplete; see RFC 2045
-               if( empty( $charset ) ) {
+               if ( empty( $charset ) ) {
                        $charset = 'UTF-8';
                }
                $charset = strtoupper( $charset );
@@ -417,7 +417,7 @@ class UserMailer {
 
                $illegal = '\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\xff=';
                $replace = $illegal . '\t ?_';
-               if( !preg_match( "/[$illegal]/", $string ) ) {
+               if ( !preg_match( "/[$illegal]/", $string ) ) {
                        return $string;
                }
                $out = "=?$charset?Q?";
@@ -791,8 +791,9 @@ class EmailNotification {
        function compose( $user ) {
                global $wgEnotifImpersonal;
 
-               if ( !$this->composed_common )
+               if ( !$this->composed_common ) {
                        $this->composeCommonMailtext();
+               }
 
                if ( $wgEnotifImpersonal ) {
                        $this->mailTargets[] = new MailAddress( $user );
index cd5dff8..56bb73f 100644 (file)
@@ -74,7 +74,7 @@ class UserRightsProxy {
         */
        public static function whoIs( $database, $id, $ignoreInvalidDB = false ) {
                $user = self::newFromId( $database, $id, $ignoreInvalidDB );
-               if( $user ) {
+               if ( $user ) {
                        return $user->name;
                } else {
                        return false;
@@ -114,12 +114,12 @@ class UserRightsProxy {
         */
        private static function newFromLookup( $database, $field, $value, $ignoreInvalidDB = false ) {
                $db = self::getDB( $database, $ignoreInvalidDB );
-               if( $db ) {
+               if ( $db ) {
                        $row = $db->selectRow( 'user',
                                array( 'user_id', 'user_name' ),
                                array( $field => $value ),
                                __METHOD__ );
-                       if( $row !== false ) {
+                       if ( $row !== false ) {
                                return new UserRightsProxy( $db, $database,
                                        $row->user_name,
                                        intval( $row->user_id ) );
@@ -138,8 +138,8 @@ class UserRightsProxy {
         */
        public static function getDB( $database, $ignoreInvalidDB = false ) {
                global $wgDBname;
-               if( self::validDatabase( $database ) ) {
-                       if( $database == $wgDBname ) {
+               if ( self::validDatabase( $database ) ) {
+                       if ( $database == $wgDBname ) {
                                // Hmm... this shouldn't happen though. :)
                                return wfGetDB( DB_MASTER );
                        } else {
index 5ac92f7..01376a0 100644 (file)
@@ -268,7 +268,7 @@ class WatchedItem {
                        );
                }
 
-               if( empty( $values ) ) {
+               if ( empty( $values ) ) {
                        // Nothing to do
                        return true;
                }
index 3bdf645..e85bf9c 100644 (file)
@@ -91,11 +91,11 @@ class WebRequest {
                        wfSuppressWarnings();
                        $a = parse_url( $url );
                        wfRestoreWarnings();
-                       if( $a ) {
+                       if ( $a ) {
                                $path = isset( $a['path'] ) ? $a['path'] : '';
 
                                global $wgScript;
-                               if( $path == $wgScript && $want !== 'all' ) {
+                               if ( $path == $wgScript && $want !== 'all' ) {
                                        // Script inside a rewrite path?
                                        // Abort to keep from breaking...
                                        return $matches;
@@ -106,7 +106,7 @@ class WebRequest {
                                // Raw PATH_INFO style
                                $router->add( "$wgScript/$1" );
 
-                               if( isset( $_SERVER['SCRIPT_NAME'] )
+                               if ( isset( $_SERVER['SCRIPT_NAME'] )
                                        && preg_match( '/\.php5?/', $_SERVER['SCRIPT_NAME'] ) )
                                {
                                        # Check for SCRIPT_NAME, we handle index.php explicitly
@@ -116,17 +116,17 @@ class WebRequest {
                                }
 
                                global $wgArticlePath;
-                               if( $wgArticlePath ) {
+                               if ( $wgArticlePath ) {
                                        $router->add( $wgArticlePath );
                                }
 
                                global $wgActionPaths;
-                               if( $wgActionPaths ) {
+                               if ( $wgActionPaths ) {
                                        $router->add( $wgActionPaths, array( 'action' => '$key' ) );
                                }
 
                                global $wgVariantArticlePath, $wgContLang;
-                               if( $wgVariantArticlePath ) {
+                               if ( $wgVariantArticlePath ) {
                                        $router->add( $wgVariantArticlePath,
                                                array( 'variant' => '$2' ),
                                                array( '$2' => $wgContLang->getVariants() )
@@ -224,7 +224,7 @@ class WebRequest {
                }
 
                $matches = self::getPathInfo( 'title' );
-               foreach( $matches as $key => $val ) {
+               foreach ( $matches as $key => $val ) {
                        $this->data[$key] = $_GET[$key] = $_REQUEST[$key] = $val;
                }
        }
@@ -240,15 +240,15 @@ class WebRequest {
         * @return array of URL variables to interpolate; empty if no match
         */
        static function extractTitle( $path, $bases, $key = false ) {
-               foreach( (array)$bases as $keyValue => $base ) {
+               foreach ( (array)$bases as $keyValue => $base ) {
                        // Find the part after $wgArticlePath
                        $base = str_replace( '$1', '', $base );
                        $baseLen = strlen( $base );
-                       if( substr( $path, 0, $baseLen ) == $base ) {
+                       if ( substr( $path, 0, $baseLen ) == $base ) {
                                $raw = substr( $path, $baseLen );
-                               if( $raw !== '' ) {
+                               if ( $raw !== '' ) {
                                        $matches = array( 'title' => rawurldecode( $raw ) );
-                                       if( $key ) {
+                                       if ( $key ) {
                                                $matches[$key] = $keyValue;
                                        }
                                        return $matches;
@@ -271,8 +271,8 @@ class WebRequest {
         */
        private function &fix_magic_quotes( &$arr, $topLevel = true ) {
                $clean = array();
-               foreach( $arr as $key => $val ) {
-                       if( is_array( $val ) ) {
+               foreach ( $arr as $key => $val ) {
+                       if ( is_array( $val ) ) {
                                $cleanKey = $topLevel ? stripslashes( $key ) : $key;
                                $clean[$cleanKey] = $this->fix_magic_quotes( $arr[$key], false );
                        } else {
@@ -293,7 +293,7 @@ class WebRequest {
        private function checkMagicQuotes() {
                $mustFixQuotes = function_exists( 'get_magic_quotes_gpc' )
                        && get_magic_quotes_gpc();
-               if( $mustFixQuotes ) {
+               if ( $mustFixQuotes ) {
                        $this->fix_magic_quotes( $_COOKIE );
                        $this->fix_magic_quotes( $_ENV );
                        $this->fix_magic_quotes( $_GET );
@@ -311,8 +311,8 @@ class WebRequest {
         * @private
         */
        function normalizeUnicode( $data ) {
-               if( is_array( $data ) ) {
-                       foreach( $data as $key => $val ) {
+               if ( is_array( $data ) ) {
+                       foreach ( $data as $key => $val ) {
                                $data[$key] = $this->normalizeUnicode( $val );
                        }
                } else {
@@ -335,12 +335,12 @@ class WebRequest {
                # http://us2.php.net/variables.external#language.variables.external.dot-in-names
                # Work around PHP *feature* to avoid *bugs* elsewhere.
                $name = strtr( $name, '.', '_' );
-               if( isset( $arr[$name] ) ) {
+               if ( isset( $arr[$name] ) ) {
                        global $wgContLang;
                        $data = $arr[$name];
-                       if( isset( $_GET[$name] ) && !is_array( $data ) ) {
+                       if ( isset( $_GET[$name] ) && !is_array( $data ) ) {
                                # Check for alternate/legacy character encoding.
-                               if( isset( $wgContLang ) ) {
+                               if ( isset( $wgContLang ) ) {
                                        $data = $wgContLang->checkTitleEncoding( $data );
                                }
                        }
@@ -364,10 +364,10 @@ class WebRequest {
         */
        public function getVal( $name, $default = null ) {
                $val = $this->getGPCVal( $this->data, $name, $default );
-               if( is_array( $val ) ) {
+               if ( is_array( $val ) ) {
                        $val = $default;
                }
-               if( is_null( $val ) ) {
+               if ( is_null( $val ) ) {
                        return $val;
                } else {
                        return (string)$val;
@@ -414,7 +414,7 @@ class WebRequest {
         */
        public function getArray( $name, $default = null ) {
                $val = $this->getGPCVal( $this->data, $name, $default );
-               if( is_null( $val ) ) {
+               if ( is_null( $val ) ) {
                        return null;
                } else {
                        return (array)$val;
@@ -433,7 +433,7 @@ class WebRequest {
         */
        public function getIntArray( $name, $default = null ) {
                $val = $this->getArray( $name, $default );
-               if( is_array( $val ) ) {
+               if ( is_array( $val ) ) {
                        $val = array_map( 'intval', $val );
                }
                return $val;
@@ -615,7 +615,7 @@ class WebRequest {
         * @return Mixed: cookie value or $default if the cookie not set
         */
        public function getCookie( $key, $prefix = null, $default = null ) {
-               if( $prefix === null ) {
+               if ( $prefix === null ) {
                        global $wgCookiePrefix;
                        $prefix = $wgCookiePrefix;
                }
@@ -630,14 +630,14 @@ class WebRequest {
         * @return String
         */
        public function getRequestURL() {
-               if( isset( $_SERVER['REQUEST_URI'] ) && strlen( $_SERVER['REQUEST_URI'] ) ) {
+               if ( isset( $_SERVER['REQUEST_URI'] ) && strlen( $_SERVER['REQUEST_URI'] ) ) {
                        $base = $_SERVER['REQUEST_URI'];
                } elseif ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) && strlen( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
                        // Probably IIS; doesn't set REQUEST_URI
                        $base = $_SERVER['HTTP_X_ORIGINAL_URL'];
-               } elseif( isset( $_SERVER['SCRIPT_NAME'] ) ) {
+               } elseif ( isset( $_SERVER['SCRIPT_NAME'] ) ) {
                        $base = $_SERVER['SCRIPT_NAME'];
-                       if( isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ) {
+                       if ( isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ) {
                                $base .= '?' . $_SERVER['QUERY_STRING'];
                        }
                } else {
@@ -651,11 +651,11 @@ class WebRequest {
                // need to strip it or we get false-positive redirect loops
                // or weird output URLs
                $hash = strpos( $base, '#' );
-               if( $hash !== false ) {
+               if ( $hash !== false ) {
                        $base = substr( $base, 0, $hash );
                }
 
-               if( $base[0] == '/' ) {
+               if ( $base[0] == '/' ) {
                        // More than one slash will look like it is protocol relative
                        return preg_replace( '!^/+!', '/', $base );
                } else {
@@ -739,21 +739,21 @@ class WebRequest {
                global $wgUser;
 
                $limit = $this->getInt( 'limit', 0 );
-               if( $limit < 0 ) {
+               if ( $limit < 0 ) {
                        $limit = 0;
                }
-               if( ( $limit == 0 ) && ( $optionname != '' ) ) {
+               if ( ( $limit == 0 ) && ( $optionname != '' ) ) {
                        $limit = $wgUser->getIntOption( $optionname );
                }
-               if( $limit <= 0 ) {
+               if ( $limit <= 0 ) {
                        $limit = $deflimit;
                }
-               if( $limit > 5000 ) {
+               if ( $limit > 5000 ) {
                        $limit = 5000; # We have *some* limits...
                }
 
                $offset = $this->getInt( 'offset', 0 );
-               if( $offset < 0 ) {
+               if ( $offset < 0 ) {
                        $offset = 0;
                }
 
@@ -893,7 +893,7 @@ class WebRequest {
         * @return Mixed
         */
        public function getSessionData( $key ) {
-               if( !isset( $_SESSION[$key] ) ) {
+               if ( !isset( $_SESSION[$key] ) ) {
                        return null;
                }
                return $_SESSION[$key];
@@ -1268,13 +1268,13 @@ class FauxRequest extends WebRequest {
         * @throws MWException
         */
        public function __construct( $data = array(), $wasPosted = false, $session = null ) {
-               if( is_array( $data ) ) {
+               if ( is_array( $data ) ) {
                        $this->data = $data;
                } else {
                        throw new MWException( "FauxRequest() got bogus data" );
                }
                $this->wasPosted = $wasPosted;
-               if( $session ) {
+               if ( $session ) {
                        $this->session = $session;
                }
        }
@@ -1359,7 +1359,7 @@ class FauxRequest extends WebRequest {
         * @return mixed
         */
        public function getSessionData( $key ) {
-               if( isset( $this->session[$key] ) ) {
+               if ( isset( $this->session[$key] ) ) {
                        return $this->session[$key];
                }
                return null;
index 8e15d71..d1f645c 100644 (file)
@@ -57,10 +57,10 @@ class WebResponse {
                if ( $expire == 0 ) {
                        $expire = time() + $wgCookieExpiration;
                }
-               if( $prefix === null ) {
+               if ( $prefix === null ) {
                        $prefix = $wgCookiePrefix;
                }
-               if( $domain === null ) {
+               if ( $domain === null ) {
                        $domain = $wgCookieDomain;
                }
 
@@ -116,7 +116,7 @@ class FauxResponse extends WebResponse {
                } else {
                        list( $key, $val ) = array_map( 'trim', explode( ":", $string, 2 ) );
 
-                       if( $replace || !isset( $this->headers[$key] ) ) {
+                       if ( $replace || !isset( $this->headers[$key] ) ) {
                                $this->headers[$key] = $val;
                        }
                }
index e6f3135..3b7d701 100644 (file)
@@ -48,7 +48,7 @@ if ( ini_get( 'register_globals' ) ) {
                'HTTP_SESSION_VARS'
        );
        foreach ( $_REQUEST as $name => $value ) {
-               if( in_array( $name, $verboten ) ) {
+               if ( in_array( $name, $verboten ) ) {
                        header( "HTTP/1.1 500 Internal Server Error" );
                        echo "register_globals security paranoia: trying to overwrite superglobals, aborting.";
                        die( -1 );
@@ -84,7 +84,7 @@ define( 'MEDIAWIKI', true );
 # if we don't have permissions on parent directories.
 $IP = getenv( 'MW_INSTALL_PATH' );
 if ( $IP === false ) {
-       if( realpath( '.' ) ) {
+       if ( realpath( '.' ) ) {
                $IP = realpath( '.' );
        } else {
                $IP = dirname( __DIR__ );
@@ -129,7 +129,7 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        # LocalSettings.php is the per site customization file. If it does not exist
        # the wiki installer needs to be launched or the generated file uploaded to
        # the root wiki directory
-       if( !file_exists( MW_CONFIG_FILE ) ) {
+       if ( !file_exists( MW_CONFIG_FILE ) ) {
                require_once( "$IP/includes/templates/NoLocalSettings.php" );
                die();
        }
index b9a7aac..2fd12d5 100644 (file)
@@ -126,7 +126,7 @@ class MediaWiki {
         * @return Title
         */
        public function getTitle() {
-               if( $this->context->getTitle() === null ) {
+               if ( $this->context->getTitle() === null ) {
                        $this->context->setTitle( $this->parseTitle() );
                }
                return $this->context->getTitle();
@@ -480,7 +480,7 @@ class MediaWiki {
                                $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
                                $resp->header( 'X-Database-Lag: ' . intval( $lag ) );
                                $resp->header( 'Content-Type: text/plain' );
-                               if( $wgShowHostnames ) {
+                               if ( $wgShowHostnames ) {
                                        echo "Waiting for $host: $lag seconds lagged\n";
                                } else {
                                        echo "Waiting for a database server: $lag seconds lagged\n";
@@ -599,7 +599,7 @@ class MediaWiki {
         * Do a job from the job queue
         */
        private function doJobs() {
-               global $wgJobRunRate;
+               global $wgJobRunRate, $wgPhpCli, $IP;
 
                if ( $wgJobRunRate <= 0 || wfReadOnly() ) {
                        return;
@@ -615,25 +615,36 @@ class MediaWiki {
                        $n = intval( $wgJobRunRate );
                }
 
-               $group = JobQueueGroup::singleton();
-               do {
-                       $job = $group->pop( JobQueueGroup::USE_CACHE ); // job from any queue
-                       if ( $job ) {
-                               $output = $job->toString() . "\n";
-                               $t = - microtime( true );
-                               wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
-                               $success = $job->run();
-                               wfProfileOut( __METHOD__ . '-' . get_class( $job ) );
-                               $group->ack( $job ); // done
-                               $t += microtime( true );
-                               $t = round( $t * 1000 );
-                               if ( $success === false ) {
-                                       $output .= "Error: " . $job->getLastError() . ", Time: $t ms\n";
-                               } else {
-                                       $output .= "Success, Time: $t ms\n";
+               if ( !wfShellExecDisabled() && is_executable( $wgPhpCli ) ) {
+                       // Start a background process to run some of the jobs.
+                       // This will be asynchronous on *nix though not on Windows.
+                       wfProfileIn( __METHOD__ . '-exec' );
+                       $retVal = 1;
+                       $cmd = wfShellWikiCmd( "$IP/maintenance/runJobs.php", array( '--maxjobs', $n ) );
+                       wfShellExec( "$cmd &", $retVal );
+                       wfProfileOut( __METHOD__ . '-exec' );
+               } else {
+                       // Fallback to running the jobs here while the user waits
+                       $group = JobQueueGroup::singleton();
+                       do {
+                               $job = $group->pop( JobQueueGroup::USE_CACHE ); // job from any queue
+                               if ( $job ) {
+                                       $output = $job->toString() . "\n";
+                                       $t = - microtime( true );
+                                       wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
+                                       $success = $job->run();
+                                       wfProfileOut( __METHOD__ . '-' . get_class( $job ) );
+                                       $group->ack( $job ); // done
+                                       $t += microtime( true );
+                                       $t = round( $t * 1000 );
+                                       if ( $success === false ) {
+                                               $output .= "Error: " . $job->getLastError() . ", Time: $t ms\n";
+                                       } else {
+                                               $output .= "Success, Time: $t ms\n";
+                                       }
+                                       wfDebugLog( 'jobqueue', $output );
                                }
-                               wfDebugLog( 'jobqueue', $output );
-                       }
-               } while ( --$n && $job );
+                       } while ( --$n && $job );
+               }
        }
 }
index 6278121..08eb800 100644 (file)
@@ -143,7 +143,7 @@ class WikiXmlError extends WikiError {
        }
 
        function _extractContext( $context, $offset ) {
-               if( is_null( $context ) ) {
+               if ( is_null( $context ) ) {
                        return null;
                } else {
                        // Hopefully integer overflow will be handled transparently here
index ab3d68d..5d90b12 100644 (file)
@@ -37,7 +37,7 @@ class WikiMap {
                $wgConf->loadFullData();
 
                list( $major, $minor ) = $wgConf->siteFromDB( $wikiID );
-               if( $major === null ) {
+               if ( $major === null ) {
                        return null;
                }
                $canonicalServer = $wgConf->get( 'wgCanonicalServer', $wikiID, $major,
index 3f7e497..c2aad76 100644 (file)
@@ -305,7 +305,7 @@ class WikiPage implements Page, IDBAccessObject {
        public function pageDataFromTitle( $dbr, $title, $options = array() ) {
                return $this->pageData( $dbr, array(
                        'page_namespace' => $title->getNamespace(),
-                       'page_title'     => $title->getDBkey() ), $options );
+                       'page_title' => $title->getDBkey() ), $options );
        }
 
        /**
@@ -462,7 +462,9 @@ class WikiPage implements Page, IDBAccessObject {
         */
        public function isRedirect() {
                $content = $this->getContent();
-               if ( !$content ) return false;
+               if ( !$content ) {
+                       return false;
+               }
 
                return $content->isRedirect();
        }
@@ -906,10 +908,10 @@ class WikiPage implements Page, IDBAccessObject {
                $dbw = wfGetDB( DB_MASTER );
                $dbw->replace( 'redirect', array( 'rd_from' ),
                        array(
-                               'rd_from'      => $this->getId(),
+                               'rd_from' => $this->getId(),
                                'rd_namespace' => $rt->getNamespace(),
-                               'rd_title'     => $rt->getDBkey(),
-                               'rd_fragment'  => $rt->getFragment(),
+                               'rd_title' => $rt->getDBkey(),
+                               'rd_fragment' => $rt->getFragment(),
                                'rd_interwiki' => $rt->getInterwiki(),
                        ),
                        __METHOD__
@@ -1155,7 +1157,7 @@ class WikiPage implements Page, IDBAccessObject {
        public function doPurge() {
                global $wgUseSquid;
 
-               if( !wfRunHooks( 'ArticlePurge', array( &$this ) ) ) {
+               if ( !wfRunHooks( 'ArticlePurge', array( &$this ) ) ) {
                        return false;
                }
 
@@ -1182,7 +1184,9 @@ class WikiPage implements Page, IDBAccessObject {
                                $content = $this->getContent();
                                $text = $content === null ? null : $content->getWikitextForTransclusion();
 
-                               if ( $text === null ) $text = false;
+                               if ( $text === null ) {
+                                       $text = false;
+                               }
                        } else {
                                $text = false;
                        }
@@ -1698,7 +1702,9 @@ class WikiPage implements Page, IDBAccessObject {
 
                // Provide autosummaries if one is not provided and autosummaries are enabled.
                if ( $wgUseAutomaticEditSummaries && $flags & EDIT_AUTOSUMMARY && $summary == '' ) {
-                       if ( !$old_content ) $old_content = null;
+                       if ( !$old_content ) {
+                               $old_content = null;
+                       }
                        $summary = $handler->getAutosummary( $old_content, $content, $flags );
                }
 
@@ -2074,15 +2080,7 @@ class WikiPage implements Page, IDBAccessObject {
                        if ( 0 == mt_rand( 0, 99 ) ) {
                                // Flush old entries from the `recentchanges` table; we do this on
                                // random requests so as to avoid an increase in writes for no good reason
-                               global $wgRCMaxAge;
-
-                               $dbw = wfGetDB( DB_MASTER );
-                               $cutoff = $dbw->timestamp( time() - $wgRCMaxAge );
-                               $dbw->delete(
-                                       'recentchanges',
-                                       array( 'rc_timestamp < ' . $dbw->addQuotes( $cutoff ) ),
-                                       __METHOD__
-                               );
+                               RecentChange::purgeExpiredChanges();
                        }
                }
 
@@ -2142,12 +2140,14 @@ class WikiPage implements Page, IDBAccessObject {
                if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
                        // XXX: could skip pseudo-messages like js/css here, based on content model.
                        $msgtext = $content ? $content->getWikitextForTransclusion() : null;
-                       if ( $msgtext === false || $msgtext === null ) $msgtext = '';
+                       if ( $msgtext === false || $msgtext === null ) {
+                               $msgtext = '';
+                       }
 
                        MessageCache::singleton()->replace( $shortTitle, $msgtext );
                }
 
-               if( $options['created'] ) {
+               if ( $options['created'] ) {
                        self::onArticleCreate( $this->mTitle );
                } else {
                        self::onArticleEdit( $this->mTitle );
@@ -2811,7 +2811,7 @@ class WikiPage implements Page, IDBAccessObject {
                        $wgContLang->timeanddate( wfTimestamp( TS_MW, $s->rev_timestamp ) ),
                        $current->getId(), $wgContLang->timeanddate( $current->getTimestamp() )
                );
-               if( $summary instanceof Message ) {
+               if ( $summary instanceof Message ) {
                        $summary = $summary->params( $args )->inContentLanguage()->text();
                } else {
                        $summary = wfMsgReplaceArgs( $summary, $args );
@@ -2852,8 +2852,8 @@ class WikiPage implements Page, IDBAccessObject {
                $resultDetails = array(
                        'summary' => $summary,
                        'current' => $current,
-                       'target'  => $target,
-                       'newid'   => $revId
+                       'target' => $target,
+                       'newid' => $revId
                );
 
                return array();
@@ -3082,11 +3082,11 @@ class WikiPage implements Page, IDBAccessObject {
                                        );
                                }
 
-                               foreach( $added as $catName ) {
+                               foreach ( $added as $catName ) {
                                        $cat = Category::newFromName( $catName );
                                        wfRunHooks( 'CategoryAfterPageAdded', array( $cat, $that ) );
                                }
-                               foreach( $deleted as $catName ) {
+                               foreach ( $deleted as $catName ) {
                                        $cat = Category::newFromName( $catName );
                                        wfRunHooks( 'CategoryAfterPageRemoved', array( $cat, $that ) );
                                }
index 29c240e..c62cbdf 100644 (file)
@@ -38,13 +38,13 @@ class Xml {
         */
        public static function element( $element, $attribs = null, $contents = '', $allowShortTag = true ) {
                $out = '<' . $element;
-               if( !is_null( $attribs ) ) {
+               if ( !is_null( $attribs ) ) {
                        $out .= self::expandAttributes( $attribs );
                }
-               if( is_null( $contents ) ) {
+               if ( is_null( $contents ) ) {
                        $out .= '>';
                } else {
-                       if( $allowShortTag && $contents === '' ) {
+                       if ( $allowShortTag && $contents === '' ) {
                                $out .= ' />';
                        } else {
                                $out .= '>' . htmlspecialchars( $contents ) . "</$element>";
@@ -64,10 +64,10 @@ class Xml {
         */
        public static function expandAttributes( $attribs ) {
                $out = '';
-               if( is_null( $attribs ) ) {
+               if ( is_null( $attribs ) ) {
                        return null;
-               } elseif( is_array( $attribs ) ) {
-                       foreach( $attribs as $name => $val ) {
+               } elseif ( is_array( $attribs ) ) {
+                       foreach ( $attribs as $name => $val ) {
                                $out .= " {$name}=\"" . Sanitizer::encodeAttribute( $val ) . '"';
                        }
                        return $out;
@@ -88,10 +88,10 @@ class Xml {
         */
        public static function elementClean( $element, $attribs = array(), $contents = '' ) {
                global $wgContLang;
-               if( $attribs ) {
+               if ( $attribs ) {
                        $attribs = array_map( array( 'UtfNormal', 'cleanUp' ), $attribs );
                }
-               if( $contents ) {
+               if ( $contents ) {
                        wfProfileIn( __METHOD__ . '-norm' );
                        $contents = $wgContLang->normalize( $contents );
                        wfProfileOut( __METHOD__ . '-norm' );
@@ -115,7 +115,9 @@ class Xml {
         * @param string $element element name
         * @return string
         */
-       public static function closeElement( $element ) { return "</$element>"; }
+       public static function closeElement( $element ) {
+               return "</$element>";
+       }
 
        /**
         * Same as Xml::element(), but does not escape contents. Handy when the
@@ -144,11 +146,11 @@ class Xml {
                wfDeprecated( __METHOD__, '1.19' );
                return Html::namespaceSelector( array(
                        'selected' => $selected,
-                       'all'      => $all,
-                       'label'    => $label,
+                       'all' => $all,
+                       'label' => $label,
                ), array(
-                       'name'  => $element_name,
-                       'id'    => 'namespace',
+                       'name' => $element_name,
+                       'id' => 'namespace',
                        'class' => 'namespaceselector',
                ) );
        }
@@ -164,12 +166,15 @@ class Xml {
        public static function monthSelector( $selected = '', $allmonths = null, $id = 'month' ) {
                global $wgLang;
                $options = array();
-               if( is_null( $selected ) )
+               if ( is_null( $selected ) ) {
                        $selected = '';
-               if( !is_null( $allmonths ) )
+               }
+               if ( !is_null( $allmonths ) ) {
                        $options[] = self::option( wfMessage( 'monthsall' )->text(), $allmonths, $selected === $allmonths );
-               for( $i = 1; $i < 13; $i++ )
+               }
+               for ( $i = 1; $i < 13; $i++ ) {
                        $options[] = self::option( $wgLang->getMonthName( $i ), $i, $selected === $i );
+               }
                return self::openElement( 'select', array( 'id' => $id, 'name' => 'month', 'class' => 'mw-month-selector' ) )
                        . implode( "\n", $options )
                        . self::closeElement( 'select' );
@@ -182,17 +187,17 @@ class Xml {
         */
        public static function dateMenu( $year, $month ) {
                # Offset overrides year/month selection
-               if( $month && $month !== -1 ) {
+               if ( $month && $month !== -1 ) {
                        $encMonth = intval( $month );
                } else {
                        $encMonth = '';
                }
-               if( $year ) {
+               if ( $year ) {
                        $encYear = intval( $year );
-               } elseif( $encMonth ) {
+               } elseif ( $encMonth ) {
                        $thisMonth = intval( gmdate( 'n' ) );
                        $thisYear = intval( gmdate( 'Y' ) );
-                       if( intval( $encMonth ) > $thisMonth ) {
+                       if ( intval( $encMonth ) > $thisMonth ) {
                                $thisYear--;
                        }
                        $encYear = $thisYear;
@@ -224,7 +229,7 @@ class Xml {
 
                // Make sure the site language is in the list;
                // a custom language code might not have a defined name...
-               if( !array_key_exists( $wgLanguageCode, $languages ) ) {
+               if ( !array_key_exists( $wgLanguageCode, $languages ) ) {
                        $languages[$wgLanguageCode] = $wgLanguageCode;
                }
 
@@ -237,14 +242,14 @@ class Xml {
                 */
                $selected = isset( $languages[$selected] ) ? $selected : $wgLanguageCode;
                $options = "\n";
-               foreach( $languages as $code => $name ) {
+               foreach ( $languages as $code => $name ) {
                        $options .= Xml::option( "$code - $name", $code, ($code == $selected) ) . "\n";
                }
 
                $attrs = array( 'id' => 'wpUserLanguage', 'name' => 'wpUserLanguage' );
                $attrs = array_merge( $attrs, $overrideAttrs );
 
-               if( $msg === null ) {
+               if ( $msg === null ) {
                        $msg = wfMessage( 'yourlanguage' );
                }
                return array(
@@ -288,11 +293,11 @@ class Xml {
        public static function input( $name, $size = false, $value = false, $attribs = array() ) {
                $attributes = array( 'name' => $name );
 
-               if( $size ) {
+               if ( $size ) {
                        $attributes['size'] = $size;
                }
 
-               if( $value !== false ) { // maybe 0
+               if ( $value !== false ) { // maybe 0
                        $attributes['value'] = $value;
                }
 
@@ -369,10 +374,10 @@ class Xml {
                $a = array( 'for' => $id );
 
                # FIXME avoid copy pasting below:
-               if( isset( $attribs['class'] ) ) {
+               if ( isset( $attribs['class'] ) ) {
                                $a['class'] = $attribs['class'];
                }
-               if( isset( $attribs['title'] ) ) {
+               if ( isset( $attribs['title'] ) ) {
                                $a['title'] = $attribs['title'];
                }
 
@@ -468,10 +473,10 @@ class Xml {
         */
        public static function option( $text, $value = null, $selected = false,
                        $attribs = array() ) {
-               if( !is_null( $value ) ) {
+               if ( !is_null( $value ) ) {
                        $attribs['value'] = $value;
                }
-               if( $selected ) {
+               if ( $selected ) {
                        $attribs['selected'] = 'selected';
                }
                return Html::element( 'option', $attribs, $text );
@@ -500,7 +505,9 @@ class Xml {
                                } elseif ( substr( $value, 0, 1 ) == '*' && substr( $value, 1, 1 ) != '*' ) {
                                        // A new group is starting ...
                                        $value = trim( substr( $value, 1 ) );
-                                       if( $optgroup ) $options .= self::closeElement( 'optgroup' );
+                                       if ( $optgroup ) {
+                                               $options .= self::closeElement( 'optgroup' );
+                                       }
                                        $options .= self::openElement( 'optgroup', array( 'label' => $value ) );
                                        $optgroup = true;
                                } elseif ( substr( $value, 0, 2 ) == '**' ) {
@@ -509,26 +516,30 @@ class Xml {
                                        $options .= self::option( $value, $value, $selected === $value );
                                } else {
                                        // groupless reason list
-                                       if( $optgroup ) $options .= self::closeElement( 'optgroup' );
+                                       if ( $optgroup ) {
+                                               $options .= self::closeElement( 'optgroup' );
+                                       }
                                        $options .= self::option( $value, $value, $selected === $value );
                                        $optgroup = false;
                                }
                        }
 
-                       if( $optgroup ) $options .= self::closeElement( 'optgroup' );
+                       if ( $optgroup ) {
+                               $options .= self::closeElement( 'optgroup' );
+                       }
 
                $attribs = array();
 
-               if( $name ) {
+               if ( $name ) {
                        $attribs['id'] = $name;
                        $attribs['name'] = $name;
                }
 
-               if( $class ) {
+               if ( $class ) {
                        $attribs['class'] = $class;
                }
 
-               if( $tabindex ) {
+               if ( $tabindex ) {
                        $attribs['tabindex'] = $tabindex;
                }
 
@@ -679,7 +690,7 @@ class Xml {
                # case folding violates XML standard, turn it off
                xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, false );
 
-               if( !xml_parse( $parser, $text, true ) ) {
+               if ( !xml_parse( $parser, $text, true ) ) {
                        //$err = xml_error_string( xml_get_error_code( $parser ) );
                        //$position = xml_get_current_byte_index( $parser );
                        //$fragment = $this->extractFragment( $html, $position );
@@ -736,7 +747,7 @@ class Xml {
                $form = '';
                $form .= "<table><tbody>";
 
-               foreach( $fields as $labelmsg => $input ) {
+               foreach ( $fields as $labelmsg => $input ) {
                        $id = "mw-$labelmsg";
                        $form .= Xml::openElement( 'tr', array( 'id' => $id ) );
                        $form .= Xml::tags( 'td', array( 'class' => 'mw-label' ), wfMessage( $labelmsg )->parse() );
@@ -744,7 +755,7 @@ class Xml {
                        $form .= Xml::closeElement( 'tr' );
                }
 
-               if( $submitLabel ) {
+               if ( $submitLabel ) {
                        $form .= Xml::openElement( 'tr' );
                        $form .= Xml::tags( 'td', array(), '' );
                        $form .= Xml::openElement( 'td', array( 'class' => 'mw-submit' ) ) . Xml::submitButton( wfMessage( $submitLabel )->text() ) . Xml::closeElement( 'td' );
@@ -769,7 +780,7 @@ class Xml {
                if ( is_array( $headers ) ) {
                        $s .= Xml::openElement( 'thead', $attribs );
 
-                       foreach( $headers as $id => $header ) {
+                       foreach ( $headers as $id => $header ) {
                                $attribs = array();
 
                                if ( is_string( $id ) ) {
@@ -781,7 +792,7 @@ class Xml {
                        $s .= Xml::closeElement( 'thead' );
                }
 
-               foreach( $rows as $id => $row ) {
+               foreach ( $rows as $id => $row ) {
                        $attribs = array();
 
                        if ( is_string( $id ) ) {
@@ -805,8 +816,7 @@ class Xml {
        public static function buildTableRow( $attribs, $cells ) {
                $s = Xml::openElement( 'tr', $attribs );
 
-               foreach( $cells as $id => $cell ) {
-
+               foreach ( $cells as $id => $cell ) {
                        $attribs = array();
 
                        if ( is_string( $id ) ) {
@@ -902,7 +912,7 @@ class XmlSelect {
        static function formatOptions( $options, $default = false ) {
                $data = '';
 
-               foreach( $options as $label => $value ) {
+               foreach ( $options as $label => $value ) {
                        if ( is_array( $value ) ) {
                                $contents = self::formatOptions( $value, $default );
                                $data .= Html::rawElement( 'optgroup', array( 'label' => $label ), $contents ) . "\n";
index 5e4f118..25dde7d 100644 (file)
@@ -78,13 +78,13 @@ class XmlTypeCheck {
                                do {
                                        $chunk = fread( $file, 32768 );
                                        $ret = xml_parse( $parser, $chunk, feof( $file ) );
-                                       if( $ret == 0 ) {
+                                       if ( $ret == 0 ) {
                                                // XML isn't well-formed!
                                                fclose( $file );
                                                xml_parser_free( $parser );
                                                return;
                                        }
-                               } while( !feof( $file ) );
+                               } while ( !feof( $file ) );
 
                                fclose( $file );
                        }
@@ -103,7 +103,7 @@ class XmlTypeCheck {
        private function rootElementOpen( $parser, $name, $attribs ) {
                $this->rootElement = $name;
 
-               if( is_callable( $this->filterCallback ) ) {
+               if ( is_callable( $this->filterCallback ) ) {
                        xml_set_element_handler( $parser, array( $this, 'elementOpen' ), false );
                        $this->elementOpen( $parser, $name, $attribs );
                } else {
@@ -118,7 +118,7 @@ class XmlTypeCheck {
         * @param $attribs
         */
        private function elementOpen( $parser, $name, $attribs ) {
-               if( call_user_func( $this->filterCallback, $name, $attribs ) ) {
+               if ( call_user_func( $this->filterCallback, $name, $attribs ) ) {
                        // Filter hit!
                        $this->filterMatch = true;
                }
index fd03ec4..c5955ae 100644 (file)
@@ -81,14 +81,14 @@ class ZhClient {
                $result = fgets( $this->mFP, 1024 );
 
                list( $status, $len ) = explode( ' ', $result );
-               if( $status == 'ERROR' ) {
+               if ( $status == 'ERROR' ) {
                        // $len is actually the error code...
                        print "zhdaemon error $len<br />\n";
                        return false;
                }
                $bytesread = 0;
                $data = '';
-               while( !feof( $this->mFP ) && $bytesread < $len ) {
+               while ( !feof( $this->mFP ) && $bytesread < $len ) {
                        $str = fread( $this->mFP, $len - $bytesread );
                        $bytesread += strlen( $str );
                        $data .= $str;
@@ -131,7 +131,7 @@ class ZhClient {
                $info = explode( ';', $infoline );
                $ret = array();
                $i = 0;
-               foreach( $info as $variant ) {
+               foreach ( $info as $variant ) {
                        list( $code, $len ) = explode( ' ', $variant );
                        $ret[strtolower( $code )] = substr( $data, $i, $len );
                        $i += $len;
index 895f3d3..0a2bf30 100644 (file)
@@ -114,9 +114,10 @@ class CreditsAction extends FormlessAction {
                # Hmm... too many to fit!
                if ( $cnt > 0 && $contributors->count() > $cnt ) {
                        $others_link = $this->othersLink();
-                       if ( !$showIfMax )
+                       if ( !$showIfMax ) {
                                return $this->msg( 'othercontribs' )->rawParams(
                                        $others_link )->params( $contributors->count() )->escaped();
+                       }
                }
 
                $real_names = array();
index 7296126..911fd58 100644 (file)
@@ -211,7 +211,7 @@ class HistoryAction extends FormlessAction {
         */
        function fetchRevisions( $limit, $offset, $direction ) {
                // Fail if article doesn't exist.
-               if( !$this->getTitle()->exists() ) {
+               if ( !$this->getTitle()->exists() ) {
                        return new FakeResultWrapper( array() );
                }
 
@@ -367,14 +367,14 @@ class HistoryPager extends ReverseChronologicalPager {
 
        function getQueryInfo() {
                $queryInfo = array(
-                       'tables'  => array( 'revision', 'user' ),
-                       'fields'  => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
-                       'conds'   => array_merge(
+                       'tables' => array( 'revision', 'user' ),
+                       'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
+                       'conds' => array_merge(
                                array( 'rev_page' => $this->getWikiPage()->getId() ),
                                $this->conds ),
                        'options' => array( 'USE INDEX' => array( 'revision' => 'page_timestamp' ) ),
                        'join_conds' => array(
-                               'user'        => Revision::userJoinCond(),
+                               'user' => Revision::userJoinCond(),
                                'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
                );
                ChangeTags::modifyDisplayQuery(
@@ -413,10 +413,10 @@ class HistoryPager extends ReverseChronologicalPager {
                $batch = new LinkBatch();
                $revIds = array();
                foreach ( $this->mResult as $row ) {
-                       if( $row->rev_parent_id ) {
+                       if ( $row->rev_parent_id ) {
                                $revIds[] = $row->rev_parent_id;
                        }
-                       if( !is_null( $row->user_name ) ) {
+                       if ( !is_null( $row->user_name ) ) {
                                $batch->add( NS_USER, $row->user_name );
                                $batch->add( NS_USER_TALK, $row->user_name );
                        } else { # for anons or usernames of imported revisions
@@ -649,9 +649,9 @@ class HistoryPager extends ReverseChronologicalPager {
                                        $this->msg( 'editundo' )->escaped(),
                                        $undoTooltip,
                                        array(
-                                               'action'    => 'edit',
+                                               'action' => 'edit',
                                                'undoafter' => $prevRev->getId(),
-                                               'undo'      => $rev->getId()
+                                               'undo' => $rev->getId()
                                        )
                                );
                                $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
@@ -788,13 +788,13 @@ class HistoryPager extends ReverseChronologicalPager {
        function diffButtons( $rev, $firstInList ) {
                if ( $this->getNumRows() > 1 ) {
                        $id = $rev->getId();
-                       $radio = array( 'type'  => 'radio', 'value' => $id );
+                       $radio = array( 'type' => 'radio', 'value' => $id );
                        /** @todo: move title texts to javascript */
                        if ( $firstInList ) {
                                $first = Xml::element( 'input',
                                        array_merge( $radio, array(
                                                'style' => 'visibility:hidden',
-                                               'name'  => 'oldid',
+                                               'name' => 'oldid',
                                                'id' => 'mw-oldid-null' ) )
                                );
                                $checkmark = array( 'checked' => 'checked' );
@@ -811,13 +811,13 @@ class HistoryPager extends ReverseChronologicalPager {
                                }
                                $first = Xml::element( 'input',
                                        array_merge( $radio, $checkmark, array(
-                                               'name'  => 'oldid',
+                                               'name' => 'oldid',
                                                'id' => "mw-oldid-$id" ) ) );
                                $checkmark = array();
                        }
                        $second = Xml::element( 'input',
                                array_merge( $radio, $checkmark, array(
-                                       'name'  => 'diff',
+                                       'name' => 'diff',
                                        'id' => "mw-diff-$id" ) ) );
                        return $first . $second;
                } else {
index 55fa108..a8905d8 100644 (file)
@@ -602,7 +602,7 @@ class InfoAction extends FormlessAction {
                        'COUNT(*)',
                        array(
                                'wl_namespace' => $title->getNamespace(),
-                               'wl_title'     => $title->getDBkey(),
+                               'wl_title' => $title->getDBkey(),
                        ),
                        __METHOD__
                );
index 82cdc79..ed0bff7 100644 (file)
@@ -71,7 +71,7 @@ class PurgeAction extends FormAction {
                                $this->getRequest()->getQueryValues(),
                                array( 'title' => null, 'action' => null )
                        ) );
-                       if( $this->onSubmit( array() ) ) {
+                       if ( $this->onSubmit( array() ) ) {
                                $this->onSuccess();
                        }
                } else {
index 23db874..3fa20b7 100644 (file)
@@ -125,7 +125,7 @@ class RawAction extends FormlessAction {
                global $wgParser;
 
                # No longer used
-               if( $this->mGen ) {
+               if ( $this->mGen ) {
                        return '';
                }
 
@@ -194,14 +194,14 @@ class RawAction extends FormlessAction {
                switch ( $this->getRequest()->getText( 'direction' ) ) {
                        case 'next':
                                # output next revision, or nothing if there isn't one
-                               if( $oldid ) {
+                               if ( $oldid ) {
                                        $oldid = $this->getTitle()->getNextRevisionID( $oldid );
                                }
                                $oldid = $oldid ? $oldid : -1;
                                break;
                        case 'prev':
                                # output previous revision, or nothing if there isn't one
-                               if( !$oldid ) {
+                               if ( !$oldid ) {
                                        # get the current revision so we can get the penultimate one
                                        $oldid = $this->page->getLatest();
                                }
index ee5aa97..c500370 100644 (file)
@@ -966,9 +966,9 @@ abstract class ApiBase extends ContextSource {
                                                }
                                                break;
                                        case 'integer': // Force everything using intval() and optionally validate limits
-                                               $min = isset ( $paramSettings[self::PARAM_MIN] ) ? $paramSettings[self::PARAM_MIN] : null;
-                                               $max = isset ( $paramSettings[self::PARAM_MAX] ) ? $paramSettings[self::PARAM_MAX] : null;
-                                               $enforceLimits = isset ( $paramSettings[self::PARAM_RANGE_ENFORCE] )
+                                               $min = isset( $paramSettings[self::PARAM_MIN] ) ? $paramSettings[self::PARAM_MIN] : null;
+                                               $max = isset( $paramSettings[self::PARAM_MAX] ) ? $paramSettings[self::PARAM_MAX] : null;
+                                               $enforceLimits = isset( $paramSettings[self::PARAM_RANGE_ENFORCE] )
                                                                ? $paramSettings[self::PARAM_RANGE_ENFORCE] : false;
 
                                                if ( is_array( $value ) ) {
index ab60008..e7e5e1d 100644 (file)
@@ -262,7 +262,7 @@ class ApiEditPage extends ApiBase {
                        $requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
                }
 
-               if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) )       {
+               if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {
                        $requestArray['wpMinoredit'] = '';
                }
 
@@ -342,7 +342,7 @@ class ApiEditPage extends ApiBase {
                $wgRequest = $oldRequest;
                global $wgMaxArticleSize;
 
-               switch( $status->value ) {
+               switch ( $status->value ) {
                        case EditPage::AS_HOOK_ERROR:
                        case EditPage::AS_HOOK_ERROR_EXPECTED:
                                $this->dieUsageMsg( 'hookaborted' );
index a11563b..f2a7748 100644 (file)
@@ -93,7 +93,7 @@ class ApiFeedContributions extends ApiBase {
 
        protected function feedItem( $row ) {
                $title = Title::makeTitle( intval( $row->page_namespace ), $row->page_title );
-               if ( $title ) {
+               if( $title && $title->userCan( 'read' ) ) {
                        $date = $row->rev_timestamp;
                        $comments = $title->getTalkPage()->getFullURL();
                        $revision = Revision::newFromRow( $row );
@@ -106,9 +106,8 @@ class ApiFeedContributions extends ApiBase {
                                $this->feedItemAuthor( $revision ),
                                $comments
                        );
-               } else {
-                       return null;
                }
+               return null;
        }
 
        /**
index f9b85ef..4ec149c 100644 (file)
@@ -155,7 +155,7 @@ class ApiFormatXml extends ApiFormatBase {
                                        unset( $elemValue[$subElemId] );
                                } elseif ( is_array( $subElemValue ) ) {
                                        $subElements[$subElemId] = $subElemValue;
-                                       unset ( $elemValue[$subElemId] );
+                                       unset( $elemValue[$subElemId] );
                                }
                        }
 
index 99847cf..dd75d3f 100644 (file)
@@ -609,7 +609,7 @@ class ApiMain extends ApiBase {
 
                $result = $this->getResult();
                // Printer may not be initialized if the extractRequestParams() fails for the main module
-               if ( !isset ( $this->mPrinter ) ) {
+               if ( !isset( $this->mPrinter ) ) {
                        // The printer has not been created yet. Try to manually get formatter value.
                        $value = $this->getRequest()->getVal( 'format', self::API_DEFAULT_FORMAT );
                        if ( !$this->mModuleMgr->isDefined( $value, 'format' ) ) {
index 0645edb..3caf81f 100644 (file)
@@ -188,7 +188,7 @@ class ApiPageSet extends ApiBase {
 
                        if ( !$isDryRun ) {
                                // Populate page information with the original user input
-                               switch( $dataSource ) {
+                               switch ( $dataSource ) {
                                        case 'titles':
                                                $this->initFromTitles( $this->mParams['titles'] );
                                                break;
@@ -407,7 +407,7 @@ class ApiPageSet extends ApiBase {
         * @return array of raw_prefixed_title (string) => prefixed_title (string)
         * @since 1.21
         */
-       public function getNormalizedTitlesAsResult( $result = null  ) {
+       public function getNormalizedTitlesAsResult( $result = null ) {
                $values = array();
                foreach ( $this->getNormalizedTitles() as $rawTitleStr => $titleStr ) {
                        $values[] = array(
index fa2a7c4..881269f 100644 (file)
@@ -121,10 +121,10 @@ class ApiQueryBlocks extends ApiQueryBase {
                        $show = array_flip( $params['show'] );
 
                        /* Check for conflicting parameters. */
-                       if ( ( isset ( $show['account'] ) && isset ( $show['!account'] ) )
-                                       || ( isset ( $show['ip'] ) && isset ( $show['!ip'] ) )
-                                       || ( isset ( $show['range'] ) && isset ( $show['!range'] ) )
-                                       || ( isset ( $show['temp'] ) && isset ( $show['!temp'] ) )
+                       if ( ( isset( $show['account'] ) && isset( $show['!account'] ) )
+                                       || ( isset( $show['ip'] ) && isset( $show['!ip'] ) )
+                                       || ( isset( $show['range'] ) && isset( $show['!range'] ) )
+                                       || ( isset( $show['temp'] ) && isset( $show['!temp'] ) )
                        ) {
                                $this->dieUsageMsg( 'show' );
                        }
index 4a53409..690d0e6 100644 (file)
@@ -50,7 +50,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                $fld_user = isset( $prop['user'] );
                $fld_userid = isset( $prop['userid'] );
                $fld_comment = isset( $prop['comment'] );
-               $fld_parsedcomment = isset ( $prop['parsedcomment'] );
+               $fld_parsedcomment = isset( $prop['parsedcomment'] );
                $fld_minor = isset( $prop['minor'] );
                $fld_len = isset( $prop['len'] );
                $fld_sha1 = isset( $prop['sha1'] );
index 33b70a4..eaa2b47 100644 (file)
@@ -49,12 +49,12 @@ class ApiQueryLogEvents extends ApiQueryBase {
                $this->fld_ids = isset( $prop['ids'] );
                $this->fld_title = isset( $prop['title'] );
                $this->fld_type = isset( $prop['type'] );
-               $this->fld_action = isset ( $prop['action'] );
+               $this->fld_action = isset( $prop['action'] );
                $this->fld_user = isset( $prop['user'] );
                $this->fld_userid = isset( $prop['userid'] );
                $this->fld_timestamp = isset( $prop['timestamp'] );
                $this->fld_comment = isset( $prop['comment'] );
-               $this->fld_parsedcomment = isset ( $prop['parsedcomment'] );
+               $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
                $this->fld_details = isset( $prop['details'] );
                $this->fld_tags = isset( $prop['tags'] );
 
index 8aceab2..7cb445d 100644 (file)
@@ -499,7 +499,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                        }
                        return $retval;
                }
-               switch( $type ) {
+               switch ( $type ) {
                        case 'edit':
                                return RC_EDIT;
                        case 'new':
index 317b7ba..1d86c97 100644 (file)
@@ -146,17 +146,17 @@ class ApiQueryRevisions extends ApiQueryBase {
                $prop = array_flip( $params['prop'] );
 
                // Optional fields
-               $this->fld_ids = isset ( $prop['ids'] );
+               $this->fld_ids = isset( $prop['ids'] );
                // $this->addFieldsIf('rev_text_id', $this->fld_ids); // should this be exposed?
-               $this->fld_flags = isset ( $prop['flags'] );
-               $this->fld_timestamp = isset ( $prop['timestamp'] );
-               $this->fld_comment = isset ( $prop['comment'] );
-               $this->fld_parsedcomment = isset ( $prop['parsedcomment'] );
-               $this->fld_size = isset ( $prop['size'] );
-               $this->fld_sha1 = isset ( $prop['sha1'] );
-               $this->fld_contentmodel = isset ( $prop['contentmodel'] );
+               $this->fld_flags = isset( $prop['flags'] );
+               $this->fld_timestamp = isset( $prop['timestamp'] );
+               $this->fld_comment = isset( $prop['comment'] );
+               $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
+               $this->fld_size = isset( $prop['size'] );
+               $this->fld_sha1 = isset( $prop['sha1'] );
+               $this->fld_contentmodel = isset( $prop['contentmodel'] );
                $this->fld_userid = isset( $prop['userid'] );
-               $this->fld_user = isset ( $prop['user'] );
+               $this->fld_user = isset( $prop['user'] );
                $this->token = $params['token'];
 
                if ( !empty( $params['contentformat'] ) ) {
index 8618339..ab78ba6 100644 (file)
@@ -93,6 +93,8 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                }
                if ( is_null( $matches ) ) {
                        $this->dieUsage( "{$what} search is disabled", "search-{$what}-disabled" );
+               } elseif( $matches instanceof Status && !$matches->isGood() ) {
+                       $this->dieUsage( $matches->getWikiText(), 'search-error' );
                }
 
                $apiResult = $this->getResult();
@@ -345,6 +347,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'code' => 'search-text-disabled', 'info' => 'text search is disabled' ),
                        array( 'code' => 'search-title-disabled', 'info' => 'title search is disabled' ),
+                       array( 'code' => 'search-error', 'info' => 'search error has occurred' ),
                ) );
        }
 
index 6d20d66..1e013eb 100644 (file)
@@ -48,7 +48,7 @@ class ApiQueryContributions extends ApiQueryBase {
                $this->fld_ids = isset( $prop['ids'] );
                $this->fld_title = isset( $prop['title'] );
                $this->fld_comment = isset( $prop['comment'] );
-               $this->fld_parsedcomment = isset ( $prop['parsedcomment'] );
+               $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
                $this->fld_size = isset( $prop['size'] );
                $this->fld_sizediff = isset( $prop['sizediff'] );
                $this->fld_flags = isset( $prop['flags'] );
@@ -255,7 +255,7 @@ class ApiQueryContributions extends ApiQueryBase {
                $this->addFieldsIf( 'rev_comment', $this->fld_comment || $this->fld_parsedcomment );
                $this->addFieldsIf( 'rev_len', $this->fld_size || $this->fld_sizediff );
                $this->addFieldsIf( 'rev_minor_edit', $this->fld_flags );
-               $this->addFieldsIf( 'rev_parent_id', $this->fld_flags || $this->fld_sizediff );
+               $this->addFieldsIf( 'rev_parent_id', $this->fld_flags || $this->fld_sizediff || $this->fld_ids );
                $this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled );
 
                if ( $this->fld_tags ) {
@@ -297,6 +297,10 @@ class ApiQueryContributions extends ApiQueryBase {
                        $vals['pageid'] = intval( $row->rev_page );
                        $vals['revid'] = intval( $row->rev_id );
                        // $vals['textid'] = intval( $row->rev_text_id ); // todo: Should this field be exposed?
+
+                       if ( !is_null( $row->rev_parent_id ) ) {
+                               $vals['parentid'] = intval( $row->rev_parent_id );
+                       }
                }
 
                $title = Title::makeTitle( $row->page_namespace, $row->page_title );
@@ -474,7 +478,11 @@ class ApiQueryContributions extends ApiQueryBase {
                        ),
                        'ids' => array(
                                'pageid' => 'integer',
-                               'revid' => 'integer'
+                               'revid' => 'integer',
+                               'parentid' => array(
+                                       ApiBase::PROP_TYPE => 'integer',
+                                       ApiBase::PROP_NULLABLE => true
+                               )
                        ),
                        'title' => array(
                                'ns' => 'namespace',
index 491d20f..3ee15f6 100644 (file)
@@ -68,7 +68,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                        $this->fld_user = isset( $prop['user'] );
                        $this->fld_userid = isset( $prop['userid'] );
                        $this->fld_comment = isset( $prop['comment'] );
-                       $this->fld_parsedcomment = isset ( $prop['parsedcomment'] );
+                       $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
                        $this->fld_timestamp = isset( $prop['timestamp'] );
                        $this->fld_sizes = isset( $prop['sizes'] );
                        $this->fld_patrol = isset( $prop['patrol'] );
@@ -143,12 +143,11 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                        $show = array_flip( $params['show'] );
 
                        /* Check for conflicting parameters. */
-                       if ( ( isset ( $show['minor'] ) && isset ( $show['!minor'] ) )
-                                       || ( isset ( $show['bot'] ) && isset ( $show['!bot'] ) )
-                                       || ( isset ( $show['anon'] ) && isset ( $show['!anon'] ) )
-                                       || ( isset ( $show['patrolled'] ) && isset ( $show['!patrolled'] ) )
-                       )
-                       {
+                       if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
+                                       || ( isset( $show['bot'] ) && isset( $show['!bot'] ) )
+                                       || ( isset( $show['anon'] ) && isset( $show['!anon'] ) )
+                                       || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
+                       ) {
                                $this->dieUsageMsg( 'show' );
                        }
 
index a8d7115..5563087 100644 (file)
@@ -456,7 +456,7 @@ class ApiUpload extends ApiBase {
                global $wgFileExtensions;
 
                // @todo Move them to ApiBase's message map
-               switch( $verification['status'] ) {
+               switch ( $verification['status'] ) {
                        // Recoverable errors
                        case UploadBase::MIN_LENGTH_PARTNAME:
                                $this->dieRecoverableError( 'filename-tooshort', 'filename' );
index d3e85d8..193f20f 100644 (file)
@@ -237,7 +237,7 @@ class BacklinkCache {
                } else {
                        $prefix = null;
                        wfRunHooks( 'BacklinkCacheGetPrefix', array( $table, &$prefix ) );
-                       if( $prefix ) {
+                       if ( $prefix ) {
                                return $prefix;
                        } else {
                                throw new MWException( "Invalid table \"$table\" in " . __CLASS__ );
@@ -292,7 +292,7 @@ class BacklinkCache {
                        default:
                                $conds = null;
                                wfRunHooks( 'BacklinkCacheGetConditions', array( $table, $this->title, &$conds ) );
-                               if( !$conds ) {
+                               if ( !$conds ) {
                                        throw new MWException( "Invalid table \"$table\" in " . __CLASS__ );
                                }
                }
index 0f047e8..32bcdf7 100644 (file)
@@ -404,7 +404,7 @@ class GlobalDependency extends CacheDependency {
         * @return bool
         */
        function isExpired() {
-               if( !isset( $GLOBALS[$this->name] ) ) {
+               if ( !isset( $GLOBALS[$this->name] ) ) {
                        return true;
                }
                return $GLOBALS[$this->name] != $this->value;
index 74feffb..7310f61 100644 (file)
@@ -138,7 +138,7 @@ abstract class FileCacheBase {
         * @return string
         */
        public function fetchText() {
-               if( $this->useGzip() ) {
+               if ( $this->useGzip() ) {
                        $fh = gzopen( $this->cachePath(), 'rb' );
                        return stream_get_contents( $fh );
                } else {
index 63e4226..b7d1b26 100644 (file)
@@ -66,15 +66,14 @@ class GenderCache {
        public function getGenderOf( $username, $caller = '' ) {
                global $wgUser;
 
-               if( $username instanceof User ) {
+               if ( $username instanceof User ) {
                        $username = $username->getName();
                }
 
                $username = self::normalizeUsername( $username );
                if ( !isset( $this->cache[$username] ) ) {
-
                        if ( $this->misses >= $this->missLimit && $wgUser->getName() !== $username ) {
-                               if( $this->misses === $this->missLimit ) {
+                               if ( $this->misses === $this->missLimit ) {
                                        $this->misses++;
                                        wfDebug( __METHOD__ . ": too many misses, returning default onwards\n" );
                                }
@@ -84,7 +83,6 @@ class GenderCache {
                                $this->misses++;
                                $this->doQuery( $username, $caller );
                        }
-
                }
 
                /* Undefined if there is a valid username which for some reason doesn't
@@ -102,7 +100,9 @@ class GenderCache {
        public function doLinkBatch( $data, $caller = '' ) {
                $users = array();
                foreach ( $data as $ns => $pagenames ) {
-                       if ( !MWNamespace::hasGenderDistinction( $ns ) ) continue;
+                       if ( !MWNamespace::hasGenderDistinction( $ns ) ) {
+                               continue;
+                       }
                        foreach ( array_keys( $pagenames ) as $username ) {
                                $users[$username] = true;
                        }
@@ -150,7 +150,7 @@ class GenderCache {
                                // For existing users, this value will be overwritten by the correct value
                                $this->cache[$name] = $default;
                                // query only for valid names, which can be in the database
-                               if( User::isValidUserName( $name ) ) {
+                               if ( User::isValidUserName( $name ) ) {
                                        $usersToCheck[] = $name;
                                }
                        }
index 72a2e8e..f47107c 100644 (file)
@@ -39,7 +39,7 @@ class LinkBatch {
        protected $caller;
 
        function __construct( $arr = array() ) {
-               foreach( $arr as $item ) {
+               foreach ( $arr as $item ) {
                        $this->addObj( $item );
                }
        }
index 0e41e26..31982e0 100644 (file)
@@ -156,8 +156,13 @@ class LinkCache {
                unset( $this->mGoodLinkFields[$dbkey] );
        }
 
-       public function getGoodLinks() { return $this->mGoodLinks; }
-       public function getBadLinks() { return array_keys( $this->mBadLinks ); }
+       public function getGoodLinks() {
+               return $this->mGoodLinks;
+       }
+
+       public function getBadLinks() {
+               return array_keys( $this->mBadLinks );
+       }
 
        /**
         * Add a title to the link cache, return the page_id or zero if non-existent
@@ -167,7 +172,7 @@ class LinkCache {
         */
        public function addLink( $title ) {
                $nt = Title::newFromDBkey( $title );
-               if( $nt ) {
+               if ( $nt ) {
                        return $this->addLinkObj( $nt );
                } else {
                        return 0;
@@ -215,7 +220,9 @@ class LinkCache {
                }
 
                $f = array( 'page_id', 'page_len', 'page_is_redirect', 'page_latest' );
-               if ( $wgContentHandlerUseDB ) $f[] = 'page_content_model';
+               if ( $wgContentHandlerUseDB ) {
+                       $f[] = 'page_content_model';
+               }
 
                $s = $db->selectRow( 'page', $f,
                        array( 'page_namespace' => $nt->getNamespace(), 'page_title' => $nt->getDBkey() ),
index 6cc2a7e..49db857 100644 (file)
@@ -205,7 +205,7 @@ class MessageCache {
        function load( $code = false ) {
                global $wgUseLocalMessageCache;
 
-               if( !is_string( $code ) ) {
+               if ( !is_string( $code ) ) {
                        # This isn't really nice, so at least make a note about it and try to
                        # fall back
                        wfDebug( __METHOD__ . " called without providing a language code\n" );
index 5f5d257..dd71801 100644 (file)
@@ -125,7 +125,7 @@ class SquidUpdate {
        static function purge( $urlArr ) {
                global $wgSquidServers, $wgHTCPMulticastRouting;
 
-               if( !$urlArr ) {
+               if ( !$urlArr ) {
                        return;
                }
 
@@ -172,7 +172,7 @@ class SquidUpdate {
                $htcpOpCLR = 4; // HTCP CLR
 
                // @todo FIXME: PHP doesn't support these socket constants (include/linux/in.h)
-               if( !defined( "IPPROTO_IP" ) ) {
+               if ( !defined( "IPPROTO_IP" ) ) {
                        define( "IPPROTO_IP", 0 );
                        define( "IP_MULTICAST_LOOP", 34 );
                        define( "IP_MULTICAST_TTL", 33 );
@@ -183,13 +183,14 @@ class SquidUpdate {
                if ( $conn ) {
                        // Set socket options
                        socket_set_option( $conn, IPPROTO_IP, IP_MULTICAST_LOOP, 0 );
-                       if ( $wgHTCPMulticastTTL != 1 )
+                       if ( $wgHTCPMulticastTTL != 1 ) {
                                socket_set_option( $conn, IPPROTO_IP, IP_MULTICAST_TTL,
                                        $wgHTCPMulticastTTL );
+                       }
 
                        $urlArr = array_unique( $urlArr ); // Remove duplicates
                        foreach ( $urlArr as $url ) {
-                               if( !is_string( $url ) ) {
+                               if ( !is_string( $url ) ) {
                                        wfProfileOut( __METHOD__ );
                                        throw new MWException( 'Bad purge URL' );
                                }
index 6aefc98..fd99caf 100644 (file)
@@ -401,10 +401,10 @@ class RequestContext implements IContextSource {
         */
        public function exportSession() {
                return array(
-                       'ip'        => $this->getRequest()->getIP(),
-                       'headers'   => $this->getRequest()->getAllHeaders(),
+                       'ip' => $this->getRequest()->getIP(),
+                       'headers' => $this->getRequest()->getAllHeaders(),
                        'sessionId' => session_id(),
-                       'userId'    => $this->getUser()->getId()
+                       'userId' => $this->getUser()->getId()
                );
        }
 
index 4e44374..2603b9f 100644 (file)
@@ -87,7 +87,7 @@ class CloneDatabase {
         * Clone the table structure
         */
        public function cloneTableStructure() {
-               foreach( $this->tablesToClone as $tbl ) {
+               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.
@@ -98,7 +98,7 @@ class CloneDatabase {
                        self::changePrefix( $this->newTablePrefix );
                        $newTableName = $this->db->tableName( $tbl, 'raw' );
 
-                       if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) ) ) {
+                       if ( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) ) ) {
                                $this->db->dropTable( $tbl, __METHOD__ );
                                wfDebug( __METHOD__ . " dropping {$newTableName}\n", true );
                                //Dropping the oldTable because the prefix was changed
@@ -115,9 +115,9 @@ class CloneDatabase {
         * @param bool $dropTables Optionally drop the tables we created
         */
        public function destroy( $dropTables = false ) {
-               if( $dropTables ) {
+               if ( $dropTables ) {
                        self::changePrefix( $this->newTablePrefix );
-                       foreach( $this->tablesToClone as $tbl ) {
+                       foreach ( $this->tablesToClone as $tbl ) {
                                $this->db->dropTable( $tbl );
                        }
                }
index 87d5f81..70fc1f3 100644 (file)
@@ -732,7 +732,7 @@ abstract class DatabaseBase implements DatabaseType {
                $dbType = strtolower( $dbType );
                $class = 'Database' . ucfirst( $dbType );
 
-               if( in_array( $dbType, $canonicalDBTypes ) || ( class_exists( $class ) && is_subclass_of( $class, 'DatabaseBase' ) ) ) {
+               if ( in_array( $dbType, $canonicalDBTypes ) || ( class_exists( $class ) && is_subclass_of( $class, 'DatabaseBase' ) ) ) {
                        return new $class(
                                isset( $p['host'] ) ? $p['host'] : false,
                                isset( $p['user'] ) ? $p['user'] : false,
@@ -1636,7 +1636,7 @@ abstract class DatabaseBase implements DatabaseType {
         * @return bool|null
         */
        public function indexExists( $table, $index, $fname = 'DatabaseBase::indexExists' ) {
-               if( !$this->tableExists( $table ) ) {
+               if ( !$this->tableExists( $table ) ) {
                        return null;
                }
 
@@ -2285,9 +2285,9 @@ abstract class DatabaseBase implements DatabaseType {
        protected function indexName( $index ) {
                // Backwards-compatibility hack
                $renamed = array(
-                       'ar_usertext_timestamp' => 'usertext_timestamp',
-                       'un_user_id'            => 'user_id',
-                       'un_user_ip'            => 'user_ip',
+                       'ar_usertext_timestamp' => 'usertext_timestamp',
+                       'un_user_id' => 'user_id',
+                       'un_user_ip' => 'user_ip',
                );
 
                if ( isset( $renamed[$index] ) ) {
@@ -2468,7 +2468,7 @@ abstract class DatabaseBase implements DatabaseType {
                        $rows = array( $rows );
                }
 
-               foreach( $rows as $row ) {
+               foreach ( $rows as $row ) {
                        # Delete rows which collide
                        if ( $uniqueIndexes ) {
                                $sql = "DELETE FROM $quotedTable WHERE ";
@@ -2966,6 +2966,7 @@ abstract class DatabaseBase implements DatabaseType {
        /**
         * Run an anonymous function as soon as there is no transaction pending.
         * If there is a transaction and it is rolled back, then the callback is cancelled.
+        * Queries in the function will run in AUTO-COMMIT mode unless there are begin() calls.
         * Callbacks must commit any transactions that they begin.
         *
         * This is useful for updates to different systems or when separate transactions are needed.
@@ -3122,13 +3123,13 @@ abstract class DatabaseBase implements DatabaseType {
                if ( $flush != 'flush' ) {
                        if ( !$this->mTrxLevel ) {
                                wfWarn( "$fname: No transaction to commit, something got out of sync!" );
-                       } elseif( $this->mTrxAutomatic ) {
+                       } elseif ( $this->mTrxAutomatic ) {
                                wfWarn( "$fname: Explicit commit of implicit transaction. Something may be out of sync!" );
                        }
                } else {
                        if ( !$this->mTrxLevel ) {
                                return; // nothing to do
-                       } elseif( !$this->mTrxAutomatic ) {
+                       } elseif ( !$this->mTrxAutomatic ) {
                                wfWarn( "$fname: Flushing an explicit transaction, getting out of sync!" );
                        }
                }
@@ -3674,11 +3675,11 @@ abstract class DatabaseBase implements DatabaseType {
         * @since 1.18
         */
        public function dropTable( $tableName, $fName = 'DatabaseBase::dropTable' ) {
-               if( !$this->tableExists( $tableName, $fName ) ) {
+               if ( !$this->tableExists( $tableName, $fName ) ) {
                        return false;
                }
                $sql = "DROP TABLE " . $this->tableName( $tableName );
-               if( $this->cascadingDeletes() ) {
+               if ( $this->cascadingDeletes() ) {
                        $sql .= " CASCADE";
                }
                return $this->query( $sql, $fName );
index 82b0e5a..da719be 100644 (file)
@@ -96,7 +96,7 @@ class DatabaseMssql extends DatabaseBase {
 
                $connectionInfo = array();
 
-               if( $dbName ) {
+               if ( $dbName ) {
                        $connectionInfo['Database'] = $dbName;
                }
 
@@ -109,7 +109,7 @@ class DatabaseMssql extends DatabaseBase {
                $ntAuthPassTest = strtolower( $password );
 
                // Decide which auth scenerio to use
-               if( $ntAuthPassTest == 'ntauth' && $ntAuthUserTest == 'ntauth' ) {
+               if ( $ntAuthPassTest == 'ntauth' && $ntAuthUserTest == 'ntauth' ) {
                        // Don't add credentials to $connectionInfo
                } else {
                        $connectionInfo['UID'] = $user;
@@ -344,7 +344,9 @@ class DatabaseMssql extends DatabaseBase {
                $rows = -1;
                if ( $res ) {
                        $row = $this->fetchRow( $res );
-                       if ( isset( $row['EstimateRows'] ) ) $rows = $row['EstimateRows'];
+                       if ( isset( $row['EstimateRows'] ) ) {
+                               $rows = $row['EstimateRows'];
+                       }
                }
                return $rows;
        }
@@ -421,7 +423,7 @@ class DatabaseMssql extends DatabaseBase {
                $identity = null;
                $tableRaw = preg_replace( '#\[([^\]]*)\]#', '$1', $table ); // strip matching square brackets from table name
                $res = $this->doQuery( "SELECT NAME AS idColumn FROM SYS.IDENTITY_COLUMNS WHERE OBJECT_NAME(OBJECT_ID)='{$tableRaw}'" );
-               if( $res && $res->numrows() ) {
+               if ( $res && $res->numrows() ) {
                        // There is an identity for this table.
                        $identity = array_pop( $res->fetch( SQLSRV_FETCH_ASSOC ) );
                }
@@ -434,11 +436,11 @@ class DatabaseMssql extends DatabaseBase {
                        $identityClause = '';
 
                        // if we have an identity column
-                       if( $identity ) {
+                       if ( $identity ) {
                                // iterate through
                                foreach ( $a as $k => $v ) {
                                        if ( $k == $identity ) {
-                                               if( !is_null( $v ) ) {
+                                               if ( !is_null( $v ) ) {
                                                        // there is a value being passed to us, we need to turn on and off inserted identity
                                                        $sqlPre = "SET IDENTITY_INSERT $table ON;";
                                                        $sqlPost = ";SET IDENTITY_INSERT $table OFF;";
@@ -1009,7 +1011,7 @@ class MssqlResult {
 
                $rows = sqlsrv_fetch_array( $queryresult, SQLSRV_FETCH_ASSOC );
 
-               foreach( $rows as $row ) {
+               foreach ( $rows as $row ) {
                        if ( $row !== null ) {
                                foreach ( $row as $k => $v ) {
                                        if ( is_object( $v ) && method_exists( $v, 'format' ) ) {// DateTime Object
@@ -1047,7 +1049,7 @@ class MssqlResult {
                                $arrNum[] = $value;
                        }
                }
-               switch( $mode ) {
+               switch ( $mode ) {
                        case SQLSRV_FETCH_ASSOC:
                                $ret = $this->mRows[$this->mCursor];
                                break;
index d6f6809..0009937 100644 (file)
@@ -42,7 +42,7 @@ class DatabaseMysql extends DatabaseBase {
         * @return resource
         */
        protected function doQuery( $sql ) {
-               if( $this->bufferResults() ) {
+               if ( $this->bufferResults() ) {
                        $ret = mysql_query( $sql, $this->mConn );
                } else {
                        $ret = mysql_unbuffered_query( $sql, $this->mConn );
@@ -153,7 +153,7 @@ class DatabaseMysql extends DatabaseBase {
 
                // Tell the server we're communicating with it in UTF-8.
                // This may engage various charset conversions.
-               if( $wgDBmysql5 ) {
+               if ( $wgDBmysql5 ) {
                        $this->query( 'SET NAMES utf8', __METHOD__ );
                } else {
                        $this->query( 'SET NAMES binary', __METHOD__ );
@@ -210,7 +210,7 @@ class DatabaseMysql extends DatabaseBase {
                // Only check for CR_SERVER_LOST and CR_UNKNOWN_ERROR, as
                // these are the only errors mysql_fetch_object can cause.
                // See http://dev.mysql.com/doc/refman/5.0/en/mysql-fetch-row.html.
-               if( $errno == 2000 || $errno == 2013 ) {
+               if ( $errno == 2000 || $errno == 2013 ) {
                        throw new DBUnexpectedError( $this, 'Error in fetchObject(): ' . htmlspecialchars( $this->lastError() ) );
                }
                return $row;
@@ -234,7 +234,7 @@ class DatabaseMysql extends DatabaseBase {
                // Only check for CR_SERVER_LOST and CR_UNKNOWN_ERROR, as
                // these are the only errors mysql_fetch_object can cause.
                // See http://dev.mysql.com/doc/refman/5.0/en/mysql-fetch-row.html.
-               if( $errno == 2000 || $errno == 2013 ) {
+               if ( $errno == 2000 || $errno == 2013 ) {
                        throw new DBUnexpectedError( $this, 'Error in fetchRow(): ' . htmlspecialchars( $this->lastError() ) );
                }
                return $row;
@@ -328,7 +328,7 @@ class DatabaseMysql extends DatabaseBase {
                } else {
                        $error = mysql_error();
                }
-               if( $error ) {
+               if ( $error ) {
                        $error .= ' (' . $this->mServer . ')';
                }
                return $error;
@@ -393,9 +393,9 @@ class DatabaseMysql extends DatabaseBase {
                        return false;
                }
                $n = mysql_num_fields( $res->result );
-               for( $i = 0; $i < $n; $i++ ) {
+               for ( $i = 0; $i < $n; $i++ ) {
                        $meta = mysql_fetch_field( $res->result, $i );
-                       if( $field == $meta->name ) {
+                       if ( $field == $meta->name ) {
                                return new MySQLField( $meta );
                        }
                }
@@ -452,7 +452,7 @@ class DatabaseMysql extends DatabaseBase {
        function strencode( $s ) {
                $sQuoted = mysql_real_escape_string( $s, $this->mConn );
 
-               if( $sQuoted === false ) {
+               if ( $sQuoted === false ) {
                        $this->ping();
                        $sQuoted = mysql_real_escape_string( $s, $this->mConn );
                }
@@ -537,11 +537,11 @@ class DatabaseMysql extends DatabaseBase {
        function getLagFromProcesslist() {
                wfDeprecated( __METHOD__, '1.19' );
                $res = $this->query( 'SHOW PROCESSLIST', __METHOD__ );
-               if( !$res ) {
+               if ( !$res ) {
                        return false;
                }
                # Find slave SQL thread
-               foreach( $res as $row ) {
+               foreach ( $res as $row ) {
                        /* This should work for most situations - when default db
                         * for thread is not specified, it had no events executed,
                         * and therefore it doesn't know yet how lagged it is.
@@ -721,7 +721,7 @@ class DatabaseMysql extends DatabaseBase {
                $result = $this->query( "SELECT GET_LOCK($lockName, $timeout) AS lockstatus", $method );
                $row = $this->fetchObject( $result );
 
-               if( $row->lockstatus == 1 ) {
+               if ( $row->lockstatus == 1 ) {
                        return true;
                } else {
                        wfDebug( __METHOD__ . " failed to acquire lock\n" );
@@ -752,13 +752,13 @@ class DatabaseMysql extends DatabaseBase {
        public function lockTables( $read, $write, $method, $lowPriority = true ) {
                $items = array();
 
-               foreach( $write as $table ) {
+               foreach ( $write as $table ) {
                        $tbl = $this->tableName( $table ) .
                                        ( $lowPriority ? ' LOW_PRIORITY' : '' ) .
                                        ' WRITE';
                        $items[] = $tbl;
                }
-               foreach( $read as $table ) {
+               foreach ( $read as $table ) {
                        $items[] = $this->tableName( $table ) . ' READ';
                }
                $sql = "LOCK TABLES " . implode( ',', $items );
@@ -905,11 +905,11 @@ class DatabaseMysql extends DatabaseBase {
 
                $endArray = array();
 
-               foreach( $result as $table ) {
+               foreach ( $result as $table ) {
                        $vars = get_object_vars( $table );
                        $table = array_pop( $vars );
 
-                       if( !$prefix || strpos( $table, $prefix ) === 0 ) {
+                       if ( !$prefix || strpos( $table, $prefix ) === 0 ) {
                                $endArray[] = $table;
                        }
                }
@@ -923,7 +923,7 @@ class DatabaseMysql extends DatabaseBase {
         * @return bool|ResultWrapper
         */
        public function dropTable( $tableName, $fName = 'DatabaseMysql::dropTable' ) {
-               if( !$this->tableExists( $tableName, $fName ) ) {
+               if ( !$this->tableExists( $tableName, $fName ) ) {
                        return false;
                }
                return $this->query( "DROP TABLE IF EXISTS " . $this->tableName( $tableName ), $fName );
index a57b24b..3333f4a 100644 (file)
@@ -324,7 +324,7 @@ class DatabaseOracle extends DatabaseBase {
 
                // handle some oracle specifics
                // remove AS column/table/subquery namings
-               if( !$this->getFlag( DBO_DDLMODE ) ) {
+               if ( !$this->getFlag( DBO_DDLMODE ) ) {
                        $sql = preg_replace( '/ as /i', ' ', $sql );
                }
 
@@ -677,7 +677,7 @@ class DatabaseOracle extends DatabaseBase {
                Using uppercase because that's the only way Oracle can handle
                quoted tablenames
                */
-               switch( $name ) {
+               switch ( $name ) {
                        case 'user':
                                $name = 'MWUSER';
                                break;
@@ -756,7 +756,7 @@ class DatabaseOracle extends DatabaseBase {
 
        function unionQueries( $sqls, $all ) {
                $glue = ' UNION ALL ';
-               return 'SELECT * ' . ( $all ? '':'/* UNION_UNIQUE */ ' ) . 'FROM (' . implode( $glue, $sqls ) . ')';
+               return 'SELECT * ' . ( $all ? '' : '/* UNION_UNIQUE */ ' ) . 'FROM (' . implode( $glue, $sqls ) . ')';
        }
 
        function wasDeadlock() {
@@ -792,8 +792,9 @@ class DatabaseOracle extends DatabaseBase {
                $endArray[] = strtoupper( $prefix . 'IMAGE' );
                $fixedOrderTabs = $endArray;
                while ( ( $row = $result->fetchRow() ) !== false ) {
-                       if ( !in_array( $row['table_name'], $fixedOrderTabs ) )
+                       if ( !in_array( $row['table_name'], $fixedOrderTabs ) ) {
                                $endArray[] = $row['table_name'];
+                       }
                }
 
                return $endArray;
@@ -801,7 +802,7 @@ class DatabaseOracle extends DatabaseBase {
 
        public function dropTable( $tableName, $fName = 'DatabaseOracle::dropTable' ) {
                $tableName = $this->tableName( $tableName );
-               if( !$this->tableExists( $tableName ) ) {
+               if ( !$this->tableExists( $tableName ) ) {
                        return false;
                }
 
@@ -906,7 +907,7 @@ class DatabaseOracle extends DatabaseBase {
                if ( is_array( $table ) ) {
                        $table = array_map( array( &$this, 'tableNameInternal' ), $table );
                        $tableWhere = 'IN (';
-                       foreach( $table as &$singleTable ) {
+                       foreach ( $table as &$singleTable ) {
                                $singleTable = $this->removeIdentifierQuotes( $singleTable );
                                if ( isset( $this->mFieldInfoCache["$singleTable.$field"] ) ) {
                                        return $this->mFieldInfoCache["$singleTable.$field"];
@@ -931,7 +932,7 @@ class DatabaseOracle extends DatabaseBase {
                $res = new ORAResult( $this, $fieldInfoStmt );
                if ( $res->numRows() == 0 ) {
                        if ( is_array( $table ) ) {
-                               foreach( $table as &$singleTable ) {
+                               foreach ( $table as &$singleTable ) {
                                        $this->mFieldInfoCache["$singleTable.$field"] = false;
                                }
                        } else {
index bb35dc3..e12175f 100644 (file)
@@ -117,7 +117,7 @@ SQL;
         * @since 1.19
         */
        function defaultValue() {
-               if( $this->has_default ) {
+               if ( $this->has_default ) {
                        return $this->default;
                } else {
                        return false;
@@ -139,15 +139,15 @@ class PostgresTransactionState {
                array(
                        "desc" => "%s: Connection state changed from %s -> %s\n",
                        "states" => array(
-                               PGSQL_CONNECTION_OK       => "OK",
-                               PGSQL_CONNECTION_BAD      => "BAD"
+                               PGSQL_CONNECTION_OK => "OK",
+                               PGSQL_CONNECTION_BAD => "BAD"
                        )
                ),
                array(
                        "desc" => "%s: Transaction state changed from %s -> %s\n",
                        "states" => array(
-                               PGSQL_TRANSACTION_IDLE    => "IDLE",
-                               PGSQL_TRANSACTION_ACTIVE  => "ACTIVE",
+                               PGSQL_TRANSACTION_IDLE => "IDLE",
+                               PGSQL_TRANSACTION_ACTIVE => "ACTIVE",
                                PGSQL_TRANSACTION_INTRANS => "TRANS",
                                PGSQL_TRANSACTION_INERROR => "ERROR",
                                PGSQL_TRANSACTION_UNKNOWN => "UNKNOWN"
@@ -189,7 +189,7 @@ class PostgresTransactionState {
        }
 
        protected function describe_changed( $status, $desc_table ) {
-               if( isset( $desc_table[$status] ) ) {
+               if ( isset( $desc_table[$status] ) ) {
                        return $desc_table[$status];
                } else {
                        return "STATUS " . $status;
@@ -438,7 +438,7 @@ class DatabasePostgres extends DatabaseBase {
                        $sql = mb_convert_encoding( $sql, 'UTF-8' );
                }
                $this->mTransactionState->check();
-               if( pg_send_query( $this->mConn, $sql ) === false ) {
+               if ( pg_send_query( $this->mConn, $sql ) === false ) {
                        throw new DBUnexpectedError( $this, "Unable to post new query to PostgreSQL\n" );
                }
                $this->mLastResult = pg_get_result( $this->mConn );
@@ -464,7 +464,7 @@ class DatabasePostgres extends DatabaseBase {
                                PGSQL_DIAG_SOURCE_LINE,
                                PGSQL_DIAG_SOURCE_FUNCTION );
                foreach ( $diags as $d ) {
-                       wfDebug( sprintf("PgSQL ERROR(%d): %s\n", $d, pg_result_error_field( $this->mLastResult, $d ) ) );
+                       wfDebug( sprintf( "PgSQL ERROR(%d): %s\n", $d, pg_result_error_field( $this->mLastResult, $d ) ) );
                }
        }
 
@@ -509,7 +509,7 @@ class DatabasePostgres extends DatabaseBase {
 
                # @todo hashar: not sure if the following test really trigger if the object
                #          fetching failed.
-               if( pg_last_error( $this->mConn ) ) {
+               if ( pg_last_error( $this->mConn ) ) {
                        throw new DBUnexpectedError( $this, 'SQL error: ' . htmlspecialchars( pg_last_error( $this->mConn ) ) );
                }
                return $row;
@@ -522,7 +522,7 @@ class DatabasePostgres extends DatabaseBase {
                wfSuppressWarnings();
                $row = pg_fetch_array( $res );
                wfRestoreWarnings();
-               if( pg_last_error( $this->mConn ) ) {
+               if ( pg_last_error( $this->mConn ) ) {
                        throw new DBUnexpectedError( $this, 'SQL error: ' . htmlspecialchars( pg_last_error( $this->mConn ) ) );
                }
                return $row;
@@ -535,7 +535,7 @@ class DatabasePostgres extends DatabaseBase {
                wfSuppressWarnings();
                $n = pg_num_rows( $res );
                wfRestoreWarnings();
-               if( pg_last_error( $this->mConn ) ) {
+               if ( pg_last_error( $this->mConn ) ) {
                        throw new DBUnexpectedError( $this, 'SQL error: ' . htmlspecialchars( pg_last_error( $this->mConn ) ) );
                }
                return $n;
@@ -596,7 +596,7 @@ class DatabasePostgres extends DatabaseBase {
                        // Forced result for simulated queries
                        return $this->mAffectedRows;
                }
-               if( empty( $this->mLastResult ) ) {
+               if ( empty( $this->mLastResult ) ) {
                        return 0;
                }
                return pg_affected_rows( $this->mLastResult );
@@ -617,7 +617,7 @@ class DatabasePostgres extends DatabaseBase {
                if ( $res ) {
                        $row = $this->fetchRow( $res );
                        $count = array();
-                       if( preg_match( '/rows=(\d+)/', $row[0], $count ) ) {
+                       if ( preg_match( '/rows=(\d+)/', $row[0], $count ) ) {
                                $rows = $count[1];
                        }
                }
@@ -650,8 +650,9 @@ class DatabasePostgres extends DatabaseBase {
         * @return Array
         */
        function indexAttributes( $index, $schema = false ) {
-               if ( $schema === false )
+               if ( $schema === false ) {
                        $schema = $this->getCoreSchema();
+               }
                /*
                 * A subquery would be not needed if we didn't care about the order
                 * of attributes, but we do
@@ -854,7 +855,7 @@ __INDEXATTR__;
        {
                $destTable = $this->tableName( $destTable );
 
-               if( !is_array( $insertOptions ) ) {
+               if ( !is_array( $insertOptions ) ) {
                        $insertOptions = array( $insertOptions );
                }
 
@@ -870,11 +871,11 @@ __INDEXATTR__;
                        $savepoint->savepoint();
                }
 
-               if( !is_array( $selectOptions ) ) {
+               if ( !is_array( $selectOptions ) ) {
                        $selectOptions = array( $selectOptions );
                }
                list( $startOpts, $useIndex, $tailOpts ) = $this->makeSelectOptions( $selectOptions );
-               if( is_array( $srcTable ) ) {
+               if ( is_array( $srcTable ) ) {
                        $srcTable = implode( ',', array_map( array( &$this, 'tableName' ), $srcTable ) );
                } else {
                        $srcTable = $this->tableName( $srcTable );
@@ -891,9 +892,9 @@ __INDEXATTR__;
                $sql .= " $tailOpts";
 
                $res = (bool)$this->query( $sql, $fname, $savepoint );
-               if( $savepoint ) {
+               if ( $savepoint ) {
                        $bar = pg_last_error();
-                       if( $bar != false ) {
+                       if ( $bar != false ) {
                                $savepoint->rollback();
                        } else {
                                $savepoint->release();
@@ -914,7 +915,7 @@ __INDEXATTR__;
 
        function tableName( $name, $format = 'quoted' ) {
                # Replace reserved words with better ones
-               switch( $name ) {
+               switch ( $name ) {
                        case 'user':
                                return $this->realTableName( 'mwuser', $format );
                        case 'text':
@@ -989,10 +990,10 @@ __INDEXATTR__;
                $result = $this->query( "SELECT tablename FROM pg_tables WHERE schemaname = $eschema", $fname );
                $endArray = array();
 
-               foreach( $result as $table ) {
+               foreach ( $result as $table ) {
                        $vars = get_object_vars( $table );
                        $table = array_pop( $vars );
-                       if( !$prefix || strpos( $table, $prefix ) === 0 ) {
+                       if ( !$prefix || strpos( $table, $prefix ) === 0 ) {
                                $endArray[] = $table;
                        }
                }
@@ -1023,11 +1024,11 @@ __INDEXATTR__;
         * @return string
         */
        function pg_array_parse( $text, &$output, $limit = false, $offset = 1 ) {
-               if( false === $limit ) {
+               if ( false === $limit ) {
                        $limit = strlen( $text ) - 1;
                        $output = array();
                }
-               if( '{}' == $text ) {
+               if ( '{}' == $text ) {
                        return $output;
                }
                do {
index e2434a0..f702047 100644 (file)
@@ -78,7 +78,7 @@ class LoadBalancer {
                        }
                }
 
-               foreach( $params['servers'] as $i => $server ) {
+               foreach ( $params['servers'] as $i => $server ) {
                        $this->mLoads[$i] = $server['load'];
                        if ( isset( $server['groupLoads'] ) ) {
                                foreach ( $server['groupLoads'] as $group => $ratio ) {
@@ -665,7 +665,7 @@ class LoadBalancer {
         * @return bool
         */
        function isOpen( $index ) {
-               if( !is_integer( $index ) ) {
+               if ( !is_integer( $index ) ) {
                        return false;
                }
                return (bool)$this->getAnyOpenConnection( $index );
@@ -682,7 +682,7 @@ class LoadBalancer {
         * @return DatabaseBase
         */
        function reallyOpenConnection( $server, $dbNameOverride = false ) {
-               if( !is_array( $server ) ) {
+               if ( !is_array( $server ) ) {
                        throw new MWException( 'You must update your load-balancing configuration. ' .
                                'See DefaultSettings.php entry for $wgDBservers.' );
                }
@@ -833,7 +833,7 @@ class LoadBalancer {
         */
        function closeAll() {
                foreach ( $this->mConns as $conns2 ) {
-                       foreach  ( $conns2 as $conns3 ) {
+                       foreach ( $conns2 as $conns3 ) {
                                foreach ( $conns3 as $conn ) {
                                        $conn->close();
                                }
index ad7b3b2..4b9ecce 100644 (file)
@@ -135,8 +135,9 @@ class LoadMonitor_MySQL implements LoadMonitor {
                $requestRate = 10;
 
                global $wgMemc;
-               if ( empty( $wgMemc ) )
+               if ( empty( $wgMemc ) ) {
                        $wgMemc = wfGetMainCache();
+               }
 
                $masterName = $this->parent->getServerName( 0 );
                $memcKey = wfMemcKey( 'lag_times', $masterName );
index 582b3ac..d75a126 100644 (file)
@@ -484,10 +484,10 @@ class MWDebug {
                // output errors as debug info, when display_errors is on
                // this is necessary for all non html output of the api, because that clears all errors first
                $obContents = ob_get_contents();
-               if( $obContents ) {
+               if ( $obContents ) {
                        $obContentArray = explode( '<br />', $obContents );
-                       foreach( $obContentArray as $obContent ) {
-                               if( trim( $obContent ) ) {
+                       foreach ( $obContentArray as $obContent ) {
+                               if ( trim( $obContent ) ) {
                                        self::debugMsg( Sanitizer::stripAllTags( $obContent ) );
                                }
                        }
@@ -498,7 +498,7 @@ class MWDebug {
 
                $result->setIndexedTagName( $debugInfo, 'debuginfo' );
                $result->setIndexedTagName( $debugInfo['log'], 'line' );
-               foreach( $debugInfo['debugLog'] as $index => $debugLogText ) {
+               foreach ( $debugInfo['debugLog'] as $index => $debugLogText ) {
                        $vals = array();
                        ApiResult::setContent( $vals, $debugLogText );
                        $debugInfo['debugLog'][$index] = $vals; //replace
index f9cb656..4435fc6 100644 (file)
@@ -271,7 +271,8 @@ class _DiffEngine {
                                $this->xchanged[$skip] = $this->ychanged[$skip] = false;
                        }
                        // Skip trailing common lines.
-                       $xi = $n_from; $yi = $n_to;
+                       $xi = $n_from;
+                       $yi = $n_to;
                        for ( $endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++ ) {
                                if ( $from_lines[$xi] !== $to_lines[$yi] ) {
                                        break;
@@ -394,7 +395,7 @@ class _DiffEngine {
                                                break;
                                        }
                                }
-                               while ( list ( , $y ) = each( $matches ) ) {
+                               while ( list( , $y ) = each( $matches ) ) {
                                        if ( $y > $this->seq[$k -1] ) {
                                                assert( '$y < $this->seq[$k]' );
                                                // Optimization: this is a common case:
@@ -471,8 +472,7 @@ class _DiffEngine {
         */
        function _compareseq( $xoff, $xlim, $yoff, $ylim ) {
                // Slide down the bottom initial diagonal.
-               while ( $xoff < $xlim && $yoff < $ylim
-               && $this->xv[$xoff] == $this->yv[$yoff] ) {
+               while ( $xoff < $xlim && $yoff < $ylim && $this->xv[$xoff] == $this->yv[$yoff] ) {
                        ++$xoff;
                        ++$yoff;
                }
@@ -491,7 +491,7 @@ class _DiffEngine {
                        // $nchunks = sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5);
                        // $nchunks = max(2,min(8,(int)$nchunks));
                        $nchunks = min( 7, $xlim - $xoff, $ylim - $yoff ) + 1;
-                       list ( $lcs, $seps ) = $this->_diag( $xoff, $xlim, $yoff, $ylim, $nchunks );
+                       list( $lcs, $seps ) = $this->_diag( $xoff, $xlim, $yoff, $ylim, $nchunks );
                }
 
                if ( $lcs == 0 ) {
@@ -554,9 +554,11 @@ class _DiffEngine {
 
                        while ( $i < $len && ! $changed[$i] ) {
                                assert( '$j < $other_len && ! $other_changed[$j]' );
-                               $i++; $j++;
-                               while ( $j < $other_len && $other_changed[$j] )
+                               $i++;
                                $j++;
+                               while ( $j < $other_len && $other_changed[$j] ) {
+                                       $j++;
+                               }
                        }
 
                        if ( $i == $len ) {
@@ -1109,7 +1111,7 @@ class ArrayDiffFormatter extends DiffFormatter {
                $newline = 1;
                $retval = array();
                foreach ( $diff->edits as $edit ) {
-                       switch( $edit->type ) {
+                       switch ( $edit->type ) {
                                case 'add':
                                        foreach ( $edit->closing as $l ) {
                                                $retval[] = array(
index 46a863f..9919236 100644 (file)
@@ -152,7 +152,7 @@ class ExternalStoreDB extends ExternalStoreMedium {
                static $externalBlobCache = array();
 
                $cacheID = ( $itemID === false ) ? "$cluster/$id" : "$cluster/$id/";
-               if( isset( $externalBlobCache[$cacheID] ) ) {
+               if ( isset( $externalBlobCache[$cacheID] ) ) {
                        wfDebugLog( 'ExternalStoreDB-cache', "ExternalStoreDB::fetchBlob cache hit on $cacheID\n" );
                        return $externalBlobCache[$cacheID];
                }
@@ -166,11 +166,11 @@ class ExternalStoreDB extends ExternalStoreMedium {
                        // Try the master
                        $dbw =& $this->getMaster( $cluster );
                        $ret = $dbw->selectField( $this->getTable( $dbw ), 'blob_text', array( 'blob_id' => $id ), __METHOD__ );
-                       if( $ret === false) {
+                       if ( $ret === false) {
                                wfDebugLog( 'ExternalStoreDB', "ExternalStoreDB::fetchBlob master failed to find $cacheID\n" );
                        }
                }
-               if( $itemID !== false && $ret !== false ) {
+               if ( $itemID !== false && $ret !== false ) {
                        // Unserialise object; caller extracts item
                        $ret = unserialize( $ret );
                }
index 92fee83..d4e32cf 100644 (file)
@@ -577,7 +577,7 @@ class FSFileBackend extends FileBackendStore {
                if ( $stat ) {
                        return array(
                                'mtime' => wfTimestamp( TS_MW, $stat['mtime'] ),
-                               'size'  => $stat['size']
+                               'size' => $stat['size']
                        );
                } elseif ( !$hadError ) {
                        return false; // file does not exist
@@ -862,7 +862,7 @@ abstract class FSFileBackendList implements Iterator {
         */
        public function __construct( $dir, array $params ) {
                $path = realpath( $dir ); // normalize
-               if( $path === false ) {
+               if ( $path === false ) {
                        $path = $dir;
                }
                $this->suffixStart = strlen( $path ) + 1; // size of "path/to/dir/"
@@ -963,7 +963,7 @@ abstract class FSFileBackendList implements Iterator {
         */
        protected function getRelPath( $dir ) {
                $path = realpath( $dir );
-               if( $path === false ) {
+               if ( $path === false ) {
                        $path = $dir;
                }
                return strtr( substr( $path, $this->suffixStart ), '\\', '/' );
index d505d6f..57fd4d7 100644 (file)
@@ -803,7 +803,9 @@ abstract class FileBackend {
        final protected function getScopedPHPBehaviorForOps() {
                if ( php_sapi_name() != 'cli' ) { // http://bugs.php.net/bug.php?id=47540
                        $old = ignore_user_abort( true ); // avoid half-finished operations
-                       return new ScopedCallback( function() use ( $old ) { ignore_user_abort( $old ); } );
+                       return new ScopedCallback( function() use ( $old ) {
+                               ignore_user_abort( $old );
+                       } );
                }
                return null;
        }
index d790a99..672e437 100644 (file)
@@ -95,17 +95,17 @@ class FileBackendGroup {
                                : 0644;
                        // Get the FS backend configuration
                        $autoBackends[] = array(
-                               'name'           => $backendName,
-                               'class'          => 'FSFileBackend',
-                               'lockManager'    => 'fsLockManager',
+                               'name' => $backendName,
+                               'class' => 'FSFileBackend',
+                               'lockManager' => 'fsLockManager',
                                'containerPaths' => array(
-                                       "{$repoName}-public"  => "{$directory}",
-                                       "{$repoName}-thumb"   => $thumbDir,
-                                       "{$repoName}-transcoded"   => $transcodedDir,
+                                       "{$repoName}-public" => "{$directory}",
+                                       "{$repoName}-thumb" => $thumbDir,
+                                       "{$repoName}-transcoded" => $transcodedDir,
                                        "{$repoName}-deleted" => $deletedDir,
-                                       "{$repoName}-temp"    => "{$directory}/temp"
+                                       "{$repoName}-temp" => "{$directory}/temp"
                                ),
-                               'fileMode'       => $fileMode,
+                               'fileMode' => $fileMode,
                        );
                }
 
@@ -135,8 +135,8 @@ class FileBackendGroup {
 
                        unset( $config['class'] ); // backend won't need this
                        $this->backends[$name] = array(
-                               'class'    => $class,
-                               'config'   => $config,
+                               'class' => $class,
+                               'config' => $config,
                                'instance' => null
                        );
                }
index 6d142b9..ea379bc 100644 (file)
@@ -1058,13 +1058,13 @@ abstract class FileBackendStore extends FileBackend {
         */
        final public function getOperationsInternal( array $ops ) {
                $supportedOps = array(
-                       'store'    => 'StoreFileOp',
-                       'copy'     => 'CopyFileOp',
-                       'move'     => 'MoveFileOp',
-                       'delete'   => 'DeleteFileOp',
-                       'create'   => 'CreateFileOp',
+                       'store' => 'StoreFileOp',
+                       'copy' => 'CopyFileOp',
+                       'move' => 'MoveFileOp',
+                       'delete' => 'DeleteFileOp',
+                       'create' => 'CreateFileOp',
                        'describe' => 'DescribeFileOp',
-                       'null'     => 'NullFileOp'
+                       'null' => 'NullFileOp'
                );
 
                $performOps = array(); // array of FileOp objects
index 62e9fba..80afcf2 100644 (file)
@@ -212,22 +212,22 @@ abstract class FileOp {
                $pathsUsed = array_merge( $this->storagePathsRead(), $this->storagePathsChanged() );
                foreach ( array_unique( $pathsUsed ) as $path ) {
                        $nullEntries[] = array( // assertion for recovery
-                               'op'      => 'null',
-                               'path'    => $path,
+                               'op' => 'null',
+                               'path' => $path,
                                'newSha1' => $this->fileSha1( $path, $oPredicates )
                        );
                }
                foreach ( $this->storagePathsChanged() as $path ) {
                        if ( $nPredicates['sha1'][$path] === false ) { // deleted
                                $deleteEntries[] = array(
-                                       'op'      => 'delete',
-                                       'path'    => $path,
+                                       'op' => 'delete',
+                                       'path' => $path,
                                        'newSha1' => ''
                                );
                        } else { // created/updated
                                $updateEntries[] = array(
-                                       'op'      => $this->fileExists( $path, $oPredicates ) ? 'update' : 'create',
-                                       'path'    => $path,
+                                       'op' => $this->fileExists( $path, $oPredicates ) ? 'update' : 'create',
+                                       'path' => $path,
                                        'newSha1' => $nPredicates['sha1'][$path]
                                );
                        }
index 00c0ff8..f0b289e 100644 (file)
@@ -807,8 +807,8 @@ class SwiftFileBackend extends FileBackendStore {
                        $stat = array(
                                // Convert dates like "Tue, 03 Jan 2012 22:01:04 GMT" to TS_MW
                                'mtime' => wfTimestamp( TS_MW, $srcObj->last_modified ),
-                               'size'  => (int)$srcObj->content_length,
-                               'sha1'  => $srcObj->getMetadataValue( 'Sha1base36' )
+                               'size' => (int)$srcObj->content_length,
+                               'sha1' => $srcObj->getMetadataValue( 'Sha1base36' )
                        );
                } catch ( NoSuchContainerException $e ) {
                } catch ( NoSuchObjectException $e ) {
@@ -1239,8 +1239,8 @@ class SwiftFileBackend extends FileBackendStore {
                                                str_replace( '/swift/v1', '', // S3 API is the rgw default
                                                        $sContObj->cfs_http->getStorageUrl() . $spath ),
                                                array(
-                                                       'Signature'      => $signature,
-                                                       'Expires'        => $expires,
+                                                       'Signature' => $signature,
+                                                       'Expires' => $expires,
                                                        'AWSAccessKeyId' => $this->rgwS3AccessKey )
                                        );
                                }
index 73f29a9..9250aa5 100644 (file)
@@ -65,11 +65,11 @@ class DBFileJournal extends FileJournal {
                foreach ( $entries as $entry ) {
                        $data[] = array(
                                'fj_batch_uuid' => $batchId,
-                               'fj_backend'    => $this->backend,
-                               'fj_op'         => $entry['op'],
-                               'fj_path'       => $entry['path'],
-                               'fj_new_sha1'   => $entry['newSha1'],
-                               'fj_timestamp'  => $dbw->timestamp( $now )
+                               'fj_backend' => $this->backend,
+                               'fj_op' => $entry['op'],
+                               'fj_path' => $entry['path'],
+                               'fj_new_sha1' => $entry['newSha1'],
+                               'fj_timestamp' => $dbw->timestamp( $now )
                        );
                }
 
index f02387d..e081987 100644 (file)
@@ -369,7 +369,9 @@ class PostgreSqlLockManager extends DBLockManager {
 
                $db = $this->getConnection( $lockSrv ); // checked in isServerUp()
                $bigints = array_unique( array_map(
-                       function( $key ) { return wfBaseConvert( substr( $key, 0, 15 ), 16, 10 ); },
+                       function( $key ) {
+                               return wfBaseConvert( substr( $key, 0, 15 ), 16, 10 );
+                       },
                        array_map( array( $this, 'sha1Base16Absolute' ), $paths )
                ) );
 
index ac0bd49..9aff241 100644 (file)
@@ -97,8 +97,8 @@ class LockManagerGroup {
                        $class = $config['class'];
                        unset( $config['class'] ); // lock manager won't need this
                        $this->managers[$name] = array(
-                               'class'    => $class,
-                               'config'   => $config,
+                               'class' => $class,
+                               'config' => $config,
                                'instance' => null
                        );
                }
index e49f37d..42c9c94 100644 (file)
@@ -56,16 +56,16 @@ class FSRepo extends FileRepo {
                        $repoName = $info['name'];
                        // Get the FS backend configuration
                        $backend = new FSFileBackend( array(
-                               'name'           => $info['name'] . '-backend',
-                               'lockManager'    => 'fsLockManager',
+                               'name' => $info['name'] . '-backend',
+                               'lockManager' => 'fsLockManager',
                                'containerPaths' => array(
-                                       "{$repoName}-public"  => "{$directory}",
-                                       "{$repoName}-temp"    => "{$directory}/temp",
-                                       "{$repoName}-thumb"   => $thumbDir,
-                                       "{$repoName}-transcoded"   => $transcodedDir,
+                                       "{$repoName}-public" => "{$directory}",
+                                       "{$repoName}-temp" => "{$directory}/temp",
+                                       "{$repoName}-thumb" => $thumbDir,
+                                       "{$repoName}-transcoded" => $transcodedDir,
                                        "{$repoName}-deleted" => $deletedDir
                                ),
-                               'fileMode'       => $fileMode,
+                               'fileMode' => $fileMode,
                        ) );
                        // Update repo config to use this backend
                        $info['backend'] = $backend;
index 0e30017..cfc3af7 100644 (file)
@@ -67,7 +67,7 @@ class FileRepo {
         */
        public function __construct( array $info = null ) {
                // Verify required settings presence
-               if(
+               if (
                        $info === null
                        || !array_key_exists( 'name', $info )
                        || !array_key_exists( 'backend', $info )
@@ -794,10 +794,10 @@ class FileRepo {
                                }
                        }
                        $operations[] = array(
-                               'op'            => $opName,
-                               'src'           => $srcPath,
-                               'dst'           => $dstPath,
-                               'overwrite'     => $flags & self::OVERWRITE,
+                               'op' => $opName,
+                               'src' => $srcPath,
+                               'dst' => $dstPath,
+                               'overwrite' => $flags & self::OVERWRITE,
                                'overwriteSame' => $flags & self::OVERWRITE_SAME,
                        );
                }
@@ -917,9 +917,9 @@ class FileRepo {
                        $src = $this->resolveToStoragePath( $src );
                        $dst = $this->resolveToStoragePath( $dst );
                        $operations[] = array(
-                               'op'          => FileBackend::isStoragePath( $src ) ? 'copy' : 'store',
-                               'src'         => $src,
-                               'dst'         => $dst,
+                               'op' => FileBackend::isStoragePath( $src ) ? 'copy' : 'store',
+                               'src' => $src,
+                               'dst' => $dst,
                                'disposition' => isset( $triple[2] ) ? $triple[2] : null
                        );
                        $status->merge( $this->initDirectory( dirname( $dst ) ) );
@@ -942,8 +942,8 @@ class FileRepo {
                $operations = array();
                foreach ( $paths as $path ) {
                        $operations[] = array(
-                               'op'                  => 'delete',
-                               'src'                 => $this->resolveToStoragePath( $path ),
+                               'op' => 'delete',
+                               'src' => $this->resolveToStoragePath( $path ),
                                'ignoreMissingSource' => true
                        );
                }
@@ -1132,9 +1132,9 @@ class FileRepo {
                        // race conditions unless an functioning LockManager is used.
                        // LocalFile also uses SELECT FOR UPDATE for synchronization.
                        $operations[] = array(
-                               'op'                  => 'copy',
-                               'src'                 => $dstPath,
-                               'dst'                 => $archivePath,
+                               'op' => 'copy',
+                               'src' => $dstPath,
+                               'dst' => $archivePath,
                                'ignoreMissingSource' => true
                        );
 
@@ -1142,28 +1142,28 @@ class FileRepo {
                        if ( FileBackend::isStoragePath( $srcPath ) ) {
                                if ( $flags & self::DELETE_SOURCE ) {
                                        $operations[] = array(
-                                               'op'        => 'move',
-                                               'src'       => $srcPath,
-                                               'dst'       => $dstPath,
+                                               'op' => 'move',
+                                               'src' => $srcPath,
+                                               'dst' => $dstPath,
                                                'overwrite' => true, // replace current
-                                               'headers'   => $headers
+                                               'headers' => $headers
                                        );
                                } else {
                                        $operations[] = array(
-                                               'op'        => 'copy',
-                                               'src'       => $srcPath,
-                                               'dst'       => $dstPath,
+                                               'op' => 'copy',
+                                               'src' => $srcPath,
+                                               'dst' => $dstPath,
                                                'overwrite' => true, // replace current
-                                               'headers'   => $headers
+                                               'headers' => $headers
                                        );
                                }
                        } else { // FS source path
                                $operations[] = array(
-                                       'op'        => 'store',
-                                       'src'       => $srcPath,
-                                       'dst'       => $dstPath,
+                                       'op' => 'store',
+                                       'src' => $srcPath,
+                                       'dst' => $dstPath,
                                        'overwrite' => true, // replace current
-                                       'headers'   => $headers
+                                       'headers' => $headers
                                );
                                if ( $flags & self::DELETE_SOURCE ) {
                                        $sourceFSFilesToDelete[] = $srcPath;
@@ -1324,9 +1324,9 @@ class FileRepo {
                        }
 
                        $operations[] = array(
-                               'op'            => 'move',
-                               'src'           => $srcPath,
-                               'dst'           => $archivePath,
+                               'op' => 'move',
+                               'src' => $srcPath,
+                               'dst' => $archivePath,
                                // We may have 2+ identical files being deleted,
                                // all of which will map to the same destination file
                                'overwriteSame' => true // also see bug 31792
@@ -1671,29 +1671,29 @@ class FileRepo {
         */
        public function getTempRepo() {
                return new TempFileRepo( array(
-                       'name'      => "{$this->name}-temp",
-                       'backend'   => $this->backend,
-                       'zones'     => array(
+                       'name' => "{$this->name}-temp",
+                       'backend' => $this->backend,
+                       'zones' => array(
                                'public' => array(
                                        'container' => $this->zones['temp']['container'],
                                        'directory' => $this->zones['temp']['directory']
                                ),
-                               'thumb'  => array(
+                               'thumb' => array(
                                        'container' => $this->zones['thumb']['container'],
                                        'directory' => ( $this->zones['thumb']['directory'] == '' )
                                                ? 'temp'
                                                : $this->zones['thumb']['directory'] . '/temp'
                                ),
-                               'transcoded'  => array(
+                               'transcoded' => array(
                                        'container' => $this->zones['transcoded']['container'],
                                        'directory' => ( $this->zones['transcoded']['directory'] == '' )
                                                ? 'temp'
                                                : $this->zones['transcoded']['directory'] . '/temp'
                                )
                        ),
-                       'url'        => $this->getZoneUrl( 'temp' ),
-                       'thumbUrl'   => $this->getZoneUrl( 'thumb' ) . '/temp',
-                       'transcodedUrl'   => $this->getZoneUrl( 'transcoded' ) . '/temp',
+                       'url' => $this->getZoneUrl( 'temp' ),
+                       'thumbUrl' => $this->getZoneUrl( 'thumb' ) . '/temp',
+                       'transcodedUrl' => $this->getZoneUrl( 'transcoded' ) . '/temp',
                        'hashLevels' => $this->hashLevels // performance
                ) );
        }
index ba574da..5cd6fc2 100644 (file)
@@ -61,21 +61,21 @@ class ForeignAPIRepo extends FileRepo {
                // http://commons.wikimedia.org/w/api.php
                $this->mApiBase = isset( $info['apibase'] ) ? $info['apibase'] : null;
 
-               if( isset( $info['apiThumbCacheExpiry'] ) ) {
+               if ( isset( $info['apiThumbCacheExpiry'] ) ) {
                        $this->apiThumbCacheExpiry = $info['apiThumbCacheExpiry'];
                }
-               if( isset( $info['fileCacheExpiry'] ) ) {
+               if ( isset( $info['fileCacheExpiry'] ) ) {
                        $this->fileCacheExpiry = $info['fileCacheExpiry'];
                }
-               if( !$this->scriptDirUrl ) {
+               if ( !$this->scriptDirUrl ) {
                        // hack for description fetches
                        $this->scriptDirUrl = dirname( $this->mApiBase );
                }
                // If we can cache thumbs we can guess sane defaults for these
-               if( $this->canCacheThumbs() && !$this->url ) {
+               if ( $this->canCacheThumbs() && !$this->url ) {
                        $this->url = $wgLocalFileRepo['url'];
                }
-               if( $this->canCacheThumbs() && !$this->thumbUrl ) {
+               if ( $this->canCacheThumbs() && !$this->thumbUrl ) {
                        $this->thumbUrl = $this->url . '/thumb';
                }
        }
@@ -105,7 +105,7 @@ class ForeignAPIRepo extends FileRepo {
                        if ( isset( $this->mFileExists[$k] ) ) {
                                $results[$k] = true;
                                unset( $files[$k] );
-                       } elseif( self::isVirtualUrl( $f ) ) {
+                       } elseif ( self::isVirtualUrl( $f ) ) {
                                # @todo FIXME: We need to be able to handle virtual
                                # URLs better, at least when we know they refer to the
                                # same repo.
@@ -120,9 +120,9 @@ class ForeignAPIRepo extends FileRepo {
 
                $data = $this->fetchImageQuery( array( 'titles' => implode( $files, '|' ),
                                                                                        'prop' => 'imageinfo' ) );
-               if( isset( $data['query']['pages'] ) ) {
+               if ( isset( $data['query']['pages'] ) ) {
                        $i = 0;
-                       foreach( $files as $key => $file ) {
+                       foreach ( $files as $key => $file ) {
                                $results[$key] = $this->mFileExists[$key] = !isset( $data['query']['pages'][$i]['missing'] );
                                $i++;
                        }
@@ -147,8 +147,8 @@ class ForeignAPIRepo extends FileRepo {
 
                $query = array_merge( $query,
                        array(
-                               'format'    => 'json',
-                               'action'    => 'query',
+                               'format' => 'json',
+                               'action' => 'query',
                                'redirects' => 'true'
                        ) );
                if ( $this->mApiBase ) {
@@ -157,10 +157,10 @@ class ForeignAPIRepo extends FileRepo {
                        $url = $this->makeUrl( $query, 'api' );
                }
 
-               if( !isset( $this->mQueryCache[$url] ) ) {
+               if ( !isset( $this->mQueryCache[$url] ) ) {
                        $key = $this->getLocalCacheKey( 'ForeignAPIRepo', 'Metadata', md5( $url ) );
                        $data = $wgMemc->get( $key );
-                       if( !$data ) {
+                       if ( !$data ) {
                                $data = self::httpGet( $url );
                                if ( !$data ) {
                                        return null;
@@ -168,7 +168,7 @@ class ForeignAPIRepo extends FileRepo {
                                $wgMemc->set( $key, $data, 3600 );
                        }
 
-                       if( count( $this->mQueryCache ) > 100 ) {
+                       if ( count( $this->mQueryCache ) > 100 ) {
                                // Keep the cache from growing infinitely
                                $this->mQueryCache = array();
                        }
@@ -182,9 +182,9 @@ class ForeignAPIRepo extends FileRepo {
         * @return bool|array
         */
        function getImageInfo( $data ) {
-               if( $data && isset( $data['query']['pages'] ) ) {
-                       foreach( $data['query']['pages'] as $info ) {
-                               if( isset( $info['imageinfo'][0] ) ) {
+               if ( $data && isset( $data['query']['pages'] ) ) {
+                       foreach ( $data['query']['pages'] as $info ) {
+                               if ( isset( $info['imageinfo'][0] ) ) {
                                        return $info['imageinfo'][0];
                                }
                        }
@@ -198,14 +198,15 @@ class ForeignAPIRepo extends FileRepo {
         */
        function findBySha1( $hash ) {
                $results = $this->fetchImageQuery( array(
-                                                                               'aisha1base36' => $hash,
-                                                                               'aiprop'       => ForeignAPIFile::getProps(),
-                                                                               'list'         => 'allimages', ) );
+                       'aisha1base36' => $hash,
+                       'aiprop' => ForeignAPIFile::getProps(),
+                       'list' => 'allimages',
+               ) );
                $ret = array();
                if ( isset( $results['query']['allimages'] ) ) {
                        foreach ( $results['query']['allimages'] as $img ) {
                                // 1.14 was broken, doesn't return name attribute
-                               if( !isset( $img['name'] ) ) {
+                               if ( !isset( $img['name'] ) ) {
                                        continue;
                                }
                                $ret[] = new ForeignAPIFile( Title::makeTitle( NS_FILE, $img['name'] ), $this, $img );
@@ -228,11 +229,11 @@ class ForeignAPIRepo extends FileRepo {
                        'iiprop' => 'url|timestamp',
                        'iiurlwidth' => $width,
                        'iiurlheight' => $height,
-                       'iiurlparam'  => $otherParams,
+                       'iiurlparam' => $otherParams,
                        'prop' => 'imageinfo' ) );
                $info = $this->getImageInfo( $data );
 
-               if( $data && $info && isset( $info['thumburl'] ) ) {
+               if ( $data && $info && isset( $info['thumburl'] ) ) {
                        wfDebug( __METHOD__ . " got remote thumb " . $info['thumburl'] . "\n" );
                        $result = $info;
                        return $info['thumburl'];
@@ -268,11 +269,11 @@ class ForeignAPIRepo extends FileRepo {
 
                /* Get the array of urls that we already know */
                $knownThumbUrls = $wgMemc->get( $key );
-               if( !$knownThumbUrls ) {
+               if ( !$knownThumbUrls ) {
                        /* No knownThumbUrls for this file */
                        $knownThumbUrls = array();
                } else {
-                       if( isset( $knownThumbUrls[$sizekey] ) ) {
+                       if ( isset( $knownThumbUrls[$sizekey] ) ) {
                                wfDebug( __METHOD__ . ': Got thumburl from local cache: ' .
                                        "{$knownThumbUrls[$sizekey]} \n" );
                                return $knownThumbUrls[$sizekey];
@@ -283,14 +284,14 @@ class ForeignAPIRepo extends FileRepo {
                $metadata = null;
                $foreignUrl = $this->getThumbUrl( $name, $width, $height, $metadata, $params );
 
-               if( !$foreignUrl ) {
+               if ( !$foreignUrl ) {
                        wfDebug( __METHOD__ . " Could not find thumburl\n" );
                        return false;
                }
 
                // We need the same filename as the remote one :)
                $fileName = rawurldecode( pathinfo( $foreignUrl, PATHINFO_BASENAME ) );
-               if( !$this->validateFilename( $fileName ) ) {
+               if ( !$this->validateFilename( $fileName ) ) {
                        wfDebug( __METHOD__ . " The deduced filename $fileName is not safe\n" );
                        return false;
                }
@@ -298,15 +299,14 @@ class ForeignAPIRepo extends FileRepo {
                $localFilename = $localPath . "/" . $fileName;
                $localUrl = $this->getZoneUrl( 'thumb' ) . "/" . $this->getHashPath( $name ) . rawurlencode( $name ) . "/" . rawurlencode( $fileName );
 
-               if( $backend->fileExists( array( 'src' => $localFilename ) )
-                       && isset( $metadata['timestamp'] ) )
-               {
+               if ( $backend->fileExists( array( 'src' => $localFilename ) )
+                       && isset( $metadata['timestamp'] ) ) {
                        wfDebug( __METHOD__ . " Thumbnail was already downloaded before\n" );
                        $modified = $backend->getFileTimestamp( array( 'src' => $localFilename ) );
                        $remoteModified = strtotime( $metadata['timestamp'] );
                        $current = time();
                        $diff = abs( $modified - $current );
-                       if( $remoteModified < $modified && $diff < $this->fileCacheExpiry ) {
+                       if ( $remoteModified < $modified && $diff < $this->fileCacheExpiry ) {
                                /* Use our current and already downloaded thumbnail */
                                $knownThumbUrls[$sizekey] = $localUrl;
                                $wgMemc->set( $key, $knownThumbUrls, $this->apiThumbCacheExpiry );
@@ -315,7 +315,7 @@ class ForeignAPIRepo extends FileRepo {
                        /* There is a new Commons file, or existing thumbnail older than a month */
                }
                $thumb = self::httpGet( $foreignUrl );
-               if( !$thumb ) {
+               if ( !$thumb ) {
                        wfDebug( __METHOD__ . " Could not download thumb\n" );
                        return false;
                }
@@ -323,7 +323,7 @@ class ForeignAPIRepo extends FileRepo {
                # @todo FIXME: Delete old thumbs that aren't being used. Maintenance script?
                $backend->prepare( array( 'dir' => dirname( $localFilename ) ) );
                $params = array( 'dst' => $localFilename, 'content' => $thumb );
-               if( !$backend->quickCreate( $params )->isOK() ) {
+               if ( !$backend->quickCreate( $params )->isOK() ) {
                        wfDebug( __METHOD__ . " could not write to thumb path '$localFilename'\n" );
                        return $foreignUrl;
                }
index 1865985..ecad618 100644 (file)
@@ -59,7 +59,7 @@ class ForeignDBRepo extends LocalRepo {
                        $this->dbConn = DatabaseBase::factory( $this->dbType,
                                array(
                                        'host' => $this->dbServer,
-                                       'user'   => $this->dbUser,
+                                       'user' => $this->dbUser,
                                        'password' => $this->dbPassword,
                                        'dbname' => $this->dbName,
                                        'flags' => $this->dbFlags,
index d017e13..549be40 100644 (file)
@@ -176,7 +176,7 @@ class LocalRepo extends FileRepo {
                } // else $cachedValue is false or null: cache miss
 
                $id = $this->getArticleID( $title );
-               if( !$id ) {
+               if ( !$id ) {
                        $wgMemc->set( $memcKey, " ", $expiry );
                        return false;
                }
@@ -188,7 +188,7 @@ class LocalRepo extends FileRepo {
                        __METHOD__
                );
 
-               if( $row && $row->rd_namespace == NS_FILE ) {
+               if ( $row && $row->rd_namespace == NS_FILE ) {
                        $targetTitle = Title::makeTitle( $row->rd_namespace, $row->rd_title );
                        $wgMemc->set( $memcKey, $targetTitle->getDBkey(), $expiry );
                        return $targetTitle;
@@ -206,7 +206,7 @@ class LocalRepo extends FileRepo {
         * @return bool|int|mixed
         */
        protected function getArticleID( $title ) {
-               if( !$title instanceof Title ) {
+               if ( !$title instanceof Title ) {
                        return 0;
                }
                $dbr = $this->getSlaveDB();
@@ -258,7 +258,7 @@ class LocalRepo extends FileRepo {
         * @return array An Array of arrays or iterators of file objects and the hash as key
         */
        function findBySha1s( array $hashes ) {
-               if( !count( $hashes ) ) {
+               if ( !count( $hashes ) ) {
                        return array(); //empty parameter
                }
 
index 02dfdad..b2b9477 100644 (file)
@@ -209,7 +209,7 @@ class RepoGroup {
                }
 
                $redir = $this->localRepo->checkRedirect( $title );
-               if( $redir ) {
+               if ( $redir ) {
                        return $redir;
                }
                foreach ( $this->foreignRepos as $repo ) {
@@ -238,7 +238,9 @@ class RepoGroup {
                if ( !$file ) {
                        foreach ( $this->foreignRepos as $repo ) {
                                $file = $repo->findFileFromKey( $hash, $options );
-                               if ( $file ) break;
+                               if ( $file ) {
+                                       break;
+                               }
                        }
                }
                return $file;
@@ -279,7 +281,7 @@ class RepoGroup {
                        $result = array_merge_recursive( $result, $repo->findBySha1s( $hashes ) );
                }
                //sort the merged (and presorted) sublist of each hash
-               foreach( $result as $hash => $files ) {
+               foreach ( $result as $hash => $files ) {
                        usort( $result[$hash], 'File::compare' );
                }
                return $result;
@@ -339,9 +341,9 @@ class RepoGroup {
         * @return bool
         */
        function forEachForeignRepo( $callback, $params = array() ) {
-               foreach( $this->foreignRepos as $repo ) {
+               foreach ( $this->foreignRepos as $repo ) {
                        $args = array_merge( array( $repo ), $params );
-                       if( call_user_func_array( $callback, $args ) ) {
+                       if ( call_user_func_array( $callback, $args ) ) {
                                return true;
                        }
                }
index 3f78619..b753e18 100644 (file)
@@ -90,7 +90,7 @@ class ArchivedFile {
                $this->exists = false;
                $this->sha1 = '';
 
-               if( $title instanceof Title ) {
+               if ( $title instanceof Title ) {
                        $this->title = File::normalizeTitle( $title, 'exception' );
                        $this->name = $title->getDBkey();
                }
@@ -119,22 +119,22 @@ class ArchivedFile {
                }
                $conds = array();
 
-               if( $this->id > 0 ) {
+               if ( $this->id > 0 ) {
                        $conds['fa_id'] = $this->id;
                }
-               if( $this->key ) {
+               if ( $this->key ) {
                        $conds['fa_storage_group'] = $this->group;
                        $conds['fa_storage_key'] = $this->key;
                }
-               if( $this->title ) {
+               if ( $this->title ) {
                        $conds['fa_name'] = $this->title->getDBkey();
                }
 
-               if( !count( $conds ) ) {
+               if ( !count( $conds ) ) {
                        throw new MWException( "No specific information for retrieving archived file" );
                }
 
-               if( !$this->title || $this->title->getNamespace() == NS_FILE ) {
+               if ( !$this->title || $this->title->getNamespace() == NS_FILE ) {
                        $this->dataLoaded = true; // set it here, to have also true on miss
                        $dbr = wfGetDB( DB_SLAVE );
                        $row = $dbr->selectRow(
@@ -224,7 +224,7 @@ class ArchivedFile {
                $this->user_text = $row->fa_user_text;
                $this->timestamp = $row->fa_timestamp;
                $this->deleted = $row->fa_deleted;
-               if( isset( $row->fa_sha1 ) ) {
+               if ( isset( $row->fa_sha1 ) ) {
                        $this->sha1 = $row->fa_sha1;
                } else {
                        // old row, populate from key
@@ -409,7 +409,7 @@ class ArchivedFile {
         */
        public function getUser() {
                $this->load();
-               if( $this->isDeleted( File::DELETED_USER ) ) {
+               if ( $this->isDeleted( File::DELETED_USER ) ) {
                        return 0;
                } else {
                        return $this->user;
@@ -423,7 +423,7 @@ class ArchivedFile {
         */
        public function getUserText() {
                $this->load();
-               if( $this->isDeleted( File::DELETED_USER ) ) {
+               if ( $this->isDeleted( File::DELETED_USER ) ) {
                        return 0;
                } else {
                        return $this->user_text;
@@ -437,7 +437,7 @@ class ArchivedFile {
         */
        public function getDescription() {
                $this->load();
-               if( $this->isDeleted( File::DELETED_COMMENT ) ) {
+               if ( $this->isDeleted( File::DELETED_COMMENT ) ) {
                        return 0;
                } else {
                        return $this->description;
index 255da17..0da4036 100644 (file)
@@ -201,9 +201,9 @@ abstract class File {
                        'mpeg' => 'mpg',
                        'tiff' => 'tif',
                        'ogv' => 'ogg' );
-               if( isset( $squish[$lower] ) ) {
+               if ( isset( $squish[$lower] ) ) {
                        return $squish[$lower];
-               } elseif( preg_match( '/^[0-9a-z]+$/', $lower ) ) {
+               } elseif ( preg_match( '/^[0-9a-z]+$/', $lower ) ) {
                        return $lower;
                } else {
                        return '';
@@ -241,7 +241,7 @@ abstract class File {
         * @return array ("text", "html") etc
         */
        public static function splitMime( $mime ) {
-               if( strpos( $mime, '/' ) !== false ) {
+               if ( strpos( $mime, '/' ) !== false ) {
                        return explode( '/', $mime, 2 );
                } else {
                        return array( $mime, 'unknown' );
index edf623e..61d321e 100644 (file)
@@ -54,22 +54,22 @@ class ForeignAPIFile extends File {
         */
        static function newFromTitle( Title $title, $repo ) {
                $data = $repo->fetchImageQuery( array(
-                       'titles'            => 'File:' . $title->getDBkey(),
-                       'iiprop'            => self::getProps(),
-                       'prop'              => 'imageinfo',
+                       'titles' => 'File:' . $title->getDBkey(),
+                       'iiprop' => self::getProps(),
+                       'prop' => 'imageinfo',
                        'iimetadataversion' => MediaHandler::getMetadataVersion()
                ) );
 
                $info = $repo->getImageInfo( $data );
 
-               if( $info ) {
+               if ( $info ) {
                        $lastRedirect = isset( $data['query']['redirects'] )
                                ? count( $data['query']['redirects'] ) - 1
                                : -1;
-                       if( $lastRedirect >= 0 ) {
+                       if ( $lastRedirect >= 0 ) {
                                $newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to'] );
                                $img = new self( $newtitle, $repo, $info, true );
-                               if( $img ) {
+                               if ( $img ) {
                                        $img->redirectedFrom( $title->getDBkey() );
                                }
                        } else {
@@ -111,7 +111,7 @@ class ForeignAPIFile extends File {
         * @return bool|MediaTransformOutput
         */
        function transform( $params, $flags = 0 ) {
-               if( !$this->canRender() ) {
+               if ( !$this->canRender() ) {
                        // show icon
                        return parent::transform( $params, $flags );
                }
@@ -161,11 +161,11 @@ class ForeignAPIFile extends File {
         * @return array
         */
        public static function parseMetadata( $metadata ) {
-               if( !is_array( $metadata ) ) {
+               if ( !is_array( $metadata ) ) {
                        return $metadata;
                }
                $ret = array();
-               foreach( $metadata as $meta ) {
+               foreach ( $metadata as $meta ) {
                        $ret[$meta['name']] = self::parseMetadata( $meta['value'] );
                }
                return $ret;
@@ -224,7 +224,7 @@ class ForeignAPIFile extends File {
         * @return string
         */
        function getMimeType() {
-               if( !isset( $this->mInfo['mime'] ) ) {
+               if ( !isset( $this->mInfo['mime'] ) ) {
                        $magic = MimeMagic::singleton();
                        $this->mInfo['mime'] = $magic->guessTypesForExtension( $this->getExtension() );
                }
index b481e83..325c673 100644 (file)
@@ -532,15 +532,15 @@ class LocalFile extends File {
 
                $dbw->update( 'image',
                        array(
-                               'img_size'       => $this->size, // sanity
-                               'img_width'      => $this->width,
-                               'img_height'     => $this->height,
-                               'img_bits'       => $this->bits,
+                               'img_size' => $this->size, // sanity
+                               'img_width' => $this->width,
+                               'img_height' => $this->height,
+                               'img_bits' => $this->bits,
                                'img_media_type' => $this->media_type,
                                'img_major_mime' => $major,
                                'img_minor_mime' => $minor,
-                               'img_metadata'   => $this->metadata,
-                               'img_sha1'       => $this->sha1,
+                               'img_metadata' => $this->metadata,
+                               'img_sha1' => $this->sha1,
                        ),
                        array( 'img_name' => $this->getName() ),
                        __METHOD__
@@ -803,7 +803,7 @@ class LocalFile extends File {
                $oldKey = $this->repo->getSharedCacheKey( 'oldfile', $hashedName );
 
                // Must purge thumbnails for old versions too! bug 30192
-               foreach( $this->getHistory() as $oldFile ) {
+               foreach ( $this->getHistory() as $oldFile ) {
                        $oldFile->purgeThumbnails();
                }
 
@@ -845,7 +845,7 @@ class LocalFile extends File {
                // Purge the squid
                if ( $wgUseSquid ) {
                        $urls = array();
-                       foreach( $files as $file ) {
+                       foreach ( $files as $file ) {
                                $urls[] = $this->getArchiveThumbUrl( $archiveName, $file );
                        }
                        SquidUpdate::purge( $urls );
@@ -866,7 +866,7 @@ class LocalFile extends File {
                // Always purge all files from squid regardless of handler filters
                if ( $wgUseSquid ) {
                        $urls = array();
-                       foreach( $files as $file ) {
+                       foreach ( $files as $file ) {
                                $urls[] = $this->getThumbUrl( $file );
                        }
                        array_shift( $urls ); // don't purge directory
@@ -1196,20 +1196,20 @@ class LocalFile extends File {
                # doesn't deadlock. SELECT FOR UPDATE causes a deadlock for every race condition.
                $dbw->insert( 'image',
                        array(
-                               'img_name'        => $this->getName(),
-                               'img_size'        => $this->size,
-                               'img_width'       => intval( $this->width ),
-                               'img_height'      => intval( $this->height ),
-                               'img_bits'        => $this->bits,
-                               'img_media_type'  => $this->media_type,
-                               'img_major_mime'  => $this->major_mime,
-                               'img_minor_mime'  => $this->minor_mime,
-                               'img_timestamp'   => $timestamp,
+                               'img_name' => $this->getName(),
+                               'img_size' => $this->size,
+                               'img_width' => intval( $this->width ),
+                               'img_height' => intval( $this->height ),
+                               'img_bits' => $this->bits,
+                               'img_media_type' => $this->media_type,
+                               'img_major_mime' => $this->major_mime,
+                               'img_minor_mime' => $this->minor_mime,
+                               'img_timestamp' => $timestamp,
                                'img_description' => $comment,
-                               'img_user'        => $user->getId(),
-                               'img_user_text'   => $user->getName(),
-                               'img_metadata'    => $this->metadata,
-                               'img_sha1'        => $this->sha1
+                               'img_user' => $user->getId(),
+                               'img_user_text' => $user->getName(),
+                               'img_metadata' => $this->metadata,
+                               'img_sha1' => $this->sha1
                        ),
                        __METHOD__,
                        'IGNORE'
@@ -1602,9 +1602,13 @@ class LocalFile extends File {
         */
        function getDescriptionText() {
                $revision = Revision::newFromTitle( $this->title, false, Revision::READ_NORMAL );
-               if ( !$revision ) return false;
+               if ( !$revision ) {
+                       return false;
+               }
                $content = $revision->getContent();
-               if ( !$content ) return false;
+               if ( !$content ) {
+                       return false;
+               }
                $pout = $content->getParserOutput( $this->title, null, new ParserOptions() );
                return $pout->getText();
        }
@@ -1659,11 +1663,11 @@ class LocalFile extends File {
        }
 
        /**
-        * @return bool
+        * @return bool Whether to cache in RepoGroup (this avoids OOMs)
         */
        function isCacheable() {
-               $this->load();
-               return strlen( $this->metadata ) <= self::CACHE_FIELD_MAX_LEN; // avoid OOMs
+               $this->load(); // if loaded from cache, metadata will be null if it didn't fit
+               return $this->metadata !== null && strlen( $this->metadata ) <= self::CACHE_FIELD_MAX_LEN;
        }
 
        /**
@@ -2174,7 +2178,7 @@ class LocalFileRestoreBatch {
                        $deletedRel = $this->file->repo->getDeletedHashPath( $row->fa_storage_key ) . $row->fa_storage_key;
                        $deletedUrl = $this->file->repo->getVirtualUrl() . '/deleted/' . $deletedRel;
 
-                       if( isset( $row->fa_sha1 ) ) {
+                       if ( isset( $row->fa_sha1 ) ) {
                                $sha1 = $row->fa_sha1;
                        } else {
                                // old row, populate from key
index bb7e877..e3bcb6f 100644 (file)
@@ -114,7 +114,7 @@ class CliInstaller extends Installer {
         */
        public function execute() {
                $vars = Installer::getExistingLocalSettings();
-               if( $vars ) {
+               if ( $vars ) {
                        $this->showStatusMessage(
                                Status::newFatal( "config-localsettings-cli-upgrade" )
                        );
index cd14e4e..13d5d42 100644 (file)
@@ -173,7 +173,7 @@ abstract class DatabaseInstaller {
                }
                $this->db->selectDB( $this->getVar( 'wgDBname' ) );
 
-               if( $this->db->tableExists( 'archive', __METHOD__ ) ) {
+               if ( $this->db->tableExists( 'archive', __METHOD__ ) ) {
                        $status->warning( 'config-install-tables-exist' );
                        $this->enableLB();
                        return $status;
@@ -183,7 +183,7 @@ abstract class DatabaseInstaller {
                $this->db->begin( __METHOD__ );
 
                $error = $this->db->sourceFile( $this->db->getSchemaPath() );
-               if( $error !== true ) {
+               if ( $error !== true ) {
                        $this->db->reportQueryError( $error, 0, '', __METHOD__ );
                        $this->db->rollback( __METHOD__ );
                        $status->fatal( 'config-install-tables-failed', $error );
@@ -191,7 +191,7 @@ abstract class DatabaseInstaller {
                        $this->db->commit( __METHOD__ );
                }
                // Resume normal operations
-               if( $status->isOk() ) {
+               if ( $status->isOk() ) {
                        $this->enableLB();
                }
                return $status;
@@ -569,7 +569,7 @@ abstract class DatabaseInstaller {
                        $this->setVar( 'wgDBpassword', $this->getVar( '_InstallPassword' ) );
                }
 
-               if( $this->getVar( '_CreateDBAccount' ) && strval( $this->getVar( 'wgDBpassword' ) ) == '' ) {
+               if ( $this->getVar( '_CreateDBAccount' ) && strval( $this->getVar( 'wgDBpassword' ) ) == '' ) {
                        return Status::newFatal( 'config-db-password-empty', $this->getVar( 'wgDBuser' ) );
                }
 
@@ -588,7 +588,7 @@ abstract class DatabaseInstaller {
                }
                $this->db->selectDB( $this->getVar( 'wgDBname' ) );
 
-               if( $this->db->selectRow( 'interwiki', '*', array(), __METHOD__ ) ) {
+               if ( $this->db->selectRow( 'interwiki', '*', array(), __METHOD__ ) ) {
                        $status->warning( 'config-install-interwiki-exists' );
                        return $status;
                }
@@ -601,9 +601,11 @@ abstract class DatabaseInstaller {
                if ( !$rows ) {
                        return Status::newFatal( 'config-install-interwiki-list' );
                }
-               foreach( $rows as $row ) {
+               foreach ( $rows as $row ) {
                        $row = preg_replace( '/^\s*([^#]*?)\s*(#.*)?$/', '\\1', $row ); // strip comments - whee
-                       if ( $row == "" ) continue;
+                       if ( $row == "" ) {
+                               continue;
+                       }
                        $row .= "||";
                        $interwikis[] = array_combine(
                                array( 'iw_prefix', 'iw_url', 'iw_local', 'iw_api', 'iw_wikiid' ),
index 3a9d82d..43fb14e 100644 (file)
@@ -336,6 +336,12 @@ The account you specify here must already exist.',
 
 If your MySQL installation supports InnoDB, it is highly recommended that you choose that instead.
 If your MySQL installation does not support InnoDB, maybe it's time for an upgrade.",
+       'config-mysql-only-myisam-dep'    => "'''Warning:''' MyISAM is the only available storage engine for MySQL, which is not recommended for use with MediaWiki, because:
+* it barely supports concurrency due to table locking
+* it is more prone to corruption than other engines
+* the MediaWiki codebase does not always handle MyISAM as it should
+
+Your MySQL installation does not support InnoDB, maybe it's time for an upgrade.",
        'config-mysql-engine-help'        => "'''InnoDB''' is almost always the best option, since it has good concurrency support.
 
 '''MyISAM''' may be faster in single-user or read-only installations.
@@ -11597,7 +11603,7 @@ Dat heiß, mer moß en affschallde, söns jeiht nix.",
 MediaWiki bruch Funxjohne en däm Modul un deiht et esu nit.
 Wann De <i lang="en">Mandrake</i> aam loufehäs, donn dat Pakätt <code lang="en">php-xml</code> enstalleere.',
        'config-pcre' => 'Dem PHP sing Modul för <i lang="en">PCRE</i> schingk ze fähle.
-MediaWiki deiht et nit ohne de Funxjohne för de <i lang="en">Perl-compatible regular expressions</i>.',
+MediaWiki deiht et nit der ohne de Funxjohne för de rejolähre Ußdrök vun dä Zoot, wi <i lang="en">Perl</i> se kännt.',
        'config-pcre-no-utf8' => "'''Dä:''' Et PHP-Modul <i lang=\"en\">PCRE</i> schingk ohne de <i lang=\"en\">PCRE_UTF8</i>-Aandeile övversaz ze sin.
 MediaWiki bruch dä UTF-8-Krohm ävver, öm ohne Fähler loufe ze künne.",
        'config-memory-raised' => 'Der jrühzte zohjelasse Shpeisherbedarf vum PHP, et <code lang="en">memory_limit</code>, shtund op $1 un es op $2 erop jesaz woode.',
@@ -11713,7 +11719,6 @@ Donn Ding Daatebangk et beß janz woh anders hen, noh <code lang="en">/var/lib/m
        'config-type-postgres' => '<i lang="en">PostgreSQL</i>',
        'config-type-sqlite' => '<i lang="en">SQLite</i>',
        'config-type-oracle' => '<i lang="en">Oracle</i>',
-       'config-type-ibm_db2' => 'Dä <i lang="en">IBM</i> ier <i lang="en">DB2</i>',
        'config-support-info' => 'MediaWiki kann met heh dä Daatebangk_Süßteeme zosamme jonn:
 
 $1
@@ -11723,12 +11728,10 @@ Wann dat Daatebangk_Süßteem, wat De nämme wells, onge nit dobei es, dann donn
        'config-support-postgres' => '* <i lang="en">$1</i> es e bikannt Daatebangksüßteem met offe Quälltäxde, un en och en Wahl nävve <i lang="en">MySQL</i> ([http://www.php.net/manual/de/pgsql.installation.php Aanleidung för et Övversäze un Enreeschte von PHP met <i lang="en">PostgreSQL</i> dobei, op Deutsch]) Et sinn_er ävver paa klein Fählershe bekannt, um kunne dat em Momang för et reschtijje Werke nit emfähle.',
        'config-support-sqlite' => '* <i lang="en">$1</i> es e eijfach Daatebangksüßteem, wat joot ongershtöz weed. ([http://www.php.net/manual/de/pdo.installation.php Aanleidong för et Övversäze un Enreeschte von PHP met <i lang="en">SQLite</i> dobei, op Deutsch])',
        'config-support-oracle' => '* <i lang="en">$1</i> es e jeschäfflesch Daatebangksüßteem för Ferme. ([http://www.php.net/manual/de/oci8.installation.php Aanleidong för et Övversäze un Enreeschte von PHP met <i lang="en">OCI8</i> dobei, op Deutsch])',
-       'config-support-ibm_db2' => '* $1 es en Datebengk för et Jeschäff un fö Ongernehme.', # Fuzzy
        'config-header-mysql' => 'De Enshtällunge för de <i lang="en">MySQL</i> Daatebangk',
        'config-header-postgres' => 'De Enshtällunge för de <i lang="en">PostgreSQL</i> Daatebangk',
        'config-header-sqlite' => 'De Enshtällunge för de <i lang="en">SQLite</i> Daatebangk',
        'config-header-oracle' => 'De Enshtällunge för de <i lang="en">Oracle</i> Daatebangk',
-       'config-header-ibm_db2' => 'De Enshtällunge för de <i lang="en">IBM</i> ier <i lang="en">DB2</i>',
        'config-invalid-db-type' => 'Dat es en onjöltijje Zoot Daatebangk.',
        'config-missing-db-name' => 'Do moß jät enjävve för dä Name vun dä Daatebangk.',
        'config-missing-db-host' => 'Do moß jät enjävve för dä Name vun däm Rääschner met dä Daatebangk.',
@@ -11817,7 +11820,6 @@ Dat es flöcker un spaasaamer wi et UTF-8 Fommaat vum <i lang=\"en\">MySQL</i> u
 
 Beim Shpeishere em '''UTF-8 Fomaat''' deiht et <i lang=\"en\">MySQL</i> der Zeishesaz un de Kodeerung vun dä Daate känne, un kann se akeraat aanzeije un ömwandelle,
 allerdengs künne kein Zeishe ußerhalv vum [//de.wikipedia.org/wiki/Basic_Multilingual_Plane#Gliederung_in_Ebenen_und_Bl.C3.B6cke jrundlääje Knubbel för vill Shprooche (<i lang=\"en\">Basic Multilingual Plane — BMP</i>)] afjeshpeishert wääde.",
-       'config-ibm_db2-low-db-pagesize' => "De <i lang=\"en\">DB2</i> Daatebangk heh hät ene standattmääßeje Plaz för Tabälle met zoh klein Sigge. Dä Plaz en de Sigge moß '''32K''' udder mieh sin.",
        'config-site-name' => 'Däm Wiki singe Name:',
        'config-site-name-help' => 'Dä douch em Tittel vun de Brauserfinstere un aan ätlije andere Shtälle op.',
        'config-site-name-blank' => 'Donn ene Name för di Sait aanjävve.',
@@ -11927,7 +11929,7 @@ Et bäß es, wam_mer vum <i lang="en">world wide web</i> doh nit drahn kumme kan
        'config-logo-help' => 'De Schtandart_Bedeen_Bovverfläsch vum MediaWiki hät e Logo bovve en der Eck met 135x160 Pixele.
 Donn e zopaß Logo huh laade, un donn däm sing URL heh endraare.
 
-Wells De kei Logo han, draach heh nix en.',
+Wells De kei Logo han, draach heh nix en.', # Fuzzy
        'config-instantcommons' => 'Donn <i lang="en">InstantCommons</i> zohlohße.',
        'config-instantcommons-help' => '<i lang="en">[//www.mediawiki.org/wiki/InstantCommons InstantCommons]</i> es en Eijeschaff, di et för Wikis müjjelesch määt, Belder, Tondatteie un ander Meedijedatteie enzebenge, di op dä Webßait vun de <i lang="en">[//commons.wikimedia.org/ Wikimedia Commons]</i> ongerjebraat sin. Öm dat noze ze künne, moß dä ẞööver vum MediaWiki en Verbendung nohm Internet opnämme künne.
 
@@ -11953,7 +11955,7 @@ Se sullte ein pro Reih opjeschrevve sin, un en Pooz (<i lang="en">port</i>) ier
        'config-memcache-noport' => 'Do has kein Pooz (<code lang="en">port</code>) Nommer aanjejovve för mem <code lang="en">memcached</code> ẞööver ze bruche: $1.
 Wann De di Nommer nit weiß, der Shtandatt es 11211.',
        'config-memcache-badport' => 'Dem <code lang="en">memcached</code> ẞööver singe Pooz (<code lang="en">port</code>) Nommere sullte zwesche $1 un $2 sin.',
-       'config-extensions' => 'Projramm-Zosätz (<i lang="en">extensions</i>)',
+       'config-extensions' => 'Projramm-Zohsäz (<i lang="en">Extensions</i>)',
        'config-extensions-help' => 'Di bovve opjeleß Zohsazprojramme för et MediaWiki sin em Verzeischneß <code lang="en">./extensions</code> ald ze fenge.
 
 Do kann se heh un jez aanschallde, ävver se künnte noch zohsäzlesch Enshtellunge bruche.',
index 6a7970b..44a7241 100644 (file)
@@ -401,7 +401,7 @@ abstract class Installer {
         */
        public function doEnvironmentChecks() {
                $phpVersion = phpversion();
-               if( version_compare( $phpVersion, self::MINIMUM_PHP_VERSION, '>=' ) ) {
+               if ( version_compare( $phpVersion, self::MINIMUM_PHP_VERSION, '>=' ) ) {
                        $this->showMessage( 'config-env-php', $phpVersion );
                        $good = true;
                } else {
@@ -409,7 +409,7 @@ abstract class Installer {
                        $good = false;
                }
 
-               if( $good ) {
+               if ( $good ) {
                        foreach ( $this->envChecks as $check ) {
                                $status = $this->$check();
                                if ( $status === false ) {
@@ -486,7 +486,7 @@ abstract class Installer {
                $_lsExists = file_exists( "$IP/LocalSettings.php" );
                wfRestoreWarnings();
 
-               if( !$_lsExists ) {
+               if ( !$_lsExists ) {
                        return false;
                }
                unset( $_lsExists );
@@ -684,7 +684,7 @@ abstract class Installer {
         * Environment check for register_globals.
         */
        protected function envCheckRegisterGlobals() {
-               if( wfIniGetBool( 'register_globals' ) ) {
+               if ( wfIniGetBool( 'register_globals' ) ) {
                        $this->showMessage( 'config-register-globals' );
                }
        }
@@ -722,7 +722,7 @@ abstract class Installer {
         * @return bool
         */
        protected function envCheckMagicQuotes() {
-               if( wfIniGetBool( "magic_quotes_runtime" ) ) {
+               if ( wfIniGetBool( "magic_quotes_runtime" ) ) {
                        $this->showError( 'config-magic-quotes-runtime' );
                        return false;
                }
@@ -830,10 +830,10 @@ abstract class Installer {
 
                $n = wfShorthandToInteger( $limit );
 
-               if( $n < $this->minMemorySize * 1024 * 1024 ) {
+               if ( $n < $this->minMemorySize * 1024 * 1024 ) {
                        $newLimit = "{$this->minMemorySize}M";
 
-                       if( ini_set( "memory_limit", $newLimit ) === false ) {
+                       if ( ini_set( "memory_limit", $newLimit ) === false ) {
                                $this->showMessage( 'config-memory-bad', $limit );
                        } else {
                                $this->showMessage( 'config-memory-raised', $limit, $newLimit );
@@ -970,6 +970,7 @@ abstract class Installer {
 
        /**
         * Environment check for setting the preferred PHP file extension.
+        * @return bool
         */
        protected function envCheckExtension() {
                // @todo FIXME: Detect this properly
@@ -983,7 +984,7 @@ abstract class Installer {
        }
 
        /**
-        * TODO: document
+        * Environment check for preferred locale in shell
         * @return bool
         */
        protected function envCheckShellLocale() {
@@ -1057,7 +1058,7 @@ abstract class Installer {
        }
 
        /**
-        * TODO: document
+        * Environment check for the permissions of the uploads directory
         * @return bool
         */
        protected function envCheckUploadsDirectory() {
@@ -1082,7 +1083,7 @@ abstract class Installer {
        protected function envCheckSuhosinMaxValueLength() {
                $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
                if ( $maxValueLength > 0 ) {
-                       if( $maxValueLength < 1024 ) {
+                       if ( $maxValueLength < 1024 ) {
                                # Only warn if the value is below the sane 1024
                                $this->showMessage( 'config-suhosin-max-value-length', $maxValueLength );
                        }
@@ -1140,14 +1141,14 @@ abstract class Installer {
                 * We're going to prefer the pecl extension here unless
                 * utf8_normalize is more up to date.
                 */
-               if( $utf8 ) {
+               if ( $utf8 ) {
                        $useNormalizer = 'utf8';
                        $utf8 = utf8_normalize( $not_normal_c, UtfNormal::UNORM_NFC );
                        if ( $utf8 !== $normal_c ) {
                                $needsUpdate = true;
                        }
                }
-               if( $intl ) {
+               if ( $intl ) {
                        $useNormalizer = 'intl';
                        $intl = normalizer_normalize( $not_normal_c, Normalizer::FORM_C );
                        if ( $intl !== $normal_c ) {
@@ -1156,11 +1157,11 @@ abstract class Installer {
                }
 
                // Uses messages 'config-unicode-using-php', 'config-unicode-using-utf8', 'config-unicode-using-intl'
-               if( $useNormalizer === 'php' ) {
+               if ( $useNormalizer === 'php' ) {
                        $this->showMessage( 'config-unicode-pure-php-warning' );
                } else {
                        $this->showMessage( 'config-unicode-using-' . $useNormalizer );
-                       if( $needsUpdate ) {
+                       if ( $needsUpdate ) {
                                $this->showMessage( 'config-unicode-update-warning' );
                        }
                }
@@ -1243,9 +1244,9 @@ abstract class Installer {
         * @return bool|string
         */
        public static function locateExecutableInDefaultPaths( $names, $versionInfo = false ) {
-               foreach( self::getPossibleBinPaths() as $path ) {
+               foreach ( self::getPossibleBinPaths() as $path ) {
                        $exe = self::locateExecutable( $path, $names, $versionInfo );
-                       if( $exe !== false ) {
+                       if ( $exe !== false ) {
                                return $exe;
                        }
                }
@@ -1344,7 +1345,7 @@ abstract class Installer {
         * @return array
         */
        public function findExtensions() {
-               if( $this->getVar( 'IP' ) === null ) {
+               if ( $this->getVar( 'IP' ) === null ) {
                        return array();
                }
 
@@ -1356,10 +1357,10 @@ abstract class Installer {
                $dh = opendir( $extDir );
                $exts = array();
                while ( ( $file = readdir( $dh ) ) !== false ) {
-                       if( !is_dir( "$extDir/$file" ) ) {
+                       if ( !is_dir( "$extDir/$file" ) ) {
                                continue;
                        }
-                       if( file_exists( "$extDir/$file/$file.php" ) ) {
+                       if ( file_exists( "$extDir/$file/$file.php" ) ) {
                                $exts[] = $file;
                        }
                }
@@ -1392,7 +1393,7 @@ abstract class Installer {
 
                require( "$IP/includes/DefaultSettings.php" );
 
-               foreach( $exts as $e ) {
+               foreach ( $exts as $e ) {
                        require_once( "$IP/extensions/$e/$e.php" );
                }
 
@@ -1431,9 +1432,9 @@ abstract class Installer {
 
                // Build the array of install steps starting from the core install list,
                // then adding any callbacks that wanted to attach after a given step
-               foreach( $coreInstallSteps as $step ) {
+               foreach ( $coreInstallSteps as $step ) {
                        $this->installSteps[] = $step;
-                       if( isset( $this->extraInstallSteps[$step['name']] ) ) {
+                       if ( isset( $this->extraInstallSteps[$step['name']] ) ) {
                                $this->installSteps = array_merge(
                                        $this->installSteps,
                                        $this->extraInstallSteps[$step['name']]
@@ -1442,7 +1443,7 @@ abstract class Installer {
                }
 
                // Prepend any steps that want to be at the beginning
-               if( isset( $this->extraInstallSteps['BEGINNING'] ) ) {
+               if ( isset( $this->extraInstallSteps['BEGINNING'] ) ) {
                        $this->installSteps = array_merge(
                                $this->extraInstallSteps['BEGINNING'],
                                $this->installSteps
@@ -1450,7 +1451,7 @@ abstract class Installer {
                }
 
                // Extensions should always go first, chance to tie into hooks and such
-               if( count( $this->getVar( '_Extensions' ) ) ) {
+               if ( count( $this->getVar( '_Extensions' ) ) ) {
                        array_unshift( $this->installSteps,
                                array( 'name' => 'extensions', 'callback' => array( $this, 'includeExtensions' ) )
                        );
@@ -1475,7 +1476,7 @@ abstract class Installer {
                $installer = $this->getDBInstaller();
                $installer->preInstall();
                $steps = $this->getInstallSteps( $installer );
-               foreach( $steps as $stepObj ) {
+               foreach ( $steps as $stepObj ) {
                        $name = $stepObj['name'];
                        call_user_func_array( $startCB, array( $name ) );
 
@@ -1488,11 +1489,11 @@ abstract class Installer {
 
                        // If we've hit some sort of fatal, we need to bail.
                        // Callback already had a chance to do output above.
-                       if( !$status->isOk() ) {
+                       if ( !$status->isOk() ) {
                                break;
                        }
                }
-               if( $status->isOk() ) {
+               if ( $status->isOk() ) {
                        $this->setVar( '_InstallDone', true );
                }
                return $installResults;
@@ -1566,7 +1567,7 @@ abstract class Installer {
 
                        $user->addGroup( 'sysop' );
                        $user->addGroup( 'bureaucrat' );
-                       if( $this->getVar( '_AdminEmail' ) ) {
+                       if ( $this->getVar( '_AdminEmail' ) ) {
                                $user->setEmail( $this->getVar( '_AdminEmail' ) );
                        }
                        $user->saveSettings();
@@ -1577,7 +1578,7 @@ abstract class Installer {
                }
                $status = Status::newGood();
 
-               if( $this->getVar( '_Subscribe' ) && $this->getVar( '_AdminEmail' ) ) {
+               if ( $this->getVar( '_Subscribe' ) && $this->getVar( '_AdminEmail' ) ) {
                        $this->subscribeToMediaWikiAnnounce( $status );
                }
 
@@ -1589,23 +1590,23 @@ abstract class Installer {
         */
        private function subscribeToMediaWikiAnnounce( Status $s ) {
                $params = array(
-                       'email'    => $this->getVar( '_AdminEmail' ),
+                       'email' => $this->getVar( '_AdminEmail' ),
                        'language' => 'en',
-                       'digest'   => 0
+                       'digest' => 0
                );
 
                // Mailman doesn't support as many languages as we do, so check to make
                // sure their selected language is available
                $myLang = $this->getVar( '_UserLang' );
-               if( in_array( $myLang, $this->mediaWikiAnnounceLanguages ) ) {
+               if ( in_array( $myLang, $this->mediaWikiAnnounceLanguages ) ) {
                        $myLang = $myLang == 'pt-br' ? 'pt_BR' : $myLang; // rewrite to Mailman's pt_BR
                        $params['language'] = $myLang;
                }
 
-               if( MWHttpRequest::canMakeRequests() ) {
+               if ( MWHttpRequest::canMakeRequests() ) {
                        $res = MWHttpRequest::factory( $this->mediaWikiAnnounceUrl,
                                array( 'method' => 'POST', 'postData' => $params ) )->execute();
-                       if( !$res->isOK() ) {
+                       if ( !$res->isOK() ) {
                                $s->warning( 'config-install-subscribe-fail', $res->getMessage() );
                        }
                } else {
index c9ebc7e..cd7e53c 100644 (file)
@@ -73,10 +73,10 @@ class LocalSettingsGenerator {
                        'wgEnotifWatchlist', 'wgEmailAuthentication', 'wgEnableUploads', 'wgUseInstantCommons'
                );
 
-               foreach( $confItems as $c ) {
+               foreach ( $confItems as $c ) {
                        $val = $installer->getVar( $c );
 
-                       if( in_array( $c, $boolItems ) ) {
+                       if ( in_array( $c, $boolItems ) ) {
                                $val = wfBoolToStr( $val );
                        }
 
@@ -136,13 +136,13 @@ class LocalSettingsGenerator {
        public function getText() {
                $localSettings = $this->getDefaultText();
 
-               if( count( $this->extensions ) ) {
+               if ( count( $this->extensions ) ) {
                        $localSettings .= "
 # Enabled Extensions. Most extensions are enabled by including the base extension file here
 # but check specific extension documentation for more details
 # The following extensions were automatically enabled:\n";
 
-                       foreach( $this->extensions as $extName ) {
+                       foreach ( $this->extensions as $extName ) {
                                $encExtName = self::escapePhpString( $extName );
                                $localSettings .= "require_once( \"\$IP/extensions/$encExtName/$encExtName.php\" );\n";
                        }
@@ -169,13 +169,13 @@ class LocalSettingsGenerator {
        protected function buildMemcachedServerList() {
                $servers = $this->values['_MemCachedServers'];
 
-               if( !$servers ) {
+               if ( !$servers ) {
                        return 'array()';
                } else {
                        $ret = 'array( ';
                        $servers = explode( ',', $servers );
 
-                       foreach( $servers as $srv ) {
+                       foreach ( $servers as $srv ) {
                                $srv = trim( $srv );
                                $ret .= "'$srv', ";
                        }
@@ -188,14 +188,14 @@ class LocalSettingsGenerator {
         * @return String
         */
        protected function getDefaultText() {
-               if( !$this->values['wgImageMagickConvertCommand'] ) {
+               if ( !$this->values['wgImageMagickConvertCommand'] ) {
                        $this->values['wgImageMagickConvertCommand'] = '/usr/bin/convert';
                        $magic = '#';
                } else {
                        $magic = '';
                }
 
-               if( !$this->values['wgShellLocale'] ) {
+               if ( !$this->values['wgShellLocale'] ) {
                        $this->values['wgShellLocale'] = 'en_US.UTF-8';
                        $locale = '#';
                } else {
@@ -205,16 +205,16 @@ class LocalSettingsGenerator {
                //$rightsUrl = $this->values['wgRightsUrl'] ? '' : '#'; // TODO: Fixme, I'm unused!
                $hashedUploads = $this->safeMode ? '' : '#';
                $metaNamespace = '';
-               if( $this->values['wgMetaNamespace'] !== $this->values['wgSitename'] ) {
+               if ( $this->values['wgMetaNamespace'] !== $this->values['wgSitename'] ) {
                        $metaNamespace = "\$wgMetaNamespace = \"{$this->values['wgMetaNamespace']}\";\n";
                }
 
                $groupRights = '';
-               if( $this->groupPermissions ) {
+               if ( $this->groupPermissions ) {
                        $groupRights .= "# The following permissions were set based on your choice in the installer\n";
-                       foreach( $this->groupPermissions as $group => $rightArr ) {
+                       foreach ( $this->groupPermissions as $group => $rightArr ) {
                                $group = self::escapePhpString( $group );
-                               foreach( $rightArr as $right => $perm ) {
+                               foreach ( $rightArr as $right => $perm ) {
                                        $right = self::escapePhpString( $right );
                                        $groupRights .= "\$wgGroupPermissions['$group']['$right'] = " .
                                                wfBoolToStr( $perm ) . ";\n";
@@ -222,7 +222,7 @@ class LocalSettingsGenerator {
                        }
                }
 
-               switch( $this->values['wgMainCacheType'] ) {
+               switch ( $this->values['wgMainCacheType'] ) {
                        case 'anything':
                        case 'db':
                        case 'memcached':
index 72514f2..84638d4 100644 (file)
@@ -350,10 +350,14 @@ class MysqlInstaller extends DatabaseInstaller {
                $s .= Xml::openElement( 'div', array(
                        'id' => 'dbMyisamWarning'
                ));
-               $s .= $this->parent->getWarningBox( wfMessage( 'config-mysql-myisam-dep' )->text() );
+               $myisamWarning = 'config-mysql-myisam-dep';
+               if ( count( $engines ) === 1 ) {
+                       $myisamWarning = 'config-mysql-only-myisam-dep';
+               }
+               $s .= $this->parent->getWarningBox( wfMessage( $myisamWarning )->text() );
                $s .= Xml::closeElement( 'div' );
 
-               if( $this->getVar( '_MysqlEngine' ) != 'MyISAM' ) {
+               if ( $this->getVar( '_MysqlEngine' ) != 'MyISAM' ) {
                        $s .= Xml::openElement( 'script', array( 'type' => 'text/javascript' ) );
                        $s .= '$(\'#dbMyisamWarning\').hide();';
                        $s .= Xml::closeElement( 'script' );
@@ -371,10 +375,12 @@ class MysqlInstaller extends DatabaseInstaller {
                                'itemAttribs' => array(
                                        'MyISAM' => array(
                                                'class' => 'showHideRadio',
-                                               'rel'   => 'dbMyisamWarning'),
+                                               'rel' => 'dbMyisamWarning'
+                                       ),
                                        'InnoDB' => array(
                                                'class' => 'hideShowRadio',
-                                               'rel'   => 'dbMyisamWarning')
+                                               'rel' => 'dbMyisamWarning'
+                                       )
                        )));
                        $s .= $this->parent->getHelpBox( 'config-mysql-engine-help' );
                }
@@ -470,7 +476,7 @@ class MysqlInstaller extends DatabaseInstaller {
                }
                $conn = $status->value;
                $dbName = $this->getVar( 'wgDBname' );
-               if( !$conn->selectDB( $dbName ) ) {
+               if ( !$conn->selectDB( $dbName ) ) {
                        $conn->query( "CREATE DATABASE " . $conn->addIdentifierQuotes( $dbName ), __METHOD__ );
                        $conn->selectDB( $dbName );
                }
@@ -483,7 +489,7 @@ class MysqlInstaller extends DatabaseInstaller {
         */
        public function setupUser() {
                $dbUser = $this->getVar( 'wgDBuser' );
-               if( $dbUser == $this->getVar( '_InstallUser' ) ) {
+               if ( $dbUser == $this->getVar( '_InstallUser' ) ) {
                        return Status::newGood();
                }
                $status = $this->getConnection();
@@ -520,7 +526,7 @@ class MysqlInstaller extends DatabaseInstaller {
                        $tryToCreate = false;
                }
 
-               if( $tryToCreate ) {
+               if ( $tryToCreate ) {
                        $createHostList = array(
                                $server,
                                'localhost',
@@ -531,16 +537,16 @@ class MysqlInstaller extends DatabaseInstaller {
                        $createHostList = array_unique( $createHostList );
                        $escPass = $this->db->addQuotes( $password );
 
-                       foreach( $createHostList as $host ) {
+                       foreach ( $createHostList as $host ) {
                                $fullName = $this->buildFullUserName( $dbUser, $host );
-                               if( !$this->userDefinitelyExists( $dbUser, $host ) ) {
+                               if ( !$this->userDefinitelyExists( $dbUser, $host ) ) {
                                        try{
                                                $this->db->begin( __METHOD__ );
                                                $this->db->query( "CREATE USER $fullName IDENTIFIED BY $escPass", __METHOD__ );
                                                $this->db->commit( __METHOD__ );
                                                $grantableNames[] = $fullName;
                                        } catch( DBQueryError $dqe ) {
-                                               if( $this->db->lastErrno() == 1396 /* ER_CANNOT_USER */ ) {
+                                               if ( $this->db->lastErrno() == 1396 /* ER_CANNOT_USER */ ) {
                                                        // User (probably) already exists
                                                        $this->db->rollback( __METHOD__ );
                                                        $status->warning( 'config-install-user-alreadyexists', $dbUser );
@@ -563,7 +569,7 @@ class MysqlInstaller extends DatabaseInstaller {
 
                // Try to grant to all the users we know exist or we were able to create
                $dbAllTables = $this->db->addIdentifierQuotes( $dbName ) . '.*';
-               foreach( $grantableNames as $name ) {
+               foreach ( $grantableNames as $name ) {
                        try {
                                $this->db->begin( __METHOD__ );
                                $this->db->query( "GRANT ALL PRIVILEGES ON $dbAllTables TO $name", __METHOD__ );
index df1f610..1c22afb 100644 (file)
@@ -331,7 +331,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        return;
                }
 
-               if( $this->applyPatch( 'patch-fix-il_from.sql', false, "Fixing ancient broken imagelinks table." ) ) {
+               if ( $this->applyPatch( 'patch-fix-il_from.sql', false, "Fixing ancient broken imagelinks table." ) ) {
                        $this->output( "NOTE: you will have to run maintenance/refreshLinks.php after this." );
                }
        }
@@ -368,7 +368,7 @@ class MysqlUpdater extends DatabaseUpdater {
                $this->output( wfTimestamp( TS_DB ) );
                $this->output( "......checking for duplicate entries.\n" );
 
-               list ( $cur, $old, $page, $revision, $text ) = $this->db->tableNamesN( 'cur', 'old', 'page', 'revision', 'text' );
+               list( $cur, $old, $page, $revision, $text ) = $this->db->tableNamesN( 'cur', 'old', 'page', 'revision', 'text' );
 
                $rows = $this->db->query( "SELECT cur_title, cur_namespace, COUNT(cur_namespace) AS c
                                FROM $cur GROUP BY cur_title, cur_namespace HAVING c>1", __METHOD__ );
@@ -525,12 +525,12 @@ class MysqlUpdater extends DatabaseUpdater {
 
        protected function doNamespaceSize() {
                $tables = array(
-                       'page'          => 'page',
-                       'archive'       => 'ar',
+                       'page' => 'page',
+                       'archive' => 'ar',
                        'recentchanges' => 'rc',
-                       'watchlist'     => 'wl',
-                       'querycache'    => 'qc',
-                       'logging'       => 'log',
+                       'watchlist' => 'wl',
+                       'querycache' => 'qc',
+                       'logging' => 'log',
                );
                foreach ( $tables as $table => $prefix ) {
                        $field = $prefix . '_namespace';
@@ -651,7 +651,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        foreach ( $groups as $group ) {
                                $this->db->insert( 'user_groups',
                                        array(
-                                               'ug_user'  => $row->ur_user,
+                                               'ug_user' => $row->ur_user,
                                                'ug_group' => $group ),
                                        __METHOD__ );
                        }
@@ -686,7 +686,7 @@ class MysqlUpdater extends DatabaseUpdater {
                $this->db->query( "UPDATE $page SET page_random = RAND() WHERE page_random = 0", __METHOD__ );
                $rows = $this->db->affectedRows();
 
-               if( $rows ) {
+               if ( $rows ) {
                        $this->output( "Set page_random to a random value on $rows rows where it was set to 0\n" );
                } else {
                        $this->output( "...no page_random rows needed to be set\n" );
index e7ae8d5..3747189 100644 (file)
@@ -431,7 +431,7 @@ class PostgresInstaller extends DatabaseInstaller {
                        'callback' => array( $this, 'setupSchema' )
                );
 
-               if( $this->getVar( '_CreateDBAccount' ) ) {
+               if ( $this->getVar( '_CreateDBAccount' ) ) {
                        $this->parent->addInstallStep( $createDbAccount, 'database' );
                }
                $this->parent->addInstallStep( $commitCB, 'interwiki' );
@@ -469,7 +469,7 @@ class PostgresInstaller extends DatabaseInstaller {
                $schema = $this->getVar( 'wgDBmwschema' );
                $safeschema = $conn->addIdentifierQuotes( $schema );
                $safeuser = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) );
-               if( !$conn->schemaExists( $schema ) ) {
+               if ( !$conn->schemaExists( $schema ) ) {
                        try {
                                $conn->query( "CREATE SCHEMA $safeschema AUTHORIZATION $safeuser" );
                        } catch ( DBQueryError $e ) {
@@ -557,7 +557,7 @@ class PostgresInstaller extends DatabaseInstaller {
                 */
                $conn = $status->value;
 
-               if( $conn->tableExists( 'archive' ) ) {
+               if ( $conn->tableExists( 'archive' ) ) {
                        $status->warning( 'config-install-tables-exist' );
                        $this->enableLB();
                        return $status;
@@ -565,12 +565,12 @@ class PostgresInstaller extends DatabaseInstaller {
 
                $conn->begin( __METHOD__ );
 
-               if( !$conn->schemaExists( $schema ) ) {
+               if ( !$conn->schemaExists( $schema ) ) {
                        $status->fatal( 'config-install-pg-schema-not-exist' );
                        return $status;
                }
                $error = $conn->sourceFile( $conn->getSchemaPath() );
-               if( $error !== true ) {
+               if ( $error !== true ) {
                        $conn->reportQueryError( $error, 0, '', __METHOD__ );
                        $conn->rollback( __METHOD__ );
                        $status->fatal( 'config-install-tables-failed', $error );
@@ -578,7 +578,7 @@ class PostgresInstaller extends DatabaseInstaller {
                        $conn->commit( __METHOD__ );
                }
                // Resume normal operations
-               if( $status->isOk() ) {
+               if ( $status->isOk() ) {
                        $this->enableLB();
                }
                return $status;
index 2615fc6..58a54c4 100644 (file)
@@ -46,9 +46,9 @@ class PostgresUpdater extends DatabaseUpdater {
                        # r15791 Change reserved word table names "user" and "text"
                        array( 'renameTable', 'user', 'mwuser' ),
                        array( 'renameTable', 'text', 'pagecontent' ),
-                       array( 'renameIndex', 'mwuser', 'user_pkey', 'mwuser_pkey'),
+                       array( 'renameIndex', 'mwuser', 'user_pkey', 'mwuser_pkey' ),
                        array( 'renameIndex', 'mwuser', 'user_user_name_key', 'mwuser_user_name_key' ),
-                       array( 'renameIndex', 'pagecontent','text_pkey', 'pagecontent_pkey' ),
+                       array( 'renameIndex', 'pagecontent', 'text_pkey', 'pagecontent_pkey' ),
 
                        # renamed sequences
                        array( 'renameSequence', 'ipblocks_ipb_id_val', 'ipblocks_ipb_id_seq'         ),
@@ -252,9 +252,9 @@ class PostgresUpdater extends DatabaseUpdater {
                        ),
                        'CREATE INDEX cl_sortkey ON "categorylinks" USING "btree" ("cl_to", "cl_sortkey", "cl_from")' ),
                        array( 'checkIndex', 'iwl_prefix_title_from', array(
-                               array('iwl_prefix', 'text_ops', 'btree', 0),
-                               array('iwl_title', 'text_ops', 'btree', 0),
-                               array('iwl_from', 'int4_ops', 'btree', 0),
+                               array( 'iwl_prefix', 'text_ops', 'btree', 0 ),
+                               array( 'iwl_title', 'text_ops', 'btree', 0 ),
+                               array( 'iwl_from', 'int4_ops', 'btree', 0 ),
                        ),
                        'CREATE INDEX iwl_prefix_title_from ON "iwlinks" USING "btree" ("iwl_prefix", "iwl_title", "iwl_from")' ),
                        array( 'checkIndex', 'logging_times', array(
@@ -308,11 +308,11 @@ class PostgresUpdater extends DatabaseUpdater {
                        array( 'checkOiNameConstraint' ),
                        array( 'checkPageDeletedTrigger' ),
                        array( 'checkRevUserFkey' ),
-                       array( 'dropIndex', 'ipblocks', 'ipb_address'),
+                       array( 'dropIndex', 'ipblocks', 'ipb_address' ),
                        array( 'checkIndex', 'ipb_address_unique', array(
                                array( 'ipb_address', 'text_ops', 'btree', 0 ),
-                               array( 'ipb_user',    'int4_ops', 'btree', 0 ),
-                               array( 'ipb_auto',    'int2_ops', 'btree', 0 ),
+                               array( 'ipb_user', 'int4_ops', 'btree', 0 ),
+                               array( 'ipb_auto', 'int2_ops', 'btree', 0 ),
                                array( 'ipb_anon_only', 'int2_ops', 'btree', 0 ),
                        ),
                        'CREATE UNIQUE INDEX ipb_address_unique ON ipblocks (ipb_address,ipb_user,ipb_auto,ipb_anon_only)' ),
@@ -515,7 +515,7 @@ END;
                if ( !$this->db->sequenceExists( $ns ) ) {
                        $this->output( "Creating sequence $ns\n" );
                        $this->db->query( "CREATE SEQUENCE $ns" );
-                       if( $pkey !== false ) {
+                       if ( $pkey !== false ) {
                                $this->setDefault( $table, $pkey, '"nextval"(\'"' . $ns . '"\'::"regclass")' );
                        }
                }
@@ -538,7 +538,7 @@ END;
                        $old = $this->db->realTableName( $old, "quoted" );
                        $new = $this->db->realTableName( $new, "quoted" );
                        $this->db->query( "ALTER TABLE $old RENAME TO $new" );
-                       if( $patch !== false ) {
+                       if ( $patch !== false ) {
                                $this->applyPatch( $patch );
                        }
                }
@@ -592,9 +592,9 @@ END;
                        exit( 1 );
                }
 
-               if ( $fi->type() === $newtype )
+               if ( $fi->type() === $newtype ) {
                        $this->output( "...column '$table.$field' is already of type '$newtype'\n" );
-               else {
+               else {
                        $this->output( "Changing column type of '$table.$field' from '{$fi->type()}' to '$newtype'\n" );
                        $sql = "ALTER TABLE $table ALTER $field TYPE $newtype";
                        if ( strlen( $default ) ) {
index 68df6ab..50a7181 100644 (file)
@@ -60,7 +60,7 @@ class SqliteInstaller extends DatabaseInstaller {
                        $result->fatal( 'config-outdated-sqlite', $db->getServerVersion(), self::MINIMUM_VERSION );
                }
                // Check for FTS3 full-text search module
-               if( DatabaseSqlite::getFulltextSearchModule() != 'FTS3' ) {
+               if ( DatabaseSqlite::getFulltextSearchModule() != 'FTS3' ) {
                        $result->warning( 'config-no-fts3' );
                }
                return $result;
index 30aa956..9c56558 100644 (file)
@@ -154,7 +154,7 @@ class WebInstaller extends Installer {
                $this->exportVars();
                $this->setupLanguage();
 
-               if( ( $this->getVar( '_InstallDone' ) || $this->getVar( '_UpgradeDone' ) )
+               if ( ( $this->getVar( '_InstallDone' ) || $this->getVar( '_UpgradeDone' ) )
                        && $this->request->getVal( 'localsettings' ) )
                {
                        $this->request->response()->header( 'Content-type: application/x-httpd-php' );
@@ -164,7 +164,7 @@ class WebInstaller extends Installer {
 
                        $ls = InstallerOverrides::getLocalSettingsGenerator( $this );
                        $rightsProfile = $this->rightsProfiles[$this->getVar( '_RightsProfile' )];
-                       foreach( $rightsProfile as $group => $rightsArr ) {
+                       foreach ( $rightsProfile as $group => $rightsArr ) {
                                $ls->setGroupRights( $group, $rightsArr );
                        }
                        echo $ls->getText();
@@ -172,7 +172,7 @@ class WebInstaller extends Installer {
                }
 
                $cssDir = $this->request->getVal( 'css' );
-               if( $cssDir ) {
+               if ( $cssDir ) {
                        $cssDir = ( $cssDir == 'rtl' ? 'rtl' : 'ltr' );
                        $this->request->response()->header( 'Content-type: text/css' );
                        echo $this->output->getCSS( $cssDir );
@@ -250,7 +250,7 @@ class WebInstaller extends Installer {
                                do {
                                        $nextPageId--;
                                        $nextPage = $this->pageSequence[$nextPageId];
-                               } while( isset( $this->skippedPages[$nextPage] ) );
+                               } while ( isset( $this->skippedPages[$nextPage] ) );
                        } else {
                                $nextPage = $this->pageSequence[$lowestUnhappy];
                        }
@@ -263,7 +263,7 @@ class WebInstaller extends Installer {
                $this->currentPageName = $page->getName();
                $this->startPageWrapper( $pageName );
 
-               if( $page->isSlow() ) {
+               if ( $page->isSlow() ) {
                        $this->disableTimeLimit();
                }
 
@@ -324,7 +324,7 @@ class WebInstaller extends Installer {
         * @return bool
         */
        public function startSession() {
-               if( wfIniGetBool( 'session.auto_start' ) || session_id() ) {
+               if ( wfIniGetBool( 'session.auto_start' ) || session_id() ) {
                        // Done already
                        return true;
                }
@@ -889,7 +889,7 @@ class WebInstaller extends Installer {
                if ( !isset( $params['help'] ) ) {
                        $params['help'] = "";
                }
-               if( isset( $params['rawtext'] ) ) {
+               if ( isset( $params['rawtext'] ) ) {
                        $labelText = $params['rawtext'];
                } else {
                        $labelText = $this->parse( wfMessage( $params['label'] )->text() );
@@ -983,10 +983,10 @@ class WebInstaller extends Installer {
         * @param $status Status
         */
        public function showStatusBox( $status ) {
-               if( !$status->isGood() ) {
+               if ( !$status->isGood() ) {
                        $text = $status->getWikiText();
 
-                       if( $status->isOk() ) {
+                       if ( $status->isOk() ) {
                                $box = $this->getWarningBox( $text );
                        } else {
                                $box = $this->getErrorBox( $text );
index a6a8667..3e65eae 100644 (file)
@@ -146,7 +146,7 @@ class WebInstallerOutput {
                }
                wfRestoreWarnings();
 
-               if( $dir == 'rtl' ) {
+               if ( $dir == 'rtl' ) {
                        $css = CSSJanus::transform( $css, true );
                }
 
index 3f3e50a..b640fb8 100644 (file)
@@ -254,7 +254,9 @@ class WebInstaller_Language extends WebInstallerPage {
                $languages = Language::fetchLanguageNames();
                ksort( $languages );
                foreach ( $languages as $code => $lang ) {
-                       if ( isset( $wgDummyLanguageCodes[$code] ) ) continue;
+                       if ( isset( $wgDummyLanguageCodes[$code] ) ) {
+                               continue;
+                       }
                        $s .= "\n" . Xml::option( "$code - $lang", $code, $code == $selectedCode );
                }
                $s .= "\n</select>\n";
@@ -310,7 +312,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
                $r = $this->parent->request;
                if ( $r->wasPosted() ) {
                        $key = $r->getText( 'config_wgUpgradeKey' );
-                       if( !$key || $key !== $vars['wgUpgradeKey'] ) {
+                       if ( !$key || $key !== $vars['wgUpgradeKey'] ) {
                                $this->parent->showError( 'config-localsettings-badkey' );
                                $this->showKeyForm();
                                return 'output';
@@ -458,7 +460,7 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                // Give grep a chance to find the usages:
                // config-support-mysql, config-support-postgres, config-support-oracle, config-support-sqlite
                $dbSupport = '';
-               foreach( $this->parent->getDBTypes() as $type ) {
+               foreach ( $this->parent->getDBTypes() as $type ) {
                        $link = DatabaseBase::factory( $type )->getSoftwareLink();
                        $dbSupport .= wfMessage( "config-support-$type", $link )->plain() . "\n";
                }
@@ -552,7 +554,7 @@ class WebInstaller_Upgrade extends WebInstallerPage {
                        if ( $result ) {
                                // If they're going to possibly regenerate LocalSettings, we
                                // need to create the upgrade/secret keys. Bug 26481
-                               if( !$this->getVar( '_ExistingDBSettings' ) ) {
+                               if ( !$this->getVar( '_ExistingDBSettings' ) ) {
                                        $this->parent->generateKeys();
                                }
                                $this->setVar( '_UpgradeDone', true );
@@ -764,7 +766,7 @@ class WebInstaller_Name extends WebInstallerPage {
                // Make sure it won't conflict with any existing namespaces
                global $wgContLang;
                $nsIndex = $wgContLang->getNsIndex( $name );
-               if( $nsIndex !== false && $nsIndex !== NS_PROJECT ) {
+               if ( $nsIndex !== false && $nsIndex !== NS_PROJECT ) {
                        $this->parent->showError( 'config-ns-conflict', $name );
                        $retVal = false;
                }
@@ -812,13 +814,13 @@ class WebInstaller_Name extends WebInstallerPage {
 
                // Validate e-mail if provided
                $email = $this->getVar( '_AdminEmail' );
-               if( $email && !Sanitizer::validateEmail( $email ) ) {
+               if ( $email && !Sanitizer::validateEmail( $email ) ) {
                        $this->parent->showError( 'config-admin-error-bademail' );
                        $retVal = false;
                }
                // If they asked to subscribe to mediawiki-announce but didn't give
                // an e-mail, show an error. Bug 29332
-               if( !$email && $this->getVar( '_Subscribe' ) ) {
+               if ( !$email && $this->getVar( '_Subscribe' ) ) {
                        $this->parent->showError( 'config-subscribe-noemail' );
                        $retVal = false;
                }
@@ -911,10 +913,10 @@ class WebInstaller_Options extends WebInstallerPage {
 
                $extensions = $this->parent->findExtensions();
 
-               if( $extensions ) {
+               if ( $extensions ) {
                        $extHtml = $this->getFieldSetStart( 'config-extensions' );
 
-                       foreach( $extensions as $ext ) {
+                       foreach ( $extensions as $ext ) {
                                $extHtml .= $this->parent->getCheckBox( array(
                                        'var' => "ext-$ext",
                                        'rawtext' => $ext,
@@ -974,7 +976,7 @@ class WebInstaller_Options extends WebInstallerPage {
                );
 
                $caches = array( 'none' );
-               if( count( $this->getVar( '_Caches' ) ) ) {
+               if ( count( $this->getVar( '_Caches' ) ) ) {
                        $caches[] = 'accel';
                }
                $caches[] = 'memcached';
@@ -987,7 +989,7 @@ class WebInstaller_Options extends WebInstallerPage {
                        // or going back!
                        $cacheval = 'none';
                }
-               $hidden = ($cacheval == 'memcached') ? '' : 'display: none';
+               $hidden = ( $cacheval == 'memcached' ) ? '' : 'display: none';
                $this->addHTML(
                        # Advanced settings
                        $this->getFieldSetStart( 'config-advanced-settings' ) .
@@ -1054,7 +1056,7 @@ class WebInstaller_Options extends WebInstallerPage {
                } else {
                        $iframeAttribs['src'] = $this->getCCPartnerUrl();
                }
-               $wrapperStyle = ($this->getVar( '_LicenseCode' ) == 'cc-choose') ? '' : 'display: none';
+               $wrapperStyle = ( $this->getVar( '_LicenseCode' ) == 'cc-choose' ) ? '' : 'display: none';
 
                return "<div class=\"config-cc-wrapper\" id=\"config-cc-wrapper\" style=\"$wrapperStyle\">\n" .
                        Html::element( 'iframe', $iframeAttribs, '', false /* not short */ ) .
@@ -1139,31 +1141,31 @@ class WebInstaller_Options extends WebInstallerPage {
 
                $extsAvailable = $this->parent->findExtensions();
                $extsToInstall = array();
-               foreach( $extsAvailable as $ext ) {
-                       if( $this->parent->request->getCheck( 'config_ext-' . $ext ) ) {
+               foreach ( $extsAvailable as $ext ) {
+                       if ( $this->parent->request->getCheck( 'config_ext-' . $ext ) ) {
                                $extsToInstall[] = $ext;
                        }
                }
                $this->parent->setVar( '_Extensions', $extsToInstall );
 
-               if( $this->getVar( 'wgMainCacheType' ) == 'memcached' ) {
+               if ( $this->getVar( 'wgMainCacheType' ) == 'memcached' ) {
                        $memcServers = explode( "\n", $this->getVar( '_MemCachedServers' ) );
-                       if( !$memcServers ) {
+                       if ( !$memcServers ) {
                                $this->parent->showError( 'config-memcache-needservers' );
                                return false;
                        }
 
-                       foreach( $memcServers as $server ) {
+                       foreach ( $memcServers as $server ) {
                                $memcParts = explode( ":", $server, 2 );
                                if ( !isset( $memcParts[0] )
                                                || ( !IP::isValid( $memcParts[0] )
                                                        && ( gethostbyname( $memcParts[0] ) == $memcParts[0] ) ) ) {
                                        $this->parent->showError( 'config-memcache-badip', $memcParts[0] );
                                        return false;
-                               } elseif( !isset( $memcParts[1] )  ) {
+                               } elseif ( !isset( $memcParts[1] ) ) {
                                        $this->parent->showError( 'config-memcache-noport', $memcParts[0] );
                                        return false;
-                               } elseif( $memcParts[1] < 1 || $memcParts[1] > 65535 ) {
+                               } elseif ( $memcParts[1] < 1 || $memcParts[1] > 65535 ) {
                                        $this->parent->showError( 'config-memcache-badport', 1, 65535 );
                                        return false;
                                }
@@ -1180,11 +1182,11 @@ class WebInstaller_Install extends WebInstallerPage {
        }
 
        public function execute() {
-               if( $this->getVar( '_UpgradeDone' ) ) {
+               if ( $this->getVar( '_UpgradeDone' ) ) {
                        return 'skip';
-               } elseif( $this->getVar( '_InstallDone' ) ) {
+               } elseif ( $this->getVar( '_InstallDone' ) ) {
                        return 'continue';
-               } elseif( $this->parent->request->wasPosted() ) {
+               } elseif ( $this->parent->request->wasPosted() ) {
                        $this->startForm();
                        $this->addHTML( "<ul>" );
                        $results = $this->parent->performInstallation(
@@ -1227,7 +1229,7 @@ class WebInstaller_Install extends WebInstallerPage {
                        $html = "<span class=\"error\">$html</span>";
                }
                $this->addHTML( $html . "</li>\n" );
-               if( !$status->isGood() ) {
+               if ( !$status->isGood() ) {
                        $this->parent->showStatusBox( $status );
                }
        }
@@ -1302,7 +1304,7 @@ abstract class WebInstaller_Document extends WebInstallerPage {
 
        public function getFileContents() {
                $file = __DIR__ . '/../../' . $this->getFileName();
-               if( ! file_exists( $file ) ) {
+               if ( ! file_exists( $file ) ) {
                        return wfMessage( 'config-nofile', $file )->plain();
                }
                return file_get_contents( $file );
@@ -1320,7 +1322,7 @@ class WebInstaller_ReleaseNotes extends WebInstaller_Document {
        protected function getFileName() {
                global $wgVersion;
 
-               if( !preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) {
+               if ( !preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) {
                        throw new MWException( 'Variable $wgVersion has an invalid value.' );
                }
 
index a765d5d..bb6fb04 100644 (file)
@@ -68,7 +68,7 @@ abstract class Job {
         */
        public static function factory( $command, Title $title, $params = false, $id = 0 ) {
                global $wgJobClasses;
-               if( isset( $wgJobClasses[$command] ) ) {
+               if ( isset( $wgJobClasses[$command] ) ) {
                        $class = $wgJobClasses[$command];
                        return new $class( $title, $params, $id );
                }
@@ -213,10 +213,10 @@ abstract class Job {
         */
        public function getDeduplicationInfo() {
                $info = array(
-                       'type'      => $this->getType(),
+                       'type' => $this->getType(),
                        'namespace' => $this->getTitle()->getNamespace(),
-                       'title'     => $this->getTitle()->getDBkey(),
-                       'params'    => $this->getParams()
+                       'title' => $this->getTitle()->getDBkey(),
+                       'params' => $this->getParams()
                );
                if ( is_array( $info['params'] ) ) {
                        // Identical jobs with different "root" jobs should count as duplicates
index c364209..9434da0 100644 (file)
@@ -91,7 +91,7 @@ class JobQueueAggregatorMemc extends JobQueueAggregator {
                        if ( $this->cache->add( "$key:rebuild", 1, 1800 ) ) { // lock
                                $pendingDbInfo = array(
                                        'pendingDBs' => $this->findPendingWikiQueues(),
-                                       'timestamp'  => time()
+                                       'timestamp' => time()
                                );
                                for ( $attempts = 1; $attempts <= 25; ++$attempts ) {
                                        if ( $this->cache->add( "$key:lock", 1, 60 ) ) { // lock
index a685fe3..6f4f6d9 100644 (file)
@@ -225,7 +225,7 @@ class JobQueueDB extends JobQueue {
                                $res = $dbw->select( 'job', 'job_sha1',
                                        array(
                                                // No job_type condition since it's part of the job_sha1 hash
-                                               'job_sha1'  => array_keys( $rowSet ),
+                                               'job_sha1' => array_keys( $rowSet ),
                                                'job_token' => '' // unclaimed
                                        ),
                                        $method
@@ -292,7 +292,7 @@ class JobQueueDB extends JobQueue {
                        $title = Title::makeTitleSafe( $row->job_namespace, $row->job_title );
                        if ( !$title ) {
                                $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
-                               wfDebugLog( 'JobQueueDB', "Row has invalid title '{$row->job_title}'." );
+                               wfDebug( "Row has invalid title '{$row->job_title}'." );
                                continue; // try again
                        }
                        $job = Job::factory( $row->job_cmd, $title,
@@ -300,7 +300,7 @@ class JobQueueDB extends JobQueue {
                        $job->metadata['id'] = $row->job_id;
                        $job->id = $row->job_id; // XXX: work around broken subclasses
                        break; // done
-               } while( true );
+               } while ( true );
 
                return $job;
        }
@@ -332,7 +332,7 @@ class JobQueueDB extends JobQueue {
                                $dir = $gte ? 'ASC' : 'DESC';
                                $row = $dbw->selectRow( 'job', '*', // find a random job
                                        array(
-                                               'job_cmd'   => $this->type,
+                                               'job_cmd' => $this->type,
                                                'job_token' => '', // unclaimed
                                                "job_random {$ineq} {$dbw->addQuotes( $rand )}" ),
                                        __METHOD__,
@@ -349,7 +349,7 @@ class JobQueueDB extends JobQueue {
                                // instead of job_random for reducing excess claim retries.
                                $row = $dbw->selectRow( 'job', '*', // find a random job
                                        array(
-                                               'job_cmd'   => $this->type,
+                                               'job_cmd' => $this->type,
                                                'job_token' => '', // unclaimed
                                        ),
                                        __METHOD__,
@@ -364,7 +364,7 @@ class JobQueueDB extends JobQueue {
                        if ( $row ) { // claim the job
                                $dbw->update( 'job', // update by PK
                                        array(
-                                               'job_token'           => $uuid,
+                                               'job_token' => $uuid,
                                                'job_token_timestamp' => $dbw->timestamp(),
                                                'job_attempts = job_attempts+1' ),
                                        array( 'job_cmd' => $this->type, 'job_id' => $row->job_id, 'job_token' => '' ),
@@ -415,7 +415,7 @@ class JobQueueDB extends JobQueue {
                                // This uses as much of the DB wrapper functions as possible.
                                $dbw->update( 'job',
                                        array(
-                                               'job_token'           => $uuid,
+                                               'job_token' => $uuid,
                                                'job_token_timestamp' => $dbw->timestamp(),
                                                'job_attempts = job_attempts+1' ),
                                        array( 'job_id = (' .
@@ -434,7 +434,7 @@ class JobQueueDB extends JobQueue {
                                        array( 'job_cmd' => $this->type, 'job_token' => $uuid ), __METHOD__
                                );
                                if ( !$row ) { // raced out by duplicate job removal
-                                       wfDebugLog( 'JobQueueDB', "Row deleted as duplicate by another process." );
+                                       wfDebug( "Row deleted as duplicate by another process." );
                                }
                        } else {
                                break; // nothing to do
@@ -514,7 +514,7 @@ class JobQueueDB extends JobQueue {
                return array(
                        'recycleAndDeleteStaleJobs' => array(
                                'callback' => array( $this, 'recycleAndDeleteStaleJobs' ),
-                               'period'   => ceil( $this->claimTTL / 2 )
+                               'period' => ceil( $this->claimTTL / 2 )
                        )
                );
        }
@@ -578,7 +578,11 @@ class JobQueueDB extends JobQueue {
                                        "job_attempts < {$dbw->addQuotes( $this->maxTries )}" ), // retries left
                                __METHOD__
                        );
-                       $ids = array_map( function( $o ) { return $o->job_id; }, iterator_to_array( $res ) );
+                       $ids = array_map(
+                               function( $o ) {
+                                       return $o->job_id;
+                               }, iterator_to_array( $res )
+                       );
                        if ( count( $ids ) ) {
                                // Reset job_token for these jobs so that other runners will pick them up.
                                // Set the timestamp to the current time, as it is useful to now that the job
@@ -610,7 +614,11 @@ class JobQueueDB extends JobQueue {
                // Get the IDs of jobs that are considered stale and should be removed. Selecting
                // the IDs first means that the UPDATE can be done by primary key (less deadlocks).
                $res = $dbw->select( 'job', 'job_id', $conds, __METHOD__ );
-               $ids = array_map( function( $o ) { return $o->job_id; }, iterator_to_array( $res ) );
+               $ids = array_map(
+                       function( $o ) {
+                               return $o->job_id;
+                       }, iterator_to_array( $res )
+               );
                if ( count( $ids ) ) {
                        $dbw->delete( 'job', array( 'job_id' => $ids ), __METHOD__ );
                        $count += $dbw->affectedRows();
@@ -681,7 +689,8 @@ class JobQueueDB extends JobQueue {
         */
        private function getCacheKey( $property ) {
                list( $db, $prefix ) = wfSplitWikiID( $this->wiki );
-               return wfForeignMemcKey( $db, $prefix, 'jobqueue', $this->type, $property );
+               $cluster = is_string( $this->cluster ) ? $this->cluster : 'main';
+               return wfForeignMemcKey( $db, $prefix, 'jobqueue', $cluster, $this->type, $property );
        }
 
        /**
index ed3c4f4..b517d55 100644 (file)
@@ -61,7 +61,7 @@ class JobQueueFederated extends JobQueue {
        protected $cache;
 
        const CACHE_TTL_SHORT = 30; // integer; seconds to cache info without re-validating
-       const CACHE_TTL_LONG  = 300; // integer; seconds to cache info that is kept up to date
+       const CACHE_TTL_LONG = 300; // integer; seconds to cache info that is kept up to date
 
        /**
         * @params include:
@@ -212,7 +212,7 @@ class JobQueueFederated extends JobQueue {
                $partitionRing = new HashRing( $partitionsTry );
                // Because jobs are spread across partitions, per-job de-duplication needs
                // to use a consistent hash to avoid allowing duplicate jobs per partition.
-               // When inserting a batch of de-duplicated jobs, QoS_Atomic is disregarded.
+               // When inserting a batch of de-duplicated jobs, QOS_ATOMIC is disregarded.
                $uJobsByPartition = array(); // (partition name => job list)
                foreach ( $jobs as $key => $job ) {
                        if ( $job->ignoreDuplicates() ) {
@@ -222,7 +222,7 @@ class JobQueueFederated extends JobQueue {
                        }
                }
                // Get the batches of jobs that are not de-duplicated
-               if ( $flags & self::QoS_Atomic ) {
+               if ( $flags & self::QOS_ATOMIC ) {
                        $nuJobBatches = array( $jobs ); // all or nothing
                } else {
                        // Split the jobs into batches and spread them out over servers if there
index f14f9fa..249ba27 100644 (file)
@@ -667,13 +667,13 @@ LUA;
                if ( $this->claimTTL > 0 ) {
                        $tasks['recycleAndDeleteStaleJobs'] = array(
                                'callback' => array( $this, 'recycleAndDeleteStaleJobs' ),
-                               'period'   => ceil( $this->claimTTL / 2 )
+                               'period' => ceil( $this->claimTTL / 2 )
                        );
                }
                if ( $this->checkDelay ) {
                        $tasks['releaseReadyDelayedJobs'] = array(
                                'callback' => array( $this, 'releaseReadyDelayedJobs' ),
-                               'period'   => 300 // 5 minutes
+                               'period' => 300 // 5 minutes
                        );
                }
                return $tasks;
index c5dd9ea..4fe1753 100644 (file)
@@ -82,11 +82,11 @@ class AssembleUploadChunksJob extends Job {
                        UploadBase::setSessionStatus(
                                $this->params['filekey'],
                                array(
-                                       'result'    => 'Success',
-                                       'stage'     => 'assembling',
-                                       'filekey'   => $newFileKey,
+                                       'result' => 'Success',
+                                       'stage' => 'assembling',
+                                       'filekey' => $newFileKey,
                                        'imageinfo' => $imageInfo,
-                                       'status'    => Status::newGood()
+                                       'status' => Status::newGood()
                                )
                        );
                } catch ( MWException $e ) {
@@ -94,7 +94,7 @@ class AssembleUploadChunksJob extends Job {
                                $this->params['filekey'],
                                array(
                                        'result' => 'Failure',
-                                       'stage'  => 'assembling',
+                                       'stage' => 'assembling',
                                        'status' => Status::newFatal( 'api-error-stashfailed' )
                                )
                        );
index 2be05b6..bbe988d 100644 (file)
@@ -35,7 +35,7 @@ class EnotifNotifyJob extends Job {
        function run() {
                $enotif = new EmailNotification();
                // Get the user from ID (rename safe). Anons are 0, so defer to name.
-               if( isset( $this->params['editorID'] ) && $this->params['editorID'] ) {
+               if ( isset( $this->params['editorID'] ) && $this->params['editorID'] ) {
                        $editor = User::newFromId( $this->params['editorID'] );
                // B/C, only the name might be given.
                } else {
index 376b388..44c240b 100644 (file)
@@ -154,7 +154,7 @@ class HTMLCacheUpdateJob extends Job {
                                        array(
                                                'table' => $this->params['table'],
                                                'start' => $start,
-                                               'end'   => $id - 1
+                                               'end' => $id - 1
                                        ) + $rootJobParams // carry over information for de-duplication
                                );
                                $start = $id;
@@ -167,7 +167,7 @@ class HTMLCacheUpdateJob extends Job {
                        array(
                                'table' => $this->params['table'],
                                'start' => $start,
-                               'end'   => $this->params['end']
+                               'end' => $this->params['end']
                        ) + $rootJobParams // carry over information for de-duplication
                );
                wfDebug( __METHOD__ . ": repartitioning into " . count( $jobs ) . " jobs\n" );
@@ -203,7 +203,7 @@ class HTMLCacheUpdateJob extends Job {
                                array(
                                        'table' => $this->params['table'],
                                        'start' => $start,
-                                       'end'   => $end,
+                                       'end' => $end,
                                ) + $rootJobParams // carry over information for de-duplication
                        );
                }
@@ -254,7 +254,7 @@ class HTMLCacheUpdateJob extends Job {
                }
 
                # Update file cache
-               if  ( $wgUseFileCache ) {
+               if ( $wgUseFileCache ) {
                        foreach ( $titleArray as $title ) {
                                HTMLFileCache::clearFileCache( $title );
                        }
index d3feda2..625e8aa 100644 (file)
@@ -94,11 +94,11 @@ class PublishStashedFileJob extends Job {
                        UploadBase::setSessionStatus(
                                $this->params['filekey'],
                                array(
-                                       'result'    => 'Success',
-                                       'stage'     => 'publish',
-                                       'filename'  => $upload->getLocalFile()->getName(),
+                                       'result' => 'Success',
+                                       'stage' => 'publish',
+                                       'filename' => $upload->getLocalFile()->getName(),
                                        'imageinfo' => $imageInfo,
-                                       'status'    => Status::newGood()
+                                       'status' => Status::newGood()
                                )
                        );
                } catch ( MWException $e ) {
@@ -106,7 +106,7 @@ class PublishStashedFileJob extends Job {
                                $this->params['filekey'],
                                array(
                                        'result' => 'Failure',
-                                       'stage'  => 'publish',
+                                       'stage' => 'publish',
                                        'status' => Status::newFatal( 'api-error-publishfailed' )
                                )
                        );
index 261ae63..4a5ecfc 100644 (file)
@@ -159,10 +159,10 @@ class RefreshLinksJob2 extends Job {
                                        list( $start, $end ) = $batch;
                                        $jobs[] = new RefreshLinksJob2( $this->title,
                                                array(
-                                                       'table'            => $table,
-                                                       'start'            => $start,
-                                                       'end'              => $end,
-                                                       'masterPos'        => $masterPos,
+                                                       'table' => $table,
+                                                       'start' => $start,
+                                                       'end' => $end,
+                                                       'masterPos' => $masterPos,
                                                ) + $this->getRootJobParams() // carry over information for de-duplication
                                        );
                                }
index 1e0e54f..ef9a2d4 100644 (file)
@@ -101,7 +101,7 @@ class DeleteLogFormatter extends LogFormatter {
 
                switch ( $this->entry->getSubtype() ) {
                case 'delete': // Show undelete link
-                       if( $user->isAllowed( 'undelete' ) ) {
+                       if ( $user->isAllowed( 'undelete' ) ) {
                                $message = 'undeletelink';
                        } else {
                                $message = 'undeleteviewlink';
@@ -147,8 +147,8 @@ class DeleteLogFormatter extends LogFormatter {
                                                $this->msg( 'diff' )->escaped(),
                                                array(),
                                                array(
-                                                       'target'    => $this->entry->getTarget()->getPrefixedDBkey(),
-                                                       'diff'      => 'prev',
+                                                       'target' => $this->entry->getTarget()->getPrefixedDBkey(),
+                                                       'diff' => 'prev',
                                                        'timestamp' => $ids[0]
                                                )
                                        );
index 0f20ed1..b99f16b 100644 (file)
@@ -151,7 +151,7 @@ class DatabaseLogEntry extends LogEntryBase {
                return array(
                        'tables' => $tables,
                        'fields' => $fields,
-                       'conds'  => array(),
+                       'conds' => array(),
                        'options' => array(),
                        'join_conds' => $joins,
                );
@@ -233,7 +233,7 @@ class DatabaseLogEntry extends LogEntryBase {
        }
 
        public function getPerformer() {
-               if( !$this->performer ) {
+               if ( !$this->performer ) {
                        $userId = (int) $this->row->log_user;
                        if ( $userId !== 0 ) { // logged-in users
                                if ( isset( $this->row->user_name ) ) {
@@ -291,7 +291,7 @@ class RCDatabaseLogEntry extends DatabaseLogEntry {
        }
 
        public function getPerformer() {
-               if( !$this->performer ) {
+               if ( !$this->performer ) {
                        $userId = (int) $this->row->rc_user;
                        if ( $userId !== 0 ) {
                                $this->performer = User::newFromId( $userId );
index fd598df..7025332 100644 (file)
@@ -76,7 +76,7 @@ class LogEventsList extends ContextSource {
                // If only one log type is used, then show a special message...
                $headerType = (count( $type ) == 1) ? $type[0] : '';
                $out = $this->getOutput();
-               if( LogPage::isLogType( $headerType ) ) {
+               if ( LogPage::isLogType( $headerType ) ) {
                        $page = new LogPage( $headerType );
                        $out->setPageTitle( $page->getName()->text() );
                        $out->addHTML( $page->getDescription()->parseAsBlock() );
@@ -104,7 +104,7 @@ class LogEventsList extends ContextSource {
                $title = SpecialPage::getTitleFor( 'Log' );
 
                // For B/C, we take strings, but make sure they are converted...
-               $types = ($types === '') ? array() : (array)$types;
+               $types = ( $types === '' ) ? array() : (array)$types;
 
                $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
 
@@ -156,7 +156,7 @@ class LogEventsList extends ContextSource {
                // Option value -> message mapping
                $links = array();
                $hiddens = ''; // keep track for "go" button
-               foreach( $filter as $type => $val ) {
+               foreach ( $filter as $type => $val ) {
                        // Should the below assignment be outside the foreach?
                        // Then it would have to be copied. Not certain what is more expensive.
                        $query = $this->getDefaultQuery();
@@ -212,7 +212,7 @@ class LogEventsList extends ContextSource {
        public function getTypeSelector() {
                $typesByName = array(); // Temporary array
                // First pass to load the log names
-               foreach( LogPage::validTypes() as $type ) {
+               foreach ( LogPage::validTypes() as $type ) {
                        $page = new LogPage( $type );
                        $restriction = $page->getRestriction();
                        if ( $this->getUser()->isAllowed( $restriction ) ) {
@@ -229,7 +229,7 @@ class LogEventsList extends ContextSource {
                $typesByName = array( '' => $public ) + $typesByName;
 
                $select = new XmlSelect( 'type' );
-               foreach( $typesByName as $type => $name ) {
+               foreach ( $typesByName as $type => $name ) {
                        $select->addOption( $name, $type );
                }
 
@@ -273,10 +273,10 @@ class LogEventsList extends ContextSource {
        private function getExtraInputs( $types ) {
                $offender = $this->getRequest()->getVal( 'offender' );
                $user = User::newFromName( $offender, false );
-               if( !$user || ( $user->getId() == 0 && !IP::isIPAddress( $offender ) ) ) {
+               if ( !$user || ( $user->getId() == 0 && !IP::isIPAddress( $offender ) ) ) {
                        $offender = ''; // Blank field if invalid
                }
-               if( count( $types ) == 1 && $types[0] == 'suppress' ) {
+               if ( count( $types ) == 1 && $types[0] == 'suppress' ) {
                        return Xml::inputLabel( $this->msg( 'revdelete-offender' )->text(), 'offender',
                                'mw-log-offender', 20, $offender );
                }
@@ -342,16 +342,16 @@ class LogEventsList extends ContextSource {
         * @return string
         */
        private function getShowHideLinks( $row ) {
-               if( ( $this->flags == self::NO_ACTION_LINK ) // we don't want to see the links
+               if ( ( $this->flags == self::NO_ACTION_LINK ) // we don't want to see the links
                        || $row->log_type == 'suppress' ) { // no one can hide items from the suppress log
                        return '';
                }
                $del = '';
                $user = $this->getUser();
                // Don't show useless checkbox to people who cannot hide log entries
-               if( $user->isAllowed( 'deletedhistory' ) ) {
+               if ( $user->isAllowed( 'deletedhistory' ) ) {
                        $canHide = $user->isAllowed( 'deletelogentry' );
-                       if( $row->log_deleted || $canHide ) {
+                       if ( $row->log_deleted || $canHide ) {
                                if ( $canHide && $this->flags & self::USE_REVDEL_CHECKBOXES ) { // Show checkboxes instead of links.
                                        if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) { // If event was hidden from sysops
                                                $del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
@@ -364,8 +364,8 @@ class LogEventsList extends ContextSource {
                                        } else {
                                                $query = array(
                                                        'target' => SpecialPage::getTitleFor( 'Log', $row->log_type )->getPrefixedDBkey(),
-                                                       'type'   => 'logging',
-                                                       'ids'    => $row->log_id,
+                                                       'type' => 'logging',
+                                                       'ids' => $row->log_id,
                                                );
                                                $del = Linker::revDeleteLink( $query, self::isDeleted( $row, LogPage::DELETED_RESTRICTED ), $canHide );
                                        }
@@ -385,10 +385,10 @@ class LogEventsList extends ContextSource {
        public static function typeAction( $row, $type, $action, $right = '' ) {
                $match = is_array( $type ) ?
                        in_array( $row->log_type, $type ) : $row->log_type == $type;
-               if( $match ) {
+               if ( $match ) {
                        $match = is_array( $action ) ?
                                in_array( $row->log_action, $action ) : $row->log_action == $action;
-                       if( $match && $right ) {
+                       if ( $match && $right ) {
                                global $wgUser;
                                $match = $wgUser->isAllowed( $right );
                        }
@@ -419,7 +419,7 @@ class LogEventsList extends ContextSource {
         * @return Boolean
         */
        public static function userCanBitfield( $bitfield, $field, User $user = null ) {
-               if( $bitfield & $field ) {
+               if ( $bitfield & $field ) {
                        if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
                                $permission = 'suppressrevision';
                        } else {
@@ -464,6 +464,7 @@ class LogEventsList extends ContextSource {
         *   set to '' to unset offset
         * - wrap String Wrap the message in html (usually something like "<div ...>$1</div>").
         * - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
+        * - useRequestParams boolean Set true to use Pager-related parameters in the WebRequest
         * @return Integer Number of total log items (not limited by $lim)
         */
        public static function showLogExtract(
@@ -475,7 +476,8 @@ class LogEventsList extends ContextSource {
                        'showIfEmpty' => true,
                        'msgKey' => array( '' ),
                        'wrap' => "$1",
-                       'flags' => 0
+                       'flags' => 0,
+                       'useRequestParams' => false,
                );
                # The + operator appends elements of remaining keys from the right
                # handed array to the left handed, whereas duplicated keys are NOT overwritten.
@@ -487,6 +489,7 @@ class LogEventsList extends ContextSource {
                $msgKey = $param['msgKey'];
                $wrap = $param['wrap'];
                $flags = $param['flags'];
+               $useRequestParams = $param['useRequestParams'];
                if ( !is_array( $msgKey ) ) {
                        $msgKey = array( $msgKey );
                }
@@ -500,13 +503,22 @@ class LogEventsList extends ContextSource {
                # Insert list of top 50 (or top $lim) items
                $loglist = new LogEventsList( $context, null, $flags );
                $pager = new LogPager( $loglist, $types, $user, $page, '', $conds );
+               if ( !$useRequestParams ) {
+                       # Reset vars that may have been taken from the request
+                       $pager->mLimit = 50;
+                       $pager->mDefaultLimit = 50;
+                       $pager->mOffset = "";
+                       $pager->mIsBackwards = false;
+               }
                if ( isset( $param['offset'] ) ) { # Tell pager to ignore WebRequest offset
                        $pager->setOffset( $param['offset'] );
                }
-               if( $lim > 0 ) $pager->mLimit = $lim;
+               if ( $lim > 0 ) {
+                       $pager->mLimit = $lim;
+               }
                $logBody = $pager->getBody();
                $s = '';
-               if( $logBody ) {
+               if ( $logBody ) {
                        if ( $msgKey[0] ) {
                                $s = '<div class="mw-warning-with-logexcerpt">';
 
@@ -521,26 +533,27 @@ class LogEventsList extends ContextSource {
                        $s .= $loglist->beginLogEventsList() .
                                $logBody .
                                $loglist->endLogEventsList();
-               } else {
-                       if ( $showIfEmpty ) {
-                               $s = Html::rawElement( 'div', array( 'class' => 'mw-warning-logempty' ),
-                                       $context->msg( 'logempty' )->parse() );
-                       }
+               } elseif ( $showIfEmpty ) {
+                       $s = Html::rawElement( 'div', array( 'class' => 'mw-warning-logempty' ),
+                               $context->msg( 'logempty' )->parse() );
                }
-               if( $pager->getNumRows() > $pager->mLimit ) { # Show "Full log" link
+               if ( $pager->getNumRows() > $pager->mLimit ) { # Show "Full log" link
                        $urlParam = array();
                        if ( $page instanceof Title ) {
                                $urlParam['page'] = $page->getPrefixedDBkey();
                        } elseif ( $page != '' ) {
                                $urlParam['page'] = $page;
                        }
-                       if ( $user != '' )
+                       if ( $user != '' ) {
                                $urlParam['user'] = $user;
-                       if ( !is_array( $types ) ) # Make it an array, if it isn't
+                       }
+                       if ( !is_array( $types ) ) { # Make it an array, if it isn't
                                $types = array( $types );
+                       }
                        # If there is exactly one log type, we can link to Special:Log?type=foo
-                       if ( count( $types ) == 1 )
+                       if ( count( $types ) == 1 ) {
                                $urlParam['type'] = $types[0];
+                       }
                        $s .= Linker::link(
                                SpecialPage::getTitleFor( 'Log' ),
                                $context->msg( 'log-fulllog' )->escaped(),
@@ -589,14 +602,14 @@ class LogEventsList extends ContextSource {
                $hiddenLogs = array();
 
                // Don't show private logs to unprivileged users
-               foreach( $wgLogRestrictions as $logType => $right ) {
-                       if( $audience == 'public' || !$user->isAllowed( $right ) ) {
+               foreach ( $wgLogRestrictions as $logType => $right ) {
+                       if ( $audience == 'public' || !$user->isAllowed( $right ) ) {
                                $hiddenLogs[] = $logType;
                        }
                }
-               if( count( $hiddenLogs ) == 1 ) {
+               if ( count( $hiddenLogs ) == 1 ) {
                        return 'log_type != ' . $db->addQuotes( $hiddenLogs[0] );
-               } elseif( $hiddenLogs ) {
+               } elseif ( $hiddenLogs ) {
                        return 'log_type NOT IN (' . $db->makeList( $hiddenLogs ) . ')';
                }
                return false;
index 683dc03..8f60aee 100644 (file)
@@ -194,9 +194,9 @@ class LogFormatter {
                // Text of title the action is aimed at.
                $target = $entry->getTarget()->getPrefixedText();
                $text = null;
-               switch( $entry->getType() ) {
+               switch ( $entry->getType() ) {
                        case 'move':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'move':
                                                $movesource = $parameters['4::target'];
                                                $text = wfMessage( '1movedto2' )
@@ -215,7 +215,7 @@ class LogFormatter {
                                break;
 
                        case 'delete':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'delete':
                                                $text = wfMessage( 'deletedarticle' )
                                                        ->rawParams( $target )->inContentLanguage()->escaped();
@@ -246,7 +246,7 @@ class LogFormatter {
                                break;
 
                        case 'protect':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                case 'protect':
                                        $text = wfMessage( 'protectedarticle' )
                                                ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
@@ -263,7 +263,7 @@ class LogFormatter {
                                break;
 
                        case 'newusers':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'newusers':
                                        case 'create':
                                                $text = wfMessage( 'newuserlog-create-entry' )
@@ -282,7 +282,7 @@ class LogFormatter {
                                break;
 
                        case 'upload':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'upload':
                                                $text = wfMessage( 'uploadedimage' )
                                                        ->rawParams( $target )->inContentLanguage()->escaped();
@@ -305,7 +305,7 @@ class LogFormatter {
                                } else {
                                        $newgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
                                }
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'rights':
                                                $text = wfMessage( 'rightslogentry' )
                                                        ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
@@ -320,7 +320,7 @@ class LogFormatter {
                        // case 'suppress' --private log -- aaron  (sign your messages so we know who to blame in a few years :-D)
                        // default:
                }
-               if( is_null( $text ) ) {
+               if ( is_null( $text ) ) {
                        $text = $this->getPlainActionText();
                }
 
@@ -479,7 +479,7 @@ class LogFormatter {
        protected function formatParameterValue( $type, $value ) {
                $saveLinkFlood = $this->linkFlood;
 
-               switch( strtolower( trim( $type ) ) ) {
+               switch ( strtolower( trim( $type ) ) ) {
                        case 'raw':
                                $value = Message::rawParam( $value );
                                break;
@@ -775,7 +775,7 @@ class LegacyLogFormatter extends LogFormatter {
                        return $this->msg( 'parentheses' )->rawParams(
                                $this->context->getLanguage()->pipeList( $links ) )->escaped();
                // Show unmerge link
-               } elseif( $type == 'merge' && $subtype == 'merge' ) {
+               } elseif ( $type == 'merge' && $subtype == 'merge' ) {
                        if ( !$this->context->getUser()->isAllowed( 'mergehistory' ) ) {
                                return '';
                        }
index 36ba200..9d6ab25 100644 (file)
@@ -94,7 +94,7 @@ class LogPage {
                $newId = !is_null( $log_id ) ? $log_id : $dbw->insertId();
 
                # And update recentchanges
-               if( $this->updateRecentChanges ) {
+               if ( $this->updateRecentChanges ) {
                        $titleObj = SpecialPage::getTitleFor( 'Log', $this->type );
 
                        RecentChange::notifyLog(
@@ -102,9 +102,9 @@ class LogPage {
                                $this->type, $this->action, $this->target, $this->comment,
                                $this->params, $newId, $this->getRcCommentIRC()
                        );
-               } elseif( $this->sendToUDP ) {
+               } elseif ( $this->sendToUDP ) {
                        # Don't send private logs to UDP
-                       if( isset( $wgLogRestrictions[$this->type] ) && $wgLogRestrictions[$this->type] != '*' ) {
+                       if ( isset( $wgLogRestrictions[$this->type] ) && $wgLogRestrictions[$this->type] != '*' ) {
                                return $newId;
                        }
 
@@ -129,7 +129,7 @@ class LogPage {
        public function getRcComment() {
                $rcComment = $this->actionText;
 
-               if( $this->comment != '' ) {
+               if ( $this->comment != '' ) {
                        if ( $rcComment == '' ) {
                                $rcComment = $this->comment;
                        } else {
@@ -149,7 +149,7 @@ class LogPage {
        public function getRcCommentIRC() {
                $rcComment = $this->ircActionText;
 
-               if( $this->comment != '' ) {
+               if ( $this->comment != '' ) {
                        if ( $rcComment == '' ) {
                                $rcComment = $this->comment;
                        } else {
@@ -198,7 +198,7 @@ class LogPage {
        public static function logName( $type ) {
                global $wgLogNames;
 
-               if( isset( $wgLogNames[$type] ) ) {
+               if ( isset( $wgLogNames[$type] ) ) {
                        return str_replace( '_', ' ', wfMessage( $wgLogNames[$type] )->text() );
                } else {
                        // Bogus log types? Perhaps an extension was removed.
@@ -247,13 +247,13 @@ class LogPage {
 
                $key = "$type/$action";
 
-               if( isset( $wgLogActions[$key] ) ) {
-                       if( is_null( $title ) ) {
+               if ( isset( $wgLogActions[$key] ) ) {
+                       if ( is_null( $title ) ) {
                                $rv = wfMessage( $wgLogActions[$key] )->inLanguage( $langObj )->escaped();
                        } else {
                                $titleLink = self::getTitleLink( $type, $langObjOrNull, $title, $params );
 
-                               if( count( $params ) == 0 ) {
+                               if ( count( $params ) == 0 ) {
                                        $rv = wfMessage( $wgLogActions[$key] )->rawParams( $titleLink )->inLanguage( $langObj )->escaped();
                                } else {
                                        $details = '';
@@ -273,14 +273,14 @@ class LogPage {
                                        // Page protections
                                        } elseif ( $type == 'protect' && count( $params ) == 3 ) {
                                                // Restrictions and expiries
-                                               if( $skin ) {
+                                               if ( $skin ) {
                                                        $details .= $wgLang->getDirMark() . htmlspecialchars( " {$params[1]}" );
                                                } else {
                                                        $details .= " {$params[1]}";
                                                }
 
                                                // Cascading flag...
-                                               if( $params[2] ) {
+                                               if ( $params[2] ) {
                                                        $details .= ' [' . wfMessage( 'protect-summary-cascade' )->inLanguage( $langObj )->text() . ']';
                                                }
                                        }
@@ -291,7 +291,7 @@ class LogPage {
                } else {
                        global $wgLogActionsHandlers;
 
-                       if( isset( $wgLogActionsHandlers[$key] ) ) {
+                       if ( isset( $wgLogActionsHandlers[$key] ) ) {
                                $args = func_get_args();
                                $rv = call_user_func_array( $wgLogActionsHandlers[$key], $args );
                        } else {
@@ -310,7 +310,7 @@ class LogPage {
                // you want to link to something OTHER than the title of the log entry.
                // The real problem, which Erik was trying to fix (and it sort-of works now) is
                // that the same messages are being treated as both wikitext *and* HTML.
-               if( $filterWikilinks ) {
+               if ( $filterWikilinks ) {
                        $rv = str_replace( '[[', '', $rv );
                        $rv = str_replace( ']]', '', $rv );
                }
@@ -327,11 +327,11 @@ class LogPage {
         * @return String
         */
        protected static function getTitleLink( $type, $lang, $title, &$params ) {
-               if( !$lang ) {
+               if ( !$lang ) {
                        return $title->getPrefixedText();
                }
 
-               switch( $type ) {
+               switch ( $type ) {
                        case 'move':
                                $titleLink = Linker::link(
                                        $title,
@@ -353,7 +353,7 @@ class LogPage {
                                }
                                break;
                        case 'block':
-                               if( substr( $title->getText(), 0, 1 ) == '#' ) {
+                               if ( substr( $title->getText(), 0, 1 ) == '#' ) {
                                        $titleLink = $title->getText();
                                } else {
                                        // @todo Store the user identifier in the parameters
@@ -377,11 +377,11 @@ class LogPage {
                                $params[1] = $lang->timeanddate( $params[1] );
                                break;
                        default:
-                               if( $title->isSpecialPage() ) {
+                               if ( $title->isSpecialPage() ) {
                                        list( $name, $par ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
 
                                        # Use the language name for log titles, rather than Log/X
-                                       if( $name == 'Log' ) {
+                                       if ( $name == 'Log' ) {
                                                $logPage = new LogPage( $par );
                                                $titleLink = Linker::link( $title, $logPage->getName()->escaped() );
                                                $titleLink = wfMessage( 'parentheses' )
@@ -465,13 +465,13 @@ class LogPage {
         * @return Boolean
         */
        public function addRelations( $field, $values, $logid ) {
-               if( !strlen( $field ) || empty( $values ) ) {
+               if ( !strlen( $field ) || empty( $values ) ) {
                        return false; // nothing
                }
 
                $data = array();
 
-               foreach( $values as $value ) {
+               foreach ( $values as $value ) {
                        $data[] = array(
                                'ls_field' => $field,
                                'ls_value' => $value,
@@ -520,8 +520,8 @@ class LogPage {
        public static function formatBlockFlags( $flags, $lang ) {
                $flags = explode( ',', trim( $flags ) );
 
-               if( count( $flags ) > 0 ) {
-                       for( $i = 0; $i < count( $flags ); $i++ ) {
+               if ( count( $flags ) > 0 ) {
+                       for ( $i = 0; $i < count( $flags ); $i++ ) {
                                $flags[$i] = self::formatBlockFlag( $flags[$i], $lang );
                        }
                        return wfMessage( 'parentheses' )->inLanguage( $lang )
@@ -541,7 +541,7 @@ class LogPage {
        public static function formatBlockFlag( $flag, $lang ) {
                static $messages = array();
 
-               if( !isset( $messages[$flag] ) ) {
+               if ( !isset( $messages[$flag] ) ) {
                        $messages[$flag] = htmlspecialchars( $flag ); // Fallback
 
                        // For grepping. The following core messages can be used here:
index 908755e..5ffad43 100644 (file)
@@ -71,16 +71,17 @@ class LogPager extends ReverseChronologicalPager {
        public function getFilterParams() {
                global $wgFilterLogTypes;
                $filters = array();
-               if( count( $this->types ) ) {
+               if ( count( $this->types ) ) {
                        return $filters;
                }
-               foreach( $wgFilterLogTypes as $type => $default ) {
+               foreach ( $wgFilterLogTypes as $type => $default ) {
                        // Avoid silly filtering
-                       if( $type !== 'patrol' || $this->getUser()->useNPPatrol() ) {
+                       if ( $type !== 'patrol' || $this->getUser()->useNPPatrol() ) {
                                $hide = $this->getRequest()->getInt( "hide_{$type}_log", $default );
                                $filters[$type] = $hide;
-                               if( $hide )
+                               if ( $hide ) {
                                        $this->mConds[] = 'log_type != ' . $this->mDb->addQuotes( $type );
+                               }
                        }
                }
                return $filters;
@@ -98,11 +99,11 @@ class LogPager extends ReverseChronologicalPager {
 
                $user = $this->getUser();
                // If $types is not an array, make it an array
-               $types = ($types === '') ? array() : (array)$types;
+               $types = ( $types === '' ) ? array() : (array)$types;
                // Don't even show header for private logs; don't recognize it...
                $needReindex = false;
                foreach ( $types as $type ) {
-                       if( isset( $wgLogRestrictions[$type] )
+                       if ( isset( $wgLogRestrictions[$type] )
                                && !$user->isAllowed( $wgLogRestrictions[$type] )
                        ) {
                                $needReindex = true;
@@ -119,13 +120,15 @@ class LogPager extends ReverseChronologicalPager {
                // Also, only show them upon specific request to avoid suprises.
                $audience = $types ? 'user' : 'public';
                $hideLogs = LogEventsList::getExcludeClause( $this->mDb, $audience, $user );
-               if( $hideLogs !== false ) {
+               if ( $hideLogs !== false ) {
                        $this->mConds[] = $hideLogs;
                }
-               if( count( $types ) ) {
+               if ( count( $types ) ) {
                        $this->mConds['log_type'] = $types;
                        // Set typeCGI; used in url param for paging
-                       if( count( $types ) == 1 ) $this->typeCGI = $types[0];
+                       if ( count( $types ) == 1 ) {
+                               $this->typeCGI = $types[0];
+                       }
                }
        }
 
@@ -136,16 +139,16 @@ class LogPager extends ReverseChronologicalPager {
         * @return bool
         */
        private function limitPerformer( $name ) {
-               if( $name == '' ) {
+               if ( $name == '' ) {
                        return false;
                }
                $usertitle = Title::makeTitleSafe( NS_USER, $name );
-               if( is_null( $usertitle ) ) {
+               if ( is_null( $usertitle ) ) {
                        return false;
                }
                /* Fetch userid at first, if known, provides awesome query plan afterwards */
                $userid = User::idFromName( $name );
-               if( !$userid ) {
+               if ( !$userid ) {
                        /* It should be nicer to abort query at all,
                           but for now it won't pass anywhere behind the optimizer */
                        $this->mConds[] = "NULL";
@@ -153,9 +156,9 @@ class LogPager extends ReverseChronologicalPager {
                        $this->mConds['log_user'] = $userid;
                        // Paranoia: avoid brute force searches (bug 17342)
                        $user = $this->getUser();
-                       if( !$user->isAllowed( 'deletedhistory' ) ) {
+                       if ( !$user->isAllowed( 'deletedhistory' ) ) {
                                $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::DELETED_USER ) . ' = 0';
-                       } elseif( !$user->isAllowed( 'suppressrevision' ) ) {
+                       } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
                                $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::SUPPRESSED_USER ) .
                                        ' != ' . LogPage::SUPPRESSED_USER;
                        }
@@ -178,7 +181,7 @@ class LogPager extends ReverseChronologicalPager {
                        $title = $page;
                } else {
                        $title = Title::newFromText( $page );
-                       if( strlen( $page ) == 0 || !$title instanceof Title ) {
+                       if ( strlen( $page ) == 0 || !$title instanceof Title ) {
                                return false;
                        }
                }
@@ -198,7 +201,7 @@ class LogPager extends ReverseChronologicalPager {
                # use the page_time index.  That should have no more than a few hundred
                # log entries for even the busiest pages, so it can be safely scanned
                # in full to satisfy an impossible condition on user or similar.
-               if( $pattern && !$wgMiserMode ) {
+               if ( $pattern && !$wgMiserMode ) {
                        $this->mConds['log_namespace'] = $ns;
                        $this->mConds[] = 'log_title ' . $db->buildLike( $title->getDBkey(), $db->anyString() );
                        $this->pattern = $pattern;
@@ -208,9 +211,9 @@ class LogPager extends ReverseChronologicalPager {
                }
                // Paranoia: avoid brute force searches (bug 17342)
                $user = $this->getUser();
-               if( !$user->isAllowed( 'deletedhistory' ) ) {
+               if ( !$user->isAllowed( 'deletedhistory' ) ) {
                        $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::DELETED_ACTION) . ' = 0';
-               } elseif( !$user->isAllowed( 'suppressrevision' ) ) {
+               } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
                        $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::SUPPRESSED_ACTION) .
                                ' != ' . LogPage::SUPPRESSED_ACTION;
                }
@@ -234,7 +237,7 @@ class LogPager extends ReverseChronologicalPager {
                # Add log_search table if there are conditions on it.
                # This filters the results to only include log rows that have
                # log_search records with the specified ls_field and ls_value values.
-               if( array_key_exists( 'ls_field', $this->mConds ) ) {
+               if ( array_key_exists( 'ls_field', $this->mConds ) ) {
                        $tables[] = 'log_search';
                        $index['log_search'] = 'ls_field_val';
                        $index['logging'] = 'PRIMARY';
@@ -249,12 +252,12 @@ class LogPager extends ReverseChronologicalPager {
                # Avoid usage of the wrong index by limiting
                # the choices of available indexes. This mainly
                # avoids site-breaking filesorts.
-               } elseif( $this->title || $this->pattern || $this->performer ) {
+               } elseif ( $this->title || $this->pattern || $this->performer ) {
                        $index['logging'] = array( 'page_time', 'user_time' );
-                       if( count( $this->types ) == 1 ) {
+                       if ( count( $this->types ) == 1 ) {
                                $index['logging'][] = 'log_user_type_time';
                        }
-               } elseif( count( $this->types ) == 1 ) {
+               } elseif ( count( $this->types ) == 1 ) {
                        $index['logging'] = 'type_time';
                } else {
                        $index['logging'] = 'times';
@@ -264,10 +267,10 @@ class LogPager extends ReverseChronologicalPager {
                $joins['log_search'] = array( 'INNER JOIN', 'ls_log_id=log_id' );
 
                $info = array(
-                       'tables'     => $tables,
-                       'fields'     => $fields,
-                       'conds'      => array_merge( $conds, $this->mConds ),
-                       'options'    => $options,
+                       'tables' => $tables,
+                       'fields' => $fields,
+                       'conds' => array_merge( $conds, $this->mConds ),
+                       'options' => $options,
                        'join_conds' => $joins,
                );
                # Add ChangeTags filter query
@@ -295,7 +298,7 @@ class LogPager extends ReverseChronologicalPager {
        public function getStartBody() {
                wfProfileIn( __METHOD__ );
                # Do a link batch query
-               if( $this->getNumRows() > 0 ) {
+               if ( $this->getNumRows() > 0 ) {
                        $lb = new LinkBatch;
                        foreach ( $this->mResult as $row ) {
                                $lb->add( $row->log_namespace, $row->log_title );
index 8dafb4a..589b1ba 100644 (file)
@@ -73,7 +73,7 @@ class MoveLogFormatter extends LogFormatter {
                        array(
                                'wpOldTitle' => $destTitle->getPrefixedDBkey(),
                                'wpNewTitle' => $this->entry->getTarget()->getPrefixedDBkey(),
-                               'wpReason'   => $this->msg( 'revertmove' )->inContentLanguage()->text(),
+                               'wpReason' => $this->msg( 'revertmove' )->inContentLanguage()->text(),
                                'wpMovetalk' => 0
                        )
                );
index e1bacf3..99b7741 100644 (file)
@@ -58,7 +58,7 @@ class BmpHandler extends BitmapHandler {
         */
        function getImageSize( $image, $filename ) {
                $f = fopen( $filename, 'rb' );
-               if( !$f ) {
+               if ( !$f ) {
                        return false;
                }
                $header = fread( $f, 54 );
index 1d8337d..1ce3d5e 100644 (file)
@@ -398,7 +398,7 @@ class BitmapHandler extends ImageHandler {
                                        $im->sharpenImage( $radius, $sigma );
                                }
                                $im->setCompressionQuality( 80 );
-                       } elseif( $params['mimeType'] == 'image/png' ) {
+                       } elseif ( $params['mimeType'] == 'image/png' ) {
                                $im->setCompressionQuality( 95 );
                        } elseif ( $params['mimeType'] == 'image/gif' ) {
                                if ( $this->getImageArea( $image ) > $wgMaxAnimatedGifArea ) {
index 3876c52..7c39c81 100644 (file)
@@ -156,7 +156,7 @@ class BitmapMetadataHandler {
                        $meta->addMetadata( Array( 'JPEGFileComment' => $seg['COM'] ), 'native' );
                }
                if ( isset( $seg['PSIR'] ) && count( $seg['PSIR'] ) > 0 ) {
-                       foreach( $seg['PSIR'] as $curPSIRValue ) {
+                       foreach ( $seg['PSIR'] as $curPSIRValue ) {
                                $meta->doApp13( $curPSIRValue );
                        }
                }
@@ -286,11 +286,13 @@ class BitmapMetadataHandler {
         */
        static function getTiffByteOrder( $filename ) {
                $fh = fopen( $filename, 'rb' );
-               if ( !$fh ) return false;
+               if ( !$fh ) {
+                       return false;
+               }
                $head = fread( $fh, 2 );
                fclose( $fh );
 
-               switch( $head ) {
+               switch ( $head ) {
                        case 'II':
                                return 'LE'; // II for intel.
                        case 'MM':
index a7aa82f..8d4e033 100644 (file)
@@ -246,12 +246,11 @@ class DjVuHandler extends ImageHandler {
                        $image->dejaMetaTree = false;
                        $image->djvuTextTree = false;
                        $tree = new SimpleXMLElement( $metadata );
-                       if( $tree->getName() == 'mw-djvu' ) {
-                               foreach( $tree->children() as $b ) {
-                                       if( $b->getName() == 'DjVuTxt' ) {
+                       if ( $tree->getName() == 'mw-djvu' ) {
+                               foreach ( $tree->children() as $b ) {
+                                       if ( $b->getName() == 'DjVuTxt' ) {
                                                $image->djvuTextTree = $b;
-                                       }
-                                       elseif ( $b->getName() == 'DjVuXML' ) {
+                                       } elseif ( $b->getName() == 'DjVuXML' ) {
                                                $image->dejaMetaTree = $b;
                                        }
                                }
@@ -263,7 +262,7 @@ class DjVuHandler extends ImageHandler {
                }
                wfRestoreWarnings();
                wfProfileOut( __METHOD__ );
-               if( $gettext ) {
+               if ( $gettext ) {
                        return $image->djvuTextTree;
                } else {
                        return $image->dejaMetaTree;
index 5d31898..54efe7a 100644 (file)
@@ -64,7 +64,7 @@ class DjVuImage {
        public function getImageSize() {
                $data = $this->getInfo();
 
-               if( $data !== false ) {
+               if ( $data !== false ) {
                        $width = $data['width'];
                        $height = $data['height'];
 
@@ -93,20 +93,20 @@ class DjVuImage {
                $start = ftell( $file );
                $secondary = fread( $file, 4 );
                echo str_repeat( ' ', $indent * 4 ) . "($secondary)\n";
-               while( ftell( $file ) - $start < $length ) {
+               while ( ftell( $file ) - $start < $length ) {
                        $chunkHeader = fread( $file, 8 );
-                       if( $chunkHeader == '' ) {
+                       if ( $chunkHeader == '' ) {
                                break;
                        }
                        // @todo FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
                        extract( unpack( 'a4chunk/NchunkLength', $chunkHeader ) );
                        echo str_repeat( ' ', $indent * 4 ) . "$chunk $chunkLength\n";
 
-                       if( $chunk == 'FORM' ) {
+                       if ( $chunk == 'FORM' ) {
                                $this->dumpForm( $file, $chunkLength, $indent + 1 );
                        } else {
                                fseek( $file, $chunkLength, SEEK_CUR );
-                               if( $chunkLength & 1 == 1 ) {
+                               if ( $chunkLength & 1 == 1 ) {
                                        // Padding byte between chunks
                                        fseek( $file, 1, SEEK_CUR );
                                }
@@ -118,7 +118,7 @@ class DjVuImage {
                wfSuppressWarnings();
                $file = fopen( $this->mFilename, 'rb' );
                wfRestoreWarnings();
-               if( $file === false ) {
+               if ( $file === false ) {
                        wfDebug( __METHOD__ . ": missing or failed file read\n" );
                        return false;
                }
@@ -126,21 +126,21 @@ class DjVuImage {
                $header = fread( $file, 16 );
                $info = false;
 
-               if( strlen( $header ) < 16 ) {
+               if ( strlen( $header ) < 16 ) {
                        wfDebug( __METHOD__ . ": too short file header\n" );
                } else {
                        // @todo FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
                        extract( unpack( 'a4magic/a4form/NformLength/a4subtype', $header ) );
 
-                       if( $magic != 'AT&T' ) {
+                       if ( $magic != 'AT&T' ) {
                                wfDebug( __METHOD__ . ": not a DjVu file\n" );
-                       } elseif( $subtype == 'DJVU' ) {
+                       } elseif ( $subtype == 'DJVU' ) {
                                // Single-page document
                                $info = $this->getPageInfo( $file, $formLength );
-                       } elseif( $subtype == 'DJVM' ) {
+                       } elseif ( $subtype == 'DJVM' ) {
                                // Multi-page document
                                $info = $this->getMultiPageInfo( $file, $formLength );
-                       } else  {
+                       } else {
                                wfDebug( __METHOD__ . ": unrecognized DJVU file type '$formType'\n" );
                        }
                }
@@ -150,7 +150,7 @@ class DjVuImage {
 
        private function readChunk( $file ) {
                $header = fread( $file, 8 );
-               if( strlen( $header ) < 8 ) {
+               if ( strlen( $header ) < 8 ) {
                        return array( false, 0 );
                } else {
                        // @todo FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
@@ -162,7 +162,7 @@ class DjVuImage {
        private function skipChunk( $file, $chunkLength ) {
                fseek( $file, $chunkLength, SEEK_CUR );
 
-               if( $chunkLength & 0x01 == 1 && !feof( $file ) ) {
+               if ( $chunkLength & 0x01 == 1 && !feof( $file ) ) {
                        // padding byte
                        fseek( $file, 1, SEEK_CUR );
                }
@@ -174,13 +174,13 @@ class DjVuImage {
                $start = ftell( $file );
                do {
                        list( $chunk, $length ) = $this->readChunk( $file );
-                       if( !$chunk ) {
+                       if ( !$chunk ) {
                                break;
                        }
 
-                       if( $chunk == 'FORM' ) {
+                       if ( $chunk == 'FORM' ) {
                                $subtype = fread( $file, 4 );
-                               if( $subtype == 'DJVU' ) {
+                               if ( $subtype == 'DJVU' ) {
                                        wfDebug( __METHOD__ . ": found first subpage\n" );
                                        return $this->getPageInfo( $file, $length );
                                }
@@ -189,7 +189,7 @@ class DjVuImage {
                                wfDebug( __METHOD__ . ": skipping '$chunk' chunk\n" );
                                $this->skipChunk( $file, $length );
                        }
-               } while( $length != 0 && !feof( $file ) && ftell( $file ) - $start < $formLength );
+               } while ( $length != 0 && !feof( $file ) && ftell( $file ) - $start < $formLength );
 
                wfDebug( __METHOD__ . ": multi-page DJVU file contained no pages\n" );
                return false;
@@ -197,17 +197,17 @@ class DjVuImage {
 
        private function getPageInfo( $file, $formLength ) {
                list( $chunk, $length ) = $this->readChunk( $file );
-               if( $chunk != 'INFO' ) {
+               if ( $chunk != 'INFO' ) {
                        wfDebug( __METHOD__ . ": expected INFO chunk, got '$chunk'\n" );
                        return false;
                }
 
-               if( $length < 9 ) {
+               if ( $length < 9 ) {
                        wfDebug( __METHOD__ . ": INFO should be 9 or 10 bytes, found $length\n" );
                        return false;
                }
                $data = fread( $file, $length );
-               if( strlen( $data ) < $length ) {
+               if ( strlen( $data ) < $length ) {
                        wfDebug( __METHOD__ . ": INFO chunk cut off\n" );
                        return false;
                }
@@ -263,7 +263,7 @@ class DjVuImage {
                        $retval = '';
                        $txt = wfShellExec( $cmd, $retval, array(), array( 'memory' => self::DJVUTXT_MEMORY_LIMIT ) );
                        wfProfileOut( 'djvutxt' );
-                       if( $retval == 0 ) {
+                       if ( $retval == 0 ) {
                                # Strip some control characters
                                $txt = preg_replace( "/[\013\035\037]/", "", $txt );
                                $reg = <<<EOR
index 5581503..d7c45d3 100644 (file)
@@ -297,7 +297,7 @@ class Exif {
                }
 
                $this->debugFile( $this->basename, __FUNCTION__, true );
-               if( function_exists( 'exif_read_data' ) ) {
+               if ( function_exists( 'exif_read_data' ) ) {
                        wfSuppressWarnings();
                        $data = exif_read_data( $this->file, 0, true );
                        wfRestoreWarnings();
@@ -394,7 +394,7 @@ class Exif {
                //ComponentsConfiguration should really be an array instead of a string...
                //This turns a string of binary numbers into an array of numbers.
 
-               if ( isset ( $this->mFilteredExifData['ComponentsConfiguration'] ) ) {
+               if ( isset( $this->mFilteredExifData['ComponentsConfiguration'] ) ) {
                        $val = $this->mFilteredExifData['ComponentsConfiguration'];
                        $ccVals = array();
                        for ( $i = 0; $i < strlen( $val ); $i++ ) {
@@ -411,7 +411,7 @@ class Exif {
                //Also change exif tag name from GPSVersion (what php exif thinks it is)
                //to GPSVersionID (what the exif standard thinks it is).
 
-               if ( isset ( $this->mFilteredExifData['GPSVersion'] ) ) {
+               if ( isset( $this->mFilteredExifData['GPSVersion'] ) ) {
                        $val = $this->mFilteredExifData['GPSVersion'];
                        $newVal = '';
                        for ( $i = 0; $i < strlen( $val ); $i++ ) {
@@ -738,26 +738,27 @@ class Exif {
                $debug = "tag is '$tag'";
                $etype = $this->mExifTags[$section][$tag];
                $ecount = 1;
-               if( is_array( $etype ) ) {
+               if ( is_array( $etype ) ) {
                        list( $etype, $ecount ) = $etype;
-                       if ( $recursive )
+                       if ( $recursive ) {
                                $ecount = 1; // checking individual elements
+                       }
                }
                $count = count( $val );
-               if( $ecount != $count ) {
+               if ( $ecount != $count ) {
                        $this->debug( $val, __FUNCTION__, "Expected $ecount elements for $tag but got $count" );
                        return false;
                }
-               if( $count > 1 ) {
-                       foreach( $val as $v ) {
-                               if( !$this->validate( $section, $tag, $v, true ) ) {
+               if ( $count > 1 ) {
+                       foreach ( $val as $v ) {
+                               if ( !$this->validate( $section, $tag, $v, true ) ) {
                                        return false;
                                }
                        }
                        return true;
                }
                // Does not work if not typecast
-               switch( (string)$etype ) {
+               switch ( (string)$etype ) {
                        case (string)Exif::BYTE:
                                $this->debug( $val, __FUNCTION__, $debug );
                                return $this->isByte( $val );
index 5bcb484..276af4d 100644 (file)
@@ -127,9 +127,9 @@ class FormatMetadata {
 
                        foreach ( $vals as &$val ) {
 
-                               switch( $tag ) {
+                               switch ( $tag ) {
                                case 'Compression':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2: case 3: case 4:
                                        case 5: case 6: case 7: case 8:
                                        case 32773: case 32946: case 34712:
@@ -142,7 +142,7 @@ class FormatMetadata {
                                        break;
 
                                case 'PhotometricInterpretation':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 2: case 6:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -153,7 +153,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Orientation':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -164,7 +164,7 @@ class FormatMetadata {
                                        break;
 
                                case 'PlanarConfiguration':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -189,7 +189,7 @@ class FormatMetadata {
 
                                case 'XResolution':
                                case 'YResolution':
-                                       switch( $resolutionunit ) {
+                                       switch ( $resolutionunit ) {
                                                case 2:
                                                        $val = self::msg( 'XYResolution', 'i', self::formatNum( $val ) );
                                                        break;
@@ -208,7 +208,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ColorSpace':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 65535:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -219,7 +219,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ComponentsConfiguration':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 5: case 6:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -267,7 +267,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ExposureProgram':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -282,7 +282,7 @@ class FormatMetadata {
                                        break;
 
                                case 'MeteringMode':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 255:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -293,7 +293,7 @@ class FormatMetadata {
                                        break;
 
                                case 'LightSource':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 9: case 10: case 11:
                                        case 12: case 13: case 14: case 15: case 17: case 18: case 19: case 20:
                                        case 21: case 22: case 23: case 24: case 255:
@@ -307,11 +307,11 @@ class FormatMetadata {
 
                                case 'Flash':
                                        $flashDecode = array(
-                                               'fired'    => $val & bindec( '00000001' ),
-                                               'return'   => ( $val & bindec( '00000110' ) ) >> 1,
-                                               'mode'     => ( $val & bindec( '00011000' ) ) >> 3,
+                                               'fired' => $val & bindec( '00000001' ),
+                                               'return' => ( $val & bindec( '00000110' ) ) >> 1,
+                                               'mode' => ( $val & bindec( '00011000' ) ) >> 3,
                                                'function' => ( $val & bindec( '00100000' ) ) >> 5,
-                                               'redeye'   => ( $val & bindec( '01000000' ) ) >> 6,
+                                               'redeye' => ( $val & bindec( '01000000' ) ) >> 6,
 //                                             'reserved' => ($val & bindec( '10000000' )) >> 7,
                                        );
                                        $flashMsgs = array();
@@ -328,7 +328,7 @@ class FormatMetadata {
                                        break;
 
                                case 'FocalPlaneResolutionUnit':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -339,7 +339,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SensingMethod':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2: case 3: case 4: case 5: case 7: case 8:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -350,7 +350,7 @@ class FormatMetadata {
                                        break;
 
                                case 'FileSource':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -361,7 +361,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SceneType':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -372,7 +372,7 @@ class FormatMetadata {
                                        break;
 
                                case 'CustomRendered':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -383,7 +383,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ExposureMode':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -394,7 +394,7 @@ class FormatMetadata {
                                        break;
 
                                case 'WhiteBalance':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -405,7 +405,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SceneCaptureType':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -416,7 +416,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GainControl':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -427,7 +427,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Contrast':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -438,7 +438,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Saturation':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -449,7 +449,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Sharpness':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -460,7 +460,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SubjectDistanceRange':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -473,7 +473,7 @@ class FormatMetadata {
                                //The GPS...Ref values are kept for compatibility, probably won't be reached.
                                case 'GPSLatitudeRef':
                                case 'GPSDestLatitudeRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'N': case 'S':
                                                $val = self::msg( 'GPSLatitude', $val );
                                                break;
@@ -485,7 +485,7 @@ class FormatMetadata {
 
                                case 'GPSLongitudeRef':
                                case 'GPSDestLongitudeRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'E': case 'W':
                                                $val = self::msg( 'GPSLongitude', $val );
                                                break;
@@ -504,7 +504,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSStatus':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'A': case 'V':
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -515,7 +515,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSMeasureMode':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 2: case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -528,7 +528,7 @@ class FormatMetadata {
                                case 'GPSTrackRef':
                                case 'GPSImgDirectionRef':
                                case 'GPSDestBearingRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'T': case 'M':
                                                $val = self::msg( 'GPSDirection', $val );
                                                break;
@@ -548,7 +548,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSSpeedRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'K': case 'M': case 'N':
                                                $val = self::msg( 'GPSSpeed', $val );
                                                break;
@@ -559,7 +559,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSDestDistanceRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'K': case 'M': case 'N':
                                                $val = self::msg( 'GPSDestDistance', $val );
                                                break;
@@ -646,7 +646,7 @@ class FormatMetadata {
                                        break;
 
                                case 'iimCategory':
-                                       switch( strtolower( $val ) ) {
+                                       switch ( strtolower( $val ) ) {
                                                // See pg 29 of IPTC photo
                                                // metadata standard.
                                                case 'ace': case 'clj':
@@ -791,7 +791,7 @@ class FormatMetadata {
                                        }
                                        break;
                                case 'Copyrighted':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'True': case 'False':
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -863,7 +863,7 @@ class FormatMetadata {
                 */
                else {
                        global $wgContLang;
-                       switch( $type ) {
+                       switch ( $type ) {
                        case 'lang':
                                // Display default, followed by ContLang,
                                // followed by the rest in no particular
@@ -948,7 +948,7 @@ class FormatMetadata {
         * this is treated as wikitext not html).
         */
        private static function langItem( $value, $lang, $default = false, $noHtml = false ) {
-               if ( $lang === false && $default === false) {
+               if ( $lang === false && $default === false ) {
                        throw new MWException( '$lang and $default cannot both '
                                . 'be false.' );
                }
@@ -1015,8 +1015,9 @@ class FormatMetadata {
        static function msg( $tag, $val, $arg = null, $arg2 = null ) {
                global $wgContLang;
 
-               if ( $val === '' )
+               if ( $val === '' ) {
                        $val = 'value';
+               }
                return wfMessage( $wgContLang->lc( "exif-$tag-$val" ), $arg, $arg2 )->text();
        }
 
@@ -1031,9 +1032,9 @@ class FormatMetadata {
        static function formatNum( $num, $round = false ) {
                global $wgLang;
                $m = array();
-               if( is_array( $num ) ) {
+               if ( is_array( $num ) ) {
                        $out = array();
-                       foreach( $num as $number ) {
+                       foreach ( $num as $number ) {
                                $out[] = self::formatNum( $number );
                        }
                        return $wgLang->commaList( $out );
@@ -1071,7 +1072,7 @@ class FormatMetadata {
                        $numerator = intval( $m[1] );
                        $denominator = intval( $m[2] );
                        $gcd = self::gcd( abs( $numerator ), $denominator );
-                       if( $gcd != 0 ) {
+                       if ( $gcd != 0 ) {
                                // 0 shouldn't happen! ;)
                                return self::formatNum( $numerator / $gcd ) . '/' . self::formatNum( $denominator / $gcd );
                        }
@@ -1096,7 +1097,7 @@ class FormatMetadata {
                        else
                                return gcd( $b, $a % $b );
                */
-               while( $b != 0 ) {
+               while ( $b != 0 ) {
                        $remainder = $a % $b;
 
                        // tail recursion...
@@ -1124,7 +1125,7 @@ class FormatMetadata {
                        return $val;
                }
                $cat = '';
-               switch( substr( $val, 0, 2 ) ) {
+               switch ( substr( $val, 0, 2 ) ) {
                        case '01':
                                $cat = 'ace';
                                break;
@@ -1236,7 +1237,7 @@ class FormatMetadata {
         * @return String of html-ish looking wikitext
         */
        public static function collapseContactInfo( $vals ) {
-               if( !( isset( $vals['CiAdrExtadr'] )
+               if ( !( isset( $vals['CiAdrExtadr'] )
                        || isset( $vals['CiAdrCity'] )
                        || isset( $vals['CiAdrCtry'] )
                        || isset( $vals['CiEmailWork'] )
@@ -1254,7 +1255,7 @@ class FormatMetadata {
                        // because people often insert >, etc into
                        // the metadata which should not be interpreted
                        // but we still want to auto-link urls.
-                       foreach( $vals as &$val ) {
+                       foreach ( $vals as &$val ) {
                                $val = htmlspecialchars( $val );
                        }
                        return self::flattenArray( $vals );
index 2e532fe..4bb7208 100644 (file)
@@ -86,7 +86,7 @@ class GIFHandler extends BitmapHandler {
                $ser = $image->getMetadata();
                if ( $ser ) {
                        $metadata = unserialize( $ser );
-                       if( $metadata['frameCount'] > 1 ) {
+                       if ( $metadata['frameCount'] > 1 ) {
                                return true;
                        }
                }
index 6a46cc0..968a2cd 100644 (file)
@@ -90,7 +90,7 @@ class GIFMetadataExtractor {
                // Skip over the GCT
                self::readGCT( $fh, $bpp );
 
-               while( !feof( $fh ) ) {
+               while ( !feof( $fh ) ) {
                        $buf = fread( $fh, 1 );
 
                        if ( $buf == self::$gif_frame_sep ) {
@@ -110,7 +110,9 @@ class GIFMetadataExtractor {
                                self::skipBlock( $fh );
                        } elseif ( $buf == self::$gif_extension_sep ) {
                                $buf = fread( $fh, 1 );
-                               if ( strlen( $buf ) < 1 ) throw new Exception( "Ran out of input" );
+                               if ( strlen( $buf ) < 1 ) {
+                                       throw new Exception( "Ran out of input" );
+                               }
                                $extension_code = unpack( 'C', $buf );
                                $extension_code = $extension_code[1];
 
@@ -121,7 +123,9 @@ class GIFMetadataExtractor {
                                        fread( $fh, 1 ); // Transparency, disposal method, user input
 
                                        $buf = fread( $fh, 2 ); // Delay, in hundredths of seconds.
-                                       if ( strlen( $buf ) < 2 ) throw new Exception( "Ran out of input" );
+                                       if ( strlen( $buf ) < 2 ) {
+                                               throw new Exception( "Ran out of input" );
+                                       }
                                        $delay = unpack( 'v', $buf );
                                        $delay = $delay[1];
                                        $duration += $delay * 0.01;
@@ -129,7 +133,9 @@ class GIFMetadataExtractor {
                                        fread( $fh, 1 ); // Transparent colour index
 
                                        $term = fread( $fh, 1 ); // Should be a terminator
-                                       if ( strlen( $term ) < 1 ) throw new Exception( "Ran out of input" );
+                                       if ( strlen( $term ) < 1 ) {
+                                               throw new Exception( "Ran out of input" );
+                                       }
                                        $term = unpack( 'C', $term );
                                        $term = $term[1];
                                        if ( $term != 0 ) {
@@ -168,7 +174,9 @@ class GIFMetadataExtractor {
                                        // Application extension (Netscape info about the animated gif)
                                        // or XMP (or theoretically any other type of extension block)
                                        $blockLength = fread( $fh, 1 );
-                                       if ( strlen( $blockLength ) < 1 ) throw new Exception( "Ran out of input" );
+                                       if ( strlen( $blockLength ) < 1 ) {
+                                               throw new Exception( "Ran out of input" );
+                                       }
                                        $blockLength = unpack( 'C', $blockLength );
                                        $blockLength = $blockLength[1];
                                        $data = fread( $fh, $blockLength );
@@ -190,7 +198,9 @@ class GIFMetadataExtractor {
 
                                                // Unsigned little-endian integer, loop count or zero for "forever"
                                                $loopData = fread( $fh, 2 );
-                                               if ( strlen( $loopData ) < 2 ) throw new Exception( "Ran out of input" );
+                                               if ( strlen( $loopData ) < 2 ) {
+                                                       throw new Exception( "Ran out of input" );
+                                               }
                                                $loopData = unpack( 'v', $loopData );
                                                $loopCount = $loopData[1];
 
@@ -228,7 +238,9 @@ class GIFMetadataExtractor {
                        } elseif ( $buf == self::$gif_term ) {
                                break;
                        } else {
-                               if ( strlen( $buf ) < 1 ) throw new Exception( "Ran out of input" );
+                               if ( strlen( $buf ) < 1 ) {
+                                       throw new Exception( "Ran out of input" );
+                               }
                                $byte = unpack( 'C', $buf );
                                $byte = $byte[1];
                                throw new Exception( "At position: " . ftell( $fh ) . ", Unknown byte " . $byte );
@@ -251,7 +263,7 @@ class GIFMetadataExtractor {
         */
        static function readGCT( $fh, $bpp ) {
                if ( $bpp > 0 ) {
-                       for( $i = 1; $i <= pow( 2, $bpp ); ++$i ) {
+                       for ( $i = 1; $i <= pow( 2, $bpp ); ++$i ) {
                                fread( $fh, 3 );
                        }
                }
@@ -263,7 +275,9 @@ class GIFMetadataExtractor {
         * @return int
         */
        static function decodeBPP( $data ) {
-               if ( strlen( $data ) < 1 ) throw new Exception( "Ran out of input" );
+               if ( strlen( $data ) < 1 ) {
+                       throw new Exception( "Ran out of input" );
+               }
                $buf = unpack( 'C', $data );
                $buf = $buf[1];
                $bpp = ( $buf & 7 ) + 1;
@@ -281,7 +295,9 @@ class GIFMetadataExtractor {
        static function skipBlock( $fh ) {
                while ( !feof( $fh ) ) {
                        $buf = fread( $fh, 1 );
-                       if ( strlen( $buf ) < 1 ) throw new Exception( "Ran out of input" );
+                       if ( strlen( $buf ) < 1 ) {
+                               throw new Exception( "Ran out of input" );
+                       }
                        $block_len = unpack( 'C', $buf );
                        $block_len = $block_len[1];
                        if ( $block_len == 0 ) {
@@ -310,7 +326,7 @@ class GIFMetadataExtractor {
                $subLength = fread( $fh, 1 );
                $blocks = 0;
 
-               while( $subLength !== "\0" ) {
+               while ( $subLength !== "\0" ) {
                        $blocks++;
                        if ( $blocks > self::MAX_SUBBLOCKS ) {
                                throw new Exception( "MAX_SUBBLOCKS exceeded (over $blocks sub-blocks)" );
index 6e04b3d..544dd21 100644 (file)
@@ -63,7 +63,7 @@ class IPTC {
                                wfDebugLog( 'iptc', "IPTC tag $tag had only whitespace as its value." );
                                continue;
                        }
-                       switch( $tag ) {
+                       switch ( $tag ) {
                                case '2#120': /*IPTC caption. mapped with exif ImageDescription*/
                                        $data['ImageDescription'] = self::convIPTC( $val, $c );
                                        break;
index d2bf1f3..8e46f2f 100644 (file)
@@ -92,7 +92,7 @@ abstract class ImageHandler extends MediaHandler {
 
                if ( !isset( $params['page'] ) ) {
                        $params['page'] = 1;
-               } else  {
+               } else {
                        if ( $params['page'] > $image->pageCount() ) {
                                $params['page'] = $image->pageCount();
                        }
@@ -160,7 +160,7 @@ abstract class ImageHandler extends MediaHandler {
                $width = intval( $width );
 
                # Sanity check $width
-               if( $width <= 0 ) {
+               if ( $width <= 0 ) {
                        wfDebug( __METHOD__ . ": Invalid destination width: $width\n" );
                        return false;
                }
@@ -189,7 +189,7 @@ abstract class ImageHandler extends MediaHandler {
                }
                $url = wfAppendQuery( $script, $this->getScriptParams( $params ) );
 
-               if( $image->mustRender() || $params['width'] < $image->getWidth() ) {
+               if ( $image->mustRender() || $params['width'] < $image->getWidth() ) {
                        return new ThumbnailImage( $image, $url, false, $params );
                }
        }
index cb0fbb3..1feb378 100644 (file)
@@ -71,7 +71,7 @@ class JpegHandler extends ExifBitmapHandler {
 
                $rotation = ( $params['rotation'] + $this->getRotation( $file ) ) % 360;
 
-               if( $wgJpegTran && is_file( $wgJpegTran ) ) {
+               if ( $wgJpegTran && is_file( $wgJpegTran ) ) {
                        $cmd = wfEscapeShellArg( $wgJpegTran ) .
                                " -rotate " . wfEscapeShellArg( $rotation ) .
                                " -outfile " . wfEscapeShellArg( $params['dstPath'] ) .
index 121652f..5165760 100644 (file)
@@ -87,7 +87,7 @@ class JpegMetadataExtractor {
                        }
 
                        $buffer = fread( $fh, 1 );
-                       while( $buffer === "\xFF" && !feof( $fh ) ) {
+                       while ( $buffer === "\xFF" && !feof( $fh ) ) {
                                // Skip through any 0xFF padding bytes.
                                $buffer = fread( $fh, 1 );
                        }
@@ -155,7 +155,9 @@ class JpegMetadataExtractor {
                        } else {
                                // segment we don't care about, so skip
                                $size = wfUnpack( "nint", fread( $fh, 2 ), 2 );
-                               if ( $size['int'] <= 2 ) throw new MWException( "invalid marker size in jpeg" );
+                               if ( $size['int'] <= 2 ) {
+                                       throw new MWException( "invalid marker size in jpeg" );
+                               }
                                fseek( $fh, $size['int'] - 2, SEEK_CUR );
                        }
 
@@ -243,7 +245,9 @@ class JpegMetadataExtractor {
                        // PHP can take issue with very large unsigned ints and make them negative.
                        // Which should never ever happen, as this has to be inside a segment
                        // which is limited to a 16 bit number.
-                       if ( $lenData['len'] < 0 ) throw new MWException( "Too big PSIR (" . $lenData['len'] . ')' );
+                       if ( $lenData['len'] < 0 ) {
+                               throw new MWException( "Too big PSIR (" . $lenData['len'] . ')' );
+                       }
 
                        $offset += 4; // 4bytes length field;
 
@@ -267,7 +271,9 @@ class JpegMetadataExtractor {
 
                        // if odd, add 1 to length to account for
                        // null pad byte.
-                       if ( $lenData['len'] % 2 == 1 ) $lenData['len']++;
+                       if ( $lenData['len'] % 2 == 1 ) {
+                               $lenData['len']++;
+                       }
                        $offset += $lenData['len'];
 
                }
index b67f3d3..b368906 100644 (file)
@@ -116,7 +116,9 @@ abstract class MediaHandler {
         * @param string $path the filename
         * @return String
         */
-       function getMetadata( $image, $path ) { return ''; }
+       function getMetadata( $image, $path ) {
+               return '';
+       }
 
        /**
         * Get metadata version.
@@ -166,7 +168,9 @@ abstract class MediaHandler {
         *
         * @return string
         */
-       function getMetadataType( $image ) { return false; }
+       function getMetadataType( $image ) {
+               return false;
+       }
 
        /**
         * Check if the metadata string is valid for this handler.
@@ -255,46 +259,69 @@ abstract class MediaHandler {
         * True if the handled types can be transformed
         * @return bool
         */
-       function canRender( $file ) { return true; }
+       function canRender( $file ) {
+               return true;
+       }
+
        /**
         * True if handled types cannot be displayed directly in a browser
         * but can be rendered
         * @return bool
         */
-       function mustRender( $file ) { return false; }
+       function mustRender( $file ) {
+               return false;
+       }
+
        /**
         * True if the type has multi-page capabilities
         * @return bool
         */
-       function isMultiPage( $file ) { return false; }
+       function isMultiPage( $file ) {
+               return false;
+       }
+
        /**
         * Page count for a multi-page document, false if unsupported or unknown
         * @return bool
         */
-       function pageCount( $file ) { return false; }
+       function pageCount( $file ) {
+               return false;
+       }
+
        /**
         * The material is vectorized and thus scaling is lossless
         * @return bool
         */
-       function isVectorized( $file ) { return false; }
+       function isVectorized( $file ) {
+               return false;
+       }
+
        /**
         * The material is an image, and is animated.
         * In particular, video material need not return true.
         * @note Before 1.20, this was a method of ImageHandler only
         * @return bool
         */
-       function isAnimatedImage( $file ) { return false; }
+       function isAnimatedImage( $file ) {
+               return false;
+       }
+
        /**
         * If the material is animated, we can animate the thumbnail
         * @since 1.20
         * @return bool If material is not animated, handler may return any value.
         */
-       function canAnimateThumbnail( $file ) { return true; }
+       function canAnimateThumbnail( $file ) {
+               return true;
+       }
+
        /**
         * False if the handler is disabled for all files
         * @return bool
         */
-       function isEnabled() { return true; }
+       function isEnabled() {
+               return true;
+       }
 
        /**
         * Get an associative array of page dimensions
@@ -394,9 +421,9 @@ abstract class MediaHandler {
        function visibleMetadataFields() {
                $fields = array();
                $lines = explode( "\n", wfMessage( 'metadata-fields' )->inContentLanguage()->text() );
-               foreach( $lines as $line ) {
+               foreach ( $lines as $line ) {
                        $matches = array();
-                       if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {
+                       if ( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {
                                $fields[] = $matches[1];
                        }
                }
@@ -496,7 +523,7 @@ abstract class MediaHandler {
        public static function fitBoxWidth( $boxWidth, $boxHeight, $maxHeight ) {
                $idealWidth = $boxWidth * $maxHeight / $boxHeight;
                $roundedUp = ceil( $idealWidth );
-               if( round( $roundedUp * $boxHeight / $boxWidth ) > $maxHeight ) {
+               if ( round( $roundedUp * $boxHeight / $boxWidth ) > $maxHeight ) {
                        return floor( $idealWidth );
                } else {
                        return $roundedUp;
@@ -535,9 +562,9 @@ abstract class MediaHandler {
         * @return bool True if removed, false otherwise
         */
        function removeBadFile( $dstPath, $retval = 0 ) {
-               if( file_exists( $dstPath ) ) {
+               if ( file_exists( $dstPath ) ) {
                        $thumbstat = stat( $dstPath );
-                       if( $thumbstat['size'] == 0 || $retval != 0 ) {
+                       if ( $thumbstat['size'] == 0 || $retval != 0 ) {
                                $result = unlink( $dstPath );
 
                                if ( $result ) {
index 2616edb..1d197b1 100644 (file)
@@ -205,7 +205,7 @@ abstract class MediaTransformOutput {
                if ( $this->page && $this->page !== 1 ) {
                        $query = 'page=' . urlencode( $this->page );
                }
-               if( $params ) {
+               if ( $params ) {
                        $query .= $query ? '&' . $params : $params;
                }
                $attribs = array(
@@ -242,7 +242,7 @@ class ThumbnailImage extends MediaTransformOutput {
                # Previous parameters:
                #   $file, $url, $width, $height, $path = false, $page = false
 
-               if( is_array( $parameters ) ) {
+               if ( is_array( $parameters ) ) {
                        $defaults = array(
                                'page' => false
                        );
index b8a5b40..9dfd5d1 100644 (file)
@@ -76,7 +76,9 @@ class PNGHandler extends BitmapHandler {
                $ser = $image->getMetadata();
                if ( $ser ) {
                        $metadata = unserialize( $ser );
-                       if( $metadata['frameCount'] > 1 ) return true;
+                       if ( $metadata['frameCount'] > 1 ) {
+                               return true;
+                       }
                }
                return false;
        }
@@ -129,8 +131,9 @@ class PNGHandler extends BitmapHandler {
                $metadata = unserialize( $image->getMetadata() );
                wfRestoreWarnings();
 
-               if( !$metadata || $metadata['frameCount'] <= 0 )
+               if ( !$metadata || $metadata['frameCount'] <= 0 ) {
                        return $original;
+               }
 
                $info = array();
                $info[] = $original;
index e65a558..d2e2cc9 100644 (file)
@@ -142,7 +142,7 @@ class PNGMetadataExtractor {
                                }
                        } elseif ( $chunk_type == "acTL" ) {
                                $buf = fread( $fh, $chunk_size );
-                               if( !$buf || strlen( $buf ) < $chunk_size || $chunk_size < 4 ) {
+                               if ( !$buf || strlen( $buf ) < $chunk_size || $chunk_size < 4 ) {
                                        throw new Exception( __METHOD__ . ": Read error" );
                                }
 
index cddab51..423e756 100644 (file)
@@ -56,7 +56,7 @@ class SvgHandler extends ImageHandler {
                $metadata = $file->getMetadata();
                if ( $metadata ) {
                        $metadata = $this->unpackMetadata( $metadata );
-                       if( isset( $metadata['animated'] ) ) {
+                       if ( isset( $metadata['animated'] ) ) {
                                return $metadata['animated'];
                        }
                }
@@ -267,7 +267,7 @@ class SvgHandler extends ImageHandler {
                        // File not found, broken, etc.
                        $metadata['error'] = array(
                                'message' => $e->getMessage(),
-                               'code'    => $e->getCode()
+                               'code' => $e->getCode()
                        );
                        wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
                }
index 592403a..948a0f8 100644 (file)
@@ -128,7 +128,7 @@ class SVGReader {
                $keepReading = $this->reader->read();
 
                /* Skip until first element */
-               while( $keepReading && $this->reader->nodeType != XmlReader::ELEMENT ) {
+               while ( $keepReading && $this->reader->nodeType != XmlReader::ELEMENT ) {
                        $keepReading = $this->reader->read();
                }
 
@@ -144,7 +144,7 @@ class SVGReader {
                while ( $keepReading ) {
                        $tag = $this->reader->localName;
                        $type = $this->reader->nodeType;
-                       $isSVG = ($this->reader->namespaceURI == self::NS_SVG);
+                       $isSVG = ( $this->reader->namespaceURI == self::NS_SVG );
 
                        $this->debug( "$tag" );
 
@@ -187,14 +187,14 @@ class SVGReader {
         */
        private function readField( $name, $metafield = null ) {
                $this->debug( "Read field $metafield" );
-               if( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
+               if ( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
                }
                $keepReading = $this->reader->read();
-               while( $keepReading ) {
-                       if( $this->reader->localName == $name && $this->reader->namespaceURI == self::NS_SVG && $this->reader->nodeType == XmlReader::END_ELEMENT ) {
+               while ( $keepReading ) {
+                       if ( $this->reader->localName == $name && $this->reader->namespaceURI == self::NS_SVG && $this->reader->nodeType == XmlReader::END_ELEMENT ) {
                                break;
-                       } elseif( $this->reader->nodeType == XmlReader::TEXT ) {
+                       } elseif ( $this->reader->nodeType == XmlReader::TEXT ) {
                                $this->metadata[$metafield] = trim( $this->reader->value );
                        }
                        $keepReading = $this->reader->read();
@@ -209,11 +209,11 @@ class SVGReader {
         */
        private function readXml( $metafield = null ) {
                $this->debug( "Read top level metadata" );
-               if( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
+               if ( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
                }
                // TODO: find and store type of xml snippet. metadata['metadataType'] = "rdf"
-               if( method_exists( $this->reader, 'readInnerXML' ) ) {
+               if ( method_exists( $this->reader, 'readInnerXML' ) ) {
                        $this->metadata[$metafield] = trim( $this->reader->readInnerXML() );
                } else {
                        throw new MWException( "The PHP XMLReader extension does not come with readInnerXML() method. Your libxml is probably out of date (need 2.6.20 or later)." );
@@ -228,7 +228,7 @@ class SVGReader {
         */
        private function animateFilter( $name ) {
                $this->debug( "animate filter for tag $name" );
-               if( $this->reader->nodeType != XmlReader::ELEMENT ) {
+               if ( $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
                }
                if ( $this->reader->isEmptyElement ) {
@@ -236,12 +236,12 @@ class SVGReader {
                }
                $exitDepth = $this->reader->depth;
                $keepReading = $this->reader->read();
-               while( $keepReading ) {
-                       if( $this->reader->localName == $name && $this->reader->depth <= $exitDepth
+               while ( $keepReading ) {
+                       if ( $this->reader->localName == $name && $this->reader->depth <= $exitDepth
                                && $this->reader->nodeType == XmlReader::END_ELEMENT ) {
                                break;
                        } elseif ( $this->reader->namespaceURI == self::NS_SVG && $this->reader->nodeType == XmlReader::ELEMENT ) {
-                               switch( $this->reader->localName ) {
+                               switch ( $this->reader->localName ) {
                                        case 'script':
                                                // Normally we disallow files with
                                                // <script>, but its possible
@@ -267,7 +267,7 @@ class SVGReader {
        }
 
        private function debug( $data ) {
-               if( $this->mDebug ) {
+               if ( $this->mDebug ) {
                        wfDebug( "SVGReader: $data\n" );
                }
        }
@@ -292,37 +292,37 @@ class SVGReader {
                $width = null;
                $height = null;
 
-               if( $this->reader->getAttribute( 'viewBox' ) ) {
+               if ( $this->reader->getAttribute( 'viewBox' ) ) {
                        // min-x min-y width height
                        $viewBox = preg_split( '/\s+/', trim( $this->reader->getAttribute( 'viewBox' ) ) );
-                       if( count( $viewBox ) == 4 ) {
+                       if ( count( $viewBox ) == 4 ) {
                                $viewWidth = $this->scaleSVGUnit( $viewBox[2] );
                                $viewHeight = $this->scaleSVGUnit( $viewBox[3] );
-                               if( $viewWidth > 0 && $viewHeight > 0 ) {
+                               if ( $viewWidth > 0 && $viewHeight > 0 ) {
                                        $aspect = $viewWidth / $viewHeight;
                                        $defaultHeight = $defaultWidth / $aspect;
                                }
                        }
                }
-               if( $this->reader->getAttribute( 'width' ) ) {
+               if ( $this->reader->getAttribute( 'width' ) ) {
                        $width = $this->scaleSVGUnit( $this->reader->getAttribute( 'width' ), $defaultWidth );
                        $this->metadata['originalWidth'] = $this->reader->getAttribute( 'width' );
                }
-               if( $this->reader->getAttribute( 'height' ) ) {
+               if ( $this->reader->getAttribute( 'height' ) ) {
                        $height = $this->scaleSVGUnit( $this->reader->getAttribute( 'height' ), $defaultHeight );
                        $this->metadata['originalHeight'] = $this->reader->getAttribute( 'height' );
                }
 
-               if( !isset( $width ) && !isset( $height ) ) {
+               if ( !isset( $width ) && !isset( $height ) ) {
                        $width = $defaultWidth;
                        $height = $width / $aspect;
-               } elseif( isset( $width ) && !isset( $height ) ) {
+               } elseif ( isset( $width ) && !isset( $height ) ) {
                        $height = $width / $aspect;
-               } elseif( isset( $height ) && !isset( $width ) ) {
+               } elseif ( isset( $height ) && !isset( $width ) ) {
                        $width = $height * $aspect;
                }
 
-               if( $width > 0 && $height > 0 ) {
+               if ( $width > 0 && $height > 0 ) {
                        $this->metadata['width'] = intval( round( $width ) );
                        $this->metadata['height'] = intval( round( $height ) );
                }
@@ -346,13 +346,13 @@ class SVGReader {
                        'in' => 90.0,
                        'em' => 16.0, // fake it?
                        'ex' => 12.0, // fake it?
-                       ''   => 1.0, // "User units" pixels by default
+                       '' => 1.0, // "User units" pixels by default
                        );
                $matches = array();
-               if( preg_match( '/^\s*(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)\s*$/', $length, $matches ) ) {
+               if ( preg_match( '/^\s*(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)\s*$/', $length, $matches ) ) {
                        $length = floatval( $matches[1] );
                        $unit = $matches[2];
-                       if( $unit == '%' ) {
+                       if ( $unit == '%' ) {
                                return $length * 0.01 * $viewportSize;
                        } else {
                                return $length * $unitLength[$unit];
index ba38d15..8872d73 100644 (file)
@@ -78,7 +78,7 @@ class XCFHandler extends BitmapHandler {
        static function getXCFMetaData( $filename ) {
                # Decode master structure
                $f = fopen( $filename, 'rb' );
-               if( !$f ) {
+               if ( !$f ) {
                        return false;
                }
                # The image structure always starts at offset 0 in the XCF file.
@@ -115,7 +115,7 @@ class XCFHandler extends BitmapHandler {
                }
 
                # Check values
-               if( $header['magic'] !== 'gimp xcf' ) {
+               if ( $header['magic'] !== 'gimp xcf' ) {
                        wfDebug( __METHOD__ . " '$filename' has invalid magic signature.\n" );
                        return false;
                }
index 081433b..7eb3d19 100644 (file)
@@ -180,12 +180,12 @@ class XMPReader {
                ) {
                        // the is_array is just paranoia. It should always
                        // be an array.
-                       foreach( $data['xmp-special']['LocationShown'] as $loc ) {
+                       foreach ( $data['xmp-special']['LocationShown'] as $loc ) {
                                if ( !is_array( $loc ) ) {
                                        // To avoid copying over the _type meta-fields.
                                        continue;
                                }
-                               foreach( $loc as $field => $val ) {
+                               foreach ( $loc as $field => $val ) {
                                        $data['xmp-general'][$field . 'Dest'][] = $val;
                                }
                        }
@@ -195,12 +195,12 @@ class XMPReader {
                ) {
                        // the is_array is just paranoia. It should always
                        // be an array.
-                       foreach( $data['xmp-special']['LocationCreated'] as $loc ) {
+                       foreach ( $data['xmp-special']['LocationCreated'] as $loc ) {
                                if ( !is_array( $loc ) ) {
                                        // To avoid copying over the _type meta-fields.
                                        continue;
                                }
-                               foreach( $loc as $field => $val ) {
+                               foreach ( $loc as $field => $val ) {
                                        $data['xmp-general'][$field . 'Created'][] = $val;
                                }
                        }
@@ -391,7 +391,9 @@ class XMPReader {
                        throw new MWException( 'Unexpected character data before first rdf:Description element' );
                }
 
-               if ( $this->mode[0] === self::MODE_IGNORE ) return;
+               if ( $this->mode[0] === self::MODE_IGNORE ) {
+                       return;
+               }
 
                if ( $this->mode[0] !== self::MODE_SIMPLE
                        && $this->mode[0] !== self::MODE_QDESC
@@ -639,7 +641,7 @@ class XMPReader {
                        throw new MWException( "Hit end element </$elm> but no curItem" );
                }
 
-               switch( $this->mode[0] ) {
+               switch ( $this->mode[0] ) {
                        case self::MODE_IGNORE:
                                $this->endElementModeIgnore( $elm );
                                break;
@@ -1058,7 +1060,7 @@ class XMPReader {
                                . "encountered <$elm> with no mode" );
                }
 
-               switch( $this->mode[0] ) {
+               switch ( $this->mode[0] ) {
                        case self::MODE_IGNORE:
                                $this->startElementModeIgnore( $elm );
                                break;
index feacc2a..f0b2cb5 100644 (file)
@@ -32,7 +32,7 @@ class XMPInfo {
         * @return Array XMP item configuration array.
         */
        public static function getItems() {
-               if( !self::$ranHooks ) {
+               if ( !self::$ranHooks ) {
                        // This is for if someone makes a custom metadata extension.
                        // For example, a medical wiki might want to decode DICOM xmp properties.
                        wfRunHooks( 'XMPGetInfo', Array( &self::$items ) );
index fbde251..58ddd6a 100644 (file)
@@ -187,7 +187,7 @@ abstract class BagOStuff {
                        }
                        usleep( $sleep ); // back off
                        $locked = $this->add( "{$key}:lock", $timeout );
-               } while( !$locked );
+               } while ( !$locked );
 
                return $locked;
        }
index 3f1fa3a..f1644ed 100644 (file)
@@ -43,7 +43,7 @@ class MemcachedBagOStuff extends BagOStuff {
                if ( !isset( $params['persistent'] ) ) {
                        $params['persistent'] = $GLOBALS['wgMemCachedPersistent'];
                }
-               if  ( !isset( $params['compress_threshold'] ) ) {
+               if ( !isset( $params['compress_threshold'] ) ) {
                        $params['compress_threshold'] = 1500;
                }
                if ( !isset( $params['timeout'] ) ) {
index bc2acb3..f4c034a 100644 (file)
@@ -329,7 +329,7 @@ class MWMemcached {
                        $this->stats['delete'] = 1;
                }
                $cmd = "delete $key $time\r\n";
-               if( !$this->_fwrite( $sock, $cmd ) ) {
+               if ( !$this->_fwrite( $sock, $cmd ) ) {
                        return false;
                }
                $res = $this->_fgets( $sock );
@@ -733,7 +733,7 @@ class MWMemcached {
                $sock = false;
                $timeout = $this->_connect_timeout;
                $errno = $errstr = null;
-               for( $i = 0; !$sock && $i < $this->_connect_attempts; $i++ ) {
+               for ( $i = 0; !$sock && $i < $this->_connect_attempts; $i++ ) {
                        wfSuppressWarnings();
                        if ( $this->_persistent == 1 ) {
                                $sock = pfsockopen( $ip, $port, $errno, $errstr, $timeout );
@@ -810,7 +810,7 @@ class MWMemcached {
                        $bu = array();
                        foreach ( $this->_servers as $v ) {
                                if ( is_array( $v ) ) {
-                                       for( $i = 0; $i < $v[1]; $i++ ) {
+                                       for ( $i = 0; $i < $v[1]; $i++ ) {
                                                $bu[] = $v[0];
                                        }
                                } else {
@@ -822,7 +822,7 @@ class MWMemcached {
                }
 
                $realkey = is_array( $key ) ? $key[1] : $key;
-               for( $tries = 0; $tries < 20; $tries++ ) {
+               for ( $tries = 0; $tries < 20; $tries++ ) {
                        $host = $this->_buckets[$hv % $this->_bucketcount];
                        $sock = $this->sock_to_host( $host );
                        if ( is_resource( $sock ) ) {
@@ -912,7 +912,7 @@ class MWMemcached {
                while ( 1 ) {
                        $decl = $this->_fgets( $sock );
 
-                       if( $decl === false ) {
+                       if ( $decl === false ) {
                                /*
                                 * If nothing can be read, something is wrong because we know exactly when
                                 * to stop reading (right after "END") and we return right after that.
index eafa836..f7247f9 100644 (file)
@@ -125,9 +125,9 @@ class ObjectCache {
        static function newAccelerator( $params ) {
                if ( function_exists( 'apc_fetch' ) ) {
                        $id = 'apc';
-               } elseif( function_exists( 'xcache_get' ) && wfIniGetBool( 'xcache.var_size' ) ) {
+               } elseif ( function_exists( 'xcache_get' ) && wfIniGetBool( 'xcache.var_size' ) ) {
                        $id = 'xcache';
-               } elseif( function_exists( 'wincache_ucache_get' ) ) {
+               } elseif ( function_exists( 'wincache_ucache_get' ) ) {
                        $id = 'wincache';
                } else {
                        throw new MWException( "CACHE_ACCEL requested but no suitable object " .
index bc76294..7cf960e 100644 (file)
@@ -94,7 +94,7 @@ class ObjectCacheSessionHandler {
         */
        static function read( $id ) {
                $data = self::getCache()->get( self::getKey( $id ) );
-               if( $data === false ) {
+               if ( $data === false ) {
                        return '';
                }
                return $data;
index f9feaf9..e1dc42e 100644 (file)
@@ -140,7 +140,13 @@ class RedisBagOStuff extends BagOStuff {
                                $conn->setex( $key, $expiry, $value );
                        }
 
-                       $result = $conn->exec();
+                       /*
+                        * multi()/exec() (transactional mode) allows multiple values to
+                        * be set/get at once and will return an array of results, in
+                        * the order they were set/get. In this case, we only set 1
+                        * value, which should (in case of success) result in true.
+                        */
+                       $result = ( $conn->exec() == array( true ) );
                } catch ( RedisException $e ) {
                        $result = false;
                        $this->handleException( $server, $conn, $e );
index 6b70e1d..8190a8a 100644 (file)
@@ -93,7 +93,7 @@ class CacheTime {
                        $expire = min( $expire, $wgParserCacheExpireTime );
                }
 
-               if( $this->containsOldMagic() ) { //compatibility hack
+               if ( $this->containsOldMagic() ) { //compatibility hack
                        $expire = min( $expire, 3600 ); # 1 hour
                }
 
index 36bfb48..e6342e4 100644 (file)
@@ -88,6 +88,8 @@ class CoreParserFunctions {
                $parser->setFunctionHook( 'pagenamee',        array( __CLASS__, 'pagenamee'        ), SFH_NO_HASH );
                $parser->setFunctionHook( 'fullpagename',     array( __CLASS__, 'fullpagename'     ), SFH_NO_HASH );
                $parser->setFunctionHook( 'fullpagenamee',    array( __CLASS__, 'fullpagenamee'    ), SFH_NO_HASH );
+               $parser->setFunctionHook( 'rootpagename',     array( __CLASS__, 'rootpagename'     ), SFH_NO_HASH );
+               $parser->setFunctionHook( 'rootpagenamee',    array( __CLASS__, 'rootpagenamee'    ), SFH_NO_HASH );
                $parser->setFunctionHook( 'basepagename',     array( __CLASS__, 'basepagename'     ), SFH_NO_HASH );
                $parser->setFunctionHook( 'basepagenamee',    array( __CLASS__, 'basepagenamee'    ), SFH_NO_HASH );
                $parser->setFunctionHook( 'subpagename',      array( __CLASS__, 'subpagename'      ), SFH_NO_HASH );
@@ -138,8 +140,9 @@ class CoreParserFunctions {
 
                // Specify a different default date format other than the the normal default
                // iff the user has 'default' for their setting
-               if ( $pref == 'default' && $defaultPref )
+               if ( $pref == 'default' && $defaultPref ) {
                        $pref = $defaultPref;
+               }
 
                $date = $df->reformat( $pref, $date, array( 'match-whole' ) );
                return $date;
@@ -184,7 +187,7 @@ class CoreParserFunctions {
                if ( is_null( $magicWords ) ) {
                        $magicWords = new MagicWordArray( array( 'url_path', 'url_query', 'url_wiki' ) );
                }
-               switch( $magicWords->matchStartToEnd( $arg ) ) {
+               switch ( $magicWords->matchStartToEnd( $arg ) ) {
 
                        // Encode as though it's a wiki page, '_' for ' '.
                        case 'url_wiki':
@@ -248,14 +251,15 @@ class CoreParserFunctions {
                # before arriving here; if that's true, then the title can't be created
                # and the variable will fail. If we can't get a decent title from the first
                # attempt, url-decode and try for a second.
-               if( is_null( $title ) )
+               if ( is_null( $title ) ) {
                        $title = Title::newFromURL( urldecode( $s ) );
-               if( !is_null( $title ) ) {
+               }
+               if ( !is_null( $title ) ) {
                        # Convert NS_MEDIA -> NS_FILE
-                       if( $title->getNamespace() == NS_MEDIA ) {
+                       if ( $title->getNamespace() == NS_MEDIA ) {
                                $title = Title::makeTitle( NS_FILE, $title->getDBkey() );
                        }
-                       if( !is_null( $arg ) ) {
+                       if ( !is_null( $arg ) ) {
                                $text = $title->$func( $arg );
                        } else {
                                $text = $title->$func();
@@ -377,12 +381,10 @@ class CoreParserFunctions {
                $text = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $text, null, array(), array(), $bad ) );
                $title = Title::newFromText( Sanitizer::stripAllTags( $text ) );
 
-               if( !$wgRestrictDisplayTitle ) {
+               if ( !$wgRestrictDisplayTitle ) {
+                       $parser->mOutput->setDisplayTitle( $text );
+               } elseif ( $title instanceof Title && $title->getFragment() == '' && $title->equals( $parser->mTitle ) ) {
                        $parser->mOutput->setDisplayTitle( $text );
-               } else {
-                       if ( $title instanceof Title && $title->getFragment() == '' && $title->equals( $parser->mTitle ) ) {
-                               $parser->mOutput->setDisplayTitle( $text );
-                       }
                }
 
                return '';
@@ -404,7 +406,7 @@ class CoreParserFunctions {
        }
 
        static function formatRaw( $num, $raw ) {
-               if( self::matchAgainstMagicword( 'rawsuffix', $raw ) ) {
+               if ( self::matchAgainstMagicword( 'rawsuffix', $raw ) ) {
                        return $num;
                } else {
                        global $wgContLang;
@@ -438,7 +440,7 @@ class CoreParserFunctions {
        static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
                return self::formatRaw( SiteStats::pagesInNs( intval( $namespace ) ), $raw );
        }
-       static function numberingroup( $parser, $name = '', $raw = null) {
+       static function numberingroup( $parser, $name = '', $raw = null ) {
                return self::formatRaw( SiteStats::numberingroup( strtolower( $name ) ), $raw );
        }
 
@@ -451,44 +453,51 @@ class CoreParserFunctions {
         */
        static function mwnamespace( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return str_replace( '_', ' ', $t->getNsText() );
        }
        static function namespacee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfUrlencode( $t->getNsText() );
        }
        static function namespacenumber( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return $t->getNamespace();
        }
        static function talkspace( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) || !$t->canTalk() )
+               if ( is_null( $t ) || !$t->canTalk() ) {
                        return '';
+               }
                return str_replace( '_', ' ', $t->getTalkNsText() );
        }
        static function talkspacee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) || !$t->canTalk() )
+               if ( is_null( $t ) || !$t->canTalk() ) {
                        return '';
+               }
                return wfUrlencode( $t->getTalkNsText() );
        }
        static function subjectspace( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return str_replace( '_', ' ', $t->getSubjectNsText() );
        }
        static function subjectspacee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfUrlencode( $t->getSubjectNsText() );
        }
 
@@ -499,74 +508,100 @@ class CoreParserFunctions {
         */
        static function pagename( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getText() );
        }
        static function pagenamee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getPartialURL() );
        }
        static function fullpagename( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) || !$t->canTalk() )
+               if ( is_null( $t ) || !$t->canTalk() ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getPrefixedText() );
        }
        static function fullpagenamee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) || !$t->canTalk() )
+               if ( is_null( $t ) || !$t->canTalk() ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getPrefixedURL() );
        }
        static function subpagename( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getSubpageText() );
        }
        static function subpagenamee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getSubpageUrlForm() );
        }
+       static function rootpagename( $parser, $title = null ) {
+               $t = Title::newFromText( $title );
+               if ( is_null( $t ) ) {
+                       return '';
+               }
+               return wfEscapeWikiText( $t->getRootText() );
+       }
+       static function rootpagenamee( $parser, $title = null ) {
+               $t = Title::newFromText( $title );
+               if ( is_null( $t ) ) {
+                       return '';
+               }
+               return wfEscapeWikiText( wfUrlEncode( str_replace( ' ', '_', $t->getRootText() ) ) );
+       }
        static function basepagename( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getBaseText() );
        }
        static function basepagenamee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( wfUrlEncode( str_replace( ' ', '_', $t->getBaseText() ) ) );
        }
        static function talkpagename( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) || !$t->canTalk() )
+               if ( is_null( $t ) || !$t->canTalk() ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getTalkPage()->getPrefixedText() );
        }
        static function talkpagenamee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) || !$t->canTalk() )
+               if ( is_null( $t ) || !$t->canTalk() ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getTalkPage()->getPrefixedURL() );
        }
        static function subjectpagename( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getSubjectPage()->getPrefixedText() );
        }
        static function subjectpagenamee( $parser, $title = null ) {
                $t = Title::newFromText( $title );
-               if ( is_null( $t ) )
+               if ( is_null( $t ) ) {
                        return '';
+               }
                return wfEscapeWikiText( $t->getSubjectPage()->getPrefixedURL() );
        }
 
@@ -589,7 +624,7 @@ class CoreParserFunctions {
                static $cache = array();
 
                // split the given option to its variable
-               if( self::matchAgainstMagicword( 'rawsuffix', $arg1 ) ) {
+               if ( self::matchAgainstMagicword( 'rawsuffix', $arg1 ) ) {
                        //{{pagesincategory:|raw[|type]}}
                        $raw = $arg1;
                        $type = $magicWords->matchStartToEnd( $arg2 );
@@ -598,23 +633,23 @@ class CoreParserFunctions {
                        $type = $magicWords->matchStartToEnd( $arg1 );
                        $raw = $arg2;
                }
-               if( !$type ) { //backward compatibility
+               if ( !$type ) { //backward compatibility
                        $type = 'pagesincategory_all';
                }
 
                $title = Title::makeTitleSafe( NS_CATEGORY, $name );
-               if( !$title ) { # invalid title
+               if ( !$title ) { # invalid title
                        return self::formatRaw( 0, $raw );
                }
 
                // Normalize name for cache
                $name = $title->getDBkey();
 
-               if( !isset( $cache[$name] ) ) {
+               if ( !isset( $cache[$name] ) ) {
                        $category = Category::newFromTitle( $title );
 
                        $allCount = $subcatCount = $fileCount = $pagesCount = 0;
-                       if( $parser->incrementExpensiveFunctionCount() ) {
+                       if ( $parser->incrementExpensiveFunctionCount() ) {
                                // $allCount is the total number of cat members,
                                // not the count of how many members are normal pages.
                                $allCount = (int)$category->getPageCount();
@@ -653,7 +688,7 @@ class CoreParserFunctions {
                static $cache = array();
                $title = Title::newFromText( $page );
 
-               if( !is_object( $title ) ) {
+               if ( !is_object( $title ) ) {
                        $cache[$page] = 0;
                        return self::formatRaw( 0, $raw );
                }
@@ -662,9 +697,9 @@ class CoreParserFunctions {
                $page = $title->getPrefixedText();
 
                $length = 0;
-               if( isset( $cache[$page] ) ) {
+               if ( isset( $cache[$page] ) ) {
                        $length = $cache[$page];
-               } elseif( $parser->incrementExpensiveFunctionCount() ) {
+               } elseif ( $parser->incrementExpensiveFunctionCount() ) {
                        $rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
                        $pageID = $rev ? $rev->getPage() : 0;
                        $revID = $rev ? $rev->getId() : 0;
@@ -717,7 +752,9 @@ class CoreParserFunctions {
        static function pad( $parser, $string, $length, $padding = '0', $direction = STR_PAD_RIGHT ) {
                $padding = $parser->killMarkers( $padding );
                $lengthOfPadding = mb_strlen( $padding );
-               if ( $lengthOfPadding == 0 ) return $string;
+               if ( $lengthOfPadding == 0 ) {
+                       return $string;
+               }
 
                # The remaining length to add counts down to 0 as padding is added
                $length = min( $length, 500 ) - mb_strlen( $string );
@@ -786,19 +823,20 @@ class CoreParserFunctions {
                $arg = $magicWords->matchStartToEnd( $uarg );
 
                $text = trim( $text );
-               if( strlen( $text ) == 0 )
+               if ( strlen( $text ) == 0 ) {
                        return '';
+               }
                $old = $parser->getCustomDefaultSort();
                if ( $old === false || $arg !== 'defaultsort_noreplace' ) {
                        $parser->setDefaultSort( $text );
                }
 
-               if( $old === false || $old == $text || $arg ) {
+               if ( $old === false || $old == $text || $arg ) {
                        return '';
                } else {
-                       return( '<span class="error">' .
+                       return '<span class="error">' .
                                wfMessage( 'duplicate-defaultsort', $old, $text )->inContentLanguage()->escaped() .
-                               '</span>' );
+                               '</span>';
                }
        }
 
@@ -807,14 +845,14 @@ class CoreParserFunctions {
        public static function filepath( $parser, $name = '', $argA = '', $argB = '' ) {
                $file = wfFindFile( $name );
 
-               if( $argA == 'nowiki' ) {
+               if ( $argA == 'nowiki' ) {
                        // {{filepath: | option [| size] }}
                        $isNowiki = true;
                        $parsedWidthParam = $parser->parseWidthParam( $argB );
                } else {
                        // {{filepath: [| size [|option]] }}
                        $parsedWidthParam = $parser->parseWidthParam( $argA );
-                       $isNowiki = ($argB == 'nowiki');
+                       $isNowiki = ( $argB == 'nowiki' );
                }
 
                if ( $file ) {
index 6505183..a2eb698 100644 (file)
@@ -77,7 +77,7 @@ class CoreTagHooks {
         */
        static function html( $content, $attributes, $parser ) {
                global $wgRawHtml;
-               if( $wgRawHtml ) {
+               if ( $wgRawHtml ) {
                        return array( $content, 'markerType' => 'nowiki' );
                } else {
                        throw new MWException( '<html> extension tag encountered unexpectedly' );
index 8103b60..0a69b04 100644 (file)
@@ -156,10 +156,10 @@ class DateFormatter {
                }
                for ( $i = 1; $i <= self::LAST; $i++ ) {
                        $this->mSource = $i;
-                       if ( isset ( $this->rules[$preference][$i] ) ) {
+                       if ( isset( $this->rules[$preference][$i] ) ) {
                                # Specific rules
                                $this->mTarget = $this->rules[$preference][$i];
-                       } elseif ( isset ( $this->rules[self::ALL][$i] ) ) {
+                       } elseif ( isset( $this->rules[self::ALL][$i] ) ) {
                                # General rules
                                $this->mTarget = $this->rules[self::ALL][$i];
                        } elseif ( $preference ) {
@@ -198,8 +198,9 @@ class DateFormatter {
        function replace( $matches ) {
                # Extract information from $matches
                $linked = true;
-               if ( isset( $this->mLinked ) )
+               if ( isset( $this->mLinked ) ) {
                        $linked = $this->mLinked;
+               }
 
                $bits = array();
                $key = $this->keys[$this->mSource];
@@ -232,10 +233,12 @@ class DateFormatter {
                $fail = false;
 
                // Pre-generate y/Y stuff because we need the year for the <span> title.
-               if ( !isset( $bits['y'] ) && isset( $bits['Y'] ) )
+               if ( !isset( $bits['y'] ) && isset( $bits['Y'] ) ) {
                        $bits['y'] = $this->makeIsoYear( $bits['Y'] );
-               if ( !isset( $bits['Y'] ) && isset( $bits['y'] ) )
+               }
+               if ( !isset( $bits['Y'] ) && isset( $bits['y'] ) ) {
                        $bits['Y'] = $this->makeNormalYear( $bits['y'] );
+               }
 
                if ( !isset( $bits['m'] ) ) {
                        $m = $this->makeIsoMonth( $bits['F'] );
@@ -293,8 +296,9 @@ class DateFormatter {
                }
 
                $isoBits = array();
-               if ( isset( $bits['y'] ) )
+               if ( isset( $bits['y'] ) ) {
                        $isoBits[] = $bits['y'];
+               }
                $isoBits[] = $bits['m'];
                $isoBits[] = $bits['d'];
                $isoDate = implode( '-', $isoBits );
@@ -312,7 +316,7 @@ class DateFormatter {
         */
        function getMonthRegex() {
                $names = array();
-               for( $i = 1; $i <= 12; $i++ ) {
+               for ( $i = 1; $i <= 12; $i++ ) {
                        $names[] = $this->lang->getMonthName( $i );
                        $names[] = $this->lang->getMonthAbbreviation( $i );
                }
@@ -353,7 +357,7 @@ class DateFormatter {
         */
        function makeNormalYear( $iso ) {
                if ( $iso[0] == '-' ) {
-                       $text = (intval( substr( $iso, 1 ) ) + 1) . ' BC';
+                       $text = ( intval( substr( $iso, 1 ) ) + 1 ) . ' BC';
                } else {
                        $text = intval( $iso );
                }
index f125510..6fc457d 100644 (file)
@@ -322,7 +322,7 @@ class LinkHolderArray {
                }
                if ( $queries ) {
                        $where = array();
-                       foreach( $queries as $ns => $pages ) {
+                       foreach ( $queries as $ns => $pages ) {
                                $where[] = $dbr->makeList(
                                        array(
                                                'page_namespace' => $ns,
@@ -362,7 +362,7 @@ class LinkHolderArray {
                wfProfileOut( __METHOD__ . '-check' );
 
                # Do a second query for different language variants of links and categories
-               if( $wgContLang->hasVariants() ) {
+               if ( $wgContLang->hasVariants() ) {
                        $this->doVariants( $colours );
                }
 
@@ -425,7 +425,7 @@ class LinkHolderArray {
                # Make interwiki link HTML
                $output = $this->parent->getOutput();
                $replacePairs = array();
-               foreach( $this->interwikis as $key => $link ) {
+               foreach ( $this->interwikis as $key => $link ) {
                        $replacePairs[$key] = Linker::link( $link['title'], $link['text'] );
                        $output->addInterwikiLink( $link['title'] );
                }
@@ -486,7 +486,7 @@ class LinkHolderArray {
                                $textVariant = $titlesAllVariants[$variantName][$i];
                                if ( $textVariant != $titlesAttrs[$i]['titleText'] ) {
                                        $variantTitle = Title::makeTitle( $titlesAttrs[$i]['ns'], $textVariant );
-                                       if( is_null( $variantTitle ) ) {
+                                       if ( is_null( $variantTitle ) ) {
                                                continue;
                                        }
                                        $linkBatch->addObj( $variantTitle );
@@ -514,7 +514,7 @@ class LinkHolderArray {
                        }
                }
 
-               if( !$linkBatch->isEmpty() ) {
+               if ( !$linkBatch->isEmpty() ) {
                        // construct query
                        $dbr = wfGetDB( DB_SLAVE );
                        $varRes = $dbr->select( 'page',
@@ -533,14 +533,14 @@ class LinkHolderArray {
                                $vardbk = $variantTitle->getDBkey();
 
                                $holderKeys = array();
-                               if( isset( $variantMap[$varPdbk] ) ) {
+                               if ( isset( $variantMap[$varPdbk] ) ) {
                                        $holderKeys = $variantMap[$varPdbk];
                                        $linkCache->addGoodLinkObjFromRow( $variantTitle, $s );
                                        $output->addLink( $variantTitle, $s->page_id );
                                }
 
                                // loop over link holders
-                               foreach( $holderKeys as $key ) {
+                               foreach ( $holderKeys as $key ) {
                                        list( $ns, $index ) = explode( ':', $key, 2 );
                                        $entry =& $this->internals[$ns][$index];
                                        $pdbk = $entry['pdbk'];
@@ -570,12 +570,12 @@ class LinkHolderArray {
                        wfRunHooks( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
 
                        // rebuild the categories in original order (if there are replacements)
-                       if( count( $varCategories ) > 0 ) {
+                       if ( count( $varCategories ) > 0 ) {
                                $newCats = array();
                                $originalCats = $output->getCategories();
-                               foreach( $originalCats as $cat => $sortkey ) {
+                               foreach ( $originalCats as $cat => $sortkey ) {
                                        // make the replacement
-                                       if( array_key_exists( $cat, $varCategories ) ) {
+                                       if ( array_key_exists( $cat, $varCategories ) ) {
                                                $newCats[$varCategories[$cat]] = $sortkey;
                                        } else {
                                                $newCats[$cat] = $sortkey;
@@ -615,13 +615,13 @@ class LinkHolderArray {
        function replaceTextCallback( $matches ) {
                $type = $matches[1];
                $key = $matches[2];
-               if( $type == 'LINK' ) {
+               if ( $type == 'LINK' ) {
                        list( $ns, $index ) = explode( ':', $key, 2 );
-                       if( isset( $this->internals[$ns][$index]['text'] ) ) {
+                       if ( isset( $this->internals[$ns][$index]['text'] ) ) {
                                return $this->internals[$ns][$index]['text'];
                        }
-               } elseif( $type == 'IWLINK' ) {
-                       if( isset( $this->interwikis[$key]['text'] ) ) {
+               } elseif ( $type == 'IWLINK' ) {
+                       if ( isset( $this->interwikis[$key]['text'] ) ) {
                                return $this->interwikis[$key]['text'];
                        }
                }
index 3ada925..47a09c4 100644 (file)
@@ -769,9 +769,9 @@ class Parser {
 
                if ( $target !== null ) {
                        return $target;
-               } elseif( $this->mOptions->getInterfaceMessage() ) {
+               } elseif ( $this->mOptions->getInterfaceMessage() ) {
                        return $this->mOptions->getUserLangObj();
-               } elseif( is_null( $this->mTitle ) ) {
+               } elseif ( is_null( $this->mTitle ) ) {
                        throw new MWException( __METHOD__ . ': $this->mTitle is null' );
                }
 
@@ -1256,7 +1256,7 @@ class Parser {
                                'x' => 'X',
                        ));
                        $titleObj = SpecialPage::getTitleFor( 'Booksources', $num );
-                       return'<a href="' .
+                       return '<a href="' .
                                htmlspecialchars( $titleObj->getLocalURL() ) .
                                "\" class=\"internal mw-magiclink-isbn\">ISBN $isbn</a>";
                } else {
@@ -1462,41 +1462,57 @@ class Parser {
                                } else {
                                        if ( strlen( $r ) == 2 ) {
                                                if ( $state === 'i' ) {
-                                                       $output .= '</i>'; $state = '';
+                                                       $output .= '</i>';
+                                                       $state = '';
                                                } elseif ( $state === 'bi' ) {
-                                                       $output .= '</i>'; $state = 'b';
+                                                       $output .= '</i>';
+                                                       $state = 'b';
                                                } elseif ( $state === 'ib' ) {
-                                                       $output .= '</b></i><b>'; $state = 'b';
+                                                       $output .= '</b></i><b>';
+                                                       $state = 'b';
                                                } elseif ( $state === 'both' ) {
-                                                       $output .= '<b><i>' . $buffer . '</i>'; $state = 'b';
+                                                       $output .= '<b><i>' . $buffer . '</i>';
+                                                       $state = 'b';
                                                } else { # $state can be 'b' or ''
-                                                       $output .= '<i>'; $state .= 'i';
+                                                       $output .= '<i>';
+                                                       $state .= 'i';
                                                }
                                        } elseif ( strlen( $r ) == 3 ) {
                                                if ( $state === 'b' ) {
-                                                       $output .= '</b>'; $state = '';
+                                                       $output .= '</b>';
+                                                       $state = '';
                                                } elseif ( $state === 'bi' ) {
-                                                       $output .= '</i></b><i>'; $state = 'i';
+                                                       $output .= '</i></b><i>';
+                                                       $state = 'i';
                                                } elseif ( $state === 'ib' ) {
-                                                       $output .= '</b>'; $state = 'i';
+                                                       $output .= '</b>';
+                                                       $state = 'i';
                                                } elseif ( $state === 'both' ) {
-                                                       $output .= '<i><b>' . $buffer . '</b>'; $state = 'i';
+                                                       $output .= '<i><b>' . $buffer . '</b>';
+                                                       $state = 'i';
                                                } else { # $state can be 'i' or ''
-                                                       $output .= '<b>'; $state .= 'b';
+                                                       $output .= '<b>';
+                                                       $state .= 'b';
                                                }
                                        } elseif ( strlen( $r ) == 5 ) {
                                                if ( $state === 'b' ) {
-                                                       $output .= '</b><i>'; $state = 'i';
+                                                       $output .= '</b><i>';
+                                                       $state = 'i';
                                                } elseif ( $state === 'i' ) {
-                                                       $output .= '</i><b>'; $state = 'b';
+                                                       $output .= '</i><b>';
+                                                       $state = 'b';
                                                } elseif ( $state === 'bi' ) {
-                                                       $output .= '</i></b>'; $state = '';
+                                                       $output .= '</i></b>';
+                                                       $state = '';
                                                } elseif ( $state === 'ib' ) {
-                                                       $output .= '</b></i>'; $state = '';
+                                                       $output .= '</b></i>';
+                                                       $state = '';
                                                } elseif ( $state === 'both' ) {
-                                                       $output .= '<i><b>' . $buffer . '</b></i>'; $state = '';
+                                                       $output .= '<i><b>' . $buffer . '</b></i>';
+                                                       $state = '';
                                                } else { # ($state == '')
-                                                       $buffer = ''; $state = 'both';
+                                                       $buffer = '';
+                                                       $state = 'both';
                                                }
                                        }
                                }
@@ -2491,13 +2507,13 @@ class Parser {
                $state = self::COLON_STATE_TEXT;
                $stack = 0;
                $len = strlen( $str );
-               for( $i = 0; $i < $len; $i++ ) {
+               for ( $i = 0; $i < $len; $i++ ) {
                        $c = $str[$i];
 
-                       switch( $state ) {
+                       switch ( $state ) {
                        # (Using the number is a performance hack for common cases)
                        case 0: # self::COLON_STATE_TEXT:
-                               switch( $c ) {
+                               switch ( $c ) {
                                case "<":
                                        # Could be either a <start> tag or an </end> tag
                                        $state = self::COLON_STATE_TAGSTART;
@@ -2542,7 +2558,7 @@ class Parser {
                                break;
                        case 1: # self::COLON_STATE_TAG:
                                # In a <tag>
-                               switch( $c ) {
+                               switch ( $c ) {
                                case ">":
                                        $stack++;
                                        $state = self::COLON_STATE_TEXT;
@@ -2556,7 +2572,7 @@ class Parser {
                                }
                                break;
                        case 2: # self::COLON_STATE_TAGSTART:
-                               switch( $c ) {
+                               switch ( $c ) {
                                case "/":
                                        $state = self::COLON_STATE_CLOSETAG;
                                        break;
@@ -2746,6 +2762,12 @@ class Parser {
                        case 'subpagenamee':
                                $value = wfEscapeWikiText( $this->mTitle->getSubpageUrlForm() );
                                break;
+                       case 'rootpagename':
+                               $value = wfEscapeWikiText( $this->mTitle->getRootText() );
+                               break;
+                       case 'rootpagenamee':
+                               $value = wfEscapeWikiText( wfUrlEncode( str_replace( ' ', '_', $this->mTitle->getRootText() ) ) );
+                               break;
                        case 'basepagename':
                                $value = wfEscapeWikiText( $this->mTitle->getBaseText() );
                                break;
@@ -2778,7 +2800,7 @@ class Parser {
                                break;
                        case 'pageid': // requested in bug 23427
                                $pageid = $this->getTitle()->getArticleID();
-                               if( $pageid == 0 ) {
+                               if ( $pageid == 0 ) {
                                        # 0 means the page doesn't exist in the database,
                                        # which means the user is previewing a new page.
                                        # The vary-revision flag must be set, because the magic word
@@ -3662,9 +3684,9 @@ class Parser {
                        if ( $skip ) {
                                $text = false;
                                $deps[] = array(
-                                       'title'         => $title,
-                                       'page_id'       => $title->getArticleID(),
-                                       'rev_id'        => null
+                                       'title' => $title,
+                                       'page_id' => $title->getArticleID(),
+                                       'rev_id' => null
                                );
                                break;
                        }
@@ -3680,15 +3702,15 @@ class Parser {
                        }
 
                        $deps[] = array(
-                               'title'         => $title,
-                               'page_id'       => $title->getArticleID(),
-                               'rev_id'        => $rev_id );
+                               'title' => $title,
+                               'page_id' => $title->getArticleID(),
+                               'rev_id' => $rev_id );
                        if ( $rev && !$title->equals( $rev->getTitle() ) ) {
                                # We fetched a rev from a different title; register it too...
                                $deps[] = array(
-                                       'title'         => $rev->getTitle(),
-                                       'page_id'       => $rev->getPage(),
-                                       'rev_id'        => $rev_id );
+                                       'title' => $rev->getTitle(),
+                                       'page_id' => $rev->getPage(),
+                                       'rev_id' => $rev_id );
                        }
 
                        if ( $rev ) {
@@ -4233,7 +4255,7 @@ class Parser {
                        # count number of headlines for each level
                        $sublevelCount[$toclevel]++;
                        $dot = 0;
-                       for( $i = 1; $i <= $toclevel; $i++ ) {
+                       for ( $i = 1; $i <= $toclevel; $i++ ) {
                                if ( !empty( $sublevelCount[$i] ) ) {
                                        if ( $dot ) {
                                                $numbering .= '.';
@@ -4486,7 +4508,7 @@ class Parser {
                        "\r\n" => "\n",
                );
                $text = str_replace( array_keys( $pairs ), array_values( $pairs ), $text );
-               if( $options->getPreSaveTransform() ) {
+               if ( $options->getPreSaveTransform() ) {
                        $text = $this->pstPass2( $text, $user );
                }
                $text = $this->mStripState->unstripBoth( $text );
@@ -4605,8 +4627,9 @@ class Parser {
                $username = $user->getName();
 
                # If not given, retrieve from the user object.
-               if ( $nickname === false )
+               if ( $nickname === false ) {
                        $nickname = $user->getOption( 'nickname' );
+               }
 
                if ( is_null( $fancySig ) ) {
                        $fancySig = $user->getBoolOption( 'fancysig' );
@@ -4647,7 +4670,7 @@ class Parser {
         * @return mixed An expanded string, or false if invalid.
         */
        function validateSig( $text ) {
-               return( Xml::isWellFormedXmlFragment( $text ) ? $text : false );
+               return Xml::isWellFormedXmlFragment( $text ) ? $text : false;
        }
 
        /**
@@ -4885,8 +4908,9 @@ class Parser {
 
                # Add to function cache
                $mw = MagicWord::get( $id );
-               if ( !$mw )
+               if ( !$mw ) {
                        throw new MWException( __METHOD__ . '() expecting a magic word identifier.' );
+               }
 
                $synonyms = $mw->getSynonyms();
                $sensitive = intval( $mw->isCaseSensitive() );
@@ -4930,7 +4954,9 @@ class Parser {
         */
        function setFunctionTagHook( $tag, $callback, $flags ) {
                $tag = strtolower( $tag );
-               if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setFunctionTagHook('$tag', ...) call" );
+               if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
+                       throw new MWException( "Invalid character {$m[0]} in setFunctionTagHook('$tag', ...) call" );
+               }
                $old = isset( $this->mFunctionTagHooks[$tag] ) ?
                        $this->mFunctionTagHooks[$tag] : null;
                $this->mFunctionTagHooks[$tag] = array( $callback, $flags );
@@ -5049,7 +5075,7 @@ class Parser {
                                        if ( $match = $magicWordAlt->matchVariableStartToEnd( $parameterMatch ) ) {
                                                $alt = $this->stripAltText( $match, false );
                                        }
-                                       elseif( $match = $magicWordLink->matchVariableStartToEnd( $parameterMatch ) ) {
+                                       elseif ( $match = $magicWordLink->matchVariableStartToEnd( $parameterMatch ) ) {
                                                $linkValue = strip_tags( $this->replaceLinkHoldersText( $match ) );
                                                $chars = self::EXT_LINK_URL_CLASS;
                                                $prots = $this->mUrlProtocols;
@@ -5189,14 +5215,14 @@ class Parser {
                                # Special case; width and height come in one variable together
                                if ( $type === 'handler' && $paramName === 'width' ) {
                                        $parsedWidthParam = $this->parseWidthParam( $value );
-                                       if( isset( $parsedWidthParam['width'] ) ) {
+                                       if ( isset( $parsedWidthParam['width'] ) ) {
                                                $width = $parsedWidthParam['width'];
                                                if ( $handler->validateParam( 'width', $width ) ) {
                                                        $params[$type]['width'] = $width;
                                                        $validated = true;
                                                }
                                        }
-                                       if( isset( $parsedWidthParam['height'] ) ) {
+                                       if ( isset( $parsedWidthParam['height'] ) ) {
                                                $height = $parsedWidthParam['height'];
                                                if ( $handler->validateParam( 'height', $height ) ) {
                                                        $params[$type]['height'] = $height;
@@ -5210,7 +5236,7 @@ class Parser {
                                                $validated = $handler->validateParam( $paramName, $value );
                                        } else {
                                                # Validate internal parameters
-                                               switch( $paramName ) {
+                                               switch ( $paramName ) {
                                                case 'manualthumb':
                                                case 'alt':
                                                case 'class':
@@ -5648,14 +5674,14 @@ class Parser {
         * @return String: user name
         */
        function getRevisionUser() {
-               if( is_null( $this->mRevisionUser ) ) {
+               if ( is_null( $this->mRevisionUser ) ) {
                        $revObject = $this->getRevisionObject();
 
                        # if this template is subst: the revision id will be blank,
                        # so just use the current user's name
-                       if( $revObject ) {
+                       if ( $revObject ) {
                                $this->mRevisionUser = $revObject->getUserText();
-                       } elseif( $this->ot['wiki'] || $this->mOptions->getIsPreview() ) {
+                       } elseif ( $this->ot['wiki'] || $this->mOptions->getIsPreview() ) {
                                $this->mRevisionUser = $this->getUser()->getName();
                        }
                }
@@ -5935,7 +5961,7 @@ class Parser {
         */
        public function parseWidthParam( $value ) {
                $parsedWidthParam = array();
-               if( $value === '' ) {
+               if ( $value === '' ) {
                        return $parsedWidthParam;
                }
                $m = array();
index 0faa40a..7c5eeb4 100644 (file)
@@ -67,7 +67,7 @@ class ParserCache {
 
                // idhash seem to mean 'page id' + 'rendering hash' (r3710)
                $pageid = $article->getID();
-               $renderkey = (int)($wgRequest->getVal( 'action' ) == 'render');
+               $renderkey = (int)( $wgRequest->getVal( 'action' ) == 'render' );
 
                $key = wfMemcKey( 'pcache', 'idhash', "{$pageid}-{$renderkey}!{$hash}" );
                return $key;
@@ -128,7 +128,7 @@ class ParserCache {
        public function getKey( $article, $popts, $useOutdated = true ) {
                global $wgCacheEpoch;
 
-               if( $popts instanceof User ) {
+               if ( $popts instanceof User ) {
                        wfWarn( "Use of outdated prototype ParserCache::getKey( &\$article, &\$user )\n" );
                        $popts = ParserOptions::newFromUser( $popts );
                }
@@ -227,7 +227,7 @@ class ParserCache {
        public function save( $parserOutput, $article, $popts ) {
                $expire = $parserOutput->getCacheExpiry();
 
-               if( $expire > 0 ) {
+               if ( $expire > 0 ) {
                        $now = wfTimestampNow();
 
                        $optionsKey = new CacheTime;
index 3eb83e3..2bd5a5d 100644 (file)
@@ -538,7 +538,7 @@ class ParserOptions {
 
                // add in language specific options, if any
                // @todo FIXME: This is just a way of retrieving the url/user preferred variant
-               if( !is_null( $title ) ) {
+               if ( !is_null( $title ) ) {
                        $confstr .= $title->getPageLanguage()->getExtraHashOptions();
                } else {
                        global $wgContLang;
@@ -557,8 +557,9 @@ class ParserOptions {
                        $confstr .= '!printable=1';
                }
 
-               if ( $this->mExtraKey != '' )
+               if ( $this->mExtraKey != '' ) {
                        $confstr .= $this->mExtraKey;
+               }
 
                // Give a chance for extensions to modify the hash, if they have
                // extra options or other effects on the parser cache.
index 3af3b7a..c5e42a4 100644 (file)
@@ -176,10 +176,10 @@ class ParserOutput extends CacheTime {
                global $wgServer, $wgRegisterInternalExternals;
 
                $registerExternalLink = true;
-               if( !$wgRegisterInternalExternals ) {
+               if ( !$wgRegisterInternalExternals ) {
                        $registerExternalLink = !self::isLinkInternal( $wgServer, $url );
                }
-               if( $registerExternalLink ) {
+               if ( $registerExternalLink ) {
                        $this->mExternalLinks[$url] = 1;
                }
        }
@@ -201,11 +201,11 @@ class ParserOutput extends CacheTime {
                if ( $ns == NS_MEDIA ) {
                        // Normalize this pseudo-alias if it makes it down here...
                        $ns = NS_FILE;
-               } elseif( $ns == NS_SPECIAL ) {
+               } elseif ( $ns == NS_SPECIAL ) {
                        // We don't record Special: links currently
                        // It might actually be wise to, but we'd need to do some normalization.
                        return;
-               } elseif( $dbk === '' ) {
+               } elseif ( $dbk === '' ) {
                        // Don't record self links -  [[#Foo]]
                        return;
                }
@@ -258,7 +258,7 @@ class ParserOutput extends CacheTime {
         */
        function addInterwikiLink( $title ) {
                $prefix = $title->getInterwiki();
-               if( $prefix == '' ) {
+               if ( $prefix == '' ) {
                        throw new MWException( 'Non-interwiki link passed, internal parser error.' );
                }
                if ( !isset( $this->mInterwikiLinks[$prefix] ) ) {
@@ -329,7 +329,7 @@ class ParserOutput extends CacheTime {
         */
        public function getDisplayTitle() {
                $t = $this->getTitleText();
-               if( $t === '' ) {
+               if ( $t === '' ) {
                        return false;
                }
                return $t;
index f25340f..aeae234 100644 (file)
@@ -122,7 +122,7 @@ class Parser_DiffTest
 
        function setFunctionHook( $id, $callback, $flags = 0 ) {
                $this->init();
-               foreach  ( $this->parsers as $parser ) {
+               foreach ( $this->parsers as $parser ) {
                        $parser->setFunctionHook( $id, $callback, $flags );
                }
        }
index 1e90928..809e7f7 100644 (file)
@@ -148,21 +148,19 @@ class Preprocessor_DOM implements Preprocessor {
                                        wfDebugLog( "Preprocessor", "Loaded preprocessor XML from memcached (key $cacheKey)" );
                                }
                        }
-               }
-               if ( $xml === false ) {
-                       if ( $cacheable ) {
+                       if ( $xml === false ) {
                                wfProfileIn( __METHOD__ . '-cache-miss' );
                                $xml = $this->preprocessToXml( $text, $flags );
                                $cacheValue = sprintf( "%08d", self::CACHE_VERSION ) . $xml;
                                $wgMemc->set( $cacheKey, $cacheValue, 86400 );
                                wfProfileOut( __METHOD__ . '-cache-miss' );
                                wfDebugLog( "Preprocessor", "Saved preprocessor XML to memcached (key $cacheKey)" );
-                       } else {
-                               $xml = $this->preprocessToXml( $text, $flags );
                        }
-
+               } else {
+                       $xml = $this->preprocessToXml( $text, $flags );
                }
 
+
                // Fail if the number of elements exceeds acceptable limits
                // Do not attempt to generate the DOM
                $this->parser->mGeneratedPPNodeCount += substr_count( $xml, '<' );
@@ -577,7 +575,7 @@ class Preprocessor_DOM implements Preprocessor {
                                                'open' => $curChar,
                                                'close' => $rule['end'],
                                                'count' => $count,
-                                               'lineStart' => ($i > 0 && $text[$i - 1] == "\n"),
+                                               'lineStart' => ( $i > 0 && $text[$i - 1] == "\n" ),
                                        );
 
                                        $stack->push( $piece );
@@ -1214,7 +1212,9 @@ class PPFrame_DOM implements PPFrame {
                $first = true;
                $s = '';
                foreach ( $args as $root ) {
-                       if ( $root instanceof PPNode_DOM ) $root = $root->node;
+                       if ( $root instanceof PPNode_DOM ) {
+                               $root = $root->node;
+                       }
                        if ( !is_array( $root ) && !( $root instanceof DOMNodeList ) ) {
                                $root = array( $root );
                        }
index 465c5a6..654a66e 100644 (file)
@@ -515,7 +515,7 @@ class Preprocessor_Hash implements Preprocessor {
                                                'open' => $curChar,
                                                'close' => $rule['end'],
                                                'count' => $count,
-                                               'lineStart' => ($i > 0 && $text[$i - 1] == "\n"),
+                                               'lineStart' => ( $i > 0 && $text[$i - 1] == "\n" ),
                                        );
 
                                        $stack->push( $piece );
index 0f7e0d3..e3ea40b 100644 (file)
@@ -158,7 +158,7 @@ class MWTidy {
                global $wgTidyInternal;
 
                $retval = 0;
-               if( $wgTidyInternal ) {
+               if ( $wgTidyInternal ) {
                        $errorStr = self::execInternalTidy( $text, true, $retval );
                } else {
                        $errorStr = self::execExternalTidy( $text, true, $retval );
index e39a7b2..49d961e 100644 (file)
@@ -75,10 +75,10 @@ class Profiler {
         * @return Profiler
         */
        public static function instance() {
-               if( is_null( self::$__instance ) ) {
+               if ( is_null( self::$__instance ) ) {
                        global $wgProfiler;
-                       if( is_array( $wgProfiler ) ) {
-                               if( !isset( $wgProfiler['class'] ) ) {
+                       if ( is_array( $wgProfiler ) ) {
+                               if ( !isset( $wgProfiler['class'] ) ) {
                                        wfDebug( __METHOD__ . " called without \$wgProfiler['class']"
                                                . " set, falling back to ProfilerStub for safety\n" );
                                        $class = 'ProfilerStub';
@@ -86,7 +86,7 @@ class Profiler {
                                        $class = $wgProfiler['class'];
                                }
                                self::$__instance = new $class( $wgProfiler );
-                       } elseif( $wgProfiler instanceof Profiler ) {
+                       } elseif ( $wgProfiler instanceof Profiler ) {
                                self::$__instance = $wgProfiler; // back-compat
                        } else {
                                wfDebug( __METHOD__ . ' called with bogus $wgProfiler setting,'
@@ -157,7 +157,7 @@ class Profiler {
         */
        public function profileIn( $functionname ) {
                global $wgDebugFunctionEntry;
-               if( $wgDebugFunctionEntry ) {
+               if ( $wgDebugFunctionEntry ) {
                        $this->debug( str_repeat( ' ', count( $this->mWorkStack ) ) . 'Entering ' . $functionname . "\n" );
                }
 
@@ -174,7 +174,7 @@ class Profiler {
                $memory = memory_get_usage();
                $time = $this->getTime();
 
-               if( $wgDebugFunctionEntry ) {
+               if ( $wgDebugFunctionEntry ) {
                        $this->debug( str_repeat( ' ', count( $this->mWorkStack ) - 1 ) . 'Exiting ' . $functionname . "\n" );
                }
 
@@ -184,12 +184,11 @@ class Profiler {
                        $this->debug( "Profiling error, !\$bit: $functionname\n" );
                } else {
                        //if( $wgDebugProfiling ) {
-                               if( $functionname == 'close' ) {
+                               if ( $functionname == 'close' ) {
                                        $message = "Profile section ended by close(): {$bit[0]}";
                                        $this->debug( "$message\n" );
                                        $this->mStack[] = array( $message, 0, 0.0, 0, 0.0, 0 );
-                               }
-                               elseif( $bit[0] != $functionname ) {
+                               } elseif ( $bit[0] != $functionname ) {
                                        $message = "Profiling error: in({$bit[0]}), out($functionname)";
                                        $this->debug( "$message\n" );
                                        $this->mStack[] = array( $message, 0, 0.0, 0, 0.0, 0 );
@@ -205,7 +204,7 @@ class Profiler {
         * Close opened profiling sections
         */
        public function close() {
-               while( count( $this->mWorkStack ) ) {
+               while ( count( $this->mWorkStack ) ) {
                        $this->profileOut( 'close' );
                }
        }
@@ -228,11 +227,11 @@ class Profiler {
                global $wgDebugFunctionEntry, $wgProfileCallTree;
                $wgDebugFunctionEntry = false;
 
-               if( !count( $this->mStack ) && !count( $this->mCollated ) ) {
+               if ( !count( $this->mStack ) && !count( $this->mCollated ) ) {
                        return "No profiling output\n";
                }
 
-               if( $wgProfileCallTree ) {
+               if ( $wgProfileCallTree ) {
                        return $this->getCallTree();
                } else {
                        return $this->getFunctionReport();
@@ -254,16 +253,16 @@ class Profiler {
         * @return array
         */
        function remapCallTree( $stack ) {
-               if( count( $stack ) < 2 ) {
+               if ( count( $stack ) < 2 ) {
                        return $stack;
                }
                $outputs = array();
-               for( $max = count( $stack ) - 1; $max > 0; ) {
+               for ( $max = count( $stack ) - 1; $max > 0; ) {
                        /* Find all items under this entry */
                        $level = $stack[$max][1];
                        $working = array();
-                       for( $i = $max -1; $i >= 0; $i-- ) {
-                               if( $stack[$i][1] > $level ) {
+                       for ( $i = $max -1; $i >= 0; $i-- ) {
+                               if ( $stack[$i][1] > $level ) {
                                        $working[] = $stack[$i];
                                } else {
                                        break;
@@ -271,7 +270,7 @@ class Profiler {
                        }
                        $working = $this->remapCallTree( array_reverse( $working ) );
                        $output = array();
-                       foreach( $working as $item ) {
+                       foreach ( $working as $item ) {
                                array_push( $output, $item );
                        }
                        array_unshift( $output, $stack[$max] );
@@ -280,8 +279,8 @@ class Profiler {
                        array_unshift( $outputs, $output );
                }
                $final = array();
-               foreach( $outputs as $output ) {
-                       foreach( $output as $item ) {
+               foreach ( $outputs as $output ) {
+                       foreach ( $output as $item ) {
                                $final[] = $item;
                        }
                }
@@ -391,18 +390,17 @@ class Profiler {
 
                # First, subtract the overhead!
                $overheadTotal = $overheadMemory = $overheadInternal = array();
-               foreach( $this->mStack as $entry ) {
+               foreach ( $this->mStack as $entry ) {
                        $fname = $entry[0];
                        $start = $entry[2];
                        $end = $entry[4];
                        $elapsed = $end - $start;
                        $memory = $entry[5] - $entry[3];
 
-                       if( $fname == '-overhead-total' ) {
+                       if ( $fname == '-overhead-total' ) {
                                $overheadTotal[] = $elapsed;
                                $overheadMemory[] = $memory;
-                       }
-                       elseif( $fname == '-overhead-internal' ) {
+                       } elseif ( $fname == '-overhead-internal' ) {
                                $overheadInternal[] = $elapsed;
                        }
                }
@@ -411,7 +409,7 @@ class Profiler {
                $overheadInternal = $overheadInternal ? array_sum( $overheadInternal ) / count( $overheadInternal ) : 0;
 
                # Collate
-               foreach( $this->mStack as $index => $entry ) {
+               foreach ( $this->mStack as $index => $entry ) {
                        $fname = $entry[0];
                        $start = $entry[2];
                        $end = $entry[4];
@@ -420,16 +418,16 @@ class Profiler {
                        $memory = $entry[5] - $entry[3];
                        $subcalls = $this->calltreeCount( $this->mStack, $index );
 
-                       if( !preg_match( '/^-overhead/', $fname ) ) {
+                       if ( !preg_match( '/^-overhead/', $fname ) ) {
                                # Adjust for profiling overhead (except special values with elapsed=0
-                               if( $elapsed ) {
+                               if ( $elapsed ) {
                                        $elapsed -= $overheadInternal;
                                        $elapsed -= ($subcalls * $overheadTotal);
                                        $memory -= ($subcalls * $overheadMemory);
                                }
                        }
 
-                       if( !array_key_exists( $fname, $this->mCollated ) ) {
+                       if ( !array_key_exists( $fname, $this->mCollated ) ) {
                                $this->mCollated[$fname] = 0;
                                $this->mCalls[$fname] = 0;
                                $this->mMemory[$fname] = 0;
@@ -467,7 +465,7 @@ class Profiler {
 
                $total = isset( $this->mCollated['-total'] ) ? $this->mCollated['-total'] : 0;
 
-               foreach( $this->mCollated as $fname => $elapsed ) {
+               foreach ( $this->mCollated as $fname => $elapsed ) {
                        $calls = $this->mCalls[$fname];
                        $percent = $total ? 100. * $elapsed / $total : 0;
                        $memory = $this->mMemory[$fname];
@@ -483,7 +481,7 @@ class Profiler {
         */
        protected static function calculateOverhead( $profileCount ) {
                wfProfileIn( '-overhead-total' );
-               for( $i = 0; $i < $profileCount; $i++ ) {
+               for ( $i = 0; $i < $profileCount; $i++ ) {
                        wfProfileIn( '-overhead-internal' );
                        wfProfileOut( '-overhead-internal' );
                }
@@ -515,16 +513,16 @@ class Profiler {
                global $wgProfilePerHost, $wgProfileToDatabase;
 
                # Do not log anything if database is readonly (bug 5375)
-               if( wfReadOnly() || !$wgProfileToDatabase ) {
+               if ( wfReadOnly() || !$wgProfileToDatabase ) {
                        return;
                }
 
                $dbw = wfGetDB( DB_MASTER );
-               if( !is_object( $dbw ) ) {
+               if ( !is_object( $dbw ) ) {
                        return;
                }
 
-               if( $wgProfilePerHost ) {
+               if ( $wgProfilePerHost ) {
                        $pfhost = wfHostname();
                } else {
                        $pfhost = '';
@@ -533,7 +531,7 @@ class Profiler {
                try {
                        $this->collateData();
 
-                       foreach( $this->mCollated as $name => $elapsed ) {
+                       foreach ( $this->mCollated as $name => $elapsed ) {
                                $eventCount = $this->mCalls[$name];
                                $timeSum = (float) ($elapsed * 1000);
                                $memorySum = (float)$this->mMemory[$name];
@@ -585,7 +583,7 @@ class Profiler {
         * @param string $s to output
         */
        function debug( $s ) {
-               if( defined( 'MW_COMPILED' ) || function_exists( 'wfDebug' ) ) {
+               if ( defined( 'MW_COMPILED' ) || function_exists( 'wfDebug' ) ) {
                        wfDebug( $s );
                }
        }
index 1cf4fa7..83bdf71 100644 (file)
@@ -50,7 +50,7 @@ class ProfilerSimpleUDP extends ProfilerSimple {
                $plength = 0;
                $packet = "";
                foreach ( $this->mCollated as $entry => $pfdata ) {
-                       if( !isset( $pfdata['count'] )
+                       if ( !isset( $pfdata['count'] )
                                || !isset( $pfdata['cpu'] )
                                || !isset( $pfdata['cpu_sq'] )
                                || !isset( $pfdata['real'] )
index 5919cde..861ff18 100644 (file)
@@ -52,7 +52,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                 */
                $namespaceIds = $wgContLang->getNamespaceIds();
                $caseSensitiveNamespaces = array();
-               foreach( MWNamespace::getCanonicalNamespaces() as $index => $name ) {
+               foreach ( MWNamespace::getCanonicalNamespaces() as $index => $name ) {
                        $namespaceIds[$wgContLang->lc( $name )] = $index;
                        if ( !MWNamespace::isCapitalized( $index ) ) {
                                $caseSensitiveNamespaces[] = $index;
index 7586bb7..9064263 100644 (file)
@@ -54,7 +54,7 @@ class ResourceLoaderUserGroupsModule extends ResourceLoaderWikiModule {
                }
 
                $pages = array();
-               foreach( $user->getEffectiveGroups() as $group ) {
+               foreach ( $user->getEffectiveGroups() as $group ) {
                        if ( in_array( $group, array( '*', 'user' ) ) ) {
                                continue;
                        }
index d2ce0b7..ac72276 100644 (file)
@@ -52,7 +52,7 @@ class RevDel_RevisionList extends RevDel_List {
                        array_merge( Revision::selectFields(), Revision::selectUserFields() ),
                        array(
                                'rev_page' => $this->title->getArticleID(),
-                               'rev_id'   => $ids,
+                               'rev_id' => $ids,
                        ),
                        __METHOD__,
                        array( 'ORDER BY' => 'rev_id DESC' ),
@@ -292,7 +292,7 @@ class RevDel_ArchiveList extends RevDel_RevisionList {
                return $db->select( 'archive', '*',
                                array(
                                        'ar_namespace' => $this->title->getNamespace(),
-                                       'ar_title'     => $this->title->getDBkey(),
+                                       'ar_title' => $this->title->getDBkey(),
                                        'ar_timestamp' => $timestamps
                                ),
                                __METHOD__,
@@ -349,12 +349,12 @@ class RevDel_ArchiveItem extends RevDel_RevisionItem {
                $dbw->update( 'archive',
                        array( 'ar_deleted' => $bits ),
                        array(
-                               'ar_namespace'  => $this->list->title->getNamespace(),
-                               'ar_title'      => $this->list->title->getDBkey(),
+                               'ar_namespace' => $this->list->title->getNamespace(),
+                               'ar_title' => $this->list->title->getDBkey(),
                                // use timestamp for index
-                               'ar_timestamp'  => $this->row->ar_timestamp,
-                               'ar_rev_id'     => $this->row->ar_rev_id,
-                               'ar_deleted'    => $this->getBits()
+                               'ar_timestamp' => $this->row->ar_timestamp,
+                               'ar_rev_id' => $this->row->ar_rev_id,
+                               'ar_deleted' => $this->getBits()
                        ),
                        __METHOD__ );
                return (bool)$dbw->affectedRows();
@@ -449,14 +449,14 @@ class RevDel_FileList extends RevDel_List {
         */
        public function doQuery( $db ) {
                $archiveNames = array();
-               foreach( $this->ids as $timestamp ) {
+               foreach ( $this->ids as $timestamp ) {
                        $archiveNames[] = $timestamp . '!' . $this->title->getDBkey();
                }
                return $db->select(
                        'oldimage',
                        OldLocalFile::selectFields(),
                        array(
-                               'oi_name'         => $this->title->getDBkey(),
+                               'oi_name' => $this->title->getDBkey(),
                                'oi_archive_name' => $archiveNames
                        ),
                        __METHOD__,
@@ -623,8 +623,8 @@ class RevDel_FileItem extends RevDel_Item {
                                array(),
                                array(
                                        'target' => $this->list->title->getPrefixedText(),
-                                       'file'   => $this->file->getArchiveName(),
-                                       'token'  => $this->list->getUser()->getEditToken(
+                                       'file' => $this->file->getArchiveName(),
+                                       'token' => $this->list->getUser()->getEditToken(
                                                $this->file->getArchiveName() )
                                )
                        );
@@ -636,13 +636,13 @@ class RevDel_FileItem extends RevDel_Item {
         * @return string HTML
         */
        protected function getUserTools() {
-               if( $this->file->userCan( Revision::DELETED_USER, $this->list->getUser() ) ) {
+               if ( $this->file->userCan( Revision::DELETED_USER, $this->list->getUser() ) ) {
                        $link = Linker::userLink( $this->file->user, $this->file->user_text ) .
                                Linker::userToolLinks( $this->file->user, $this->file->user_text );
                } else {
                        $link = $this->list->msg( 'rev-deleted-user' )->escaped();
                }
-               if( $this->file->isDeleted( Revision::DELETED_USER ) ) {
+               if ( $this->file->isDeleted( Revision::DELETED_USER ) ) {
                        return '<span class="history-deleted">' . $link . '</span>';
                }
                return $link;
@@ -655,12 +655,12 @@ class RevDel_FileItem extends RevDel_Item {
         * @return string HTML
         */
        protected function getComment() {
-               if( $this->file->userCan( File::DELETED_COMMENT, $this->list->getUser() ) ) {
+               if ( $this->file->userCan( File::DELETED_COMMENT, $this->list->getUser() ) ) {
                        $block = Linker::commentBlock( $this->file->description );
                } else {
                        $block = ' ' . $this->list->msg( 'rev-deleted-comment' )->escaped();
                }
-               if( $this->file->isDeleted( File::DELETED_COMMENT ) ) {
+               if ( $this->file->isDeleted( File::DELETED_COMMENT ) ) {
                        return "<span class=\"history-deleted\">$block</span>";
                }
                return $block;
@@ -700,7 +700,7 @@ class RevDel_ArchivedFileList extends RevDel_FileList {
                        ArchivedFile::selectFields(),
                        array(
                                'fa_name' => $this->title->getDBkey(),
-                               'fa_id'   => $ids
+                               'fa_id' => $ids
                        ),
                        __METHOD__,
                        array( 'ORDER BY' => 'fa_id DESC' )
@@ -759,7 +759,7 @@ class RevDel_ArchivedFileItem extends RevDel_FileItem {
                        $this->file->getTimestamp(), $this->list->getUser() ) );
 
                # Hidden files...
-               if( !$this->canViewContent() ) {
+               if ( !$this->canViewContent() ) {
                        $link = $date;
                } else {
                        $undelete = SpecialPage::getTitleFor( 'Undelete' );
@@ -772,7 +772,7 @@ class RevDel_ArchivedFileItem extends RevDel_FileItem {
                                )
                        );
                }
-               if( $this->isDeleted() ) {
+               if ( $this->isDeleted() ) {
                        $link = '<span class="history-deleted">' . $link . '</span>';
                }
                return $link;
@@ -901,7 +901,7 @@ class RevDel_LogItem extends RevDel_Item {
                $action = $formatter->getActionText();
                // Comment
                $comment = $this->list->getLanguage()->getDirMark() . Linker::commentBlock( $this->row->log_comment );
-               if( LogEventsList::isDeleted( $this->row, LogPage::DELETED_COMMENT ) ) {
+               if ( LogEventsList::isDeleted( $this->row, LogPage::DELETED_COMMENT ) ) {
                        $comment = '<span class="history-deleted">' . $comment . '</span>';
                }
 
index fcbec9e..9ace35a 100644 (file)
@@ -94,14 +94,14 @@ abstract class RevDel_List extends RevisionListBase {
                        }
                        if ( !$item->canView() ) {
                                // Cannot access this revision
-                               $msg = ($opType == 'show') ?
+                               $msg = ( $opType == 'show' ) ?
                                        'revdelete-show-no-access' : 'revdelete-modify-no-access';
                                $status->error( $msg, $item->formatDate(), $item->formatTime() );
                                $status->failCount++;
                                continue;
                        }
                        // Cannot just "hide from Sysops" without hiding any fields
-                       if( $newBits == Revision::DELETED_RESTRICTED ) {
+                       if ( $newBits == Revision::DELETED_RESTRICTED ) {
                                $status->warning( 'revdelete-only-restricted', $item->formatDate(), $item->formatTime() );
                                $status->failCount++;
                                continue;
@@ -113,9 +113,9 @@ abstract class RevDel_List extends RevisionListBase {
                        if ( $ok ) {
                                $idsForLog[] = $item->getId();
                                $status->successCount++;
-                               if( $item->getAuthorId() > 0 ) {
+                               if ( $item->getAuthorId() > 0 ) {
                                        $authorIds[] = $item->getAuthorId();
-                               } elseif( IP::isIPAddress( $item->getAuthorName() ) ) {
+                               } elseif ( IP::isIPAddress( $item->getAuthorName() ) ) {
                                        $authorIPs[] = $item->getAuthorName();
                                }
                        } else {
@@ -189,7 +189,7 @@ abstract class RevDel_List extends RevisionListBase {
        protected function updateLog( $params ) {
                // Get the URL param's corresponding DB field
                $field = RevisionDeleter::getRelationType( $this->getType() );
-               if( !$field ) {
+               if ( !$field ) {
                        throw new MWException( "Bad log URL param type!" );
                }
                // Put things hidden from sysops in the oversight log
index c02e9c7..4505ee1 100644 (file)
@@ -54,7 +54,7 @@ class RevisionDeleteUser {
                # The same goes for the sysop-restricted *_deleted bit.
                $delUser = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
                $delAction = LogPage::DELETED_ACTION | Revision::DELETED_RESTRICTED;
-               if( $op == '&' ) {
+               if ( $op == '&' ) {
                        $delUser = "~{$delUser}";
                        $delAction = "~{$delAction}";
                }
index d2e10e1..2de19ac 100644 (file)
@@ -39,7 +39,7 @@ class RevisionDeleter {
         * @param array $arr the array to update.
         */
        protected static function checkItem( $desc, $field, $diff, $new, &$arr ) {
-               if( $diff & $field ) {
+               if ( $diff & $field ) {
                        $arr[( $new & $field ) ? 0 : 1][] = $desc;
                }
        }
@@ -73,11 +73,12 @@ class RevisionDeleter {
                self::checkItem( 'revdelete-uname',
                        Revision::DELETED_USER, $diff, $n, $ret );
                // Restriction application to sysops
-               if( $diff & Revision::DELETED_RESTRICTED ) {
-                       if( $n & Revision::DELETED_RESTRICTED )
+               if ( $diff & Revision::DELETED_RESTRICTED ) {
+                       if ( $n & Revision::DELETED_RESTRICTED ) {
                                $ret[2][] = 'revdelete-restricted';
-                       else
+                       } else {
                                $ret[2][] = 'revdelete-unrestricted';
+                       }
                }
                return $ret;
        }
index cfd941a..13e8a00 100644 (file)
@@ -93,7 +93,7 @@ class SearchEngine {
         * @return Boolean
         */
        public function supports( $feature ) {
-               switch( $feature ) {
+               switch ( $feature ) {
                case 'list-redirects':
                        return true;
                case 'title-suffix-filter':
@@ -331,8 +331,9 @@ class SearchEngine {
                                $parsed = substr( $query, strlen( $prefix ) + 1 );
                        }
                }
-               if ( trim( $parsed ) == '' )
+               if ( trim( $parsed ) == '' ) {
                        $parsed = $query; // prefix was the whole query
+               }
 
                wfRunHooks( 'SearchEngineReplacePrefixesComplete', array( $this, $query, &$parsed ) );
 
@@ -420,8 +421,9 @@ class SearchEngine {
 
                $formatted = array_map( array( $wgContLang, 'getFormattedNsText' ), $namespaces );
                foreach ( $formatted as $key => $ns ) {
-                       if ( empty( $ns ) )
+                       if ( empty( $ns ) ) {
                                $formatted[$key] = wfMessage( 'blanknamespace' )->text();
+                       }
                }
                return $formatted;
        }
@@ -641,26 +643,30 @@ class SqlSearchResultSet extends SearchResultSet {
        }
 
        function numRows() {
-               if ( $this->mResultSet === false )
+               if ( $this->mResultSet === false ) {
                        return false;
+               }
 
                return $this->mResultSet->numRows();
        }
 
        function next() {
-               if ( $this->mResultSet === false )
+               if ( $this->mResultSet === false ) {
                        return false;
+               }
 
                $row = $this->mResultSet->fetchObject();
-               if ( $row === false )
+               if ( $row === false ) {
                        return false;
+               }
 
                return SearchResult::newFromRow( $row );
        }
 
        function free() {
-               if ( $this->mResultSet === false )
+               if ( $this->mResultSet === false ) {
                        return false;
+               }
 
                $this->mResultSet->free();
        }
@@ -750,8 +756,9 @@ class SearchResult {
                        wfRunHooks( 'SearchResultInitFromTitle', array( $title, &$id ) );
                        $this->mRevision = Revision::newFromTitle(
                                $this->mTitle, $id, Revision::READ_NORMAL );
-                       if ( $this->mTitle->getNamespace() === NS_FILE )
+                       if ( $this->mTitle->getNamespace() === NS_FILE ) {
                                $this->mImage = wfFindFile( $this->mTitle );
+                       }
                }
        }
 
@@ -761,8 +768,9 @@ class SearchResult {
         * @return Boolean
         */
        function isBrokenTitle() {
-               if ( is_null( $this->mTitle ) )
+               if ( is_null( $this->mTitle ) ) {
                        return true;
+               }
                return false;
        }
 
@@ -816,10 +824,11 @@ class SearchResult {
                // TODO: make highliter take a content object. Make ContentHandler a factory for SearchHighliter.
                list( $contextlines, $contextchars ) = SearchEngine::userHighlightPrefs( $wgUser );
                $h = new SearchHighlighter();
-               if ( $wgAdvancedSearchHighlighting )
+               if ( $wgAdvancedSearchHighlighting ) {
                        return $h->highlightText( $this->mText, $terms, $contextlines, $contextchars );
-               else
+               } else {
                        return $h->highlightSimple( $this->mText, $terms, $contextlines, $contextchars );
+               }
        }
 
        /**
@@ -863,10 +872,11 @@ class SearchResult {
         * @return String: timestamp
         */
        function getTimestamp() {
-               if ( $this->mRevision )
+               if ( $this->mRevision ) {
                        return $this->mRevision->getTimestamp();
-               elseif ( $this->mImage )
+               } elseif ( $this->mImage ) {
                        return $this->mImage->getTimestamp();
+               }
                return '';
        }
 
@@ -952,8 +962,9 @@ class SearchHighlighter {
                global $wgSearchHighlightBoundaries;
                $fname = __METHOD__;
 
-               if ( $text == '' )
+               if ( $text == '' ) {
                        return '';
+               }
 
                // spli text into text + templates/links/tables
                $spat = "/(\\{\\{)|(\\[\\[[^\\]:]+:)|(\n\\{\\|)";
@@ -984,8 +995,9 @@ class SearchHighlighter {
                                                if ( $key == 2 ) {
                                                        // see if this is an image link
                                                        $ns = substr( $val[0], 2, - 1 );
-                                                       if ( $wgContLang->getNsIndex( $ns ) != NS_FILE )
+                                                       if ( $wgContLang->getNsIndex( $ns ) != NS_FILE ) {
                                                                break;
+                                                       }
 
                                                }
                                                $epat = $endPatterns[$key];
@@ -1155,17 +1167,19 @@ class SearchHighlighter {
                $last = - 1;
                $extract = '';
                foreach ( $snippets as $index => $line ) {
-                       if ( $last == - 1 )
+                       if ( $last == - 1 ) {
                                $extract .= $line; // first line
-                       elseif ( $last + 1 == $index && $offsets[$last] + strlen( $snippets[$last] ) >= strlen( $all[$last] ) )
+                       } elseif ( $last + 1 == $index && $offsets[$last] + strlen( $snippets[$last] ) >= strlen( $all[$last] ) ) {
                                $extract .= " " . $line; // continous lines
-                       else
+                       } else {
                                $extract .= '<b> ... </b>' . $line;
+                       }
 
                        $last = $index;
                }
-               if ( $extract )
+               if ( $extract ) {
                        $extract .= '<b> ... </b>';
+               }
 
                $processed = array();
                foreach ( $terms as $term ) {
@@ -1193,8 +1207,9 @@ class SearchHighlighter {
                $split = explode( "\n", $this->mCleanWikitext ? $this->removeWiki( $text ) : $text );
                foreach ( $split as $line ) {
                        $tt = trim( $line );
-                       if ( $tt )
+                       if ( $tt ) {
                                $extracts[$count++] = $tt;
+                       }
                }
        }
 
@@ -1268,8 +1283,9 @@ class SearchHighlighter {
                        while ( $char >= 0x80 && $char < 0xc0 ) {
                                // skip trailing bytes
                                $point++;
-                               if ( $point >= strlen( $text ) )
+                               if ( $point >= strlen( $text ) ) {
                                        return strlen( $text );
+                               }
                                $char = ord( $text[$point] );
                        }
                        return $point;
@@ -1289,24 +1305,28 @@ class SearchHighlighter {
         * @protected
         */
        function process( $pattern, $extracts, &$linesleft, &$contextchars, &$out, &$offsets ) {
-               if ( $linesleft == 0 )
+               if ( $linesleft == 0 ) {
                        return; // nothing to do
+               }
                foreach ( $extracts as $index => $line ) {
-                       if ( array_key_exists( $index, $out ) )
+                       if ( array_key_exists( $index, $out ) ) {
                                continue; // this line already highlighted
+                       }
 
                        $m = array();
-                       if ( !preg_match( $pattern, $line, $m, PREG_OFFSET_CAPTURE ) )
+                       if ( !preg_match( $pattern, $line, $m, PREG_OFFSET_CAPTURE ) ) {
                                continue;
+                       }
 
                        $offset = $m[0][1];
                        $len = strlen( $m[0][0] );
-                       if ( $offset + $len < $contextchars )
+                       if ( $offset + $len < $contextchars ) {
                                $begin = 0;
-                       elseif ( $len > $contextchars )
+                       } elseif ( $len > $contextchars ) {
                                $begin = $offset;
-                       else
+                       } else {
                                $begin = $offset + intval( ( $len - $contextchars ) / 2 );
+                       }
 
                        $end = $begin + $contextchars;
 
@@ -1315,8 +1335,9 @@ class SearchHighlighter {
                        $out[$index] = $this->extract( $line, $begin, $end, $posBegin );
                        $offsets[$index] = $posBegin;
                        $linesleft--;
-                       if ( $linesleft == 0 )
+                       if ( $linesleft == 0 ) {
                                return;
+                       }
                }
        }
 
@@ -1357,16 +1378,17 @@ class SearchHighlighter {
         */
        function linkReplace( $matches ) {
                $colon = strpos( $matches[1], ':' );
-               if ( $colon === false )
+               if ( $colon === false ) {
                        return $matches[2]; // replace with caption
+               }
                global $wgContLang;
                $ns = substr( $matches[1], 0, $colon );
                $index = $wgContLang->getNsIndex( $ns );
-               if ( $index !== false && ( $index == NS_FILE || $index == NS_CATEGORY ) )
+               if ( $index !== false && ( $index == NS_FILE || $index == NS_CATEGORY ) ) {
                        return $matches[0]; // return the whole thing
-               else
+               } else {
                        return $matches[2];
-
+               }
        }
 
        /**
index 163d9dc..cbc1a7a 100644 (file)
@@ -170,8 +170,9 @@ class SearchMssql extends SearchEngine {
 
                                if ( !empty( $terms[3] ) ) {
                                        $regexp = preg_quote( $terms[3], '/' );
-                                       if ( $terms[4] )
+                                       if ( $terms[4] ) {
                                                $regexp .= "[0-9A-Za-z_]+";
+                                       }
                                } else {
                                        $regexp = preg_quote( str_replace( '"', '', $terms[2] ), '/' );
                                }
@@ -247,8 +248,9 @@ class MssqlSearchResultSet extends SearchResultSet {
 
        function next() {
                $row = $this->mResultSet->fetchObject();
-               if ( $row === false )
+               if ( $row === false ) {
                        return false;
+               }
                return new SearchResult( $row );
        }
 }
index ddfd1b3..c219b92 100644 (file)
@@ -57,12 +57,12 @@ class SearchMySQL extends SearchEngine {
 
                # @todo FIXME: This doesn't handle parenthetical expressions.
                $m = array();
-               if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
+               if ( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
                                $filteredText, $m, PREG_SET_ORDER ) ) {
-                       foreach( $m as $bits ) {
+                       foreach ( $m as $bits ) {
                                @list( /* all */, $modifier, $term, $nonQuoted, $wildcard ) = $bits;
 
-                               if( $nonQuoted != '' ) {
+                               if ( $nonQuoted != '' ) {
                                        $term = $nonQuoted;
                                        $quote = '';
                                } else {
@@ -70,8 +70,10 @@ class SearchMySQL extends SearchEngine {
                                        $quote = '"';
                                }
 
-                               if( $searchon !== '' ) $searchon .= ' ';
-                               if( $this->strictMatching && ($modifier == '') ) {
+                               if ( $searchon !== '' ) {
+                                       $searchon .= ' ';
+                               }
+                               if ( $this->strictMatching && ( $modifier == '' ) ) {
                                        // If we leave this out, boolean op defaults to OR which is rarely helpful.
                                        $modifier = '+';
                                }
@@ -79,7 +81,7 @@ class SearchMySQL extends SearchEngine {
                                // Some languages such as Serbian store the input form in the search index,
                                // so we may need to search for matches in multiple writing system variants.
                                $convertedVariants = $wgContLang->autoConvertToAllVariants( $term );
-                               if( is_array( $convertedVariants ) ) {
+                               if ( is_array( $convertedVariants ) ) {
                                        $variants = array_unique( array_values( $convertedVariants ) );
                                } else {
                                        $variants = array( $term );
@@ -99,11 +101,12 @@ class SearchMySQL extends SearchEngine {
                                $strippedVariants = array_unique( $strippedVariants );
 
                                $searchon .= $modifier;
-                               if( count( $strippedVariants ) > 1 )
+                               if ( count( $strippedVariants ) > 1 ) {
                                        $searchon .= '(';
-                               foreach( $strippedVariants as $stripped ) {
+                               }
+                               foreach ( $strippedVariants as $stripped ) {
                                        $stripped = $this->normalizeText( $stripped );
-                                       if( $nonQuoted && strpos( $stripped, ' ' ) !== false ) {
+                                       if ( $nonQuoted && strpos( $stripped, ' ' ) !== false ) {
                                                // Hack for Chinese: we need to toss in quotes for
                                                // multiple-character phrases since normalizeForSearch()
                                                // added spaces between them to make word breaks.
@@ -111,8 +114,9 @@ class SearchMySQL extends SearchEngine {
                                        }
                                        $searchon .= "$quote$stripped$quote$wildcard ";
                                }
-                               if( count( $strippedVariants ) > 1 )
+                               if ( count( $strippedVariants ) > 1 ) {
                                        $searchon .= ')';
+                               }
 
                                // Match individual terms or quoted phrase in result highlighting...
                                // Note that variants will be introduced in a later stage for highlighting!
@@ -134,8 +138,8 @@ class SearchMySQL extends SearchEngine {
                global $wgContLang;
 
                $regex = preg_quote( $string, '/' );
-               if( $wgContLang->hasWordBreaks() ) {
-                       if( $wildcard ) {
+               if ( $wgContLang->hasWordBreaks() ) {
+                       if ( $wildcard ) {
                                // Don't cut off the final bit!
                                $regex = "\b$regex";
                        } else {
@@ -177,7 +181,9 @@ class SearchMySQL extends SearchEngine {
                global $wgCountTotalSearchHits;
 
                // This seems out of place, why is this called with empty term?
-               if ( trim( $term ) === '' ) return null;
+               if ( trim( $term ) === '' ) {
+                       return null;
+               }
 
                $filteredTerm = $this->filter( $term );
                $query = $this->getQuery( $filteredTerm, $fulltext );
@@ -187,7 +193,7 @@ class SearchMySQL extends SearchEngine {
                );
 
                $total = null;
-               if( $wgCountTotalSearchHits ) {
+               if ( $wgCountTotalSearchHits ) {
                        $query = $this->getCountQuery( $filteredTerm, $fulltext );
                        $totalResult = $this->db->select(
                                $query['tables'], $query['fields'], $query['conds'],
@@ -195,7 +201,7 @@ class SearchMySQL extends SearchEngine {
                        );
 
                        $row = $totalResult->fetchObject();
-                       if( $row ) {
+                       if ( $row ) {
                                $total = intval( $row->c );
                        }
                        $totalResult->free();
@@ -205,7 +211,7 @@ class SearchMySQL extends SearchEngine {
        }
 
        public function supports( $feature ) {
-               switch( $feature ) {
+               switch ( $feature ) {
                case 'list-redirects':
                case 'title-suffix-filter':
                        return true;
@@ -223,7 +229,7 @@ class SearchMySQL extends SearchEngine {
                foreach ( $this->features as $feature => $value ) {
                        if ( $feature === 'list-redirects' && !$value ) {
                                $query['conds']['page_is_redirect'] = 0;
-                       } elseif( $feature === 'title-suffix-filter' && $value ) {
+                       } elseif ( $feature === 'title-suffix-filter' && $value ) {
                                $query['conds'][] = 'page_title' . $this->db->buildLike( $this->db->anyString(), $value );
                        }
                }
@@ -358,7 +364,7 @@ class SearchMySQL extends SearchEngine {
 
                $dbw->update( 'searchindex',
                        array( 'si_title' => $this->normalizeText( $title ) ),
-                       array( 'si_page'  => $id ),
+                       array( 'si_page' => $id ),
                        __METHOD__,
                        array( $dbw->lowPriorityOption() ) );
        }
@@ -386,7 +392,7 @@ class SearchMySQL extends SearchEngine {
                // ignores short words... Pad them so we can pass them
                // through without reconfiguring the server...
                $minLength = $this->minSearchLength();
-               if( $minLength > 1 ) {
+               if ( $minLength > 1 ) {
                        $n = $minLength - 1;
                        $out = preg_replace(
                                "/\b(\w{1,$n})\b/",
@@ -427,7 +433,7 @@ class SearchMySQL extends SearchEngine {
         * @return int
         */
        protected function minSearchLength() {
-               if( is_null( self::$mMinSearchLength ) ) {
+               if ( is_null( self::$mMinSearchLength ) ) {
                        $sql = "SHOW GLOBAL VARIABLES LIKE 'ft\\_min\\_word\\_len'";
 
                        $dbr = wfGetDB( DB_SLAVE );
@@ -435,7 +441,7 @@ class SearchMySQL extends SearchEngine {
                        $row = $result->fetchObject();
                        $result->free();
 
-                       if( $row && $row->Variable_name == 'ft_min_word_len' ) {
+                       if ( $row && $row->Variable_name == 'ft_min_word_len' ) {
                                self::$mMinSearchLength = intval( $row->Value );
                        } else {
                                self::$mMinSearchLength = 0;
index dd152f7..a847965 100644 (file)
@@ -74,8 +74,9 @@ class SearchOracle extends SearchEngine {
         * @return SqlSearchResultSet
         */
        function searchText( $term ) {
-               if ( $term == '' )
+               if ( $term == '' ) {
                        return new SqlSearchResultSet( false, '' );
+               }
 
                $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), true ) ) );
                return new SqlSearchResultSet( $resultSet, $this->searchTerms );
@@ -88,8 +89,9 @@ class SearchOracle extends SearchEngine {
         * @return SqlSearchResultSet
         */
        function searchTitle( $term ) {
-               if ( $term == '' )
+               if ( $term == '' ) {
                        return new SqlSearchResultSet( false, '' );
+               }
 
                $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), false ) ) );
                return new MySQLSearchResultSet( $resultSet, $this->searchTerms );
@@ -112,8 +114,9 @@ class SearchOracle extends SearchEngine {
         * @return String
         */
        function queryNamespaces() {
-               if( is_null( $this->namespaces ) )
+               if ( is_null( $this->namespaces ) ) {
                        return '';
+               }
                if ( !count( $this->namespaces ) ) {
                        $namespaces = '0';
                } else {
@@ -197,23 +200,24 @@ class SearchOracle extends SearchEngine {
                $searchon = '';
                if ( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
                                $filteredText, $m, PREG_SET_ORDER ) ) {
-                       foreach( $m as $terms ) {
+                       foreach ( $m as $terms ) {
                                // Search terms in all variant forms, only
                                // apply on wiki with LanguageConverter
                                $temp_terms = $wgContLang->autoConvertToAllVariants( $terms[2] );
-                               if( is_array( $temp_terms ) ) {
+                               if ( is_array( $temp_terms ) ) {
                                        $temp_terms = array_unique( array_values( $temp_terms ) );
-                                       foreach( $temp_terms as $t ) {
-                                               $searchon .= ($terms[1] == '-' ? ' ~' : ' & ') . $this->escapeTerm( $t );
+                                       foreach ( $temp_terms as $t ) {
+                                               $searchon .= ( $terms[1] == '-' ? ' ~' : ' & ' ) . $this->escapeTerm( $t );
                                        }
                                }
                                else {
-                                       $searchon .= ($terms[1] == '-' ? ' ~' : ' & ') . $this->escapeTerm( $terms[2] );
+                                       $searchon .= ( $terms[1] == '-' ? ' ~' : ' & ' ) . $this->escapeTerm( $terms[2] );
                                }
                                if ( !empty( $terms[3] ) ) {
                                        $regexp = preg_quote( $terms[3], '/' );
-                                       if ( $terms[4] )
+                                       if ( $terms[4] ) {
                                                $regexp .= "[0-9A-Za-z_]+";
+                                       }
                                } else {
                                        $regexp = preg_quote( str_replace( '"', '', $terms[2] ), '/' );
                                }
@@ -275,7 +279,7 @@ class SearchOracle extends SearchEngine {
 
                $dbw->update( 'searchindex',
                        array( 'si_title' => $title ),
-                       array( 'si_page'  => $id ),
+                       array( 'si_page' => $id ),
                        'SearchOracle::updateTitle',
                        array() );
        }
index 148a657..2fe31c9 100644 (file)
@@ -97,8 +97,8 @@ class SearchPostgres extends SearchEngine {
 
                $searchstring = '';
                $m = array();
-               if( preg_match_all( '/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) {
-                       foreach( $m as $terms ) {
+               if ( preg_match_all( '/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) {
+                       foreach ( $m as $terms ) {
                                if ( strlen( $terms[1] ) ) {
                                        $searchstring .= ' & !';
                                }
@@ -169,8 +169,8 @@ class SearchPostgres extends SearchEngine {
                }
                else {
                        $m = array();
-                       if( preg_match_all( "/'([^']+)'/", $top, $m, PREG_SET_ORDER ) ) {
-                               foreach( $m as $terms ) {
+                       if ( preg_match_all( "/'([^']+)'/", $top, $m, PREG_SET_ORDER ) ) {
+                               foreach ( $m as $terms ) {
                                        $this->searchTerms[$terms[1]] = $terms[1];
                                }
                        }
@@ -182,11 +182,12 @@ class SearchPostgres extends SearchEngine {
                }
 
                ## Redirects
-               if ( !$this->showRedirects )
+               if ( !$this->showRedirects ) {
                        $query .= ' AND page_is_redirect = 0';
+               }
 
                ## Namespaces - defaults to 0
-               if( !is_null( $this->namespaces ) ) { // null -> search all
+               if ( !is_null( $this->namespaces ) ) { // null -> search all
                        if ( count( $this->namespaces ) < 1 ) {
                                $query .= ' AND page_namespace = 0';
                        } else {
@@ -244,7 +245,7 @@ class PostgresSearchResultSet extends SqlSearchResultSet {
 
        function next() {
                $row = $this->mResultSet->fetchObject();
-               if( $row === false ) {
+               if ( $row === false ) {
                        return false;
                } else {
                        return new PostgresSearchResult( $row );
index 5b0b7f7..71fd021 100644 (file)
@@ -61,12 +61,12 @@ class SearchSqlite extends SearchEngine {
                $this->searchTerms = array();
 
                $m = array();
-               if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
+               if ( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
                                $filteredText, $m, PREG_SET_ORDER ) ) {
-                       foreach( $m as $bits ) {
+                       foreach ( $m as $bits ) {
                                @list( /* all */, $modifier, $term, $nonQuoted, $wildcard ) = $bits;
 
-                               if( $nonQuoted != '' ) {
+                               if ( $nonQuoted != '' ) {
                                        $term = $nonQuoted;
                                        $quote = '';
                                } else {
@@ -74,14 +74,14 @@ class SearchSqlite extends SearchEngine {
                                        $quote = '"';
                                }
 
-                               if( $searchon !== '' ) {
+                               if ( $searchon !== '' ) {
                                        $searchon .= ' ';
                                }
 
                                // Some languages such as Serbian store the input form in the search index,
                                // so we may need to search for matches in multiple writing system variants.
                                $convertedVariants = $wgContLang->autoConvertToAllVariants( $term );
-                               if( is_array( $convertedVariants ) ) {
+                               if ( is_array( $convertedVariants ) ) {
                                        $variants = array_unique( array_values( $convertedVariants ) );
                                } else {
                                        $variants = array( $term );
@@ -101,10 +101,11 @@ class SearchSqlite extends SearchEngine {
                                $strippedVariants = array_unique( $strippedVariants );
 
                                $searchon .= $modifier;
-                               if( count( $strippedVariants ) > 1 )
+                               if ( count( $strippedVariants ) > 1 ) {
                                        $searchon .= '(';
-                               foreach( $strippedVariants as $stripped ) {
-                                       if( $nonQuoted && strpos( $stripped, ' ' ) !== false ) {
+                               }
+                               foreach ( $strippedVariants as $stripped ) {
+                                       if ( $nonQuoted && strpos( $stripped, ' ' ) !== false ) {
                                                // Hack for Chinese: we need to toss in quotes for
                                                // multiple-character phrases since normalizeForSearch()
                                                // added spaces between them to make word breaks.
@@ -112,8 +113,9 @@ class SearchSqlite extends SearchEngine {
                                        }
                                        $searchon .= "$quote$stripped$quote$wildcard ";
                                }
-                               if( count( $strippedVariants ) > 1 )
+                               if ( count( $strippedVariants ) > 1 ) {
                                        $searchon .= ')';
+                               }
 
                                // Match individual terms or quoted phrase in result highlighting...
                                // Note that variants will be introduced in a later stage for highlighting!
@@ -134,8 +136,8 @@ class SearchSqlite extends SearchEngine {
                global $wgContLang;
 
                $regex = preg_quote( $string, '/' );
-               if( $wgContLang->hasWordBreaks() ) {
-                       if( $wildcard ) {
+               if ( $wgContLang->hasWordBreaks() ) {
+                       if ( $wildcard ) {
                                // Don't cut off the final bit!
                                $regex = "\b$regex";
                        } else {
@@ -184,10 +186,10 @@ class SearchSqlite extends SearchEngine {
                $resultSet = $this->db->query( $this->getQuery( $filteredTerm, $fulltext ) );
 
                $total = null;
-               if( $wgCountTotalSearchHits ) {
+               if ( $wgCountTotalSearchHits ) {
                        $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) );
                        $row = $totalResult->fetchObject();
-                       if( $row ) {
+                       if ( $row ) {
                                $total = intval( $row->c );
                        }
                        $totalResult->free();
@@ -201,7 +203,7 @@ class SearchSqlite extends SearchEngine {
         * @return String
         */
        function queryRedirect() {
-               if( $this->showRedirects ) {
+               if ( $this->showRedirects ) {
                        return '';
                } else {
                        return 'AND page_is_redirect=0';
@@ -213,8 +215,9 @@ class SearchSqlite extends SearchEngine {
         * @return String
         */
        function queryNamespaces() {
-               if( is_null( $this->namespaces ) )
+               if ( is_null( $this->namespaces ) ) {
                        return '';  # search all
+               }
                if ( !count( $this->namespaces ) ) {
                        $namespaces = '0';
                } else {
@@ -324,7 +327,7 @@ class SearchSqlite extends SearchEngine {
 
                $dbw->update( 'searchindex',
                        array( 'si_title' => $title ),
-                       array( 'rowid'  => $id ),
+                       array( 'rowid' => $id ),
                        __METHOD__ );
        }
 }
index 35199d6..8c1bda2 100644 (file)
@@ -40,7 +40,7 @@ class SearchUpdate implements DeferrableUpdate {
                        $nt = $title;
                }
 
-               if( $nt ) {
+               if ( $nt ) {
                        $this->mId = $id;
                        $this->mText = $text;
 
@@ -56,7 +56,7 @@ class SearchUpdate implements DeferrableUpdate {
        function doUpdate() {
                global $wgContLang, $wgDisableSearchUpdate;
 
-               if( $wgDisableSearchUpdate || !$this->mId ) {
+               if ( $wgDisableSearchUpdate || !$this->mId ) {
                        return;
                }
 
@@ -65,7 +65,7 @@ class SearchUpdate implements DeferrableUpdate {
                $search = SearchEngine::create();
                $lc = SearchEngine::legalSearchChars() . '&#;';
 
-               if( $this->mText === false ) {
+               if ( $this->mText === false ) {
                        $search->updateTitle( $this->mId,
                                $search->normalizeText( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) );
                        wfProfileOut( __METHOD__ );
index a0351a4..52261c9 100644 (file)
@@ -388,7 +388,7 @@ class SpecialContributions extends SpecialPage {
                }
 
                if ( !isset( $this->opts['year'] ) ) {
-                       $this->opts['year'] = '';
+                       $this->opts['year'] = gmdate( 'Y' );
                }
 
                if ( !isset( $this->opts['month'] ) ) {
index b2b2946..4da5155 100644 (file)
@@ -57,7 +57,7 @@ class SpecialUnblock extends SpecialPage {
                $form->addPreText( $this->msg( 'unblockiptext' )->parseAsBlock() );
 
                if ( $form->show() ) {
-                       switch( $this->type ) {
+                       switch ( $this->type ) {
                                case Block::TYPE_USER:
                                case Block::TYPE_IP:
                                        $out->addWikiMsg( 'unblocked', wfEscapeWikiText( $this->target ) );
@@ -106,7 +106,7 @@ class SpecialUnblock extends SpecialPage {
                        } else {
                                $fields['Target']['default'] = $target;
                                $fields['Target']['type'] = 'hidden';
-                               switch( $type ) {
+                               switch ( $type ) {
                                        case Block::TYPE_USER:
                                        case Block::TYPE_IP:
                                                $fields['Name']['default'] = Linker::link(
index 6fb133a..ee737c6 100644 (file)
@@ -530,7 +530,7 @@ class SpecialUpload extends SpecialPage {
        protected function processVerificationError( $details ) {
                global $wgFileExtensions;
 
-               switch( $details['status'] ) {
+               switch ( $details['status'] ) {
 
                        /** Statuses that only require name changing **/
                        case UploadBase::MIN_LENGTH_PARTNAME:
index f7e4d0a..bb57e6c 100644 (file)
@@ -973,6 +973,29 @@ class LoginForm extends SpecialPage {
                );
        }
 
+       /**
+        * Add a "return to" link or redirect to it.
+        * Extensions can use this to reuse the "return to" logic after
+        * inject steps (such as redirection) into the login process.
+        *
+        * @param $type string, one of the following:
+        *    - error: display a return to link ignoring $wgRedirectOnLogin
+        *    - success: display a return to link using $wgRedirectOnLogin if needed
+        *    - successredirect: send an HTTP redirect using $wgRedirectOnLogin if needed
+        * @param string $returnTo
+        * @param array|string $returnToQuery
+        * @param bool $stickHTTPs Keep redirect link on HTTPs
+        * @since 1.22
+        */
+       public function showReturnToPage(
+               $type, $returnTo = '', $returnToQuery = '', $stickHTTPs = false
+       ) {
+               $this->mReturnTo = $returnTo;
+               $this->mReturnToQuery = $returnToQuery;
+               $this->mStickHTTPS = $stickHTTPs;
+               $this->executeReturnTo( $type );
+       }
+
        /**
         * Add a "return to" link or redirect to it.
         *
@@ -1023,10 +1046,10 @@ class LoginForm extends SpecialPage {
         * @return Boolean
         */
        private function shouldShowVForm() {
-               global $wgUseVFormUserLogin;
+               global $wgUseVFormCreateAccount, $wgUseVFormUserLogin;
 
                if ( $this->mType == 'signup' ) {
-                       return false;
+                       return $this->mRequest->getBool( 'useNew', $wgUseVFormCreateAccount );
                } else {
                        return $this->mRequest->getBool( 'useNew', $wgUseVFormUserLogin );
                }
@@ -1070,11 +1093,24 @@ class LoginForm extends SpecialPage {
                }
 
                if ( $this->mType == 'signup' ) {
-                       $template = new UsercreateTemplate();
+                       $out->addModules( 'mediawiki.special.userlogin.signup' );
+                       if ( $this->mShowVForm ) {
+                               $template = new UsercreateTemplateVForm();
+                               $out->addModuleStyles( array(
+                                       'mediawiki.ui',
+                                       'mediawiki.special.createaccount.vform'
+                               ) );
+                               // XXX hack pending RL or JS parse() support for complex content messages
+                               // https://bugzilla.wikimedia.org/show_bug.cgi?id=25349
+                               $out->addJsConfigVars( 'wgCreateacctImgcaptchaHelp',
+                                       $this->msg( 'createacct-imgcaptcha-help' )->parse() );
+                               $out->addModules( 'mediawiki.special.createaccount.vform.js' );
+                       } else {
+                               $template = new UsercreateTemplate();
+                       }
                        $q = 'action=submitlogin&type=signup';
                        $linkq = 'type=login';
                        $linkmsg = 'gotaccount';
-                       $out->addModules( 'mediawiki.special.userlogin.signup' );
                } else {
                        if ( $this->mShowVForm ) {
                                $template = new UserloginTemplateVForm();
index b01058a..c257dd4 100644 (file)
@@ -515,9 +515,9 @@ class SpecialVersion extends SpecialPage {
                }
 
                # Make description text.
-               $description = isset ( $extension['description'] ) ? $extension['description'] : '';
+               $description = isset( $extension['description'] ) ? $extension['description'] : '';
 
-               if ( isset ( $extension['descriptionmsg'] ) ) {
+               if ( isset( $extension['descriptionmsg'] ) ) {
                        # Look for a localized description.
                        $descriptionMsg = $extension['descriptionmsg'];
 
@@ -540,7 +540,7 @@ class SpecialVersion extends SpecialPage {
                                <td colspan=\"2\"><em>$mainLink $versionText</em></td>";
                }
 
-               $author = isset ( $extension['author'] ) ? $extension['author'] : array();
+               $author = isset( $extension['author'] ) ? $extension['author'] : array();
                $extDescAuthor = "<td>$description</td>
                        <td>" . $this->listAuthors( $author, false ) . "</td>
                        </tr>\n";
index ff4313f..0296a63 100644 (file)
@@ -76,7 +76,7 @@ class SpecialWatchlist extends SpecialPage {
                $mode = SpecialEditWatchlist::getMode( $request, $par );
                if ( $mode !== false ) {
                        # TODO: localise?
-                       switch( $mode ) {
+                       switch ( $mode ) {
                                case SpecialEditWatchlist::EDIT_CLEAR:
                                        $mode = 'clear';
                                        break;
@@ -163,7 +163,7 @@ class SpecialWatchlist extends SpecialPage {
                        $big = 1000; /* The magical big */
                        if ( $nitems > $big ) {
                                # Set default cutoff shorter
-                               $values['days'] = $defaults['days'] = (12.0 / 24.0); # 12 hours...
+                               $values['days'] = $defaults['days'] = ( 12.0 / 24.0 ); # 12 hours...
                        } else {
                                $values['days'] = $defaults['days']; # default cutoff for shortlisters
                        }
index dff9ada..28b5d79 100644 (file)
@@ -46,12 +46,12 @@ class UsercreateTemplate extends QuickTemplate {
        function execute() {
                if ( $this->data['message'] ) {
 ?>
-       <div class="<?php $this->text('messagetype') ?>box">
+       <div class="<?php $this->text( 'messagetype' ); ?>box">
 <?php
                        if ( $this->data['messagetype'] == 'error' ) {
-                               ?><strong><?php $this->msg( 'loginerror' ) ?></strong><br /><?php
+                               ?><strong><?php $this->msg( 'loginerror' ); ?></strong><br /><?php
                        }
-                       $this->html('message');
+                       $this->html( 'message' );
 ?>
        </div>
        <div class="visualClear"></div>
@@ -62,10 +62,10 @@ class UsercreateTemplate extends QuickTemplate {
 <div id="signupstart"><?php $this->msgWiki( 'signupstart' ); ?></div>
 <div id="userlogin">
 
-<form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>">
-       <h2><?php $this->msg('createaccount') ?></h2>
-       <p id="userloginlink"><?php $this->html('link') ?></p>
-       <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
+<form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text( 'action' ); ?>">
+       <h2><?php $this->msg( 'createaccount' ); ?></h2>
+       <p id="userloginlink"><?php $this->html( 'link' ); ?></p>
+       <?php $this->html( 'header' ); /* pre-table point for form plugins... */ ?>
 <?php
        if ( $this->haveData( 'languages' ) ) {
                ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php
@@ -73,7 +73,7 @@ class UsercreateTemplate extends QuickTemplate {
 ?>
        <table>
                <tr>
-                       <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
+                       <td class="mw-label"><label for='wpName2'><?php $this->msg( 'yourname' ); ?></label></td>
                        <td class="mw-input">
                                <?php
                        echo Html::input( 'wpName', $this->data['name'], 'text', array(
@@ -103,7 +103,7 @@ class UsercreateTemplate extends QuickTemplate {
                        </td>
                </tr>
                <tr class="mw-row-password">
-                       <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td>
+                       <td class="mw-label"><label for='wpPassword2'><?php $this->msg( 'yourpassword' ); ?></label></td>
                        <td class="mw-input">
 <?php
                        echo Html::input( 'wpPassword', null, 'password', array(
@@ -122,9 +122,9 @@ class UsercreateTemplate extends QuickTemplate {
                }
 ?>
                <tr id="mw-user-domain-section">
-                       <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
+                       <td class="mw-label"><?php $this->msg( 'yourdomainname' ); ?></td>
                        <td class="mw-input">
-                               <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
+                               <select name="wpDomain" value="<?php $this->text( 'domain' ); ?>"
                                        tabindex="4">
                                        <?php echo $doms ?>
                                </select>
@@ -134,7 +134,7 @@ class UsercreateTemplate extends QuickTemplate {
                }
 ?>
                <tr class="mw-row-password">
-                       <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
+                       <td class="mw-label"><label for='wpRetype'><?php $this->msg( 'yourpasswordagain' ); ?></label></td>
                        <td class="mw-input">
                                <?php
                echo Html::input( 'wpRetype', null, 'password', array(
@@ -149,7 +149,7 @@ class UsercreateTemplate extends QuickTemplate {
 <?php
                if ( $this->data['useemail'] ) {
 ?>
-                               <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td>
+                               <td class="mw-label"><label for='wpEmail'><?php $this->msg( 'youremail' ); ?></label></td>
                                <td class="mw-input">
                                        <?php
                echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
@@ -160,13 +160,13 @@ class UsercreateTemplate extends QuickTemplate {
                ) ); ?>
                                        <div class="prefsectiontip">
                                                <?php  // duplicated in Preferences.php profilePreferences()
-                                                       if( $this->data['emailrequired'] ) {
-                                                               $this->msgWiki('prefs-help-email-required');
+                                                       if ( $this->data['emailrequired'] ) {
+                                                               $this->msgWiki( 'prefs-help-email-required' );
                                                        } else {
-                                                               $this->msgWiki('prefs-help-email');
+                                                               $this->msgWiki( 'prefs-help-email' );
                                                        }
-                                                       if( $this->data['emailothers'] ) {
-                                                               $this->msgWiki('prefs-help-email-others');
+                                                       if ( $this->data['emailothers'] ) {
+                                                               $this->msgWiki( 'prefs-help-email-others' );
                                                        } ?>
                                        </div>
                                </td>
@@ -177,13 +177,13 @@ class UsercreateTemplate extends QuickTemplate {
 ?>
                                </tr>
                                <tr>
-                                       <td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
+                                       <td class="mw-label"><label for='wpRealName'><?php $this->msg( 'yourrealname' ); ?></label></td>
                                        <td class="mw-input">
                                                <input type='text' class='loginText' name="wpRealName" id="wpRealName"
                                                        tabindex="7"
-                                                       value="<?php $this->text('realname') ?>" size='20' />
+                                                       value="<?php $this->text( 'realname' ); ?>" size='20' />
                                                <div class="prefsectiontip">
-                                                       <?php $this->msgWiki('prefs-help-realname'); ?>
+                                                       <?php $this->msgWiki( 'prefs-help-realname' ); ?>
                                                </div>
                                        </td>
 <?php
@@ -193,11 +193,11 @@ class UsercreateTemplate extends QuickTemplate {
 ?>
                                </tr>
                                <tr>
-                                       <td class="mw-label"><label for='wpReason'><?php $this->msg('createaccountreason') ?></label></td>
+                                       <td class="mw-label"><label for='wpReason'><?php $this->msg( 'createaccountreason' ); ?></label></td>
                                        <td class="mw-input">
                                                <input type='text' class='loginText' name="wpReason" id="wpReason"
                                                        tabindex="8"
-                                                       value="<?php $this->text('reason') ?>" size='20' />
+                                                       value="<?php $this->text( 'reason' ); ?>" size='20' />
                                        </td>
 <?php
                }
@@ -233,13 +233,13 @@ class UsercreateTemplate extends QuickTemplate {
                                if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
                                        ?><td class="mw-label"><label for="<?php
                                        echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
-                                       $this->msgWiki( $inputItem['msg'] ) ?></label><?php
+                                       $this->msgWiki( $inputItem['msg'] ); ?></label><?php
                                } else {
                                        ?><td><?php
                                }
                        ?></td>
                        <td class="mw-input">
-                               <input type="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name="<?php
+                               <input type="<?php echo htmlspecialchars( $inputItem['type'] ); ?>" name="<?php
                                echo htmlspecialchars( $inputItem['name'] ); ?>"
                                        tabindex="<?php echo $tabIndex++; ?>"
                                        value="<?php
@@ -250,13 +250,14 @@ class UsercreateTemplate extends QuickTemplate {
                                }
                                        ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
                                        <?php
-                               if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
+                               if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) ) {
                                        echo 'checked="checked"';
+                               }
                                        ?> /> <?php
                                        if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
                                                ?>
                                <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
-                                       $this->msgHtml( $inputItem['msg'] ) ?></label><?php
+                                       $this->msgHtml( $inputItem['msg'] ); ?></label><?php
                                        }
                                if ( $inputItem['helptext'] !== false ) {
                                ?>
@@ -276,7 +277,7 @@ class UsercreateTemplate extends QuickTemplate {
                        <td class="mw-submit">
                                <input type='submit' name="wpCreateaccount" id="wpCreateaccount"
                                        tabindex="<?php echo $tabIndex++; ?>"
-                                       value="<?php $this->msg('createaccount') ?>" />
+                                       value="<?php $this->msg( 'createaccount' ); ?>" />
                        </td>
                </tr>
        </table>
diff --git a/includes/templates/UsercreateVForm.php b/includes/templates/UsercreateVForm.php
new file mode 100644 (file)
index 0000000..0366aef
--- /dev/null
@@ -0,0 +1,291 @@
+<?php
+/**
+ * Html form for account creation with new VForm appearance.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Templates
+ */
+
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die( -1 );
+}
+
+/**
+ * Html form for create account with new VForm appearance.
+ *
+ * @since 1.22
+ */
+class UsercreateTemplateVForm extends BaseTemplate {
+
+       /**
+        * Extensions (AntiSpoof and TitleBlacklist) call this in response to
+        * UserCreateForm hook to add checkboxes to the create account form.
+        */
+       function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
+               $this->data['extraInput'][] = array(
+                       'name' => $name,
+                       'value' => $value,
+                       'type' => $type,
+                       'msg' => $msg,
+                       'helptext' => $helptext,
+               );
+       }
+
+       function execute() {
+               global $wgCookieExpiration;
+               $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
+?>
+<div class="mw-ui-container">
+       <?php
+       if ( $this->haveData( 'languages' ) ) {
+       ?>
+               <div id="languagelinks">
+                       <p><?php $this->html( 'languages' ); ?></p>
+               </div>
+       <?php
+       }
+       ?>
+<div id="userloginForm">
+<h2 class="createaccount-join"><?php $this->msg( 'createacct-join' ); ?></h2>
+<form name="userlogin2" id="userlogin2" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>">
+       <section class="mw-form-header">
+               <?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?>
+       </section>
+       <?php
+       if ( $this->data['message'] ) {
+?>
+               <div class="<?php $this->text( 'messagetype' ); ?>box">
+               <?php if ( $this->data['messagetype'] == 'error' ) { ?>
+                       <strong><?php $this->msg( 'createacct-error' ); ?></strong><br />
+               <?php } ?>
+               <?php $this->html( 'message' ); ?>
+               </div>
+       <?php } ?>
+               <div>
+                       <label for='wpName2'>
+                               <?php $this->msg( 'userlogin-yourname' ); ?>
+
+                               <span class="mw-ui-flush-right"><?php echo $this->getMsg( 'createacct-helpusername-link' )->parse(); ?></span>
+                       </label>
+                       <?php echo Html::input( 'wpName', $this->data['name'], 'text', array(
+                               'class' => 'mw-input loginText',
+                               'id' => 'wpName2',
+                               'tabindex' => '1',
+                               'size' => '20',
+                               'required',
+                               'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text(),
+                               'autofocus'
+                       ) ); ?>
+               </div>
+               <div>
+               <?php if ( $this->data['createemail'] ) { ?>
+                       <label class="mw-ui-checkbox-label">
+                               <input name="wpCreateaccountMail" type="checkbox" value="1" id="wpCreateaccountMail" tabindex="2"
+                                       <?php if ( $this->data['createemailset'] ) {
+                                               echo 'checked="checked"';
+                                       } ?>
+                               >
+                               <?php $this->msg( 'createaccountmail' ); ?>
+                       </label>
+               <?php } ?>
+               </div>
+               <div class="mw-row-password">
+                       <label for='wpPassword2'><?php $this->msg( 'userlogin-yourpassword' ); ?></label>
+                       <?php echo Html::input( 'wpPassword', null, 'password', array(
+                               'class' => 'mw-input loginPassword',
+                               'id' => 'wpPassword2',
+                               'tabindex' => '3',
+                               'size' => '20',
+                               'required',
+                               'placeholder' => $this->getMsg( 'createacct-yourpassword-ph' )->text()
+                       ) + User::passwordChangeInputAttribs() ); ?>
+               </div>
+       <?php if ( $this->data['usedomain'] ) {
+               $doms = "";
+               foreach ( $this->data['domainnames'] as $dom ) {
+                       $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
+               }
+       ?>
+               <div>
+                       <label><?php $this->msg( 'yourdomainname' ); ?></label>
+                       <div class="mw-input">
+                               <select name="wpDomain" value="<?php $this->text( 'domain' ); ?>"
+                                       tabindex="4">
+                                       <?php echo $doms ?>
+                               </select>
+                       </div>
+               </div>
+       <?php } ?>
+               <div class="mw-row-password">
+                       <label for='wpRetype'><?php $this->msg( 'createacct-yourpasswordagain' ); ?></label>
+                       <?php
+                       echo Html::input( 'wpRetype', null, 'password', array(
+                               'class' => 'mw-input loginPassword',
+                               'id' => 'wpRetype',
+                               'tabindex' => '5',
+                               'size' => '20',
+                               'required',
+                               'placeholder' => $this->getMsg( 'createacct-yourpasswordagain-ph' )->text()
+                               ) + User::passwordChangeInputAttribs() );
+                       ?>
+               </div>
+               <div>
+               <?php if ( $this->data['useemail'] ) { ?>
+                       <label for='wpEmail'>
+                               <?php
+                                       $this->msg( $this->data['emailrequired'] ?
+                                               'createacct-emailrequired' :
+                                               'createacct-emailoptional'
+                                       );
+                               ?>
+                       </label>
+                       <?php
+                               echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
+                                       'class' => 'mw-input loginText',
+                                       'id' => 'wpEmail',
+                                       'tabindex' => '6',
+                                       'size' => '20',
+                                       'placeholder' => $this->getMsg( 'createacct-email-ph' )->text()
+                               ) + ( $this->data['emailrequired'] ? array() : array( 'required' => '' ) ) );
+                       ?>
+                       <?php
+                       // VForm eliminates the prefsectiontip div tip:
+                       // prefs-help-email-required is redundant with the placeholder text
+                       // Doesn't show the wordy prefs-help-email
+                       // Doesn't show the wordy prefs-help-email-others
+                       ?>
+               <?php } ?>
+               </div>
+               <?php if ( $this->data['userealname'] ) { ?>
+                       <div>
+                               <label for='wpRealName'><?php $this->msg( 'createacct-realname' ); ?></label>
+                               <input type='text' class='mw-input loginText' name="wpRealName" id="wpRealName"
+                                       tabindex="7"
+                                       value="<?php $this->text( 'realname' ); ?>" size='20' />
+                               <div class="prefsectiontip">
+                                       <?php $this->msgWiki( 'prefs-help-realname' ); ?>
+                               </div>
+                       </div>
+               <?php }
+               if ( $this->data['usereason'] ) { ?>
+                       <div>
+                               <label for='wpReason'><?php $this->msg( 'createacct-reason' ); ?></label>
+                               <input type='text' class='mw-input loginText' name="wpReason" id="wpReason"
+                                               tabindex="8"
+                                               value="<?php $this->text( 'reason' ); ?>" size='20' />
+                       </div>
+               <?php }
+               $tabIndex = 9;
+               if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
+                       foreach ( $this->data['extraInput'] as $inputItem ) { ?>
+                       <div>
+                               <?php
+                               // If it's a checkbox, output the whole thing (assume it has a msg).
+                               if ( $inputItem['type'] == 'checkbox' ) {
+                               ?>
+                                       <label class="mw-ui-checkbox-label">
+                                               <input
+                                                       name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
+                                                       id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
+                                                       type="checkbox" value="1"
+                                                       tabindex="<?php echo $tabIndex++; ?>"
+                                                       <?php if ( !empty( $inputItem['value'] ) )  {
+                                                               echo 'checked="checked"';
+                                                       } ?>
+                                               >
+                                               <?php $this->msg( $inputItem['msg'] ); ?>
+                                       </label>
+                               <?php
+                               } else {
+                                       // Not a checkbox.
+                                       if ( !empty( $inputItem['msg'] ) ) {
+                                               // Output the message label
+                                       ?>
+                                               <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>">
+                                                       <?php $this->msgWiki( $inputItem['msg'] ); ?>
+                                               </label>
+                                       <?php
+                                       }
+                                       ?>
+                                       <input
+                                               type="<?php echo htmlspecialchars( $inputItem['type'] ); ?>"
+                                               class="mw-input"
+                                               name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
+                                               tabindex="<?php echo $tabIndex++; ?>"
+                                               value="<?php echo htmlspecialchars( $inputItem['value'] ); ?>"
+                                               id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
+                                       />
+                               <?php
+                               }
+                               if ( $inputItem['helptext'] !== false ) {
+                               ?>
+                                       <div class="prefsectiontip">
+                                               <?php $this->msgWiki( $inputItem['helptext'] ); ?>
+                                       </div>
+                               <?php
+                               }
+                               ?>
+                               </div>
+                       <?php
+                       }
+               }
+               // JS attempts to move the image CAPTCHA below this part of the form,
+               // so skip one index.
+               $tabIndex++;
+               ?>
+               <div class="mw-submit">
+                       <input type='submit' class="mw-ui-button mw-ui-big mw-ui-block mw-ui-primary" name="wpCreateaccount" id="wpCreateaccount"
+                               tabindex="<?php echo $tabIndex++; ?>"
+                               value="<?php $this->msg( 'createaccount' ); ?>" />
+               </div>
+       <input type="hidden" id="useNew" name="useNew" value="1" />
+<?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
+<?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+</form>
+</div>
+<div class="mw-createacct-benefits-container">
+       <h2><?php $this->msg( 'createacct-benefit-heading' ); ?></h2>
+       <div class="mw-createacct-benefits-list">
+               <div>
+                       <div class="mw-benefits-icon <?php $this->msg( 'createacct-benefit-icon1' ); ?>"></div>
+                       <div class="mw-number-text">
+                               <h3><?php $this->msg( 'createacct-benefit-head1' ); ?></h3>
+                               <p><?php $this->msg( 'createacct-benefit-body1' ); ?></p>
+                       </div>
+               </div>
+               <div>
+                       <div class="mw-benefits-icon <?php $this->msg( 'createacct-benefit-icon2' ); ?>"></div>
+                       <div class="mw-number-text">
+                               <h3><?php $this->msg( 'createacct-benefit-head2' ); ?></h3>
+                               <p><?php $this->msg( 'createacct-benefit-body2' ); ?></p>
+                       </div>
+               </div>
+               <div>
+                       <div class="mw-benefits-icon <?php $this->msg( 'createacct-benefit-icon3' ); ?>"></div>
+                       <div class="mw-number-text">
+                               <h3><?php $this->msg( 'createacct-benefit-head3' ); ?></h3>
+                               <p><?php $this->msg( 'createacct-benefit-body3' ); ?></p>
+                       </div>
+               </div>
+       </div>
+</div>
+</div>
+<?php
+
+       }
+}
index 0b4b8e5..8c937a7 100644 (file)
@@ -33,13 +33,13 @@ class UserloginTemplate extends QuickTemplate {
        function execute() {
                if ( $this->data['message'] ) {
 ?>
-       <div class="<?php $this->text('messagetype') ?>box">
+       <div class="<?php $this->text( 'messagetype' ); ?>box">
                <?php
                if ( $this->data['messagetype'] == 'error' ) {
-                       ?><strong><?php $this->msg( 'loginerror' ) ?></strong><br /><?php
+                       ?><strong><?php $this->msg( 'loginerror' ); ?></strong><br /><?php
                }
                ?>
-               <?php $this->html('message') ?>
+               <?php $this->html( 'message' ); ?>
        </div>
        <div class="visualClear"></div><?php
 
@@ -47,11 +47,11 @@ class UserloginTemplate extends QuickTemplate {
 ?>
 <div id="loginstart"><?php $this->msgWiki( 'loginstart' ); ?></div>
 <div id="userloginForm">
-<form name="userlogin" method="post" action="<?php $this->text('action') ?>">
-       <h2><?php $this->msg('login') ?></h2>
-       <p id="userloginlink"><?php $this->html('link') ?></p>
-       <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
-       <div id="userloginprompt"><?php  $this->msgWiki('loginprompt') ?></div>
+<form name="userlogin" method="post" action="<?php $this->text( 'action' ); ?>">
+       <h2><?php $this->msg( 'login' ); ?></h2>
+       <p id="userloginlink"><?php $this->html( 'link' ); ?></p>
+       <?php $this->html( 'header' ); /* pre-table point for form plugins... */ ?>
+       <div id="userloginprompt"><?php  $this->msgWiki( 'loginprompt' ); ?></div>
 <?php
                if ( $this->haveData( 'languages' ) ) {
                        ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php
@@ -59,7 +59,7 @@ class UserloginTemplate extends QuickTemplate {
 ?>
        <table>
                <tr>
-                       <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
+                       <td class="mw-label"><label for='wpName1'><?php $this->msg( 'yourname' ); ?></label></td>
                        <td class="mw-input">
                                <?php
                        echo Html::input( 'wpName', $this->data['name'], 'text', array(
@@ -75,7 +75,7 @@ class UserloginTemplate extends QuickTemplate {
                        </td>
                </tr>
                <tr>
-                       <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td>
+                       <td class="mw-label"><label for='wpPassword1'><?php $this->msg( 'yourpassword' ); ?></label></td>
                        <td class="mw-input">
                                <?php
                        echo Html::input( 'wpPassword', null, 'password', array(
index 2e90c09..0948a20 100644 (file)
@@ -31,30 +31,31 @@ class UserloginTemplateVForm extends BaseTemplate {
 ?>
 <div class="mw-ui-container">
        <?php
-       // Some extensions including CAPTCHAs add content to header on UserLoginForm hook.
-       $this->html('header');
-       if( $this->haveData( 'languages' ) ) {
+       if ( $this->haveData( 'languages' ) ) {
        ?>
                <div id="languagelinks">
-                       <p><?php $this->html('languages' ); ?></p>
+                       <p><?php $this->html( 'languages' ); ?></p>
                </div>
        <?php
        }
        ?>
 <div id="userloginForm">
-<form name="userlogin" class="mw-ui-vform" method="post" action="<?php $this->text('action') ?>">
+<form name="userlogin" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>">
+       <section class="mw-form-header">
+               <?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?>
+       </section>
        <?php
 
-       if( $this->data['message'] ) {
+       if ( $this->data['message'] ) {
        ?>
-               <div class="<?php $this->text('messagetype') ?>box">
+               <div class="<?php $this->text( 'messagetype' ); ?>box">
                <?php
                if ( $this->data['messagetype'] == 'error' ) {
                ?>
                        <strong><?php $this->msg( 'loginerror' )?></strong><br />
                <?php
                }
-               $this->html('message')
+               $this->html( 'message' );
                ?>
                </div>
        <?php
@@ -92,7 +93,7 @@ class UserloginTemplateVForm extends BaseTemplate {
                <div>
                        <label for='wpPassword1'>
                        <?php
-                       $this->msg('userlogin-yourpassword');
+                       $this->msg( 'userlogin-yourpassword' );
 
                        if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) {
                                echo Linker::link(
@@ -122,28 +123,28 @@ class UserloginTemplateVForm extends BaseTemplate {
                        ?>
                </div>
        <?php
-       if( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
+       if ( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
                $doms = "";
-               foreach( $this->data['domainnames'] as $dom ) {
+               foreach ( $this->data['domainnames'] as $dom ) {
                        $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
                }
        ?>
                <div id="mw-user-domain-section">
-                       <label for='wpDomain' class="pos-above"><?php $this->msg( 'yourdomain' ) ?></label>
-                               <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
+                       <label for='wpDomain' class="pos-above"><?php $this->msg( 'yourdomain' ); ?></label>
+                               <select name="wpDomain" value="<?php $this->text( 'domain' ); ?>"
                                        tabindex="3">
                                        <?php echo $doms ?>
                                </select>
                </div>
        <?php }
 
-       if( $this->haveData( 'extrafields' ) ) {
+       if ( $this->haveData( 'extrafields' ) ) {
                echo $this->data['extrafields'];
        } ?>
 
                <div>
 
-       <?php if( $this->data['canremember'] ) { ?>
+       <?php if ( $this->data['canremember'] ) { ?>
                <label class="mw-ui-checkbox-label">
                        <input name="wpRemember" type="checkbox" value="1" id="wpRemember" tabindex="4"
                                <?php if ( $this->data['remember'] ) {
@@ -155,7 +156,7 @@ class UserloginTemplateVForm extends BaseTemplate {
        <?php } ?>
                </div>
 
-       <?php if( $this->data['cansecurelogin'] ) { ?>
+       <?php if ( $this->data['cansecurelogin'] ) { ?>
                <div>
                        <label class="mw-ui-checkbox-label">
                                <input name="wpStickHTTPS" type="checkbox" value="1" id="wpStickHTTPS" tabindex="5"
@@ -177,16 +178,16 @@ class UserloginTemplateVForm extends BaseTemplate {
                        ?>
                </div>
                <div id="mw-userlogin-help">
-                       <?php echo $this->getMsg( 'userlogin-helplink' )->parse() ?>
+                       <?php echo $this->getMsg( 'userlogin-helplink' )->parse(); ?>
                </div>
-               <?php if( $this->haveData( 'createOrLoginHref' ) ) { ?>
+               <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?>
                        <div id="mw-createaccount-cta">
-                               <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ) ?><a href="<?php $this->text( 'createOrLoginHref' ) ?>" id="mw-createaccount-join" tabindex="7"  class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ) ?></a></h3>
+                               <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7"  class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ); ?></a></h3>
                        </div>
                <?php } ?>
        <input type="hidden" id="mw-useNew" name="useNew" value="1" />
-<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
+<?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
 </form>
 </div>
 </div>
index c98c445..6a31582 100644 (file)
@@ -83,7 +83,7 @@ abstract class UploadBase {
                        self::WINDOWS_NONASCII_FILENAME => 'windows-nonascii-filename',
                        self::FILENAME_TOO_LONG => 'filename-toolong',
                );
-               if( isset( $code_to_status[$error] ) ) {
+               if ( isset( $code_to_status[$error] ) ) {
                        return $code_to_status[$error];
                }
 
@@ -136,7 +136,7 @@ abstract class UploadBase {
        public static function createFromRequest( &$request, $type = null ) {
                $type = $type ? $type : $request->getVal( 'wpSourceType', 'File' );
 
-               if( !$type ) {
+               if ( !$type ) {
                        return null;
                }
 
@@ -149,18 +149,18 @@ abstract class UploadBase {
                if ( is_null( $className ) ) {
                        $className = 'UploadFrom' . $type;
                        wfDebug( __METHOD__ . ": class name: $className\n" );
-                       if( !in_array( $type, self::$uploadHandlers ) ) {
+                       if ( !in_array( $type, self::$uploadHandlers ) ) {
                                return null;
                        }
                }
 
                // Check whether this upload class is enabled
-               if( !call_user_func( array( $className, 'isEnabled' ) ) ) {
+               if ( !call_user_func( array( $className, 'isEnabled' ) ) ) {
                        return null;
                }
 
                // Check whether the request is valid
-               if( !call_user_func( array( $className, 'isValidRequest' ), $request ) ) {
+               if ( !call_user_func( array( $className, 'isValidRequest' ), $request ) ) {
                        return null;
                }
 
@@ -275,7 +275,7 @@ abstract class UploadBase {
                /**
                 * If there was no filename or a zero size given, give up quick.
                 */
-               if( $this->isEmptyFile() ) {
+               if ( $this->isEmptyFile() ) {
                        wfProfileOut( __METHOD__ );
                        return array( 'status' => self::EMPTY_FILE );
                }
@@ -284,7 +284,7 @@ abstract class UploadBase {
                 * Honor $wgMaxUploadSize
                 */
                $maxSize = self::getMaxUploadSize( $this->getSourceType() );
-               if( $this->mFileSize > $maxSize ) {
+               if ( $this->mFileSize > $maxSize ) {
                        wfProfileOut( __METHOD__ );
                        return array(
                                'status' => self::FILE_TOO_LARGE,
@@ -298,7 +298,7 @@ abstract class UploadBase {
                 * probably not accept it.
                 */
                $verification = $this->verifyFile();
-               if( $verification !== true ) {
+               if ( $verification !== true ) {
                        wfProfileOut( __METHOD__ );
                        return array(
                                'status' => self::VERIFICATION_ERROR,
@@ -310,13 +310,13 @@ abstract class UploadBase {
                 * Make sure this file can be created
                 */
                $result = $this->validateName();
-               if( $result !== true ) {
+               if ( $result !== true ) {
                        wfProfileOut( __METHOD__ );
                        return $result;
                }
 
                $error = '';
-               if( !wfRunHooks( 'UploadVerification',
+               if ( !wfRunHooks( 'UploadVerification',
                        array( $this->mDestName, $this->mTempPath, &$error ) ) )
                {
                        wfProfileOut( __METHOD__ );
@@ -335,9 +335,9 @@ abstract class UploadBase {
         **/
        public function validateName() {
                $nt = $this->getTitle();
-               if( is_null( $nt ) ) {
+               if ( is_null( $nt ) ) {
                        $result = array( 'status' => $this->mTitleError );
-                       if( $this->mTitleError == self::ILLEGAL_FILENAME ) {
+                       if ( $this->mTitleError == self::ILLEGAL_FILENAME ) {
                                $result['filtered'] = $this->mFilteredName;
                        }
                        if ( $this->mTitleError == self::FILETYPE_BADTYPE ) {
@@ -421,12 +421,12 @@ abstract class UploadBase {
 
                # check for htmlish code and javascript
                if ( !$wgDisableUploadScriptChecks ) {
-                       if( self::detectScript( $this->mTempPath, $mime, $this->mFinalExtension ) ) {
+                       if ( self::detectScript( $this->mTempPath, $mime, $this->mFinalExtension ) ) {
                                wfProfileOut( __METHOD__ );
                                return array( 'uploadscripted' );
                        }
-                       if( $this->mFinalExtension == 'svg' || $mime == 'image/svg+xml' ) {
-                               if( $this->detectScriptInSvg( $this->mTempPath ) ) {
+                       if ( $this->mFinalExtension == 'svg' || $mime == 'image/svg+xml' ) {
+                               if ( $this->detectScriptInSvg( $this->mTempPath ) ) {
                                        wfProfileOut( __METHOD__ );
                                        return array( 'uploadscripted' );
                                }
@@ -532,7 +532,7 @@ abstract class UploadBase {
                 * to modify it by uploading a new revision.
                 */
                $nt = $this->getTitle();
-               if( is_null( $nt ) ) {
+               if ( is_null( $nt ) ) {
                        return true;
                }
                $permErrors = $nt->getUserPermissionsErrors( 'edit', $user );
@@ -542,7 +542,7 @@ abstract class UploadBase {
                } else {
                        $permErrorsCreate = array();
                }
-               if( $permErrors || $permErrorsUpload || $permErrorsCreate ) {
+               if ( $permErrors || $permErrorsUpload || $permErrorsCreate ) {
                        $permErrors = array_merge( $permErrors, wfArrayDiff2( $permErrorsUpload, $permErrors ) );
                        $permErrors = array_merge( $permErrors, wfArrayDiff2( $permErrorsCreate, $permErrors ) );
                        return $permErrors;
@@ -579,7 +579,7 @@ abstract class UploadBase {
                $comparableName = str_replace( ' ', '_', $this->mDesiredDestName );
                $comparableName = Title::capitalize( $comparableName, NS_FILE );
 
-               if( $this->mDesiredDestName != $filename && $comparableName != $filename ) {
+               if ( $this->mDesiredDestName != $filename && $comparableName != $filename ) {
                        $warnings['badfilename'] = $filename;
                }
 
@@ -602,7 +602,7 @@ abstract class UploadBase {
                }
 
                $exists = self::getExistsWarning( $localFile );
-               if( $exists !== false ) {
+               if ( $exists !== false ) {
                        $warnings['exists'] = $exists;
                }
 
@@ -612,11 +612,11 @@ abstract class UploadBase {
                $title = $this->getTitle();
                // Remove all matches against self
                foreach ( $dupes as $key => $dupe ) {
-                       if( $title->equals( $dupe->getTitle() ) ) {
+                       if ( $title->equals( $dupe->getTitle() ) ) {
                                unset( $dupes[$key] );
                        }
                }
-               if( $dupes ) {
+               if ( $dupes ) {
                        $warnings['duplicate'] = $dupes;
                }
 
@@ -654,7 +654,7 @@ abstract class UploadBase {
                        $user
                );
 
-               if( $status->isGood() ) {
+               if ( $status->isGood() ) {
                        if ( $watch ) {
                                $user->addWatch( $this->getLocalFile()->getTitle() );
                        }
@@ -701,7 +701,7 @@ abstract class UploadBase {
                $this->mFilteredName = wfStripIllegalFilenameChars( $this->mFilteredName );
                /* Normalize to title form before we do any further processing */
                $nt = Title::makeTitleSafe( NS_FILE, $this->mFilteredName );
-               if( is_null( $nt ) ) {
+               if ( is_null( $nt ) ) {
                        $this->mTitleError = self::ILLEGAL_FILENAME;
                        return $this->mTitle = null;
                }
@@ -713,7 +713,7 @@ abstract class UploadBase {
                 */
                list( $partname, $ext ) = $this->splitExtensions( $this->mFilteredName );
 
-               if( count( $ext ) ) {
+               if ( count( $ext ) ) {
                        $this->mFinalExtension = trim( $ext[count( $ext ) - 1] );
                } else {
                        $this->mFinalExtension = '';
@@ -761,13 +761,13 @@ abstract class UploadBase {
 
                # If there was more than one "extension", reassemble the base
                # filename to prevent bogus complaints about length
-               if( count( $ext ) > 1 ) {
-                       for( $i = 0; $i < count( $ext ) - 1; $i++ ) {
+               if ( count( $ext ) > 1 ) {
+                       for ( $i = 0; $i < count( $ext ) - 1; $i++ ) {
                                $partname .= '.' . $ext[$i];
                        }
                }
 
-               if( strlen( $partname ) < 1 ) {
+               if ( strlen( $partname ) < 1 ) {
                        $this->mTitleError = self::MIN_LENGTH_PARTNAME;
                        return $this->mTitle = null;
                }
@@ -781,7 +781,7 @@ abstract class UploadBase {
         * @return LocalFile|null
         */
        public function getLocalFile() {
-               if( is_null( $this->mLocalFile ) ) {
+               if ( is_null( $this->mLocalFile ) ) {
                        $nt = $this->getTitle();
                        $this->mLocalFile = is_null( $nt ) ? null : wfLocalFile( $nt );
                }
@@ -894,7 +894,7 @@ abstract class UploadBase {
        public static function verifyExtension( $mime, $extension ) {
                $magic = MimeMagic::singleton();
 
-               if ( !$mime || $mime == 'unknown' || $mime == 'unknown/unknown' )
+               if ( !$mime || $mime == 'unknown' || $mime == 'unknown/unknown' ) {
                        if ( !$magic->isRecognizableExtension( $extension ) ) {
                                wfDebug( __METHOD__ . ": passing file with unknown detected mime type; " .
                                        "unrecognized extension '$extension', can't verify\n" );
@@ -904,13 +904,14 @@ abstract class UploadBase {
                                        "recognized extension '$extension', so probably invalid file\n" );
                                return false;
                        }
+               }
 
                $match = $magic->isMatchingExtension( $extension, $mime );
 
                if ( $match === null ) {
                        wfDebug( __METHOD__ . ": no file extension known for mime type $mime, passing file\n" );
                        return true;
-               } elseif( $match === true ) {
+               } elseif ( $match === true ) {
                        wfDebug( __METHOD__ . ": mime type $mime matches extension $extension, passing file\n" );
 
                        #TODO: if it's a bitmap, make sure PHP or ImageMagic resp. can handle it!
@@ -940,7 +941,7 @@ abstract class UploadBase {
                # ugly hack: for text files, always look at the entire file.
                # For binary field, just check the first K.
 
-               if( strpos( $mime, 'text/' ) === 0 ) {
+               if ( strpos( $mime, 'text/' ) === 0 ) {
                        $chunk = file_get_contents( $file );
                } else {
                        $fp = fopen( $file, 'rb' );
@@ -950,21 +951,21 @@ abstract class UploadBase {
 
                $chunk = strtolower( $chunk );
 
-               if( !$chunk ) {
+               if ( !$chunk ) {
                        wfProfileOut( __METHOD__ );
                        return false;
                }
 
                # decode from UTF-16 if needed (could be used for obfuscation).
-               if( substr( $chunk, 0, 2 ) == "\xfe\xff" ) {
+               if ( substr( $chunk, 0, 2 ) == "\xfe\xff" ) {
                        $enc = 'UTF-16BE';
-               } elseif( substr( $chunk, 0, 2 ) == "\xff\xfe" ) {
+               } elseif ( substr( $chunk, 0, 2 ) == "\xff\xfe" ) {
                        $enc = 'UTF-16LE';
                } else {
                        $enc = null;
                }
 
-               if( $enc ) {
+               if ( $enc ) {
                        $chunk = iconv( $enc, "ASCII//IGNORE", $chunk );
                }
 
@@ -1005,12 +1006,12 @@ abstract class UploadBase {
                        '<table'
                );
 
-               if( !$wgAllowTitlesInSVG && $extension !== 'svg' && $mime !== 'image/svg' ) {
+               if ( !$wgAllowTitlesInSVG && $extension !== 'svg' && $mime !== 'image/svg' ) {
                        $tags[] = '<title';
                }
 
-               foreach( $tags as $tag ) {
-                       if( false !== strpos( $chunk, $tag ) ) {
+               foreach ( $tags as $tag ) {
+                       if ( false !== strpos( $chunk, $tag ) ) {
                                wfDebug( __METHOD__ . ": found something that may make it be mistaken for html: $tag\n" );
                                wfProfileOut( __METHOD__ );
                                return true;
@@ -1025,21 +1026,21 @@ abstract class UploadBase {
                $chunk = Sanitizer::decodeCharReferences( $chunk );
 
                # look for script-types
-               if( preg_match( '!type\s*=\s*[\'"]?\s*(?:\w*/)?(?:ecma|java)!sim', $chunk ) ) {
+               if ( preg_match( '!type\s*=\s*[\'"]?\s*(?:\w*/)?(?:ecma|java)!sim', $chunk ) ) {
                        wfDebug( __METHOD__ . ": found script types\n" );
                        wfProfileOut( __METHOD__ );
                        return true;
                }
 
                # look for html-style script-urls
-               if( preg_match( '!(?:href|src|data)\s*=\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) {
+               if ( preg_match( '!(?:href|src|data)\s*=\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) {
                        wfDebug( __METHOD__ . ": found html-style script urls\n" );
                        wfProfileOut( __METHOD__ );
                        return true;
                }
 
                # look for css-style script-urls
-               if( preg_match( '!url\s*\(\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) {
+               if ( preg_match( '!url\s*\(\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) {
                        wfDebug( __METHOD__ . ": found css-style script urls\n" );
                        wfProfileOut( __METHOD__ );
                        return true;
@@ -1071,77 +1072,77 @@ abstract class UploadBase {
                /*
                 * check for elements that can contain javascript
                 */
-               if( $strippedElement == 'script' ) {
+               if ( $strippedElement == 'script' ) {
                        wfDebug( __METHOD__ . ": Found script element '$element' in uploaded file.\n" );
                        return true;
                }
 
                # e.g., <svg xmlns="http://www.w3.org/2000/svg"> <handler xmlns:ev="http://www.w3.org/2001/xml-events" ev:event="load">alert(1)</handler> </svg>
-               if( $strippedElement == 'handler' ) {
+               if ( $strippedElement == 'handler' ) {
                        wfDebug( __METHOD__ . ": Found scriptable element '$element' in uploaded file.\n" );
                        return true;
                }
 
                # SVG reported in Feb '12 that used xml:stylesheet to generate javascript block
-               if( $strippedElement == 'stylesheet' ) {
+               if ( $strippedElement == 'stylesheet' ) {
                        wfDebug( __METHOD__ . ": Found scriptable element '$element' in uploaded file.\n" );
                        return true;
                }
 
-               foreach( $attribs as $attrib => $value ) {
+               foreach ( $attribs as $attrib => $value ) {
                        $stripped = $this->stripXmlNamespace( $attrib );
                        $value = strtolower( $value );
 
-                       if( substr( $stripped, 0, 2 ) == 'on' ) {
+                       if ( substr( $stripped, 0, 2 ) == 'on' ) {
                                wfDebug( __METHOD__ . ": Found event-handler attribute '$attrib'='$value' in uploaded file.\n" );
                                return true;
                        }
 
                        # href with javascript target
-                       if( $stripped == 'href' && strpos( strtolower( $value ), 'javascript:' ) !== false ) {
+                       if ( $stripped == 'href' && strpos( strtolower( $value ), 'javascript:' ) !== false ) {
                                wfDebug( __METHOD__ . ": Found script in href attribute '$attrib'='$value' in uploaded file.\n" );
                                return true;
                        }
 
                        # href with embedded svg as target
-                       if( $stripped == 'href' && preg_match( '!data:[^,]*image/svg[^,]*,!sim', $value ) ) {
+                       if ( $stripped == 'href' && preg_match( '!data:[^,]*image/svg[^,]*,!sim', $value ) ) {
                                wfDebug( __METHOD__ . ": Found href to embedded svg \"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
                                return true;
                        }
 
                        # href with embedded (text/xml) svg as target
-                       if( $stripped == 'href' && preg_match( '!data:[^,]*text/xml[^,]*,!sim', $value ) ) {
+                       if ( $stripped == 'href' && preg_match( '!data:[^,]*text/xml[^,]*,!sim', $value ) ) {
                                wfDebug( __METHOD__ . ": Found href to embedded svg \"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
                                return true;
                        }
 
                        # use set/animate to add event-handler attribute to parent
-                       if( ( $strippedElement == 'set' || $strippedElement == 'animate' ) && $stripped == 'attributename' && substr( $value, 0, 2 ) == 'on' ) {
+                       if ( ( $strippedElement == 'set' || $strippedElement == 'animate' ) && $stripped == 'attributename' && substr( $value, 0, 2 ) == 'on' ) {
                                wfDebug( __METHOD__ . ": Found svg setting event-handler attribute with \"<$strippedElement $stripped='$value'...\" in uploaded file.\n" );
                                return true;
                        }
 
                        # use set to add href attribute to parent element
-                       if( $strippedElement == 'set' && $stripped == 'attributename' && strpos( $value, 'href' ) !== false ) {
+                       if ( $strippedElement == 'set' && $stripped == 'attributename' && strpos( $value, 'href' ) !== false ) {
                                wfDebug( __METHOD__ . ": Found svg setting href attribute '$value' in uploaded file.\n" );
                                return true;
                        }
 
                        # use set to add a remote / data / script target to an element
-                       if( $strippedElement == 'set' && $stripped == 'to' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
+                       if ( $strippedElement == 'set' && $stripped == 'to' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
                                wfDebug( __METHOD__ . ": Found svg setting attribute to '$value' in uploaded file.\n" );
                                return true;
                        }
 
                        # use handler attribute with remote / data / script
-                       if( $stripped == 'handler' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
+                       if ( $stripped == 'handler' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
                                wfDebug( __METHOD__ . ": Found svg setting handler with remote/data/script '$attrib'='$value' in uploaded file.\n" );
                                return true;
                        }
 
                        # use CSS styles to bring in remote code
                        # catch url("http:..., url('http:..., url(http:..., but not url("#..., url('#..., url(#....
-                       if( $stripped == 'style' && preg_match_all( '!((?:font|clip-path|fill|filter|marker|marker-end|marker-mid|marker-start|mask|stroke)\s*:\s*url\s*\(\s*["\']?\s*[^#]+.*?\))!sim', $value, $matches ) ) {
+                       if ( $stripped == 'style' && preg_match_all( '!((?:font|clip-path|fill|filter|marker|marker-end|marker-mid|marker-start|mask|stroke)\s*:\s*url\s*\(\s*["\']?\s*[^#]+.*?\))!sim', $value, $matches ) ) {
                                foreach ( $matches[1] as $match ) {
                                        if ( !preg_match( '!(?:font|clip-path|fill|filter|marker|marker-end|marker-mid|marker-start|mask|stroke)\s*:\s*url\s*\(\s*(#|\'#|"#)!sim', $match ) ) {
                                                wfDebug( __METHOD__ . ": Found svg setting a style with remote url '$attrib'='$value' in uploaded file.\n" );
@@ -1151,7 +1152,7 @@ abstract class UploadBase {
                        }
 
                        # image filters can pull in url, which could be svg that executes scripts
-                       if( $strippedElement == 'image' && $stripped == 'filter' && preg_match( '!url\s*\(!sim', $value ) ) {
+                       if ( $strippedElement == 'image' && $stripped == 'filter' && preg_match( '!url\s*\(!sim', $value ) ) {
                                wfDebug( __METHOD__ . ": Found image filter with url: \"<$strippedElement $stripped='$value'...\" in uploaded file.\n" );
                                return true;
                        }
@@ -1281,8 +1282,8 @@ abstract class UploadBase {
        private function checkOverwrite( $user ) {
                // First check whether the local file can be overwritten
                $file = $this->getLocalFile();
-               if( $file->exists() ) {
-                       if( !self::userCanReUpload( $user, $file ) ) {
+               if ( $file->exists() ) {
+                       if ( !self::userCanReUpload( $user, $file ) ) {
                                return array( 'fileexists-forbidden', $file->getName() );
                        } else {
                                return true;
@@ -1308,13 +1309,13 @@ abstract class UploadBase {
         * @return Boolean
         */
        public static function userCanReUpload( User $user, $img ) {
-               if( $user->isAllowed( 'reupload' ) ) {
+               if ( $user->isAllowed( 'reupload' ) ) {
                        return true; // non-conditional
                }
-               if( !$user->isAllowed( 'reupload-own' ) ) {
+               if ( !$user->isAllowed( 'reupload-own' ) ) {
                        return false;
                }
-               if( is_string( $img ) ) {
+               if ( is_string( $img ) ) {
                        $img = wfLocalFile( $img );
                }
                if ( !( $img instanceof LocalFile ) ) {
@@ -1336,11 +1337,11 @@ abstract class UploadBase {
         * @return mixed False if the file does not exists, else an array
         */
        public static function getExistsWarning( $file ) {
-               if( $file->exists() ) {
+               if ( $file->exists() ) {
                        return array( 'warning' => 'exists', 'file' => $file );
                }
 
-               if( $file->getTitle()->getArticleID() ) {
+               if ( $file->getTitle()->getArticleID() ) {
                        return array( 'warning' => 'page-exists', 'file' => $file );
                }
 
@@ -1348,7 +1349,7 @@ abstract class UploadBase {
                        return array( 'warning' => 'was-deleted', 'file' => $file );
                }
 
-               if( strpos( $file->getName(), '.' ) == false ) {
+               if ( strpos( $file->getName(), '.' ) == false ) {
                        $partname = $file->getName();
                        $extension = '';
                } else {
@@ -1367,7 +1368,7 @@ abstract class UploadBase {
                        $nt_lc = Title::makeTitle( NS_FILE, "{$partname}.{$normalizedExtension}" );
                        $file_lc = wfLocalFile( $nt_lc );
 
-                       if( $file_lc->exists() ) {
+                       if ( $file_lc->exists() ) {
                                return array(
                                        'warning' => 'exists-normalized',
                                        'file' => $file,
@@ -1391,7 +1392,7 @@ abstract class UploadBase {
                        # Check for filenames like 50px- or 180px-, these are mostly thumbnails
                        $nt_thb = Title::newFromText( substr( $partname, strpos( $partname, '-' ) + 1 ) . '.' . $extension, NS_FILE );
                        $file_thb = wfLocalFile( $nt_thb );
-                       if( $file_thb->exists() ) {
+                       if ( $file_thb->exists() ) {
                                return array(
                                        'warning' => 'thumb',
                                        'file' => $file,
@@ -1407,7 +1408,7 @@ abstract class UploadBase {
                        }
                }
 
-               foreach( self::getFilenamePrefixBlacklist() as $prefix ) {
+               foreach ( self::getFilenamePrefixBlacklist() as $prefix ) {
                        if ( substr( $partname, 0, strlen( $prefix ) ) == $prefix ) {
                                return array(
                                        'warning' => 'bad-prefix',
@@ -1443,9 +1444,9 @@ abstract class UploadBase {
        public static function getFilenamePrefixBlacklist() {
                $blacklist = array();
                $message = wfMessage( 'filename-prefix-blacklist' )->inContentLanguage();
-               if( !$message->isDisabled() ) {
+               if ( !$message->isDisabled() ) {
                        $lines = explode( "\n", $message->plain() );
-                       foreach( $lines as $line ) {
+                       foreach ( $lines as $line ) {
                                // Remove comment lines
                                $comment = substr( trim( $line ), 0, 1 );
                                if ( $comment == '#' || $comment == '' ) {
index 7e07516..37db688 100644 (file)
@@ -41,16 +41,16 @@ class UploadFromChunks extends UploadFromFile {
                // user object. sometimes this won't exist, as when running from cron.
                $this->user = $user;
 
-               if( $repo ) {
+               if ( $repo ) {
                        $this->repo = $repo;
                } else {
                        $this->repo = RepoGroup::singleton()->getLocalRepo();
                }
 
-               if( $stash ) {
+               if ( $stash ) {
                        $this->stash = $stash;
                } else {
-                       if( $user ) {
+                       if ( $user ) {
                                wfDebug( __METHOD__ . " creating new UploadFromChunks instance for " . $user->getId() . "\n" );
                        } else {
                                wfDebug( __METHOD__ . " creating new UploadFromChunks instance with no user\n" );
@@ -112,7 +112,7 @@ class UploadFromChunks extends UploadFromFile {
                // Concatenate all the chunks to mVirtualTempPath
                $fileList = Array();
                // The first chunk is stored at the mVirtualTempPath path so we start on "chunk 1"
-               for( $i = 0; $i <= $this->getChunkIndex(); $i++ ) {
+               for ( $i = 0; $i <= $this->getChunkIndex(); $i++ ) {
                        $fileList[] = $this->getVirtualChunkLocation( $i );
                }
 
@@ -127,7 +127,7 @@ class UploadFromChunks extends UploadFromFile {
                $tStart = microtime( true );
                $status = $this->repo->concatenate( $fileList, $tmpPath, FileRepo::DELETE_SOURCE );
                $tAmount = microtime( true ) - $tStart;
-               if( !$status->isOk() ) {
+               if ( !$status->isOk() ) {
                        return $status;
                }
                wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds.\n" );
@@ -190,7 +190,7 @@ class UploadFromChunks extends UploadFromFile {
                                // Update local chunk index for the current chunk
                                $this->mChunkIndex++;
                                $status = $this->outputChunk( $chunkPath );
-                               if( $status->isGood() ) {
+                               if ( $status->isGood() ) {
                                        // Update local offset:
                                        $this->mOffset = $preAppendOffset + $chunkSize;
                                        // Update chunk table status db
@@ -257,7 +257,7 @@ class UploadFromChunks extends UploadFromFile {
         * @return Integer index of the current chunk
         */
        private function getChunkIndex() {
-               if( $this->mChunkIndex !== null ) {
+               if ( $this->mChunkIndex !== null ) {
                        return $this->mChunkIndex;
                }
                return 0;
@@ -307,7 +307,7 @@ class UploadFromChunks extends UploadFromFile {
        }
 
        private function getChunkFileKey( $index = null ) {
-               if( $index === null ) {
+               if ( $index === null ) {
                        $index = $this->getChunkIndex();
                }
                return $this->mFileKey . '.' . $index;
index ab2a7a3..a00ed32 100644 (file)
@@ -40,7 +40,7 @@ class UploadFromFile extends UploadBase {
        function initializeFromRequest( &$request ) {
                $upload = $request->getUpload( 'wpUploadFile' );
                $desiredDestName = $request->getText( 'wpDestFile' );
-               if( !$desiredDestName ) {
+               if ( !$desiredDestName ) {
                        $desiredDestName = $upload->getName();
                }
 
index fd2416d..9276b53 100644 (file)
@@ -45,16 +45,16 @@ class UploadFromStash extends UploadBase {
                // user object. sometimes this won't exist, as when running from cron.
                $this->user = $user;
 
-               if( $repo ) {
+               if ( $repo ) {
                        $this->repo = $repo;
                } else {
                        $this->repo = RepoGroup::singleton()->getLocalRepo();
                }
 
-               if( $stash ) {
+               if ( $stash ) {
                        $this->stash = $stash;
                } else {
-                       if( $user ) {
+                       if ( $user ) {
                                wfDebug( __METHOD__ . " creating new UploadStash instance for " . $user->getId() . "\n" );
                        } else {
                                wfDebug( __METHOD__ . " creating new UploadStash instance with no user\n" );
index 150e516..c99feef 100644 (file)
@@ -77,7 +77,7 @@ class UploadFromUrl extends UploadBase {
                        return false;
                }
                $valid = false;
-               foreach( $wgCopyUploadsDomains as $domain ) {
+               foreach ( $wgCopyUploadsDomains as $domain ) {
                        // See if the domain for the upload matches this whitelisted domain
                        $whitelistedDomainPieces = explode( '.', $domain );
                        $uploadDomainPieces = explode( '.', $parsedUrl['host'] );
@@ -172,7 +172,7 @@ class UploadFromUrl extends UploadBase {
                        return Status::newFatal( 'http-invalid-url' );
                }
 
-               if( !self::isAllowedHost( $this->mUrl ) ) {
+               if ( !self::isAllowedHost( $this->mUrl ) ) {
                        return Status::newFatal( 'upload-copy-upload-invalid-domain' );
                }
                if ( !$this->mAsync ) {
index a90fecf..1ee4627 100644 (file)
@@ -338,7 +338,7 @@ class UploadStash {
                        __METHOD__
                );
 
-               if( !$row ) {
+               if ( !$row ) {
                        throw new UploadStashNoSuchKeyException( "No such key ($key), cannot remove" );
                }
 
@@ -454,7 +454,7 @@ class UploadStash {
        protected function fetchFileMetadata( $key, $readFromDB = DB_SLAVE ) {
                // populate $fileMetadata[$key]
                $dbr = null;
-               if( $readFromDB === DB_MASTER ) {
+               if ( $readFromDB === DB_MASTER ) {
                        // sometimes reading from the master is necessary, if there's replication lag.
                        $dbr = $this->repo->getMasterDb();
                } else {
index df1b156..ff87f89 100644 (file)
@@ -1822,7 +1822,7 @@ class Language {
                }
                $start = substr( $str, 0, strlen( $str ) - 2 );
                $end = substr( $str, strlen( $str ) - 2 );
-               switch( $end ) {
+               switch ( $end ) {
                        case 'כ':
                                $str = $start . 'ך';
                                break;
@@ -1961,6 +1961,8 @@ class Language {
         * @param $type string May be date, time or both
         * @param $pref string The format name as it appears in Messages*.php
         *
+        * @since 1.22 New type 'pretty' that provides a more readable timestamp format
+        *
         * @return string
         */
        function getDateFormatString( $type, $pref ) {
@@ -1970,7 +1972,12 @@ class Language {
                                $df = self::$dataCache->getSubitem( $this->mCode, 'dateFormats', "$pref $type" );
                        } else {
                                $df = self::$dataCache->getSubitem( $this->mCode, 'dateFormats', "$pref $type" );
-                               if ( is_null( $df ) ) {
+
+                               if ( $type === 'pretty' && $df === null ) {
+                                       $df = $this->getDateFormatString( 'date', $pref );
+                               }
+
+                               if ( $df === null ) {
                                        $pref = $this->getDefaultDateFormat();
                                        $df = self::$dataCache->getSubitem( $this->mCode, 'dateFormats', "$pref $type" );
                                }
@@ -2203,6 +2210,79 @@ class Language {
                return $this->internalUserTimeAndDate( 'both', $ts, $user, $options );
        }
 
+       /**
+        * Convert an MWTimestamp into a pretty human-readable timestamp using
+        * the given user preferences and relative base time.
+        *
+        * DO NOT USE THIS FUNCTION DIRECTLY. Instead, call MWTimestamp::getHumanTimestamp
+        * on your timestamp object, which will then call this function. Calling
+        * this function directly will cause hooks to be skipped over.
+        *
+        * @see MWTimestamp::getHumanTimestamp
+        * @param MWTimestamp $ts Timestamp to prettify
+        * @param MWTimestamp $relativeTo Base timestamp
+        * @param User $user User preferences to use
+        * @return string Human timestamp
+        * @since 1.21
+        */
+       public function getHumanTimestamp( MWTimestamp $ts, MWTimestamp $relativeTo, User $user ) {
+               $diff = $ts->diff( $relativeTo );
+               $diffDay = (bool)( (int)$ts->timestamp->format( 'w' ) - (int)$relativeTo->timestamp->format( 'w' ) );
+               $days = $diff->days ?: (int)$diffDay;
+               if ( $diff->invert || $days > 5 && $ts->timestamp->format( 'Y' ) !== $relativeTo->timestamp->format( 'Y' ) ) {
+                       // Timestamps are in different years: use full timestamp
+                       // Also do full timestamp for future dates
+                       /**
+                        * @FIXME Add better handling of future timestamps.
+                        */
+                       $format = $this->getDateFormatString( 'both', $user->getDatePreference() ?: 'default' );
+                       $ts = $this->sprintfDate( $format, $ts->getTimestamp( TS_MW ) );
+               } elseif ( $days > 5 ) {
+                       // Timestamps are in same year,  but more than 5 days ago: show day and month only.
+                       $format = $this->getDateFormatString( 'pretty', $user->getDatePreference() ?: 'default' );
+                       $ts = $this->sprintfDate( $format, $ts->getTimestamp( TS_MW ) );
+               } elseif ( $days > 1 ) {
+                       // Timestamp within the past week: show the day of the week and time
+                       $format = $this->getDateFormatString( 'time', $user->getDatePreference() ?: 'default' );
+                       $weekday = self::$mWeekdayMsgs[$ts->timestamp->format( 'w' )];
+                       $ts = wfMessage( "$weekday-at" )
+                               ->inLanguage( $this )
+                               ->params( $this->sprintfDate( $format, $ts->getTimestamp( TS_MW ) ) )
+                               ->text();
+               } elseif ( $days == 1 ) {
+                       // Timestamp was yesterday: say 'yesterday' and the time.
+                       $format = $this->getDateFormatString( 'time', $user->getDatePreference() ?: 'default' );
+                       $ts = wfMessage( 'yesterday-at' )
+                               ->inLanguage( $this )
+                               ->params( $this->sprintfDate( $format, $ts->getTimestamp( TS_MW ) ) )
+                               ->text();
+               } elseif ( $diff->h > 1 || $diff->h == 1 && $diff->i > 30 ) {
+                       // Timestamp was today, but more than 90 minutes ago: say 'today' and the time.
+                       $format = $this->getDateFormatString( 'time', $user->getDatePreference() ?: 'default' );
+                       $ts = wfMessage( 'today-at' )
+                               ->inLanguage( $this )
+                               ->params( $this->sprintfDate( $format, $ts->getTimestamp( TS_MW ) ) )
+                               ->text();
+
+               // From here on in, the timestamp was soon enough ago so that we can simply say
+               // XX units ago, e.g., "2 hours ago" or "5 minutes ago"
+               } elseif ( $diff->h == 1 ) {
+                       // Less than 90 minutes, but more than an hour ago.
+                       $ts = wfMessage( 'hours-ago' )->inLanguage( $this )->numParams( 1 )->text();
+               } elseif ( $diff->i >= 1 ) {
+                       // A few minutes ago.
+                       $ts = wfMessage( 'minutes-ago' )->inLanguage( $this )->numParams( $diff->i )->text();
+               } elseif ( $diff->s >= 30 ) {
+                       // Less than a minute, but more than 30 sec ago.
+                       $ts = wfMessage( 'seconds-ago' )->inLanguage( $this )->numParams( $diff->s )->text();
+               } else {
+                       // Less than 30 seconds ago.
+                       $ts = wfMessage( 'just-now' )->text();
+               }
+
+               return $ts;
+       }
+
        /**
         * @param $key string
         * @return array|null
@@ -4059,15 +4139,14 @@ class Language {
         * @since 1.18
         */
        public function formatExpiry( $expiry, $format = true ) {
-               static $infinity, $infinityMsg;
+               static $infinity;
                if ( $infinity === null ) {
-                       $infinityMsg = wfMessage( 'infiniteblock' );
                        $infinity = wfGetDB( DB_SLAVE )->getInfinity();
                }
 
                if ( $expiry == '' || $expiry == $infinity ) {
                        return $format === true
-                               ? $infinityMsg
+                               ? $this->getMessageFromDB( 'infiniteblock' )
                                : $infinity;
                } else {
                        return $format === true
index c8c06f3..c0bdc3f 100644 (file)
@@ -303,7 +303,7 @@ class KkConverter extends LanguageConverter {
                global $wgLanguageCode;
                $text = parent::translate( $text, $toVariant );
 
-               switch( $toVariant ) {
+               switch ( $toVariant ) {
                        case 'kk-cyrl':
                        case 'kk-kz':
                                $letters = KK_L_UC . KK_L_LC . 'ʺʹ#0123456789';
@@ -347,7 +347,7 @@ class KkConverter extends LanguageConverter {
                        return $text;
                }
 
-               switch( $toVariant ) {
+               switch ( $toVariant ) {
                        case 'kk-arab':
                        case 'kk-cn':
                                $letters = KK_C_LC . KK_C_UC/*.KK_L_LC.KK_L_UC*/;
index 6c07f0b..4444cc4 100644 (file)
@@ -290,6 +290,16 @@ $messages = array(
 'nov' => 'নৱেম্বৰ:',
 'dec' => 'ডিচেম্বৰ:',
 
+'monday-at' => 'সোমবাৰে $1ত',
+'tuesday-at' => 'মঙ্গলবাৰে  $1’ত',
+'wednesday-at' => 'বুধবাৰে $1’ত',
+'thursday-at' => 'বৃহস্পতিবাৰে $1’ত',
+'friday-at' => 'শুক্ৰবাৰে $1’ত',
+'saturday-at' => 'শনিবাৰে $1’ত',
+'sunday-at' => 'দেওবাৰে $1’ত',
+'today-at' => '$1',
+'yesterday-at' => 'কালি $1’ত',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|শ্ৰেণী|শ্ৰেণীসমূহ}}',
 'category_header' => '"$1" শ্ৰেণীৰ পৃষ্ঠাসমূহ',
@@ -3925,4 +3935,8 @@ $5
 'duration-centuries' => '$1 {{PLURAL:$1|শতাব্দী|শতাব্দী}}',
 'duration-millennia' => '$1 {{PLURAL:$1|সহস্ৰাব্দ|সহস্ৰাব্দ}}',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|ঘন্টা}} আগেয়ে',
+'minutes-ago' => '$1 {{PLURAL:$1|মাহ}} আগেয়ে',
+'seconds-ago' => '$1 {{PLURAL:$1|ছেকেন্ড}} আগতে',
 );
index 8823dd5..ca1e8a3 100644 (file)
@@ -562,9 +562,13 @@ $2',
 'welcomecreation-msg' => 'Иҫәп яҙыуығыҙ яһалды.
 Шәхси [[Special:Preferences|{{SITENAME}} көйләүҙәрен]] үҙегеҙгә уңайлы итеп үҙгәртергә онотмағыҙ.',
 'yourname' => 'Ҡатнашыусы исеме',
+'userlogin-yourname' => 'Ҡулланыусы исеме',
 'yourpassword' => 'Һеҙҙең пароль',
+'userlogin-yourpassword' => 'Пароль',
+'userlogin-yourpassword-ph' => 'Яңы паролде яҙығыҙ',
 'yourpasswordagain' => 'Паролде ҡабаттан яҙыу',
 'remembermypassword' => 'Был компьютерҙа паролемде иҫләргә ($1 {{PLURAL:$1|көндән|көндән}} күп түгел)',
+'userlogin-remembermypassword' => 'Хәтерҙә ҡалдырырға',
 'securelogin-stick-https' => 'Танылғандан һуң HTTPS менән бәйләнеште ҡалдырырға',
 'yourdomainname' => 'Һеҙҙең домен',
 'password-change-forbidden' => 'Был викила паролегеҙҙе үҙгәртә алмайһығыҙ.',
index 7e78295..b69874e 100644 (file)
@@ -368,6 +368,16 @@ $messages = array(
 'nov' => 'ліс',
 'dec' => 'сьн',
 
+'monday-at' => 'Панядзелак, $1',
+'tuesday-at' => 'Аўторак, $1',
+'wednesday-at' => 'Серада, $1',
+'thursday-at' => 'Чацьвер, $1',
+'friday-at' => 'Пятніца, $1',
+'saturday-at' => 'Субота, $1',
+'sunday-at' => 'Нядзеля, $1',
+'today-at' => '$1',
+'yesterday-at' => 'Учора, $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Катэгорыя|Катэгорыі|Катэгорыі}}',
 'category_header' => 'Старонкі ў катэгорыі «$1»',
@@ -4011,4 +4021,8 @@ MediaWiki распаўсюджваецца з надзеяй, што будзе
 # Image rotation
 'rotate-comment' => 'Выява павернутая на $1{{PLURAL:$1|°}} па гадзіньнікавай стрэлцы',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|гадзіну|гадзіны|гадзінаў}} таму',
+'minutes-ago' => '$1 {{PLURAL:$1|хвіліну|хвіліны|хвілінаў}} таму',
+'seconds-ago' => '$1 {{PLURAL:$1|сэкунду|сэкунды|сэкундаў}} таму',
 );
index 3243c2a..c274d36 100644 (file)
@@ -492,6 +492,7 @@ $2',
 'yourpasswordagain' => 'শব্দচাবিটি (password) আবার লিখুন',
 'remembermypassword' => 'একাধিক সেশনের জন্য শব্দচাবি মনে রাখা হোক (সর্বোচ্চ $1 {{PLURAL:$1|দিনের|দিনের}} জন্য)',
 'userlogin-remembermypassword' => 'আমাকে মনে রাখো',
+'userlogin-signwithsecure' => 'নিরাপদ সার্ভারের মাধ্যমে লগইন করুন',
 'securelogin-stick-https' => 'লগইনের পর এইচটিটিপিএস-এর সাথে সংযোগকৃত থাকুন',
 'yourdomainname' => 'আপনার ডোমেইন',
 'password-change-forbidden' => 'আপনি এই উইকিতে পাসওয়ার্ড পরিবর্তন করতে পারবেন না।',
@@ -505,6 +506,7 @@ $2',
 'userlogout' => 'প্রস্থান',
 'notloggedin' => 'আপনি সংযুক্ত নন',
 'userlogin-noaccount' => 'কোনও অ্যাকাউন্ট নেই?',
+'userlogin-joinproject' => '{{SITENAME}}-এ অংশগ্রহন করুন',
 'nologin' => "আপনার কি উইকিপিডিয়াতে অ্যাকাউন্ট নেই? তাহলে '''$1'''।",
 'nologinlink' => 'অ্যাকাউন্ট তৈরি করুন',
 'createaccount' => 'নতুন অ্যাকাউন্ট খুলুন',
@@ -512,6 +514,7 @@ $2',
 'gotaccountlink' => 'প্রবেশ',
 'userlogin-resetlink' => 'আপনার লগইনের বিস্তারিত তথ্যাদি ভুলে গেছেন?',
 'helplogin-url' => 'Help:প্রবেশ',
+'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|লগইন সংক্রান্ত সাহায্য]]',
 'createaccountmail' => 'একটি র‌্যান্ডম পাসওয়ার্ড নির্বাচন করুন এবং নিচের নির্ধারিত ইমেইল ঠিকানায় পাঠিয়ে দিন',
 'createaccountreason' => 'কারণ:',
 'badretype' => "আপনার প্রবেশ করানো শব্দচাবি'টি মিলছেনা।",
@@ -602,6 +605,7 @@ $2',
 'passwordreset-text' => 'আপনার শব্দচাবি বদলের জন্য নিচের ফর্মটি পূরণ করুন।',
 'passwordreset-legend' => 'শব্দচাবি রিসেট',
 'passwordreset-disabled' => 'এই উইকিতে শব্দচাবি রিসেটের সুবিধা নিষ্ক্রিয় রয়েছে।',
+'passwordreset-emaildisabled' => 'এই উইকিতে ইমেইল অপশনটি বন্ধ করা হয়েছে।',
 'passwordreset-pretext' => '{{PLURAL:$1||নিচে উল্লেখিত ডেটাগুলোর কোনো একটি প্রবেশ করান}}',
 'passwordreset-username' => 'ব্যবহারকারী নাম:',
 'passwordreset-domain' => 'ডোমেইন:',
@@ -632,7 +636,7 @@ $2
 অস্থায়ী শব্দচাবি: $2',
 'passwordreset-emailsent' => 'শব্দচাবি বদলের একটি ই-মেইল পাঠানো হয়েছে।',
 'passwordreset-emailsent-capture' => 'স্মরণ করিয়ে দেয়ার জন্য একটি ইমেইল করা হয়েছে, যা নিচে দেখানো হচ্ছে।',
-'passwordreset-emailerror-capture' => 'স্মরণ করিয়ে দেয়ার জন্য একটি ইমেইল তৈরী করা হয়েছিল, যা নিচে দেখানো হচ্ছে, তবে $1 ব্যবহারকারীকে এটি পাঠানো যায়নি!',
+'passwordreset-emailerror-capture' => 'স্মরণ করিয়ে দেয়ার জন্য একটি ইমেইল তৈরী করা হয়েছিল, যা নিচে দেখানো হচ্ছে, তবে $1 {{GENDER:$2|ব্যবহারকারীকে}} এটি পাঠানো যায়নি!',
 
 # Special:ChangeEmail
 'changeemail' => 'ই-মেইল ঠিকানা পরিবর্তন',
@@ -1125,6 +1129,7 @@ $1",
 'powersearch-togglenone' => 'কিছু নয়',
 'search-external' => 'বহিঃস্থ অনুসন্ধান',
 'searchdisabled' => '{{SITENAME}} অনুসন্ধান এখন নিষ্ক্রিয় আছে। আপনি গুগলের মাধ্যমে অনুসন্ধান চালাতে পারেন। লক্ষ্য করুন যে {{SITENAME}}-এর বিষয়বস্তুর উপর গুগলের ইন্ডেক্সগুলি হালনাগাদ না-ও করা থাকতে পারে।',
+'search-error' => 'অনুসন্ধানের সময় একটি ত্রুটি হয়েছে: $1',
 
 # Preferences page
 'preferences' => 'আমার পছন্দ',
index cdfede3..99712bf 100644 (file)
@@ -330,7 +330,7 @@ $messages = array(
 'about' => 'Quant a',
 'article' => 'Pàgina de contingut',
 'newwindow' => '(obre en una nova finestra)',
-'cancel' => 'Cancel·lar',
+'cancel' => 'Cancel·la',
 'moredotdotdot' => 'Més...',
 'morenotlisted' => 'Més no en la llista...',
 'mypage' => 'Pàgina',
index 452ada1..5bce37b 100644 (file)
@@ -12,6 +12,7 @@
  * @author Girdi
  * @author Mega programmer
  * @author Sasan700
+ * @author Умар
  */
 
 $fallback = 'ru';
@@ -217,7 +218,7 @@ $messages = array(
 'tog-extendwatchlist' => 'Шорбина тlехьажарна могlам, ша беригге а хийцамаш чубогlуш, тlяхьабина боцурш а',
 'tog-usenewrc' => 'Лелабе дика могlам керла чу хийцамашна (оьшу JavaScript)',
 'tog-numberheadings' => 'Ша шех хlитто терахь корташна',
-'tog-showtoolbar' => 'Ð\93айÑ\82а Ð»Ð°ÐºÑ\85аÑ\80а Ð³lиÑ\80Ñ\81ан Ð´Ð°ÐºÑ\8aа Ð½Ð¸Ñ\81йеÑ\88 Ð°Ñ\82Ñ\82он Ð¾Ñ\86 Ñ\80едаккÑ\85ар чохь (JavaScript)',
+'tog-showtoolbar' => 'Ð\93айÑ\82а Ð»Ð°ÐºÑ\85аÑ\80а Ð³lиÑ\80Ñ\81ан Ð´Ð°ÐºÑ\8aа Ð½Ð¸Ñ\81йеÑ\88 Ð°Ñ\82Ñ\82он Ð¾Ñ\86 Ñ\82адар чохь (JavaScript)',
 'tog-editondblclick' => 'Нисйе агlонаш шозза тlетаlийча (JavaScript)',
 'tog-editsection' => 'Гайта хьажориг «нисйе» аьлла хlора агlона',
 'tog-editsectiononrightclick' => 'Нисде дакъа шозза бакъехьар дахка тlетаlийча оцу кортан (JavaScript)',
@@ -238,8 +239,6 @@ $messages = array(
 'tog-shownumberswatching' => 'Гайта декъашхойн терахь, агlо латийна болу шай тергаме могlам юкъа',
 'tog-oldsig' => 'Хьалххьажар долучу куьгтаlорна:',
 'tog-fancysig' => 'Шен вики-къастаман куьгтаlдар (ша шех хьажориг йоцуш)',
-'tog-externaleditor' => 'Лелайан арахьара рéдаккхар (гlулкхдириг леррина нисйина хила йеза, [//www.mediawiki.org/wiki/Manual:External_editors кхин дlа.])',
-'tog-externaldiff' => 'Лелабан арахьара диллагlарам башхо тарйо гlирс (гlулкхдириг леррина нисйина хила йеза, [//www.mediawiki.org/wiki/Manual:External_editors кхин дlа.])',
 'tog-showjumplinks' => 'Латайе гlодарна хьажоригаш «дехьа вала оцу»',
 'tog-uselivepreview' => 'Лелайа чехка хьалха хьажа (JavaScript, муха ю хьажарна)',
 'tog-forceeditsummary' => 'Дага даийта, нагахь нисйарх лаьцна чохь язъйина язахь',
@@ -281,60 +280,60 @@ $messages = array(
 'thu' => 'Еа',
 'fri' => 'Пle',
 'sat' => 'Шот',
-'january' => 'нажи бутт',
-'february' => 'мархи бутт',
-'march' => 'биÑ\8dкаÑ\80г Ð±Ñ\83Ñ\82т',
-'april' => 'тушоли бутт',
-'may_long' => 'сели бутт',
-'june' => 'мангал Ð±Ñ\83Ñ\82Ñ\82',
-'july' => 'мÑ\8fÑ\82Ñ\81ел Ð±Ñ\83Ñ\82Ñ\82',
-'august' => 'эгиш бутт',
-'september' => 'Ñ\82ав Ð±Ñ\83Ñ\82Ñ\82',
-'october' => 'аÑ\80даÑ\80 Ð±Ñ\83Ñ\82Ñ\82',
-'november' => 'эрх бутт',
-'december' => 'огой Ð±Ñ\83Ñ\82Ñ\82',
-'january-gen' => 'нажи бутт',
-'february-gen' => 'мархи бутт',
-'march-gen' => 'биÑ\8dкаÑ\80г Ð±Ñ\83Ñ\82т',
-'april-gen' => 'тушоли бутт',
-'may-gen' => 'сели бутт',
-'june-gen' => 'мангал Ð±Ñ\83Ñ\82Ñ\82',
-'july-gen' => 'мÑ\8fÑ\82Ñ\81ел Ð±Ñ\83Ñ\82Ñ\82',
-'august-gen' => 'эгиш бутт',
-'september-gen' => 'Ñ\82ав Ð±Ñ\83Ñ\82Ñ\82',
-'october-gen' => 'аÑ\80даÑ\80 Ð±Ñ\83Ñ\82Ñ\82',
-'november-gen' => 'эрх бутт',
-'december-gen' => 'огой Ð±Ñ\83Ñ\82Ñ\82',
-'jan' => 'нажи бутт',
-'feb' => 'мархи бутт',
-'mar' => 'биÑ\8dкаÑ\80г Ð±Ñ\83Ñ\82т',
-'apr' => 'тушоли бутт',
-'may' => 'сели бутт',
-'jun' => 'мангал Ð±Ñ\83Ñ\82Ñ\82',
-'jul' => 'мÑ\8fÑ\82Ñ\81ел Ð±Ñ\83Ñ\82Ñ\82',
-'aug' => 'эгиш бутт',
-'sep' => 'Ñ\82ав Ð±Ñ\83Ñ\82Ñ\82',
-'oct' => 'аÑ\80даÑ\80 Ð±Ñ\83Ñ\82Ñ\82',
-'nov' => 'эрх бутт',
-'dec' => 'огой Ð±Ñ\83Ñ\82Ñ\82',
+'january' => 'январь',
+'february' => 'февраль',
+'march' => 'маÑ\80т',
+'april' => 'апрель',
+'may_long' => 'май',
+'june' => 'иÑ\8eнÑ\8c',
+'july' => 'иÑ\8eлÑ\8c',
+'august' => 'август',
+'september' => 'Ñ\81енÑ\82Ñ\8fбÑ\80Ñ\8c',
+'october' => 'окÑ\82Ñ\8fбÑ\80Ñ\8c',
+'november' => 'ноябрь',
+'december' => 'декабÑ\80Ñ\8c',
+'january-gen' => 'январь',
+'february-gen' => 'февраль',
+'march-gen' => 'маÑ\80т',
+'april-gen' => 'апрель',
+'may-gen' => 'май',
+'june-gen' => 'иÑ\8eнÑ\8c',
+'july-gen' => 'иÑ\8eлÑ\8c',
+'august-gen' => 'август',
+'september-gen' => 'Ñ\81енÑ\82Ñ\8fбÑ\80Ñ\8c',
+'october-gen' => 'окÑ\82Ñ\8fбÑ\80Ñ\8c',
+'november-gen' => 'ноябрь',
+'december-gen' => 'декабÑ\80Ñ\8c',
+'jan' => 'январь',
+'feb' => 'февраль',
+'mar' => 'маÑ\80т',
+'apr' => 'апрель',
+'may' => 'май',
+'jun' => 'иÑ\8eнÑ\8c',
+'jul' => 'иÑ\8eлÑ\8c',
+'aug' => 'август',
+'sep' => 'Ñ\81енÑ\82Ñ\8fбÑ\80Ñ\8c',
+'oct' => 'окÑ\82Ñ\8fбÑ\80Ñ\8c',
+'nov' => 'ноябрь',
+'dec' => 'декабÑ\80Ñ\8c',
 
 # Categories related messages
-'pagecategories' => '{{PLURAL:$1|Кадегар|Кадегарш}}',
-'category_header' => 'Агlонаш оц кадегаршчохь «$1»',
-'subcategories' => 'Бухаркадегарш',
-'category-media-header' => 'Хlумнаш оцу кадегар чохь «$1»',
-'category-empty' => "''Хlара кадегар хlинца йаьсса ю.''",
-'hidden-categories' => '{{PLURAL:$1|Къайлаха кадегар|Къайлаха йолу кадегарш}}',
-'hidden-category-category' => 'Къайлаха йолу кадегарш',
-'category-subcat-count' => '{{PLURAL:$2|Хlокх кадегар чохь ю хlокхуьна бухар кадегар.|{{PLURAL:$1|Гойташ $1 бухар кадегар|Гойту $1 бухар кадегар|Гойту $1 бухар кадегар}} оцу $2.}}',
-'category-subcat-count-limited' => 'Хlокх кадегар чохь {{PLURAL:$1|$1 бухар кадегар|$1 бухар кадегарша|$1 бухар кадегарш}}.',
-'category-article-count' => '{{PLURAL:$2|Хlокх кадегар чохь яц цхьа агlо бе.|{{PLURAL:$1|Гойташ $1 агlо|Гойту $1 агlонаш|Гойту $1 агlонаш}} хlокх кадегарца кху $2.}}',
-'category-article-count-limited' => 'Хlокх кадегар чохь {{PLURAL:$1|$1 агlо|$1 агlонаш|$1 агlонаш}}.',
-'category-file-count' => '{{PLURAL:$2|Хlокх кадегар чохь цхьа хlум бе яц.|{{PLURAL:$1|Гойта $1 хlум|Гойту $1 хlума|Гойту $1 хlумнаш}} хlокх кадегарца кху $2.}}',
-'category-file-count-limited' => 'Хlокх кадегар чохь {{PLURAL:$1|$1 хlум|$1 хlума|$1 хlумнаш}}.',
+'pagecategories' => '{{PLURAL:$1|Категори|Категореш}}',
+'category_header' => 'Агlонаш оц категоречохь «$1»',
+'subcategories' => 'Бухаркатегореш',
+'category-media-header' => 'ХӀумнаш оцу категори чохь «$1»',
+'category-empty' => "''ХӀара категори хӀинца йаьсса ю.''",
+'hidden-categories' => '{{PLURAL:$1|Къайлаха категори|Къайлаха йолу категореш}}',
+'hidden-category-category' => 'Къайлаха йолу категореш',
+'category-subcat-count' => '{{PLURAL:$2|ХӀокх категори чохь ю хӀокхуьна бухар категори.|{{PLURAL:$1|Гойташ $1 бухар категори|Гойту $1 бухар категори|Гойту $1 бухар категори}} оцу $2.}}',
+'category-subcat-count-limited' => 'Хlокх категори чохь {{PLURAL:$1|$1 бухар категори|$1 бухар категореша|$1 бухар категореш}}.',
+'category-article-count' => '{{PLURAL:$2|ХӀокх категори чохь яц цхьа агӀо бе.|{{PLURAL:$1|Гойташ $1 агlо|Гойту $1 агӀонаш|Гойту $1 агӀонаш}} хӀокх категорешца кху $2.}}',
+'category-article-count-limited' => 'Хlокх категори чохь {{PLURAL:$1|$1 агlо|$1 агlонаш|$1 агlонаш}}.',
+'category-file-count' => '{{PLURAL:$2|ХӀокх категори чохь цхьа хӀум бе яц.|{{PLURAL:$1|Гойта $1 хӀум|Гойту $1 хlума|Гойту $1 хlумнаш}} хlокх категорешца кху $2.}}',
+'category-file-count-limited' => 'ХӀокх категори чохь {{PLURAL:$1|$1 файл|$1 хӀума|$1 файлаш}}.',
 'listingcontinuesabbrev' => '(кхин дlа)',
 'index-category' => 'Меттигтерахьйо агlонаш',
-'noindex-category' => 'Дlахьушйоцу агlонаш',
+'noindex-category' => 'ДӀахьушйоцу агӀонаш',
 
 'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD',
 
@@ -342,10 +341,10 @@ $messages = array(
 'article' => 'Яззам',
 'newwindow' => '(керлачу корехь)',
 'cancel' => 'Цаоьшу',
-'moredotdotdot' => 'Кхин дlа…',
-'mypage' => 'Долахь йолу агlо',
-'mytalk' => 'Сан дийцаре агlо',
-'anontalk' => 'Дийцаре хlара IP-долуметтиг',
+'moredotdotdot' => 'Кхин дӀа…',
+'mypage' => 'Долахь йолу агӀо',
+'mytalk' => 'Сан дийцаре агӀо',
+'anontalk' => 'Дийцаре хӀара IP-долуметтиг',
 'navigation' => 'Шавигар',
 'and' => '&#32;а',
 
@@ -369,7 +368,7 @@ $messages = array(
 'vector-simplesearch-preference' => 'Шуьйра лахаран хьехар лата де (декъа «Хьушйерг» кечйарца)',
 'vector-view-create' => 'Кхоллар',
 'vector-view-edit' => 'Нисйé',
-'vector-view-history' => 'Ð¥Ñ\8cажа Ð¸Ñ\81Ñ\82оÑ\80е',
+'vector-view-history' => 'Ð¥Ñ\8cажа Ð¸Ñ\81Ñ\82оÑ\80и',
 'vector-view-view' => 'Éшар',
 'vector-view-viewsource' => 'Билглонашка хьажа',
 'actions' => 'Дийраш',
@@ -384,8 +383,8 @@ $messages = array(
 'searchbutton' => 'Лаха',
 'go' => 'Дехьа вала',
 'searcharticle' => 'Дехьа вала',
-'history' => 'Ð\98Ñ\81Ñ\82оÑ\80е',
-'history_short' => 'Ð\98Ñ\81Ñ\82оÑ\80е',
+'history' => 'Ð\98Ñ\81Ñ\82оÑ\80и',
+'history_short' => 'Ð\98Ñ\81Ñ\82оÑ\80и',
 'updatedmarker' => 'Керла яккхина со чуваьллачултlаьхьа',
 'printableversion' => 'Зорба туху варси',
 'permalink' => 'Даиман йолу хьажориг',
@@ -506,11 +505,11 @@ $1',
 'nstab-user' => 'Декъашхо',
 'nstab-special' => 'Белха агlо',
 'nstab-project' => 'Кхолламех',
-'nstab-image' => 'Ð¥lÑ\83м',
+'nstab-image' => 'Файл',
 'nstab-mediawiki' => 'Хаам',
-'nstab-template' => 'Куцкеп',
+'nstab-template' => 'Кеп',
 'nstab-help' => 'Нисвохаам',
-'nstab-category' => 'Кадегар',
+'nstab-category' => 'Категори',
 
 # Main script and global functions
 'nosuchaction' => 'Ишта дийриг дац',
@@ -594,7 +593,7 @@ $1',
 'nowiki_sample' => 'Чудиллийша кхузе барамхlоттонза йоза.',
 'nowiki_tip' => 'Тергал ца бо вики-бáрамхlоттор',
 'image_sample' => 'Example.jpg',
-'image_tip' => 'ЧоÑ\85Ñ\8c Ð¹Ð¾Ð»Ñ\83 Ñ\85\83м',
+'image_tip' => 'ЧоÑ\85Ñ\8c Ð¹Ð¾Ð»Ñ\83 Ñ\84айл',
 'media_sample' => 'Example.ogg',
 'media_tip' => 'Хьажориг оцу медиа-хlуман',
 'sig_tip' => 'Хьан куьгтаlор аъ хlоттина хан',
@@ -609,7 +608,7 @@ $1',
 'preview' => 'Хьалха муха ю хьажа',
 'showpreview' => 'Хьалха муха ю хьажар',
 'showdiff' => 'Хlоттина болу хийцам',
-'anoneditwarning' => "'''ТеÑ\80гам Ð±Ðµ''': Ð\90Ñ\85Ñ\8cа Ñ\85Ñ\8cо Ð²Ð¾Ð²Ð·Ð¸Ñ\82ина Ð²Ð°Ñ\86 Ð³lиÑ\80Ñ\81ан. Ð¥Ñ\8cан IP-долÑ\83 Ð¼ÐµÑ\82Ñ\82иг Ð´lаÑ\8fзйина Ñ\85иÑ\80а Ñ\8e Ñ\85lокÑ\85Ñ\83 Ð°Ð³lон Ð¸Ñ\81Ñ\82оÑ\80е чу.",
+'anoneditwarning' => "'''ТеÑ\80гам Ð±Ðµ''': Ð\90Ñ\85Ñ\8cа Ñ\85Ñ\8cо Ð²Ð¾Ð²Ð·Ð¸Ñ\82ина Ð²Ð°Ñ\86 Ð³lиÑ\80Ñ\81ан. Ð¥Ñ\8cан IP-долÑ\83 Ð¼ÐµÑ\82Ñ\82иг Ð´lаÑ\8fзйина Ñ\85иÑ\80а Ñ\8e Ñ\85lокÑ\85Ñ\83 Ð°Ð³lон Ð¸Ñ\81Ñ\82оÑ\80и чу.",
 'summary-preview' => 'Цуьнах лаьцна хирду:',
 'blockedtitle' => 'Декъашхо сацийна',
 'accmailtitle' => 'Ишар дlаяхьийтина.',
@@ -635,9 +634,9 @@ $1',
 'updated' => '(Карла йаькхина)',
 'note' => "'''Билгалдаккхар:'''",
 'previewnote' => "'''Хlара хьалх хьажар ду, йоза хlинца язданза ду!'''",
-'editing' => 'РедаккÑ\85ар: $1',
-'editingsection' => 'РедаккÑ\85ар $1 (даакъа)',
-'editingcomment' => 'РедаккÑ\85ар $1 (керла даакъа)',
+'editing' => 'Тадар: $1',
+'editingsection' => 'Тадар $1 (даакъа)',
+'editingcomment' => 'Тадар $1 (керла даакъа)',
 'editconflict' => 'Редаккхарна дойнаш: $1',
 'yourtext' => 'Хьан йоза',
 'yourdiff' => 'Башхаллаш',
@@ -653,8 +652,8 @@ $1',
 'protectedpagewarning' => "'''Дlахьедар. Хlара агlо гlаролла дина ю хийцам цабайта, иза хийца йа нисйа а бакъо йолуш адаманкуьйгалла лелош болу декъашхой бе бац.'''
 Лахахьа гойту хаамаш тlаьхьара бина болу хийцамна тептар чура:",
 'cascadeprotectedwarning' => "'''Дlахьедар:''' Хlокху агlонна редаккха бакъо йолуш хlара тоба йу «Адаманкуьйгалхой», хlунда аьлча иза латийна {{PLURAL:$1|кхечу агlонца|кхечу агlонашца}} хlоттделлачу гlароллийца:",
-'templatesused' => '{{PLURAL:$1|Куцкеп, лелийна|Куцкепаш, лелош ду}} хlокху агlон башхонца:',
-'templatesusedpreview' => '{{PLURAL:$1|Куцкеп, лелошдолу|Куцкепаш, лелошдолу}} оцу хьалх хьожучу агlонца:',
+'templatesused' => '{{PLURAL:$1|Кеп, лелийна|Кепаш, лелош ду}} хlокху агlон башхонца:',
+'templatesusedpreview' => '{{PLURAL:$1|Кеп, лелошдолу|Кепаш, лелошдолу}} оцу хьалх хьожучу агlонца:',
 'template-protected' => '(гlароллийца)',
 'template-semiprotected' => '(дуьззина доцуш гlаролла)',
 'hiddencategories' => 'Хlара агlо чуйогlуш ю оцу $1 {{PLURAL:$1|къайлаха кадегарчу|къайлаха кадегаршчу|къайлаха кадегаршчу}}:',
@@ -671,7 +670,7 @@ $1',
 
 # Parser/template warnings
 'parser-template-loop-warning' => 'Карийна куцкепаш юкъахь хилла шад: [[$1]]',
-'parser-template-recursion-depth-warning' => 'Дозанал хьалаваьлла кlоргенца йух йуха дина куцкеп ($1)',
+'parser-template-recursion-depth-warning' => 'Дозанал хьалаваьлла кlоргенца йух йуха дина кеп ($1)',
 
 # "Undo" feature
 'undo-success' => 'Нисйинарг а тlе цалаца мега. Дехар до, хьажа цхьатерра йуй башхо, тешна хила, баккъалла иза хийцам буйте хьуна безарг, тlакха тlе таlайе «дlайазйе агlо», хийцам хlотта ба.',
@@ -690,8 +689,8 @@ $1',
 'page_last' => 'тlаьххьара',
 'histlegend' => "Кхетор: (хlинцлера.) — йолучу башхон къастам; (хьалх.) — хьалхлерачу башхон къастам; '''ж''' — жимо бозалца болу хийцам.",
 'history-fieldset-title' => 'Хьажа исцlарерачу',
-'histfirst' => 'къена',
-'histlast' => 'Ñ\85Ñ\8cалÑ\85о',
+'histfirst' => 'ширниш',
+'histlast' => 'Ñ\85Ñ\8cалÑ\85аÑ\80ниÑ\88',
 'historyempty' => '(йаьсса)',
 
 # Revision feed
@@ -715,7 +714,7 @@ $1',
 'revertmerge' => 'Йекъа',
 
 # Diffs
-'history-title' => '$1 â\80\94 Ñ\85ийÑ\86аман Ð¸Ñ\81Ñ\82оÑ\80е',
+'history-title' => '$1 â\80\94 Ñ\85ийÑ\86аман Ð¸Ñ\81Ñ\82оÑ\80и',
 'lineno' => 'Могlа $1:',
 'compareselectedversions' => 'Хаьржиначуьна башхо муха ю хьажа',
 'showhideselectedversions' => 'Гайта/къайлайаха хаьржина башхонаш',
@@ -784,7 +783,7 @@ $1',
 'prefs-resetpass' => 'Хийца ишар',
 'prefs-rendering' => 'Арахьара хатl',
 'saveprefs' => 'lалашдан',
-'prefs-editing' => 'РедаккÑ\85ар',
+'prefs-editing' => 'Тадар',
 'searchresultshead' => 'Лаха',
 'timezonelegend' => 'Сахьатан аса:',
 'prefs-searchoptions' => 'Лахарна гlирс нисба',
@@ -851,7 +850,7 @@ $1',
 'rcshowhidemine' => '$1 айхьа нисдинарш',
 'rclinks' => 'Гайта тlаьхьара $1 хийцамаш оцу $2 ден<br />$3',
 'diff' => 'тейп тайпнара',
-'hist' => 'иÑ\81Ñ\82оÑ\80е',
+'hist' => 'иÑ\81Ñ\82оÑ\80и',
 'hide' => 'Къайлаяккха',
 'show' => 'Гайта',
 'minoreditletter' => 'ж',
@@ -873,8 +872,8 @@ $1',
 'recentchangeslinked-to' => 'Кхечу агlор, гайта хийцамаш агlонашца, хlоттийначу агlонтlе хьажориг йолуш',
 
 # Upload
-'upload' => 'ЧÑ\83йаккÑ\85а Ñ\85\83м',
-'uploadbtn' => 'ЧÑ\83йаккÑ\85а Ñ\85\83м',
+'upload' => 'ЧÑ\83йаккÑ\85а Ñ\84айл',
+'uploadbtn' => 'ЧÑ\83йаккÑ\85а Ñ\84айл',
 'uploadlogpage' => 'Чуйахаран тéптар',
 'uploadlogpagetext' => 'Лахахьа гойтуш бу могlам тlаьххьара чуяхна хlумнаши. Ишта хьажа. [[Special:ImageList|хlумнаши могlам]] йа [[Special:NewImages|галеларе хlумнаши]].',
 'filename' => 'Хlуман цlе',
@@ -899,7 +898,7 @@ PICT # тайп тайпан
 
 # Special:ListFiles
 'listfiles_search_for' => 'Лаха хIуман цIарца:',
-'imgfile' => 'Ñ\85\83м',
+'imgfile' => 'Ñ\84айл',
 'listfiles' => 'Хlумнаши могlам',
 'listfiles_name' => 'Хlуман цlе',
 'listfiles_user' => 'Декъашхо',
@@ -907,9 +906,9 @@ PICT # тайп тайпан
 'listfiles_description' => 'Цуьнах лаьцна',
 
 # File description page
-'file-anchor-link' => ' Хlум',
-'filehist' => 'Ð¥lÑ\83ман Ð¸Ñ\81Ñ\82оÑ\80е',
-'filehist-help' => 'ТlеÑ\82аlаде Ñ\82еÑ\80аÑ\85Ñ\8c\85ан, Ð¼Ñ\83Ñ\85а Ñ\85илла Ñ\85Ñ\8cажаÑ\80на Ð¸ Ñ\85\83м.',
+'file-anchor-link' => 'Файл',
+'filehist' => 'Файлан Ð¸Ñ\81Ñ\82оÑ\80и',
+'filehist-help' => 'ТlеÑ\82аlаде Ñ\82еÑ\80аÑ\85Ñ\8c\85ан, Ð¼Ñ\83Ñ\85а Ñ\85илла Ñ\85Ñ\8cажаÑ\80на Ð¸ Ñ\84айл.',
 'filehist-deleteall' => 'дlадайá массо',
 'filehist-deleteone' => 'дlадайá',
 'filehist-current' => 'карара',
@@ -929,7 +928,7 @@ PICT # тайп тайпан
 'filerevert-submit' => 'Юхаяккха',
 
 # File deletion
-'filedelete-legend' => 'Ð\94lайайá Ð¸ Ñ\85\83м',
+'filedelete-legend' => 'Ð\94lайайá Ð¸ Ñ\84айл',
 'filedelete-submit' => 'Дlадайá',
 'filedelete-otherreason' => 'Кхин бахьан:',
 'filedelete-reason-otherlist' => 'Кхин бахьан',
@@ -982,14 +981,14 @@ PICT # тайп тайпан
 
 # Miscellaneous special pages
 'nbytes' => '$1 {{PLURAL:$1|цlинцl|цlинцlа|цlинацl}}',
-'ncategories' => '$1 {{PLURAL:$1|кадегар|кадегарш|кадегарш}}',
-'nmembers' => '$1 {{PLURAL:$1|Ñ\85\83м|Ñ\85\83ма|Ñ\85\83мнаш}}',
+'ncategories' => '$1 {{PLURAL:$1|категори|категореш|категореш}}',
+'nmembers' => '$1 {{PLURAL:$1|Ñ\84айл|Ñ\84айлана|Ñ\84айлаш}}',
 'specialpage-empty' => 'Дехаро хlумма ца елла.',
 'lonelypages' => 'Байлахь йисина агIонаш',
-'uncategorizedpages' => 'Кадегар йоцу агIонаш',
-'uncategorizedcategories' => 'Кадегар йоцу кадегарш',
-'uncategorizedimages' => 'Кадегар йоцу хIумнаш',
-'uncategorizedtemplates' => 'Кадегар йоцу куцкепаш',
+'uncategorizedpages' => 'Категори йоцу агIонаш',
+'uncategorizedcategories' => 'Категори йоцу категореш',
+'uncategorizedimages' => 'Категори йоцу хIумнаш',
+'uncategorizedtemplates' => 'Категори йоцу кепаш',
 'unusedcategories' => 'Йаьсса кадегарш',
 'wantedcategories' => 'Оьшуш йолу кадегарш',
 'wantedpages' => 'Оьшуш йолу агIонаш',
@@ -1010,12 +1009,12 @@ PICT # тайп тайпан
 'listusers' => 'Декъашхой могlам',
 'newpages' => 'Керла агlонаш',
 'newpages-username' => 'Декъашхо:',
-'ancientpages' => 'ЯззамаÑ\88 Ð¾Ñ\86Ñ\83 Ñ\82еÑ\80аÑ\85Ñ\8cÑ\86а Ñ\82Ñ\8fÑ\85Ñ\85Ñ\8cаÑ\80а Ñ\80едаккÑ\85ар дина долу',
+'ancientpages' => 'ЯззамаÑ\88 Ð¾Ñ\86Ñ\83 Ñ\82еÑ\80аÑ\85Ñ\8cÑ\86а Ñ\82Ñ\8fÑ\85Ñ\85Ñ\8cаÑ\80а Ñ\82адар дина долу',
 'move' => 'Цlе хийца',
 'movethispage' => 'Хlокху агlон цlе хийца',
 'unusedimagestext' => 'Дехар до, тидаме эца, кхин йолу дуьнана машан-меттигаш а лелош хила мега нисса йогlу хьажориг (URL) хlокху хlуман, хlокху могlаме йогlуш ялахь яцахь а иза хила мега жигара лелош.',
 'pager-newer-n' => '{{PLURAL:$1|алсамо керла|алсамо керланаш|алсамо керлачарех}} $1',
-'pager-older-n' => '{{PLURAL:$1|алсамо къена|алсамо къенанаш|алсамо къеначарех}} $1',
+'pager-older-n' => '{{PLURAL:$1|алсамо шира|алсамо ширниш|алсамо ширачарех}} $1',
 
 # Book sources
 'booksources' => 'Жайнан хьосташ',
@@ -1059,16 +1058,13 @@ PICT # тайп тайпан
 # Special:ListUsers
 'listusers-submit' => 'Гайта',
 
-# Special:ActiveUsers
-'activeusers' => 'Жигар декъашхой могlам',
-
 # Special:ListGroupRights
 'listgrouprights' => 'Декъашхойн тобанаши бакъонаш',
 'listgrouprights-group' => 'Тоба',
 'listgrouprights-helppage' => 'Help:Тобан бакъонаш',
 'listgrouprights-members' => '(тобан могlам)',
 
-# E-mail user
+# Email user
 'emailuser' => 'Декъашхочун хааман кехат',
 'defemailsubject' => 'Хаам {{grammar:genitive|{{SITENAME}}}} чура бу',
 'emailmessage' => 'Хаам:',
@@ -1101,7 +1097,7 @@ PICT # тайп тайпан
 'exbeforeblank' => 'чуьраниг дlацlанйале хьалха: «$1»',
 'exblank' => 'агlо йаьсса йара',
 'delete-legend' => 'Дlадайáр',
-'confirmdeletetext' => 'Ð¥Ñ\8cан Ð´ÐµÑ\85аÑ\80 Ð´Ñ\83 Ñ\85lаÑ\80а Ð°Ð³lо Ñ\88е Ð±Ñ\83Ñ\85Ñ\86и Ð´lабайа Ð°Ñ\8cлла (йа Ñ\81Ñ\83Ñ\80Ñ\82) Ð° Ð¼Ð°Ñ\81Ñ\81о Ñ\86Ñ\83Ñ\8cнан Ð¸Ñ\81Ñ\82оÑ\80е оцу бух чура. Дехар до, бакъде, билгала хьайна иза лаахь, кхеташ хира ву хьо тlаьхьа хир долу чун, иза деш ду ахьа бакъонца догlуш, вахьа дехкина долучу дакъанца [[{{MediaWiki:Policy-url}}]].',
+'confirmdeletetext' => 'Ð¥Ñ\8cан Ð´ÐµÑ\85аÑ\80 Ð´Ñ\83 Ñ\85lаÑ\80а Ð°Ð³lо Ñ\88е Ð±Ñ\83Ñ\85Ñ\86и Ð´lабайа Ð°Ñ\8cлла (йа Ñ\81Ñ\83Ñ\80Ñ\82) Ð° Ð¼Ð°Ñ\81Ñ\81о Ñ\86Ñ\83Ñ\8cнан Ð¸Ñ\81Ñ\82оÑ\80и оцу бух чура. Дехар до, бакъде, билгала хьайна иза лаахь, кхеташ хира ву хьо тlаьхьа хир долу чун, иза деш ду ахьа бакъонца догlуш, вахьа дехкина долучу дакъанца [[{{MediaWiki:Policy-url}}]].',
 'actioncomplete' => 'Дешдерг кхочушди',
 'deletedtext' => '«$1» дlаяккхина йара.
 Хьажа. $2 хьажарна оцу тlаьхьара дlадайаран могlаме.',
@@ -1222,7 +1218,7 @@ PICT # тайп тайпан
 Нагахь ахьа иза цадинехь, дехар до, хьажа йуйла [[Special:DoubleRedirects|шалгlа]] а [[Special:BrokenRedirects|хадийначу дlасахьажориш]].
 Ахьа жоп лур ду кхин дlа а хьажориг хьажийна хилийта, хила йезаче.
 
-ТеÑ\80гамбеÑ\88 Ñ\85ила, Ð¸Ð·Ð° Ð°Ð³lо '''Ñ\85иÑ\80а Ñ\8fÑ\86''' Ñ\86lе Ñ\85ийÑ\86ина, Ð½Ð°Ð³Ð°Ñ\85Ñ\8c Ð¸Ð·Ð° Ñ\86lе Ð¹Ð¾Ð»Ñ\83Ñ\88 ÐºÐµÑ\80ла Ð°Ð³lо Ð¹Ð°Ð»Ð°Ñ\85Ñ\8c, Ñ\86Ñ\85Ñ\8cа Ð¹Ð¾Ð»Ñ\83 Ñ\85енаÑ\85Ñ\8c, Ð½Ð°Ð³Ð°Ñ\85Ñ\8c Ð¸Ð·Ð° Ð¹Ð°Ð»Ð°Ñ\85Ñ\8c Ñ\86Ñ\85Ñ\8cан Ñ\82lе Ñ\85Ñ\8cажийна Ð¹Ð° Ð¹Ð°Ñ\8cÑ\81Ñ\81а Ð° Ð½Ð¸Ñ\81йаÑ\80Ñ\86а Ð¸Ñ\81Ñ\82оÑ\80е йоцуш.
+ТеÑ\80гамбеÑ\88 Ñ\85ила, Ð¸Ð·Ð° Ð°Ð³lо '''Ñ\85иÑ\80а Ñ\8fÑ\86''' Ñ\86lе Ñ\85ийÑ\86ина, Ð½Ð°Ð³Ð°Ñ\85Ñ\8c Ð¸Ð·Ð° Ñ\86lе Ð¹Ð¾Ð»Ñ\83Ñ\88 ÐºÐµÑ\80ла Ð°Ð³lо Ð¹Ð°Ð»Ð°Ñ\85Ñ\8c, Ñ\86Ñ\85Ñ\8cа Ð¹Ð¾Ð»Ñ\83 Ñ\85енаÑ\85Ñ\8c, Ð½Ð°Ð³Ð°Ñ\85Ñ\8c Ð¸Ð·Ð° Ð¹Ð°Ð»Ð°Ñ\85Ñ\8c Ñ\86Ñ\85Ñ\8cан Ñ\82lе Ñ\85Ñ\8cажийна Ð¹Ð° Ð¹Ð°Ñ\8cÑ\81Ñ\81а Ð° Ð½Ð¸Ñ\81йаÑ\80Ñ\86а Ð¸Ñ\81Ñ\82оÑ\80и йоцуш.
 Иза бохург ду, хьега хийцалур ю оцу агlон цlе оцу цlарца, хlинц цуьна хилла йолу, нагахь ахьа гlалатонца цlе хийцанехь, йолуш йолу агlо цахууш йа мега хьа.
 
 '''ДlАХЬЕДАР!'''
@@ -1259,7 +1255,7 @@ PICT # тайп тайпан
 'export' => 'Яззамаш кхечу меттиган арадахар',
 'exporttext' => 'Шуьга далур ду кхечу меттера чудахарш, йоза а хийцаме тептарш билгалла йолу агlонаш йа гулдина йолу агlонаш хlокх XML барамца, йуха тlяхьа чура [[Special:Import|хьаэцалурдолш]] кхечу вики-хьалхен, болх беш йолу хlокху MediaWiki гlирсаца.
 
\9aÑ\85еÑ\87Ñ\83 Ð¼ÐµÑ\82Ñ\82еÑ\80а Ñ\8fззамаÑ\88 Ñ\87Ñ\83йаÑ\85а, Ñ\87Ñ\83Ñ\8fзйе Ñ\86lе Ñ\80едокÑ\85Ñ\87Ñ\83 Ð¼ÐµÑ\82Ñ\82е, Ñ\86\85Ñ\8cа Ð¼Ð¾Ð³lан Ñ\86lе Ð¼Ð¾Ð³lаÑ\80Ñ\88каÑ\85Ñ\8c, Ð¹Ñ\83Ñ\85а Ñ\85аÑ\80жа Ð»Ð°Ñ\8cи Ñ\88Ñ\83на Ð\9aÑ\85еÑ\87Ñ\83 Ð¼ÐµÑ\82Ñ\82еÑ\80 Ñ\87Ñ\83йаÑ\85а Ð¼Ð°Ñ\81Ñ\81о Ñ\8fззамаÑ\88на Ð¸Ñ\81Ñ\82оÑ\80е хийцамбарш йа тlяхьаралера яззамна башхо.
\9aÑ\85еÑ\87Ñ\83 Ð¼ÐµÑ\82Ñ\82еÑ\80а Ñ\8fззамаÑ\88 Ñ\87Ñ\83йаÑ\85а, Ñ\87Ñ\83Ñ\8fзйе Ñ\86lе Ñ\80едокÑ\85Ñ\87Ñ\83 Ð¼ÐµÑ\82Ñ\82е, Ñ\86\85Ñ\8cа Ð¼Ð¾Ð³lан Ñ\86lе Ð¼Ð¾Ð³lаÑ\80Ñ\88каÑ\85Ñ\8c, Ð¹Ñ\83Ñ\85а Ñ\85аÑ\80жа Ð»Ð°Ñ\8cи Ñ\88Ñ\83на Ð\9aÑ\85еÑ\87Ñ\83 Ð¼ÐµÑ\82Ñ\82еÑ\80 Ñ\87Ñ\83йаÑ\85а Ð¼Ð°Ñ\81Ñ\81о Ñ\8fззамаÑ\88на Ð¸Ñ\81Ñ\82оÑ\80и хийцамбарш йа тlяхьаралера яззамна башхо.
 
 Шуьга кхи даландерг, лелаеш йолу меттиг къастаман машан хьажориг кхечу меттер чудаха тlяхьарлера башхон яззамаш. Массала оцу яззамна [[{{MediaWiki:Mainpage}}]] хlара хира йу хьажориг [[{{#Special:Export}}/{{MediaWiki:Mainpage}}]].',
 'export-templates' => 'Латадé куцкепаш',
@@ -1329,7 +1325,7 @@ PICT # тайп тайпан
 'tooltip-t-permalink' => 'Даимна йолу хьажориг хlокху башха агlонна',
 'tooltip-ca-nstab-main' => 'Яззамна чулацам',
 'tooltip-ca-nstab-user' => 'Хlора декъашхон долахь йолу агlо',
-'tooltip-ca-nstab-media' => 'Ð\9cедиа-Ñ\85\83м',
+'tooltip-ca-nstab-media' => 'Ð\9cедиа-Ñ\84айл',
 'tooltip-ca-nstab-special' => 'Хlара белха агlо йу, хlара рéдаккхалуш яц',
 'tooltip-ca-nstab-project' => 'Кхолламан дакъа',
 'tooltip-ca-nstab-image' => 'Хlуман агlо',
@@ -1364,9 +1360,6 @@ PICT # тайп тайпан
 # Spam protection
 'spamprotectiontitle' => 'Совбиларна литтар',
 
-# Skin names
-'skinname-standard' => 'Лела ма ярра',
-
 # Browsing diffs
 'previousdiff' => '← Хьалхдоьда нисдинарг',
 'nextdiff' => 'Тlяхьа догlа нисдинарг →',
@@ -1470,7 +1463,7 @@ PICT # тайп тайпан
 
 # Special:FilePath
 'filepath' => 'ХIуман тIе болу некъ',
-'filepath-page' => 'Ð¥lÑ\83м:',
+'filepath-page' => 'Файл:',
 'filepath-submit' => 'Дехьавала',
 
 # Special:FileDuplicateSearch
index 7833a2c..34ba28c 100644 (file)
@@ -3287,7 +3287,7 @@ $5
 'hijri-calendar-m3' => 'ڕەبیعەلئەووەڵ',
 'hijri-calendar-m4' => 'ڕەبیعەلئاخیر',
 'hijri-calendar-m5' => 'جومادەلئوولا',
-'hijri-calendar-m6' => 'جومادەسسانی',
+'hijri-calendar-m6' => 'جومادەلئاخیر',
 'hijri-calendar-m7' => 'ڕەجەب',
 'hijri-calendar-m8' => 'شەعبان',
 'hijri-calendar-m9' => 'ڕەمەزان',
index 99681ba..37cbd2e 100644 (file)
@@ -469,6 +469,16 @@ $messages = array(
 'nov' => '11.',
 'dec' => '12.',
 
+'monday-at' => 'v pondělí v $1',
+'tuesday-at' => 'v úterý v $1',
+'wednesday-at' => 've středu v $1',
+'thursday-at' => 've čtvrtek v $1',
+'friday-at' => 'v pátek v $1',
+'saturday-at' => 'v sobotu v $1',
+'sunday-at' => 'v neděli v $1',
+'today-at' => '$1',
+'yesterday-at' => 'včera v $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategorie|Kategorie|Kategorie}}',
 'category_header' => 'Stránky v kategorii „$1“',
@@ -1343,7 +1353,7 @@ Ujistěte se, že tato změna udrží souvislost a posloupnost verzí v historii
 'mergelogpagetext' => 'Níže je seznam nejnovějších sloučení historie jedné stránky s jinou.',
 
 # Diffs
-'history-title' => '$1: Historie verzí',
+'history-title' => 'Historie verzí stránky „$1“',
 'difference-title' => '$1: Porovnání verzí',
 'difference-title-multipage' => '$1 a $2: Porovnání stránek',
 'difference-multipage' => '(Rozdíly mezi stránkami)',
@@ -2154,7 +2164,7 @@ Každý řádek obsahuje odkaz na první a druhé přesměrování a k tomu cíl
 'ncategories' => '$1 {{PLURAL:$1|kategorie|kategorie|kategorií}}',
 'ninterwikis' => '$1 {{PLURAL:$1|mezijazykový odkaz|mezijazykové odkazy|mezijazykových odkazů}}',
 'nlinks' => '$1 {{PLURAL:$1|odkaz|odkazy|odkazů}}',
-'nmembers' => '$1 {{PLURAL:$1|stránka|stránky|stránek}}',
+'nmembers' => '$1 {{PLURAL:$1|položka|položky|položek}}',
 'nrevisions' => '$1 {{PLURAL:$1|revize|revize|revizí}}',
 'nviews' => '$1 {{PLURAL:$1|návšteva|návštevy|návštev}}',
 'nimagelinks' => 'Použit na $1 {{PLURAL:$1|stránce|stránkách}}',
@@ -4144,4 +4154,8 @@ Jinak můžete využít jednoduchý formulář níže. Váš komentář bude př
 # Image rotation
 'rotate-comment' => 'Obrázek otočen o $1 {{PLURAL:$1|stupeň|stupně|stupňů}} po směru hodinových ručiček',
 
+# Unknown messages
+'hours-ago' => 'před $1 {{PLURAL:$1|hodinou|hodinami}}',
+'minutes-ago' => 'před $1 {{PLURAL:$1|minutou|minutami}}',
+'seconds-ago' => 'před $1 {{PLURAL:$1|sekundou|sekundami}}',
 );
index 63c41f2..8a2cfca 100644 (file)
@@ -2210,7 +2210,7 @@ Fremtidige ændringer af denne side og dens tilknyttede diskussionsside vil bliv
 'watchmethod-list' => 'Tjekker seneste ændringer for sider i din overvågningsliste',
 'watchlistcontains' => 'Din overvågningsliste indeholder $1 {{PLURAL:$1|side|sider}}.',
 'iteminvalidname' => "Problem med '$1', ugyldigt navn...",
-'wlnote' => "Nedenfor ses {{PLURAL:$1|den seneste ændring|de seneste '''$1''' ændringer}} i {{PLURAL:$2|den sidste time|'''de sidste $2 timer}}''' fra den $3, kl. $4.",
+'wlnote' => "Nedenfor ses {{PLURAL:$1|den seneste ændring|de seneste '''$1''' ændringer}} i {{PLURAL:$2|den sidste time|'''de sidste $2 timer}}''' op til den $3 kl. $4.",
 'wlshowlast' => 'Vis de seneste $1 timer $2 dage $3',
 'watchlist-options' => 'Indstillinger for overvågningslisten',
 
index e803c12..a9fd166 100644 (file)
@@ -518,6 +518,16 @@ $messages = array(
 'nov' => 'Nov.',
 'dec' => 'Dez.',
 
+'monday-at' => 'Montag um $1',
+'tuesday-at' => 'Dienstag um $1',
+'wednesday-at' => 'Mittwoch um $1',
+'thursday-at' => 'Donnerstag um $1',
+'friday-at' => 'Freitag um $1',
+'saturday-at' => 'Samstag um $1',
+'sunday-at' => 'Sonntag um $1',
+'today-at' => '$1',
+'yesterday-at' => 'Gestern um $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategorie|Kategorien}}',
 'category_header' => 'Seiten in der Kategorie „$1“',
@@ -832,7 +842,7 @@ Vergiss nicht, deine [[Special:Preferences|{{SITENAME}}-Einstellungen]] zu ände
 'yourpasswordagain' => 'Passwort wiederholen:',
 'remembermypassword' => 'Mit diesem Browser dauerhaft angemeldet bleiben (maximal $1 {{PLURAL:$1|Tag|Tage}})',
 'userlogin-remembermypassword' => 'Angemeldet bleiben',
-'userlogin-signwithsecure' => 'Mit dem sicheren Server anmelden',
+'userlogin-signwithsecure' => 'Über den sicheren Server anmelden',
 'securelogin-stick-https' => 'Nach dem Anmelden mit HTTPS verbunden bleiben',
 'yourdomainname' => 'Deine Domain:',
 'password-change-forbidden' => 'Du kannst auf diesem Wiki keine Passwörter ändern.',
@@ -1439,7 +1449,7 @@ Einzelheiten sind im [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}}
 'searchprofile-advanced' => 'Erweitert',
 'searchprofile-articles-tooltip' => 'Suchen in $1',
 'searchprofile-project-tooltip' => 'Suchen in $1',
-'searchprofile-images-tooltip' => 'Nach Bildern suchen',
+'searchprofile-images-tooltip' => 'Nach Dateien suchen',
 'searchprofile-everything-tooltip' => 'Gesamten Inhalt durchsuchen (inklusive Diskussionsseiten)',
 'searchprofile-advanced-tooltip' => 'Suche in weiteren Namensräumen',
 'search-result-size' => '$1 ({{PLURAL:$2|1 Wort|$2 Wörter}})',
@@ -1739,7 +1749,7 @@ Dies kann nicht mehr rückgängig gemacht werden.',
 'action-rollback' => 'die Änderungen des letzten Bearbeiters einer bestimmten Seite schnell zurückzusetzen',
 'action-import' => 'Seiten aus einem anderen Wiki zu importieren',
 'action-importupload' => 'Seiten über das Hochladen einer Datei zu importieren',
-'action-patrol' => 'die Bearbeitungen anderer Benutzer zu kontrollieren',
+'action-patrol' => 'Bearbeitungen anderer Benutzer als kontrolliert zu markieren',
 'action-autopatrol' => 'eigene Bearbeitungen als kontrolliert zu markieren',
 'action-unwatchedpages' => 'die Liste der unbeobachteten Seiten einzusehen',
 'action-mergehistory' => 'die Versionengeschichten von Seiten zu vereinen',
@@ -1782,8 +1792,8 @@ Stand: $4, $5 Uhr.",
 'rc-change-size' => '$1 {{PLURAL:$1|Byte|Bytes}}',
 'rc-change-size-new' => '$1 {{PLURAL:$1|Byte|Bytes}} nach der Änderung',
 'newsectionsummary' => 'Neuer Abschnitt /* $1 */',
-'rc-enhanced-expand' => 'Details anzeigen (benötigt JavaScript)',
-'rc-enhanced-hide' => 'Details verstecken',
+'rc-enhanced-expand' => 'Einzelheiten anzeigen (benötigt JavaScript)',
+'rc-enhanced-hide' => 'Einzelheiten verstecken',
 'rc-old-title' => 'ursprünglich erstellt als „$1“',
 
 # Recent changes linked
@@ -3311,6 +3321,7 @@ Durch das Herunterladen und Öffnen der Datei kann dein Computer beschädigt wer
 'minutes' => '{{PLURAL:$1|$1 Minute|$1 Minuten}}',
 'hours' => '{{PLURAL:$1|1 Stunde|$1 Stunden}}',
 'days' => '{{PLURAL:$1|$1 Tag|$1 Tage}}',
+'weeks' => '{{PLURAL:$1|$1 Woche|$1 Wochen}}',
 'months' => '{{PLURAL:$1|1 Monat|$1 Monate}}',
 'years' => '{{PLURAL:$1|1 Jahr|$1 Jahre}}',
 'ago' => 'vor $1',
@@ -4169,4 +4180,8 @@ Anderenfalls kannst du auch das untenstehende einfache Formular nutzen. Dein Kom
 # Image rotation
 'rotate-comment' => 'Bild um $1 {{PLURAL:$1|Grad}} im Uhrzeigersinn gedreht',
 
+# Unknown messages
+'hours-ago' => 'vor {{PLURAL:$1|einer Stunde|$1 Stunden}}',
+'minutes-ago' => 'vor {{PLURAL:$1|einer Minute|$1 Minuten}}',
+'seconds-ago' => 'vor {{PLURAL:$1|einer Sekunde|$1 Sekunden}}',
 );
index 4e3d6d8..cf8af7c 100644 (file)
@@ -309,12 +309,12 @@ $magicWords = array(
 
 $messages = array(
 # User preference toggles
-'tog-underline' => 'Bınê gırey de xete bıance:',
+'tog-underline' => 'Bınê gırey de xete bance:',
 'tog-justify' => 'Paragrafan eyar ke',
 'tog-hideminor' => 'Vurnayışanê şenıkan pela vurnayışanê peyênan de bınımne',
 'tog-hidepatrolled' => 'Vurnayışanê qontrolkerdeyan pela vurnayışê peyêni de bınımne',
 'tog-newpageshidepatrolled' => 'Pelanê qontrolkerdeyan lista pelanê neweyan de bınımne',
-'tog-extendwatchlist' => 'Lista seyrkerdışi hera bıke ke vurnayışi pêro bıasê, tenya tewr peyêni nê',
+'tog-extendwatchlist' => 'Lista seyrkerdışi hera bıke ke vurnayışi pêro basê, tenya tewr peyêni nê',
 'tog-usenewrc' => 'Pele be vurnayışanê grube de vurnayışê peyêni u lista seyrkerdışi (JavaScript lazımo)',
 'tog-numberheadings' => 'Sernuşteyan be xo numre cı şane',
 'tog-showtoolbar' => 'Goceganê hacetanê vurnayışi bımocne (JavaScript lazımo)',
@@ -331,7 +331,7 @@ $messages = array(
 'tog-previewontop' => 'Verqayti pela nuştışi ser de bımocne',
 'tog-previewonfirst' => 'Vurnayışo verên de verqayti tım bımocne',
 'tog-nocache' => 'Pelanê cıgeyrayoği meya xo viri',
-'tog-enotifwatchlistpages' => ' pele ya zi dosyaya ke lista mına seyrkerdışi de vurnayê mı rê e-poste bırışe',
+'tog-enotifwatchlistpages' => 'Yew pele ya zi dosyaya ke lista mına seyrkerdışi de vurnayê mı rê e-poste bırışe',
 'tog-enotifusertalkpages' => 'Pela mına werênayışi ke vurnayê mı rê e-poste bırışe',
 'tog-enotifminoredits' => 'Vurnayışanê qıckekanê pelan u dosyeyan de zi mı rê e-poste bırışe',
 'tog-enotifrevealaddr' => 'Adresa e-posteyê mı posteyê xeberan de bımocne',
@@ -346,17 +346,17 @@ $messages = array(
 'tog-watchlisthideminor' => 'Vurnayışanê qıckekan lista mına seyrkerdışi de bınımne',
 'tog-watchlisthideliu' => 'Lista seyrkerdışi ra vurnayışanê karberanê cıkewteyan bınımne',
 'tog-watchlisthideanons' => 'Lista seyrkerdışi ra vurnayışanê karberanê anoniman bınımne',
-'tog-watchlisthidepatrolled' => 'Lista seyrkerdışi ra vurnayışanê qontrol kerdeyan bınımne',
+'tog-watchlisthidepatrolled' => 'Lista seyrkerdışi ra vurnayışanê qontrolkerdeyan bınımne',
 'tog-ccmeonemails' => 'E-posteyanê ke ez karberanê binan rê rışenan, mı rê kopya inan bırışe',
 'tog-diffonly' => 'Qıyasê versiyonan de tek ferqan bımocne, pela butıne nê',
-'tog-showhiddencats' => 'Kategoriyanê dızdine bımocne',
+'tog-showhiddencats' => 'Kategoriyanê dızdiye bımocne',
 'tog-noconvertlink' => 'Greyê sernami çerx kerdışi bıqefılne',
 'tog-norollbackdiff' => 'Peyserardışi ra dıme ferqi caverde',
-'tog-useeditwarning' => 'wexta ke ez pelo nêqeydbiyaye ra veciyaya mı hişyar bıker',
+'tog-useeditwarning' => 'Wexto ke mı yew pela nizami be vurnayışanê nêqeydbiyayeyan caverdê, hay be mı ser de',
 
 'underline-always' => 'Tım',
 'underline-never' => 'Qet',
-'underline-default' => 'Cild ya zi cıgeyrayoğo hesıbyaye',
+'underline-default' => 'Cild ya zi cıgeyrayoğo hesebiyaye',
 
 # Font style option in Special:Preferences
 'editfont-style' => 'Cayê vurnayışi de terzê nuştışi:',
@@ -476,7 +476,7 @@ $messages = array(
 'vector-view-view' => 'Bıwane',
 'vector-view-viewsource' => 'Çımey bıvêne',
 'actions' => 'Kerdışi',
-'namespaces' => 'Cayê namam',
+'namespaces' => 'Cayê namey',
 'variants' => 'Varyanti',
 
 'navigation-heading' => 'Menuya Navigasyoni',
@@ -1430,7 +1430,7 @@ Etıya şıma rê yew kılito raştameo ke şıma şenê bıgurenê/bıxebetnê:
 'timezoneregion-pacific' => 'Okyanuso Pasifik',
 'allowemail' => 'Karberê bini wa bışê mı rê e-posta bırışê.',
 'prefs-searchoptions' => 'Cı geyre',
-'prefs-namespaces' => 'Cayê namam',
+'prefs-namespaces' => 'Cayê namey',
 'defaultns' => 'Eke heni, enê cayanê namey de cı geyre (sae ke):',
 'default' => 'qısur',
 'prefs-files' => 'Dosyey',
@@ -2091,12 +2091,12 @@ gıreyê her satıri de gıreyi; raş motışê yewın u dıyıni esto.
 'brokenredirects-edit' => 'bıvurne',
 'brokenredirects-delete' => 'bestere',
 
-'withoutinterwiki' => 'Peleyê ke zıwanan de bina re gırey cı çınyo',
+'withoutinterwiki' => 'Pelê ke zıwananê binan rê gıreyê cı çıniyo',
 'withoutinterwiki-summary' => 'Enê pelî ke versiyonê ziwanî binî ra link nidano.',
 'withoutinterwiki-legend' => 'Verole',
 'withoutinterwiki-submit' => 'Bımocne',
 
-'fewestrevisions' => 'Peleyê ke cı sero tewr tayn timaryayış vıraziyayo',
+'fewestrevisions' => 'Pelê be senık çımraviyarnayışi',
 
 # Miscellaneous special pages
 'nbytes' => '$1 {{PLURAL:$1|bayt|bayti}}',
@@ -2114,17 +2114,17 @@ gıreyê her satıri de gıreyi; raş motışê yewın u dıyıni esto.
 'uncategorizedpages' => 'Pelayanê ke kategorî nibiye',
 'uncategorizedcategories' => 'Kategoriyê ke bê kategorîyê',
 'uncategorizedimages' => 'Dosyayê ke bê kategoriyê',
-'uncategorizedtemplates' => 'Şablonê ke bê kategoriyê',
+'uncategorizedtemplates' => 'Şablonê ke bêkategoriyê',
 'unusedcategories' => 'Kategoriyê ke nê xebtênê',
 'unusedimages' => 'Dosyeyê ke nê xebtênê',
 'popularpages' => 'Pelî ke populer o.',
 'wantedcategories' => 'Kategoriye ke waştênê',
 'wantedpages' => 'Peleye ke waştênê',
 'wantedpages-badtitle' => 'sernuşte meqbul niyo: $1',
-'wantedfiles' => 'Dosyeye ke waştênê',
+'wantedfiles' => 'Dosyeyê cıgeyriyayey',
 'wantedfiletext-cat' => 'Dosyaya cêrên karvıstedeya lakin çınya. Mewcud dosyayan de xeriba miyan de liste bena. Xırabiya wınisin dana <del>ateber</del>. Zewbi zi, şırê pela da dosyeyê ke çınyaya [[:$1]].',
 'wantedfiletext-nocat' => 'Dosyeyê cêrêni estê lekin karnêvıstê. Dosyeyê xeribi liste benê. bo babeta dano <del>ateber</del>',
-'wantedtemplates' => 'Şablonê ke waştênê',
+'wantedtemplates' => 'Şablonê ke waziyenê',
 'mostlinked' => 'Pelî ke tewr zafî lînk bîy.',
 'mostlinkedcategories' => 'Kategorî ke tewr zafî lînk bîy.',
 'mostlinkedtemplates' => 'Şablonê ke tewr zafî pela re gıre bîye.',
@@ -2136,14 +2136,14 @@ gıreyê her satıri de gıreyi; raş motışê yewın u dıyıni esto.
 'prefixindex-namespace' => 'Peleyê Veroleyıni ($1 cay nami)',
 'shortpages' => 'Pelê kılmeki',
 'longpages' => 'Peleyê dergeki',
-'deadendpages' => 'pelê ke pelê binan re gırey nêeşto',
+'deadendpages' => 'Pelê nêgıredayey',
 'deadendpagestext' => 'Ena pelan ke {{SITENAME}} de zerrî ey de link çini yo.',
-'protectedpages' => 'Pelayê ke biyê star',
+'protectedpages' => 'Pelê pawıtiyey',
 'protectedpages-indef' => 'têna pawıteyê bêmuddeti',
 'protectedpages-cascade' => 'Kilit biyaye ke teyna cascadiye',
 'protectedpagestext' => 'pelê cêrınî pawiyenê',
 'protectedpagesempty' => 'pê ney parametreyan pelê pawiteyi çinî',
-'protectedtitles' => 'Sernameyê ke starênê',
+'protectedtitles' => 'Sernameyê pawıtiyey',
 'protectedtitlestext' => 'sernameyê cêrıni pawıte yî',
 'protectedtitlesempty' => 'pê ney parametreyan sernuşteyê pawite çinê',
 'listusers' => 'Listeyê Karberan',
@@ -2227,7 +2227,7 @@ hem zi bıewnê [[Special:WantedCategories|kategori yê ke waziyeni]].',
 # Special:LinkSearch
 'linksearch' => 'Gıreyê teberi cı geyrê',
 'linksearch-pat' => 'bıgêr motif:',
-'linksearch-ns' => 'Cayênameyî:',
+'linksearch-ns' => 'Cayê namey:',
 'linksearch-ok' => 'Cı geyre',
 'linksearch-text' => 'Jokeri ê zey "*.wikipedia.org"i benê ke bıgureniyê.
 Tewr senık yew sewiya serêna cayê tesiri lazıma, mesela "*.org".<br />
@@ -2504,9 +2504,9 @@ Tı eşkeno seviyeye kılit kerdışi bıvurno, feqat tı nıeşken "cascading p
 'restriction-upload' => 'Bar ke',
 
 # Restriction levels
-'restriction-level-sysop' => 'pawıtışê tamamîye',
-'restriction-level-autoconfirmed' => 'nêm-pawıtış',
-'restriction-level-all' => 'seviye ya ke raşt ame',
+'restriction-level-sysop' => 'tam pawiyayo',
+'restriction-level-autoconfirmed' => 'nêm pawiyayo',
+'restriction-level-all' => 'heme yew sewiya',
 
 # Undelete
 'undelete' => 'Peleyê ke besterneyayê enê bımocnê',
@@ -4053,14 +4053,14 @@ Resımi be tam asayış mocniyayê, tipê dosyaê bini be programê cıyo elaqed
 * Xısusi pelaya normal
 * <span class="mw-specialpagerestricted">Xısusi peleyê keı rê ray nê deyaya.</span>
 * <strong class="mw-specialpagerestricted">Peleya xısusiya ke grota verhefıza.</strong>',
-'specialpages-group-maintenance' => 'Raporê pak tepiştîşî',
+'specialpages-group-maintenance' => 'Raporê tepıştışi',
 'specialpages-group-other' => 'Pelê xasiyê bini',
 'specialpages-group-login' => 'Cı kewe / hesab vıraze',
 'specialpages-group-changes' => 'Vurnayişê peni u logan',
 'specialpages-group-media' => 'Raporê medya u bar kerdîşî',
 'specialpages-group-users' => 'Karber u heqqî',
 'specialpages-group-highuse' => 'Peleyê ke vêşi karênê',
-'specialpages-group-pages' => 'listeyanê pelan',
+'specialpages-group-pages' => 'Listeyê pelan',
 'specialpages-group-pagetools' => 'Haletê pelan',
 'specialpages-group-wiki' => 'Melumat u haceti',
 'specialpages-group-redirects' => 'Pela xasîyê ke heteneyayê',
index f3a0072..8191f59 100644 (file)
@@ -162,18 +162,22 @@ $dateFormats = array(
        'mdy time' => 'H:i',
        'mdy date' => 'F j, Y',
        'mdy both' => 'H:i, F j, Y',
+       'mdy pretty' => 'F j',
 
        'dmy time' => 'H:i',
        'dmy date' => 'j F Y',
        'dmy both' => 'H:i, j F Y',
+       'dmy pretty' => 'j F',
 
        'ymd time' => 'H:i',
        'ymd date' => 'Y F j',
        'ymd both' => 'H:i, Y F j',
+       'ymd pretty' => 'F j',
 
        'ISO 8601 time' => 'xnH:xni:xns',
        'ISO 8601 date' => 'xnY-xnm-xnd',
        'ISO 8601 both' => 'xnY-xnm-xnd"T"xnH:xni:xns',
+       'ISO 8601 pretty' => 'xnm-xnd'
 );
 
 /**
@@ -249,6 +253,8 @@ $magicWords = array(
        'fullpagenamee'           => array( 1,    'FULLPAGENAMEE' ),
        'subpagename'             => array( 1,    'SUBPAGENAME' ),
        'subpagenamee'            => array( 1,    'SUBPAGENAMEE' ),
+       'rootpagename'            => array( 1,    'ROOTPAGENAME' ),
+       'rootpagenamee'           => array( 1,    'ROOTPAGENAMEE' ),
        'basepagename'            => array( 1,    'BASEPAGENAME' ),
        'basepagenamee'           => array( 1,    'BASEPAGENAMEE' ),
        'talkpagename'            => array( 1,    'TALKPAGENAME' ),
@@ -1075,10 +1081,15 @@ Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].',
 'yourname'                     => 'Username:',
 'userlogin-yourname'           => 'Username',
 'userlogin-yourname-ph'        => 'Enter your username',
+'createacct-helpusername-url'     => '{{ns:Project}}:Username_policy',
+'createacct-helpusername-link'    => '[[{{MediaWiki:createacct-helpusername-url}}|(help me choose)]]',
 'yourpassword'                 => 'Password:',
 'userlogin-yourpassword'       => 'Password',
 'userlogin-yourpassword-ph'    => 'Enter your password',
+'createacct-yourpassword-ph'      => 'Enter a password',
 'yourpasswordagain'            => 'Retype password:',
+'createacct-yourpasswordagain'    => 'Confirm password',
+'createacct-yourpasswordagain-ph' => 'Enter password again',
 'remembermypassword'           => 'Remember my login on this browser (for a maximum of $1 {{PLURAL:$1|day|days}})',
 'userlogin-remembermypassword' => 'Remember me',
 'userlogin-signwithsecure'     => 'Sign in with secure server',
@@ -1105,12 +1116,33 @@ Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].',
 'userlogin-resetlink'          => 'Forgotten your login details?',
 'helplogin-url'                => 'Help:Logging in',
 'userlogin-helplink'           => '[[{{MediaWiki:helplogin-url}}|Help with logging in]]',
+'createacct-join'                 => 'Enter your information below.',
+'createacct-emailrequired'        => 'Email address',
+'createacct-emailoptional'        => 'Email address (optional)',
+'createacct-email-ph'             => 'Enter your email address',
 'createaccountmail'            => 'Use a temporary random password and send it to the email address specified below',
+'createacct-realname'             => 'Real name (optional)',
 'createaccountreason'          => 'Reason:',
+'createacct-reason'               => 'Reason',
+'createacct-captcha'              => 'Security check',
+'createacct-captcha-help-url'     => '{{ns:Project}}:Request an account',
+'createacct-imgcaptcha-help'      => 'Can\'t see the image? [[{{MediaWiki:createacct-captcha-help-url}}|Request an account]]',
+'createacct-imgcaptcha-ph'        => 'Enter the text you see above',
+'createacct-benefit-heading'      => '{{SITENAME}} is made by people like you.',
+'createacct-benefit-icon1'        => 'icon-edits',
+'createacct-benefit-head1'        => '{{NUMBEROFEDITS}}',
+'createacct-benefit-body1'        => 'edits',
+'createacct-benefit-icon2'        => 'icon-pages',
+'createacct-benefit-head2'        => '{{NUMBEROFARTICLES}}',
+'createacct-benefit-body2'        => 'pages',
+'createacct-benefit-icon3'        => 'icon-contributors',
+'createacct-benefit-head3'        => '{{NUMBEROFACTIVEUSERS}}',
+'createacct-benefit-body3'        => 'contributors this month',
 'badretype'                    => 'The passwords you entered do not match.',
 'userexists'                   => 'Username entered already in use.
 Please choose a different name.',
 'loginerror'                   => 'Login error',
+'createacct-error'             => 'Account creation error',
 'createaccounterror'           => 'Could not create account: $1',
 'nocookiesnew'                 => 'The user account was created, but you are not logged in.
 {{SITENAME}} uses cookies to log in users.
@@ -3880,11 +3912,26 @@ By executing it, your system may be compromised.",
 'minutes'        => '{{PLURAL:$1|$1 minute|$1 minutes}}',
 'hours'          => '{{PLURAL:$1|$1 hour|$1 hours}}',
 'days'           => '{{PLURAL:$1|$1 day|$1 days}}',
+'weeks'          => '{{PLURAL:$1|$1 week|$1 weeks}}',
 'months'         => '{{PLURAL:$1|$1 month|$1 months}}',
 'years'          => '{{PLURAL:$1|$1 year|$1 years}}',
 'ago'            => '$1 ago',
 'just-now'       => 'just now',
 
+# Human-readable timestamps
+'hours-ago'    => '$1 {{PLURAL:$1|hour|hours}} ago',
+'minutes-ago'  => '$1 {{PLURAL:$1|minute|minutes}} ago',
+'seconds-ago'  => '$1 {{PLURAL:$1|seconds|seconds}} ago',
+'monday-at'    => 'Monday at $1',
+'tuesday-at'   => 'Tuesday at $1',
+'wednesday-at' => 'Wednesday at $1',
+'thursday-at'  => 'Thursday at $1',
+'friday-at'    => 'Friday at $1',
+'saturday-at'  => 'Saturday at $1',
+'sunday-at'    => 'Sunday at $1',
+'today-at'     => '$1',
+'yesterday-at' => 'Yesterday at $1',
+
 # Bad image list
 'bad_image_list' => 'The format is as follows:
 
index 0d41e46..f570b42 100644 (file)
@@ -422,6 +422,8 @@ $messages = array(
 'nov' => 'Nov',
 'dec' => 'Dec',
 
+'today-at' => '$1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategorio|Kategorioj}}',
 'category_header' => 'Artikoloj en kategorio "$1"',
@@ -730,9 +732,14 @@ Notu ke iuj paĝoj daŭre ŝajnos kvazaŭ vi ankoraŭ estus ensalutinta, ĝis vi
 'welcomecreation-msg' => 'Via konto estas kreita.
 Ne forgesu ŝanĝi viajn [[Special:Preferences|{{SITENAME}}-preferojn]]',
 'yourname' => 'Salutnomo:',
+'userlogin-yourname' => 'Uzantonomo',
+'userlogin-yourname-ph' => 'Enigu vian uzantonomon',
 'yourpassword' => 'Pasvorto:',
+'userlogin-yourpassword' => 'Pasvorto',
+'userlogin-yourpassword-ph' => 'Enigu vian pasvorton',
 'yourpasswordagain' => 'Retajpu pasvorton',
 'remembermypassword' => 'Memori mian ensalutadon ĉe ĉi tiu komputilo (daŭrante maksimume $1 {{PLURAL:$1|tagon|tagojn}})',
+'userlogin-remembermypassword' => 'Memoru min',
 'securelogin-stick-https' => 'Resti konektita al HTTPS post ensalutado',
 'yourdomainname' => 'Via domajno',
 'password-change-forbidden' => 'Ve ne povas ŝanĝi pasvortojn en ĉi tiu vikio.',
@@ -745,12 +752,14 @@ Ne forgesu ŝanĝi viajn [[Special:Preferences|{{SITENAME}}-preferojn]]',
 'logout' => 'Elsaluti',
 'userlogout' => 'Elsaluti',
 'notloggedin' => 'Ne ensalutinta',
+'userlogin-noaccount' => 'Ĉu vi ne havas konton?',
 'nologin' => "Ĉu vi ne havas konton? '''$1'''.",
 'nologinlink' => 'Krei konton',
 'createaccount' => 'Krei novan konton',
 'gotaccount' => "Ĉu vi jam havas konton? '''$1'''.",
 'gotaccountlink' => 'Ensaluti',
 'userlogin-resetlink' => 'Ĉu vi forgesis ensalutajn detalojn?',
+'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Helpo pri ensalutado]]',
 'createaccountmail' => 'Uzi provizoran hazardsignan pasvorton kaj sendi ĝin al la retpoŝto suben',
 'createaccountreason' => 'Kialo:',
 'badretype' => 'La pasvortojn kiujn vi tajpis ne egalas.',
@@ -822,6 +831,7 @@ Bonvolu ĝisatendi antaŭ retrovi.',
 # Email sending
 'php-mail-error-unknown' => 'Nekonata eraro en la funkcio mail() de PHP',
 'user-mail-no-addy' => 'Provis sendi retpoŝton sen retpoŝtadreso.',
+'user-mail-no-body' => 'Provo sendi malplenan aŭ sensence mallongan retpošton.',
 
 # Change password dialog
 'resetpass' => 'Ŝanĝi pasvorton',
@@ -843,9 +853,10 @@ Vi eble jam ŝanĝis vian pasvorton aŭ petis novan provizoran pasvorton.',
 
 # Special:PasswordReset
 'passwordreset' => 'Restarigo de pasvorto',
-'passwordreset-text' => 'Plenumigu ĉi tiun formularon por ricevi retpoŝtan memoraĵon de viaj kontaj detaloj.',
+'passwordreset-text' => 'Plenigu ĉi tiun formularon por renovigi vian pasvorton.',
 'passwordreset-legend' => 'Refari pasvorton',
 'passwordreset-disabled' => 'Pasvortaj restarigoj estis malŝaltitaj en ĉi tiu vikio.',
+'passwordreset-emaildisabled' => 'Retpoŝtaj funkcioj estas malfunkciigitaj en tiu ĉi vikio.',
 'passwordreset-pretext' => '{{PLURAL:$1||Enigi unu el la jenaj datenoj}}',
 'passwordreset-username' => 'Salutnomo:',
 'passwordreset-domain' => 'Domajno:',
@@ -875,9 +886,9 @@ aŭ se vi memoris vian originalan pasvorton, kaj vi ne plu volas ŝanĝi
 ĝin, vi povas ignori ĉi tiun mesaĝon kaj uzi vian malnovan pasvorton.',
 'passwordreset-emailelement' => 'Salutnomo: $1
 Provizora pasvorto: $2',
-'passwordreset-emailsent' => 'Rememoriga retpoŝto estis sendita.',
-'passwordreset-emailsent-capture' => 'Memoriga retpoŝto estis sendita, kiu estas montrata sube.',
-'passwordreset-emailerror-capture' => 'Memoriga retpoŝto estis generita, montrata sube, sed sendado al uzanto malsukcesis: $1',
+'passwordreset-emailsent' => 'Renovigita pasvorto estis retpoŝte sendita.',
+'passwordreset-emailsent-capture' => 'Retpoŝto kun renovigita pasvorto estis sendita, kiu estas montrata sube.',
+'passwordreset-emailerror-capture' => 'Retpoŝto kun renovigita pasvorto estis generita, montrata sube, sed sendado al uzanto malsukcesis: $1',
 
 # Special:ChangeEmail
 'changeemail' => 'Ŝanĝi retpoŝtadreson',
@@ -1359,7 +1370,7 @@ Detaloj troveblos en la [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}
 'search-interwiki-default' => '$1 rezultoj:',
 'search-interwiki-more' => '(plu)',
 'search-relatedarticle' => 'Relataj',
-'mwsuggest-disable' => 'Malŝalti AJAX-sugestojn',
+'mwsuggest-disable' => 'Malŝalti serĉajn sugestojn',
 'searcheverything-enable' => 'Traserĉi ĉiujn nomspacojn',
 'searchrelated' => 'rilataj',
 'searchall' => 'ĉiuj',
@@ -1380,6 +1391,7 @@ Provu prefiksi vian mendon kun ''all:'' por serĉi ĉiun enhavon (inkluzivante d
 'search-external' => 'Ekstera serĉo',
 'searchdisabled' => '<p>Oni provizore malŝaltis serĉadon per la plenteksta
 indekso pro troŝarĝita servilo. Intertempe, vi povas serĉi per <i>guglo</i> aŭ per <i>jahu!</i>:</p>',
+'search-error' => 'Okazis eraro dum serĉado: $1',
 
 # Preferences page
 'preferences' => 'Preferoj',
@@ -2447,6 +2459,7 @@ Vidu [[Special:ProtectedPages|liston de protektitaj paĝoj]] por listo de aktual
 'prot_1movedto2' => '[[$1]] movita al [[$2]]',
 'protect-badnamespace-title' => 'Ne-protektebla nomspaco',
 'protect-badnamespace-text' => 'Paĝoj en ĉi tiu datumbazo ne povas esti protektita.',
+'protect-norestrictiontypes-title' => 'Neprotektebla paĝo',
 'protect-legend' => 'Konfirmi protektadon',
 'protectcomment' => 'Kialo:',
 'protectexpiry' => 'Eksvalidiĝas:',
@@ -2462,9 +2475,9 @@ Jen la aktualaj valoroj por la paĝo '''$1''':",
 'protect-cascadeon' => 'Ĉi paĝo estas nun protektita kontraŭ redaktado ĉar ĝi estas inkluzivita en {{PLURAL:$1|jena paĝo, kiu mem estas protektita|jenaj paĝoj, kiuj mem estas protektitaj}} per kaskada protekto.
 Vi povas ŝanĝi ties protektnivelon, sed tio ne ŝanĝos la kaskadan protekton.',
 'protect-default' => 'Permesigi ĉiujn uzantojn',
-'protect-fallback' => 'Rajto "$1" nepras.',
+'protect-fallback' => 'Permesi nur uzantojn kun la rajto  "$1"',
 'protect-level-autoconfirmed' => 'Bloki novajn kaj neregistritajn uzantojn',
-'protect-level-sysop' => 'Nur administrantoj',
+'protect-level-sysop' => 'Permesi nur administrantojn',
 'protect-summary-cascade' => 'kaskada',
 'protect-expiring' => 'finiĝas je $1 (UTC)',
 'protect-expiring-local' => 'eksdatiĝas $1',
@@ -3106,6 +3119,7 @@ Datoj de versioj kaj nomoj de redaktantoj estos preservitaj.
 'pageinfo-robot-noindex' => 'Ne indeksebla',
 'pageinfo-views' => 'Nombro de rigardoj',
 'pageinfo-watchers' => 'Nombro de paĝatentantoj',
+'pageinfo-few-watchers' => 'Malpli ol $1 {{PLURAL:$1|atentanto|atentantoj}}',
 'pageinfo-redirects-name' => 'Alidirektoj al ĉi tiu paĝo',
 'pageinfo-subpages-name' => 'Subpaĝoj de ĉi tiu paĝo',
 'pageinfo-subpages-value' => '$1 ($2 {{PLURAL:$2|alidirektilo|alidirektiloj}}; $3 {{PLURAL:$3|ne-alidirektilo|ne-alidirektiloj}})',
@@ -3213,6 +3227,7 @@ $1',
 'minutes' => '{{PLURAL:$1|$1 minuto|$1 minutoj}}',
 'hours' => '{{PLURAL:$1|$1 horo|$1 horoj}}',
 'days' => '{{PLURAL:$1|$1 tago|$1 tagoj}}',
+'weeks' => '{{PLURAL:$1|$1 semajno|$1 semajnoj}}',
 'months' => '{{PLURAL:$1|$1 monato|$1 monatoj}}',
 'years' => '{{PLURAL:$1|$1 jaro|$1 jaroj}}',
 'ago' => 'antaŭ $1',
@@ -3989,6 +4004,8 @@ Bildoj montriĝas en plena distingivo, aliaj dosiertipoj estas malfermataj rekte
 'htmlform-submit' => 'Ek!',
 'htmlform-reset' => 'Malfari ŝanĝojn',
 'htmlform-selectorother-other' => 'Alia',
+'htmlform-no' => 'Ne',
+'htmlform-yes' => 'Jes',
 
 # SQLite database support
 'sqlite-has-fts' => '$1 kun tut-teksta subteno',
@@ -3999,13 +4016,13 @@ Bildoj montriĝas en plena distingivo, aliaj dosiertipoj estas malfermataj rekte
 'logentry-delete-restore' => '$1 restarigis paĝon $3',
 'logentry-delete-event' => '$1 ŝanĝis videblecon de {{PLURAL:$5|protokola evento|$5 protokolaj eventoj}} je $3: $4',
 'logentry-delete-revision' => '$1 ŝanĝis videblecon de {{PLURAL:$5|revizio|$5 reviziojn}} je paĝo $3: $4',
-'logentry-delete-event-legacy' => '$1 ŝanĝis vidiblecon de protokolaj eventoj en $3',
-'logentry-delete-revision-legacy' => '$1 ŝanĝis vidiblecon de revizioj en $3',
+'logentry-delete-event-legacy' => '$1 ŝanĝis videblecon de protokolaj eventoj en $3',
+'logentry-delete-revision-legacy' => '$1 ŝanĝis videblecon de revizioj en $3',
 'logentry-suppress-delete' => '$1 kaŝis paĝon $3',
 'logentry-suppress-event' => '$1 kaŝite ŝanĝis videblecon de {{PLURAL:$5|protokola evento|$5 protokolaj eventoj}} je $3: $4',
 'logentry-suppress-revision' => '$1 kaŝite ŝanĝis videblecon de {{PLURAL:$5|revizio|$5 reviziojn}} je paĝo $3: $4',
-'logentry-suppress-event-legacy' => '$1 kaŝite ŝanĝis vidiblecon de protokolaj eventoj en $3',
-'logentry-suppress-revision-legacy' => '$1 kaŝite ŝanĝis vidiblecon de revizioj en paĝo $3',
+'logentry-suppress-event-legacy' => '$1 kaŝite ŝanĝis videblecon de protokolaj eventoj en $3',
+'logentry-suppress-revision-legacy' => '$1 kaŝite ŝanĝis videblecon de revizioj en paĝo $3',
 'revdelete-content-hid' => 'enhavo kaŝita',
 'revdelete-summary-hid' => 'resumo de redakto kaŝita',
 'revdelete-uname-hid' => 'salutnomo kaŝita',
@@ -4015,15 +4032,16 @@ Bildoj montriĝas en plena distingivo, aliaj dosiertipoj estas malfermataj rekte
 'revdelete-restricted' => 'aplikis limojn al administrantoj',
 'revdelete-unrestricted' => 'forigis limojn por administrantoj',
 'logentry-move-move' => '$1 movis paĝon $3 al $4',
-'logentry-move-move-noredirect' => '$1 movis paĝon $3 al $4 sen lasante alidirektilon',
+'logentry-move-move-noredirect' => '$1 movis paĝon $3 al $4 ne lasante alidirektilon',
 'logentry-move-move_redir' => '$1 movis paĝon $3 al $4 anstataŭigante alidirektilon',
-'logentry-move-move_redir-noredirect' => '$1 movis paĝon $3 al $4 anstataŭigante alidirektilon sen lasante alidirektilon',
-'logentry-patrol-patrol' => '$1 markis revizion $4 de paĝo $3 kiel patrolita',
-'logentry-patrol-patrol-auto' => '$1 aŭtomate markis revizion $4 de paĝo $3 kiel patrolita',
-'logentry-newusers-newusers' => '$1 kreis konton',
-'logentry-newusers-create' => '$1 kreis konton',
-'logentry-newusers-create2' => '$1 kreis uzanton $3',
-'logentry-newusers-autocreate' => 'Konto $1 estis kreita aŭtomate',
+'logentry-move-move_redir-noredirect' => '$1 movis paĝon $3 al $4 anstataŭigante alidirektilon ne lasante alidirektilon',
+'logentry-patrol-patrol' => '$1 markis revizion $4 de paĝo $3 patrolita',
+'logentry-patrol-patrol-auto' => '$1 aŭtomate markis revizion $4 de paĝo $3 patrolita',
+'logentry-newusers-newusers' => 'Konto de uzanto $1 estis kreita',
+'logentry-newusers-create' => 'Konto de uzanto $1 estis kreita',
+'logentry-newusers-create2' => 'Konto de uzanto $3 estis kreita de $1',
+'logentry-newusers-byemail' => 'Konto de uzanto $3 estis kreita de $1 kaj pasvorto estis sendita per retpoŝto',
+'logentry-newusers-autocreate' => 'Uzantokonto $1 estis kreita aŭtomate',
 'logentry-rights-rights' => '$1 ŝanĝis grupan membrecon por $3 de $4 al $5',
 'logentry-rights-rights-legacy' => '$1 ŝanĝis grupan membrecon por $3',
 'logentry-rights-autopromote' => '$1 estis aŭtomate {{GENDER:$2|altrangigita}} de $4 al $5',
@@ -4102,4 +4120,8 @@ Aŭ vi povas uzi la facilan formularon sube. Via komento estos aldonita al la pa
 'duration-centuries' => '$1 {{PLURAL:$1|jarcento|jarcentoj}}',
 'duration-millennia' => '$1 {{PLURAL:$1|jarmilo|jarmiloj}}',
 
+# Unknown messages
+'hours-ago' => 'antaŭ $1 {{PLURAL:$1|horo|horoj}}',
+'minutes-ago' => 'antaŭ $1 {{PLURAL:$1|minuto|minutoj}}',
+'seconds-ago' => 'antaŭ $1 {{PLURAL:$1|sekundo|sekundoj}}',
 );
index d144573..5b01aa1 100644 (file)
@@ -474,6 +474,16 @@ $messages = array(
 'nov' => 'nov',
 'dec' => 'dic',
 
+'monday-at' => 'El lunes a las $1',
+'tuesday-at' => 'El martes a las $1',
+'wednesday-at' => 'El miércoles a las $1',
+'thursday-at' => 'El jueves a las $1',
+'friday-at' => 'El viernes a las $1',
+'saturday-at' => 'El sábado a las $1',
+'sunday-at' => 'El domingo a las $1',
+'today-at' => '$1',
+'yesterday-at' => 'Ayer a las $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Categoría|Categorías}}',
 'category_header' => 'Artículos en la categoría «$1»',
@@ -4121,4 +4131,8 @@ En otro caso, puedes usar el siguiente formulario. Tu comentario será añadido
 # Image rotation
 'rotate-comment' => 'Imagen girada por $1 {{PLURAL:$1|grado|grados}} en el sentido de las agujas del reloj',
 
+# Unknown messages
+'hours-ago' => 'hace $1 {{PLURAL:$1|hora|horas}}',
+'minutes-ago' => 'hace {{PLURAL:$1|un minuto|$1 minutos}}',
+'seconds-ago' => 'hace $1 {{PLURAL:$1|segundo|segundos}}',
 );
index a3ecc82..591f6ed 100644 (file)
@@ -538,6 +538,16 @@ $messages = array(
 'nov' => 'نوامبر',
 'dec' => 'دسامبر',
 
+'monday-at' => 'دوشنبهٔ $1',
+'tuesday-at' => 'سه‌شنبهٔ $1',
+'wednesday-at' => 'چهارشنبهٔ $1',
+'thursday-at' => 'پنج‌شنبهٔ $1',
+'friday-at' => 'جمعهٔ $1',
+'saturday-at' => 'شنبهٔ $1',
+'sunday-at' => 'یک‌شنبهٔ $1',
+'today-at' => '$1',
+'yesterday-at' => 'دیروز $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|رده|رده‌ها}}',
 'category_header' => 'صفحه‌های ردهٔ «$1»',
@@ -4272,4 +4282,8 @@ $5
 # Image rotation
 'rotate-comment' => 'تصویر به دست $1 {{PLURAL:$1|درجهٔ|درجهٔ}} ساعت‌گرد چرخانده شد',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|ساعت|ساعت}} قبل',
+'minutes-ago' => '$1 {{PLURAL:$1|دقیقه|دقیقه}} قبل',
+'seconds-ago' => '$1 {{PLURAL:$1|ثانیه|ثانیه}} قبل',
 );
index 10a6f50..f7c996a 100644 (file)
@@ -495,6 +495,16 @@ $messages = array(
 'nov' => 'nov',
 'dec' => 'déc',
 
+'monday-at' => 'Lundi à $1',
+'tuesday-at' => 'Mardi à $1',
+'wednesday-at' => 'Mercredi à $1',
+'thursday-at' => 'Jeudi à $1',
+'friday-at' => 'Vendredi à $1',
+'saturday-at' => 'Samedi à $1',
+'sunday-at' => 'Dimanche à $1',
+'today-at' => '$1',
+'yesterday-at' => 'Hier à $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Catégorie|Catégories}}',
 'category_header' => 'Pages dans la catégorie « $1 »',
@@ -546,7 +556,7 @@ $messages = array(
 'vector-simplesearch-preference' => "Activer la barre de recherche simplifiée (seulement pour l'habillage Vector)",
 'vector-view-create' => 'Créer',
 'vector-view-edit' => 'Modifier',
-'vector-view-history' => "Afficher l'historique",
+'vector-view-history' => 'Afficher l’historique',
 'vector-view-view' => 'Lire',
 'vector-view-viewsource' => 'Voir la source',
 'actions' => 'Actions',
@@ -3306,6 +3316,7 @@ Si vous l'exécutez, votre système peut être compromis.",
 'minutes' => '{{PLURAL:$1|$1 minute|$1 minutes}}',
 'hours' => '{{PLURAL:$1|$1 heure|$1 heures}}',
 'days' => '{{PLURAL:$1|$1 jour|$1 jours}}',
+'weeks' => '{{PLURAL:$1|$1 semaine|$1 semaines}}',
 'months' => '{{PLURAL:$1|$1 mois}}',
 'years' => '{{PLURAL:$1|$1 an|$1 ans}}',
 'ago' => 'Il y a $1',
@@ -4227,4 +4238,8 @@ Sinon, vous pouvez utiliser le formulaire simplifié ci-dessous. Votre commentai
 # Image rotation
 'rotate-comment' => 'Image pivotée de $1 {{PLURAL:$1|degré|degrés}} dans le sens des aiguilles d’une montre',
 
+# Unknown messages
+'hours-ago' => 'il y a $1 {{PLURAL:$1|heure|heures}}',
+'minutes-ago' => 'il y a $1 {{PLURAL:$1|minute|minutes}}',
+'seconds-ago' => 'il y a $1 {{PLURAL:$1|seconde|secondes}}',
 );
index 9d60c9f..9457d96 100644 (file)
@@ -371,21 +371,21 @@ $messages = array(
 'tog-watchmoves' => 'מעקב אחרי דפים וקבצים שהעברתי',
 'tog-watchdeletion' => 'מעקב אחרי דפים וקבצים שמחקתי',
 'tog-minordefault' => 'הגדרת כל פעולת עריכה כמשנית אם לא צוין אחרת',
-'tog-previewontop' => 'הצגת תצוגה מקדימה לפני תיבת העריכה (או: אחריה)',
+'tog-previewontop' => 'הצגת תצוגה מקדימה לפני תיבת העריכה',
 'tog-previewonfirst' => 'הצגת תצוגה מקדימה בעריכה ראשונה',
 'tog-nocache' => 'מניעת אחסון הדפים בזיכרון המטמון בדפדפן',
 'tog-enotifwatchlistpages' => 'לשלוח אליי דואר אלקטרוני כאשר משתנה דף או קובץ ברשימת המעקב שלי',
 'tog-enotifusertalkpages' => 'לשלוח אליי דואר אלקטרוני כאשר נעשה שינוי בדף שיחת המשתמש שלי',
 'tog-enotifminoredits' => 'לשלוח אליי דואר אלקטרוני גם על עריכות משניות של דפים וקבצים',
 'tog-enotifrevealaddr' => 'חשיפת כתובת הדוא"ל שלך בהודעות דוא"ל',
-'tog-shownumberswatching' => 'הצגת מספר המשתמשים העוקבים אחרי הדף',
-'tog-oldsig' => '×\94×\97ת×\99×\9e×\94 ×\94ק×\99×\99×\9eת:',
+'tog-shownumberswatching' => 'הצגת מספר המשתמשים העוקבים',
+'tog-oldsig' => '×\94×\97ת×\99×\9e×\94 ×\94× ×\95×\9b×\97×\99ת:',
 'tog-fancysig' => 'פירוש החתימה כקוד ויקי (ללא קישור אוטומטי)',
-'tog-showjumplinks' => 'הצגת קישורי נגישות מסוג "קפוץ אל"',
+'tog-showjumplinks' => 'הצגת קישורי נגישות מסוג "{{int:jumpto}}"',
 'tog-uselivepreview' => 'שימוש בתצוגה מקדימה מהירה (דרוש JavaScript) (ניסיוני)',
 'tog-forceeditsummary' => 'הצגת אזהרה בעת הכנסת תקציר עריכה ריק',
-'tog-watchlisthideown' => 'הסתרת עריכות שלי ברשימת המעקב',
-'tog-watchlisthidebots' => 'הסתרת בוטים ברשימת המעקב',
+'tog-watchlisthideown' => '×\94סתרת ×\94ער×\99×\9b×\95ת ×©×\9c×\99 ×\91רש×\99×\9eת ×\94×\9eעק×\91',
+'tog-watchlisthidebots' => '×\94סתרת ×¢×¨×\99×\9b×\95ת ×©×\9c ×\91×\95×\98×\99×\9d ×\91רש×\99×\9eת ×\94×\9eעק×\91',
 'tog-watchlisthideminor' => 'הסתרת עריכות משניות ברשימת המעקב',
 'tog-watchlisthideliu' => 'הסתרת עריכות של משתמשים רשומים ברשימת המעקב',
 'tog-watchlisthideanons' => 'הסתרת עריכות של משתמשים אנונימיים ברשימת המעקב',
@@ -460,6 +460,16 @@ $messages = array(
 'nov' => "נוב'",
 'dec' => "דצמ'",
 
+'monday-at' => 'ביום שני בשעה $1',
+'tuesday-at' => 'ביום שלישי בשעה $1',
+'wednesday-at' => 'ביום רביעי בשעה $1',
+'thursday-at' => 'ביום חמישי בשעה $1',
+'friday-at' => 'ביום שישי בשעה $1',
+'saturday-at' => 'בשבת בשעה $1',
+'sunday-at' => 'ביום ראשון בשעה $1',
+'today-at' => '$1',
+'yesterday-at' => 'אתמול בשעה $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|קטגוריה|קטגוריות}}',
 'category_header' => 'דפים בקטגוריה "$1"',
@@ -3302,6 +3312,7 @@ $1',
 'minutes' => '{{PLURAL:$1|דקה|$1 דקות}}',
 'hours' => '{{PLURAL:$1|שעה|שעתיים|$1 שעות}}',
 'days' => '{{PLURAL:$1|יום|יומיים|$1 ימים}}',
+'weeks' => '{{PLURAL:$1|שבוע|שבועיים|$1 שבועות}}',
 'months' => '{{PLURAL:$1|חודש|חודשיים|$1 חודשים}}',
 'years' => '{{PLURAL:$1|שנה|שנתיים|$1 שנים}}',
 'ago' => 'לפני $1',
@@ -4204,4 +4215,8 @@ $5
 # Image rotation
 'rotate-comment' => 'התמונה סובבה {{PLURAL:$1|במעלה אחת|ב֫־$1 מעלות}} בכיוון השעון',
 
+# Unknown messages
+'hours-ago' => 'לפני {{PLURAL:$1|שעה|שעתיים|$1 שעות}}',
+'minutes-ago' => 'לפני {{PLURAL:$1|דקה|$1 דקות}}',
+'seconds-ago' => 'לפני {{PLURAL:$1|שנייה|$1 שניות}}',
 );
index 20ef535..2332a69 100644 (file)
@@ -1494,9 +1494,9 @@ Smě mjenje hač $1 {{PLURAL:$1|znamješko|znamješce|znamješka|znamješkow}} d
 'rc-old-title' => 'prěnjotnje wutworjeny jako "$1"',
 
 # Recent changes linked
-'recentchangeslinked' => 'Změny w zwjazanych stronach',
+'recentchangeslinked' => 'Změny na zwjazanych stronach',
 'recentchangeslinked-feed' => 'Změny zwjazanych stron',
-'recentchangeslinked-toolbox' => 'Změny w zwjazanych stronach',
+'recentchangeslinked-toolbox' => 'Změny na zwjazanych stronach',
 'recentchangeslinked-title' => 'Změny na stronach, kotrež su z „$1“ wotkazane',
 'recentchangeslinked-noresult' => 'Njejsu změny zwajzanych stron we wubranej dobje.',
 'recentchangeslinked-summary' => "Tuta strona nalistuje poslednje změny na wotkazanych stronach (resp. pola kategorijow na čłonach kategorije).
index f58f2fa..72c4c1a 100644 (file)
@@ -251,6 +251,16 @@ $messages = array(
 'nov' => 'nov',
 'dec' => 'dec',
 
+'monday-at' => 'Lunedi a $1',
+'tuesday-at' => 'Martedi a $1',
+'wednesday-at' => 'Mercuridi a $1',
+'thursday-at' => 'Jovedi a $1',
+'friday-at' => 'Venerdi a $1',
+'saturday-at' => 'Sabbato a $1',
+'sunday-at' => 'Dominica a $1',
+'today-at' => '$1',
+'yesterday-at' => 'Heri a $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Categoria|Categorias}}',
 'category_header' => 'Articulos in le categoria "$1"',
@@ -3962,4 +3972,8 @@ Si non, tu pote usar le formulario facile hic infra. Tu commento essera addite a
 # Image rotation
 'rotate-comment' => 'Imagine rotate de $1 {{PLURAL:$1|grado|grados}} in senso horologic',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|hora|horas}} retro',
+'minutes-ago' => '$1 {{PLURAL:$1|minuta|minutas}} retro',
+'seconds-ago' => '$1 {{PLURAL:$1|secunda|secundas}} retro',
 );
index fad44dd..fb4d15a 100644 (file)
@@ -12,6 +12,7 @@
  * @author Reedy
  * @author Sapral Mikail
  * @author Tagir
+ * @author Умар
  */
 
 $fallback = 'ru';
@@ -47,8 +48,6 @@ $messages = array(
 'tog-shownumberswatching' => 'Ший теркама дагарленгах оагӀув чулаьца бола дакъалаьцархой таьрах хьахьокха',
 'tog-oldsig' => 'Дола кулгайоазув:',
 'tog-fancysig' => 'Ший кулга яздара массахоамбаккхам (ший лоӀаме Ӏинка йоацаш)',
-'tog-externaleditor' => 'Арена гӀалатнийсдарца болх бе (ший болх ховш болачара мара мегаш дац, хьамлоархIара ший-тайпара оттам эша; [//www.mediawiki.org/wiki/Manual:External_editors хьажа эша])',
-'tog-externaldiff' => 'Арена бӀасакхосса болхоагӀувца болх бе (ший болх ховш болачара мара мегаш дац, хьамлоархIара ший-тайпара оттам эша; [//www.mediawiki.org/wiki/Manual:External_editors хьажа эша])',
 'tog-showjumplinks' => '"Дехьадала" яха новкъостала Ӏинк хьахьокха',
 'tog-uselivepreview' => 'Сиха бӀарахьажар (JavaScript) (Экспериментально)',
 'tog-forceeditsummary' => 'Хоам бе, хувцамий лоацам белгал даь деце',
@@ -556,9 +555,6 @@ $messages = array(
 'powersearch-toggleall' => 'Деррига',
 'powersearch-togglenone' => 'Цхьаккха',
 
-# Quickbar
-'qbsettings-none' => 'Цхьаккха',
-
 # Preferences page
 'preferences' => 'Оттамаш',
 'mypreferences' => 'Оттамаш',
@@ -796,7 +792,7 @@ $messages = array(
 # Special:ListGroupRights
 'listgrouprights-members' => '(тоабий дагарче)',
 
-# E-mail user
+# Email user
 'emailuser' => 'Дакъалаьцархочоа д-хоамни:',
 
 # Watchlist
index 518d16b..724430e 100644 (file)
@@ -395,6 +395,15 @@ $messages = array(
 'nov' => 'nov',
 'dec' => 'dic',
 
+'monday-at' => 'Lunedì alle $1',
+'tuesday-at' => 'Martedì alle $1',
+'wednesday-at' => 'Mercoledì alle $1',
+'thursday-at' => 'Giovedì alle $1',
+'friday-at' => 'Venerdì alle $1',
+'saturday-at' => 'Sabato alle $1',
+'sunday-at' => 'Domenica alle $1',
+'yesterday-at' => 'Ieri alle $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Categoria|Categorie}}',
 'category_header' => 'Pagine nella categoria "$1"',
@@ -576,7 +585,6 @@ $1',
 'site-atom-feed' => 'Feed Atom di $1',
 'page-rss-feed' => 'Feed RSS per "$1"',
 'page-atom-feed' => 'Feed Atom per "$1"',
-'feed-rss' => 'RSS',
 'red-link-title' => '$1 (la pagina non esiste)',
 'sort-descending' => 'Ordinamento decrescente',
 'sort-ascending' => 'Ordinamento crescente',
@@ -3148,6 +3156,7 @@ $1',
 'minutes' => '{{PLURAL:$1|un minuto|$1 minuti}}',
 'hours' => "{{PLURAL:$1|un'ora|$1 ore}}",
 'days' => '{{PLURAL:$1|$1 giorno|$1 giorni}}',
+'weeks' => '{{PLURAL:$1|$1 settimana|$1 settimane}}',
 'months' => '{{PLURAL:$1|$1 mese|$1 mesi}}',
 'years' => '{{PLURAL:$1|$1 anno|$1 anni}}',
 'ago' => '$1 fa',
@@ -4003,4 +4012,8 @@ Le immagini vengono mostrate alla massima risoluzione disponibile, per gli altri
 # Image rotation
 'rotate-comment' => 'Immagine ruotata di $1 {{PLURAL:$1|grado|gradi}} in senso orario',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|ora|ore}} fa',
+'minutes-ago' => '$1 {{PLURAL:$1|minuto|minuti}} fa',
+'seconds-ago' => '$1 {{PLURAL:$1|secondo|secondi}} fa',
 );
index 00264bc..41c32ab 100644 (file)
@@ -472,6 +472,16 @@ $messages = array(
 'nov' => '11月',
 'dec' => '12月',
 
+'monday-at' => '月曜日 $1',
+'tuesday-at' => '火曜日 $1',
+'wednesday-at' => '水曜日 $1',
+'thursday-at' => '木曜日 $1',
+'friday-at' => '金曜日 $1',
+'saturday-at' => '土曜日 $1',
+'sunday-at' => '日曜日 $1',
+'today-at' => '$1',
+'yesterday-at' => '昨日 $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|カテゴリ}}',
 'category_header' => 'カテゴリ「$1」にあるページ',
@@ -4368,4 +4378,8 @@ MediaWikiは、有用であることを期待して配布されていますが
 # Image rotation
 'rotate-comment' => '画像を時計回りに $1 {{PLURAL:$1|度}}回転',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|時間}}前',
+'minutes-ago' => '$1 {{PLURAL:$1|分}}前',
+'seconds-ago' => '$1 {{PLURAL:$1|秒}}前',
 );
index 16c6518..cc32f1c 100644 (file)
@@ -150,6 +150,16 @@ $messages = array(
 'nov' => 'Wam',
 'dec' => 'Duj',
 
+'monday-at' => 'Arim af $1',
+'tuesday-at' => 'Aram af $1',
+'wednesday-at' => 'Ahad af $1',
+'thursday-at' => 'Amhad af $1',
+'friday-at' => 'Sem af $1',
+'saturday-at' => 'Sed af $1',
+'sunday-at' => 'Acer af $1',
+'today-at' => '$1',
+'yesterday-at' => 'Iḍelli af $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Taggayt|Taggayin}}',
 'category_header' => 'Imagraden deg taggayt "$1"',
@@ -3003,4 +3013,8 @@ G leɛnaya-k sentem belli ṣaḥḥ tebɣiḍ ad tɛiwedeḍ axlaq n usebter-ag
 'duration-centuries' => '$1 {{PLURAL:$1|timiḍi|timiḍa}}',
 'duration-millennia' => '$1 {{PLURAL:$1|agimseggwas|agimseggwasen}}',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|asrag|isragen}} aya',
+'minutes-ago' => '$1 {{PLURAL:$1|tamrect|timercin}} aya',
+'seconds-ago' => '$1 {{PLURAL:$1|tasint|tisinin}} aya',
 );
index a084acd..a79f258 100644 (file)
@@ -1562,7 +1562,7 @@ Eke dosya de peydêna vuriyais biyo ki, beno ke taê melumati gorê vurnaisê ne
 'specialpages-group-media' => 'Raporê medya u bar-kerdey',
 'specialpages-group-users' => 'Karber u heqi',
 'specialpages-group-highuse' => 'Pelê jêdêr gurenaey',
-'specialpages-group-pages' => 'Lista pelun',
+'specialpages-group-pages' => 'Listê pelun',
 'specialpages-group-pagetools' => 'Hacetê pele',
 'specialpages-group-wiki' => "Daê ''Wiki''y u haceti",
 'specialpages-group-redirects' => 'Newe-vırastena pelunê xususiyun',
index e59596f..6793e76 100644 (file)
@@ -453,6 +453,16 @@ $messages = array(
 'nov' => '11',
 'dec' => '12',
 
+'monday-at' => '월요일 $1',
+'tuesday-at' => '화요일 $1',
+'wednesday-at' => '수요일 $1',
+'thursday-at' => '목요일 $1',
+'friday-at' => '금요일 $1',
+'saturday-at' => '토요일 $1',
+'sunday-at' => '일요일 $1',
+'today-at' => '$1',
+'yesterday-at' => '어제 $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|분류}}',
 'category_header' => '"$1" 분류에 속하는 문서',
@@ -929,7 +939,7 @@ $2
 임시 비밀번호: $2',
 'passwordreset-emailsent' => '비밀번호 재설정 이메일을 보냈습니다.',
 'passwordreset-emailsent-capture' => '비밀번호 재설정 이메일이 발송되었으며, 아래에 나타나 있습니다.',
-'passwordreset-emailerror-capture' => '비밀번호 재설정 이메일이 ë§\8cë\93¤ì\96´ì ¸ ì\95\84ë\9e\98ì\97\90 ë\82\98í\83\80ë\82¬ì§\80ë§\8c ë°\9cì\86¡í\95\98ë\8a\94 ë\8d°ì\97\90ë\8a\94 ì\8b¤í\8c¨í\96\88ì\8aµë\8b\88ë\8b¤: $1',
+'passwordreset-emailerror-capture' => '비밀번호 재설정 이메일이 ì\83\9dì\84±ë\90\98ì\96´ ì\95\84ë\9e\98ì\97\90 í\91\9cì\8b\9cë\90\98ì\96´ ì\9e\88ì§\80ë§\8c, {{GENDER:$2|ì\82¬ì\9a©ì\9e\90}}ì\97\90ê²\8c ë°\9cì\86¡í\95\98ë\8a\94 ë\8d°ì\97\90ë\8a\94 ì\8b¤í\8c¨í\96\88ì\8aµë\8b\88ë\8b¤: $1',
 
 # Special:ChangeEmail
 'changeemail' => '이메일 주소 바꾸기',
@@ -4197,4 +4207,8 @@ $5
 # Image rotation
 'rotate-comment' => '그림을 시계 방향으로 $1{{PLURAL:$1|도}}로 회전함',
 
+# Unknown messages
+'hours-ago' => '$1{{PLURAL:$1|시간}} 전',
+'minutes-ago' => '$1{{PLURAL:$1|분}} 전',
+'seconds-ago' => '$1{{PLURAL:$1|초}} 전',
 );
index 45aa8d8..fa797ac 100644 (file)
@@ -647,6 +647,8 @@ Wann De wells, künnts De Ding [[Special:Preferences|Enschtällonge aanpaße]].'
 'userlogin-yourpassword-ph' => 'Donn Ding Paßwood enjävve',
 'yourpasswordagain' => 'Noch ens dat Passwood',
 'remembermypassword' => 'Op Duur aanmelde (hält {{PLURAL:$1|för eine Daach|bes op $1 Dääsch|bloß för hück}})',
+'userlogin-remembermypassword' => 'Op Duur enlogge',
+'userlogin-signwithsecure' => 'Verschlößeld enlogge',
 'securelogin-stick-https' => 'Noh em Enlogge övver HTTPS verbonge blieve.',
 'yourdomainname' => 'Ding Domain',
 'password-change-forbidden' => 'Do kanns en heh däm Wiki kein Paßwööter ändere.',
@@ -660,6 +662,7 @@ Wann De wells, künnts De Ding [[Special:Preferences|Enschtällonge aanpaße]].'
 'userlogout' => 'Ußlogge',
 'notloggedin' => 'Nit enjelogg',
 'userlogin-noaccount' => 'Do häß noch keine Zohjang?',
+'userlogin-joinproject' => 'Aanmälde zom Metmaache!',
 'nologin' => "Wann De Dich noch nit aanjemeldt häs, dann dun Dich '''$1'''.",
 'nologinlink' => 'neu aanmelde',
 'createaccount' => 'Aanmelde als ene neue Metmaacher',
@@ -802,6 +805,7 @@ Do häs Der enzwesche e neu Zweschepaßwood jehollt.',
 'passwordreset-text' => 'Donn dat Fommulaa heh ußfölle, öm e neu Paßwoot faßzelääje.',
 'passwordreset-legend' => 'Et Paßwoot zeröck säze',
 'passwordreset-disabled' => 'Et Paßwoot zeröck ze säze es heh em Wiki afjeschalldt.',
+'passwordreset-emaildisabled' => 'Heh dat Wiki määt nix met <i lang="en">e-mail</i>!',
 'passwordreset-pretext' => '{{PLURAL:$1||Jiff ein vun dä Saache heh dronger enn|}}',
 'passwordreset-username' => 'Metmaacher Name:',
 'passwordreset-domain' => 'Domähn:',
@@ -837,7 +841,7 @@ moß De jäz jaa nix donn, un kanns Ding Paßwoot wigger bruche.',
 Eijmohl-Paßwoot: $2',
 'passwordreset-emailsent' => 'En <i lang="en">e-mail</i> met Aanjaabe zom neue Paßwoot för der Zohjang heh es verscheck.',
 'passwordreset-emailsent-capture' => 'En <i lang="en">e-mail</i> met Aanjaabe zom neue Paßwoot för der Zohjang heh es verscheck woode. Heh dronger kanns De se lässe.',
-'passwordreset-emailerror-capture' => 'En <i lang="en">e-mail</i> met Aanjaabe zom neue Paßwoot för der Zohjang heh sullt verscheck wääde, ävver dat Verschecke hät nit jeflup: $1',
+'passwordreset-emailerror-capture' => 'En <i lang="en">e-mail</i> met Aanjaabe zom neue Paßwoot för der Zohjang heh sullt verscheck wääde, ävver dat Verschecke aan {{GENDER:$2|dä|dat|dä Metmaacher|de|dat}} $2 hät nit jeflup: $1',
 
 # Special:ChangeEmail
 'changeemail' => 'Donn Ding Address för de <i lang="en">e-mail</i> ändere',
@@ -2004,7 +2008,7 @@ Wann ene Metmaacher ußjesöhk es, kritt mer bloß die Dateie, di dä Metmaacher
 'listfiles_user' => 'Metmaacher',
 'listfiles_size' => 'Byte',
 'listfiles_description' => 'Wat en dä Datei dren schtisch',
-'listfiles_count' => 'Versione',
+'listfiles_count' => 'Väsjohne',
 
 # File description page
 'file-anchor-link' => 'Datei',
@@ -3999,7 +4003,7 @@ De könnts Ding Oppassliss ävver och [[Special:EditWatchlist|övver e Fomulaa m
 Dä Shtanndat-Zoot-Schlößel „$1“ övverschriif dä älldere Zoot-Schlößel „$2“.",
 
 # Special:Version
-'version' => 'Version vun de Wiki Soffwär zeije',
+'version' => 'Väsjohn vun de Wiki Soffwär zeije',
 'version-extensions' => 'Installeete Erjänzunge un Zohsätz',
 'version-specialpages' => '{{int:nstab-special}}e',
 'version-parserhooks' => 'De Parser-Hooke',
@@ -4015,7 +4019,7 @@ Dä Shtanndat-Zoot-Schlößel „$1“ övverschriif dä älldere Zoot-Schlöße
 'version-parser-function-hooks' => 'Parserfunktione',
 'version-hook-name' => 'De Schnettstelle ier Name',
 'version-hook-subscribedby' => 'Opjeroofe vun',
-'version-version' => '(Version $1)',
+'version-version' => '(Väsjohn $1)',
 'version-license' => 'Lėzänz',
 'version-poweredby-credits' => "Dat Wiki heh löp met '''[//www.mediawiki.org/ MediaWiki]''', copyright © 2001–$1 $2.",
 'version-poweredby-others' => 'sönß wää',
@@ -4027,7 +4031,7 @@ MediaWiki weed verdeilt met dä Hoffnung, dat et för jet jood es, ävver <span
 Do sullts en [{{SERVER}}{{SCRIPTPATH}}/COPYING Kopie vun dä <i lang="en">GNU General Public License</i>] zosamme met däm Projramm krääje han, un wann nit, schrief aan de: <i lang="en">Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA </i> udder [//www.gnu.org/licenses/old-licenses/gpl-2.0.html liß se em Internet noh].',
 'version-software' => 'Installeete Soffwäer',
 'version-software-product' => 'Produk',
-'version-software-version' => 'Version',
+'version-software-version' => 'Väsjohn',
 'version-entrypoints' => '<i lang="en>URLs</i> för enzeschteije',
 'version-entrypoints-header-entrypoint' => 'Enschteesch',
 'version-entrypoints-header-url' => '<i lang="en">URL</i>',
@@ -4075,7 +4079,7 @@ Die Datei weed jlich aanjezeig, odder med däm paßende Projramm op jemaat.",
 
 # External image whitelist
 'external_image_whitelist' => '# Donn aan dä Reih heh nix ändere<pre>
-# Onge künne Brochstöck fun regular expressions aanjejovve wäde,
+# Onge künne Brochstöke fun rejolähre Ußdrök aanjejovve wäde,
 # alsu dä Deil zwesche / und /
 # Noh em Verjliische met däm URL vun ene Datei fun ußerhallef:
 # Treffer: De Datei weed jezeich odder enjebonge.
index ba467b5..99b4249 100644 (file)
@@ -748,7 +748,7 @@ Dir sollt Iech aloggen an een neit Passwuert festleeën. Wann een Aneren déi Uf
 Temporärt Passwuert: $2',
 'passwordreset-emailsent' => "Eng Mail fir d'Passwuert zréckzesetze gouf geschéckt.",
 'passwordreset-emailsent-capture' => "Eng Mail fir d'Passwuert zréckzesetze gouf geschéckt, Dir gesitt se hei drënner.",
-'passwordreset-emailerror-capture' => "Eng Mail fir d'Passwuert zréckzesetze gouf geschéckt, Dir gesitt se hei drënner, awer de Benotzer konnt se net kréien: $1",
+'passwordreset-emailerror-capture' => "Eng Mail fir d'Passwuert zréckzesetze gouf geschéckt, Dir gesitt se hei drënner, awer de {{GENDER:$2|Benotzer}} konnt se net kréien: $1",
 
 # Special:ChangeEmail
 'changeemail' => 'Mailadress änneren',
@@ -2202,6 +2202,7 @@ All weider Ännerungen op dëser Säit an der assoziéierter Diskussiounssäit g
 'enotif_subject_restored' => "D'{{SITENAME}}-Säit $1 gouf vum {{gender:$2|$2}} restauréiert",
 'enotif_subject_changed' => "D'{{SITENAME}}-Säit $1 gouf vum {{gender:$2|$2}} geännert",
 'enotif_body_intro_deleted' => 'D\'{{SITENAME}}-Säit $1 gouf de(n) $PAGEEDITDATE {{gender:$2|vum $2|vun der $2}} geläscht, kuckt $3.',
+'enotif_body_intro_created' => 'D\'{{SITENAME}}-Säit $1 gouf den $PAGEEDITDATE vum $2 {{GENDER:$2|ugeluecht}}, kuckt $3 fir déi aktuell Versioun.',
 'enotif_lastvisited' => 'All Ännerungen op ee Bléck: $1',
 'enotif_lastdiff' => 'Kuckt $1 fir dës Ännerung.',
 'enotif_anon_editor' => 'Anonyme Benotzer $1',
index 2786312..bd5d04b 100644 (file)
@@ -129,15 +129,15 @@ $messages = array(
 'tog-underline' => 'Sottolineâ i collegamenti',
 'tog-justify' => 'Alliniamento di paragrafi giustificòu',
 'tog-hideminor' => 'asconde e modifiche minori inte ùrtime modifiche',
-'tog-hidepatrolled' => 'Ascondi e modifiche verific inte ùrtime modifiche',
-'tog-newpageshidepatrolled' => 'Ascondi e paggine verifiché da-o elenco de paggine ciù reçenti',
-'tog-extendwatchlist' => 'mostrâ tùtte e modifiche a-i òsserve speciali',
+'tog-hidepatrolled' => 'Ascondi e modifiche verificæ inte ùrtime modifiche',
+'tog-newpageshidepatrolled' => "Ascondi e paggine verificæ da  l'elenco de paggine ciù reçenti",
+'tog-extendwatchlist' => "mostra tùtte e modifiche a-i osservæ speciali, non solo l'urtima",
 'tog-usenewrc' => 'Ammuggia pe paggina e modifiche in urtime modifiche e sotta oservaçion (serve o Javascript)',
 'tog-numberheadings' => 'Nùmeraçion aotomàtica di tìtoli de seçión',
-'tog-showtoolbar' => 'Fâ vedde a barra de strumenti de modìffica (con JavaScript)',
-'tog-editondblclick' => 'Modifica e paggine co-o dópio clic (serve Javascrpt)',
+'tog-showtoolbar' => 'Fanni vedde a barra di strumenti de modìffica (serve JavaScript)',
+'tog-editondblclick' => 'Modifica e paggine co-o doggio clic (serve Javascrpt)',
 'tog-editsection' => 'Modifica e seçión co-o colegamento [modifica]',
-'tog-editsectiononrightclick' => 'Modifica e seçión co-o clic destro in sciô tìtolo (serve Javascipt)',
+'tog-editsectiononrightclick' => 'Modifica e seçión co-o clic drito in sciô tìtolo (serve Javascipt)',
 'tog-showtoc' => "Fanni védde l'indiçe pe-e pàgine con ciù de 3 seçioìn",
 'tog-rememberpassword' => "Arregorda a mæ paròlla d'ordine (a-o màscimo pe $1 {{PLURAL:$1|day|days}})",
 'tog-watchcreations' => 'Azonzi e paggine che creo e i file che carrego a-i oservæ speciâli',
@@ -155,11 +155,26 @@ $messages = array(
 'tog-shownumberswatching' => "Mostra o numero di utenti che tegnan d'oeuggio sta pagina",
 'tog-oldsig' => 'Firma attuale:',
 'tog-fancysig' => 'Tratta a firma comme wikitesto (sensa un collegamento aotomatico)',
+'tog-showjumplinks' => 'Attiva i collegamenti d\'accescibilitæ "sata a"',
+'tog-uselivepreview' => "Doeuvia l'anteprimma in diretta (ghe voeu o JavaScript)(sperimentâ)",
+'tog-watchlisthideown' => "Ascondi e mæ modiffiche da-a lista che tegno d'oeuggio",
+'tog-watchlisthidebots' => "Ascondi e modiffiche di bot da-a lista che tegno d'oeuggio",
+'tog-watchlisthideminor' => "Ascondi e modiffiche menoî da-a lista che tegno d'oeuggio",
+'tog-watchlisthideliu' => "Ascondi e modiffiche di utenti intræ da-a lista che tegno d'oeuggio",
+'tog-watchlisthideanons' => "Ascondi e modiffiche di utenti anonnimi da-a lista che tegno d'oeuggio",
+'tog-watchlisthidepatrolled' => "Ascondi e modiffiche za controllæ da-a lista che tegno d'oeuggio",
+'tog-ccmeonemails' => "Mandime 'na coppia de e-mail che mando a-i atri utenti",
+'tog-diffonly' => 'No mostrâ o contegnuo da paggina sotta o confronto tra verscioin',
 'tog-showhiddencats' => 'Fa vedde e categorîe ascose',
+'tog-norollbackdiff' => "Ometti o confronto tra verscioin doppo ch'ho fæto o ripristino",
+'tog-useeditwarning' => "Avertime se lascio 'na paggina de modiffica sens'avei sarvou i cangi",
 
 'underline-always' => 'Sempre',
 'underline-never' => 'Mâi',
 
+# Font style option in Special:Preferences
+'editfont-style' => "Stile do carattere de l'aera de modiffica",
+
 # Dates
 'sunday' => 'Domenega',
 'monday' => 'Lunedì',
@@ -225,15 +240,19 @@ $messages = array(
 'category-article-count' => "{{PLURAL:$2|Questa categoria a contegne solo sta pagina chì.|Questa categoria a contegne {{PLURAL:$1|a pagina indicâ|e $1 pagine indicæ}} chì de sotta , insce 'n totale de $2.}}",
 'category-article-count-limited' => "'Sta categorîa a contegne {{PLURAL:$1|'sta paggina|'ste $1 paggine}}.",
 'category-file-count' => "{{PLURAL:$2|Sta categoria a contegne sôlo sto file.|{{PLURAL:$1|Sto file o l'é|Sti $1 file son}} inte sta categoria, pe in totale de $2.}}",
+'category-file-count-limited' => 'Questa categoria a contegne {{PLURAL:$1|o file indicao|i $1 file indicæ}} chi de sotta.',
 'listingcontinuesabbrev' => 'cont.',
+'index-category' => 'Paggine indiçizzæ',
 'noindex-category' => 'Pàgine sénsa indiçe',
+'broken-file-category' => 'Paggine con di colegamenti a di file che no ghe son',
 
 'about' => 'Informaçioìn',
 'article' => 'Pagina de i contenùi',
 'newwindow' => "(O s'arve inte 'n âtro barcon)",
 'cancel' => 'Scancella',
 'moredotdotdot' => 'De ciû...',
-'mypage' => 'A mea pagina',
+'morenotlisted' => 'Atro...',
+'mypage' => 'Paggina',
 'mytalk' => 'Discuscioin',
 'anontalk' => 'Discuscion pe questo indirisso IP',
 'navigation' => 'Navegaçión',
@@ -241,17 +260,21 @@ $messages = array(
 
 # Cologne Blue skin
 'qbfind' => 'Attrêuva',
+'qbbrowse' => 'Navvega',
 'qbedit' => 'Cangia',
 'qbpageoptions' => "Opsioîn de 'sta paggina",
 'qbmyoptions' => 'E mæ paggine',
 'qbspecialpages' => 'Pagine speçiä',
 'faq' => 'Domande frequenti',
+'faqpage' => 'Project:Domande frequente',
 
 # Vector skin
 'vector-action-addsection' => 'Azónzi discusción',
 'vector-action-delete' => 'Scancella',
 'vector-action-move' => 'Mescia',
 'vector-action-protect' => 'Protezi',
+'vector-action-undelete' => 'Recuppera',
+'vector-action-unprotect' => 'Cangia a proteçion',
 'vector-view-create' => 'Crea',
 'vector-view-edit' => 'Càngia',
 'vector-view-history' => 'Fanni védde a Stöia',
@@ -261,6 +284,7 @@ $messages = array(
 'namespaces' => 'Namespaces',
 'variants' => 'Diferense',
 
+'navigation-heading' => 'Menu de navegaçion',
 'errorpagetitle' => 'Erô',
 'returnto' => 'Torna a $1.',
 'tagline' => 'Da {{SITENAME}}',
@@ -271,6 +295,7 @@ $messages = array(
 'searcharticle' => 'Vanni',
 'history' => 'Stöia da pàgina',
 'history_short' => 'Stöia',
+'updatedmarker' => 'modificâ da-a mæ urtima vixita',
 'printableversion' => 'Verscion da stanpâ',
 'permalink' => 'Ingancio fisso',
 'print' => 'Stampa',
@@ -280,31 +305,45 @@ $messages = array(
 'create-this-page' => "Crea 'sta paggina",
 'delete' => 'Scancella',
 'deletethispage' => "Scassa 'sta paggina",
+'undelete_short' => 'Recuppera {{PLURAL:$1|una revixon|$1 revixoin}}',
 'protect' => 'Protezi',
 'protect_change' => 'cangia',
 'protectthispage' => "Proteze 'sta paggina.",
 'unprotect' => 'Càngia proteçión',
 'unprotectthispage' => 'Càngia a proteçión de sta paggina',
 'newpage' => 'Nêuva pàgina',
-'talkpage' => 'Paggina de discûxon',
+'talkpage' => 'Paggina de discuscion',
 'talkpagelinktext' => 'Ciæti',
 'specialpage' => 'Pagina speçiâ',
 'personaltools' => 'Strùmenti personâli',
+'postcomment' => 'Noeuva seçion',
 'articlepage' => 'Veddi a voxe',
 'talk' => 'Ciæti',
 'views' => 'Vìxite',
 'toolbox' => 'Arneixi',
+'userpage' => 'Veddi a paggina utente',
 'projectpage' => 'Veddi a pagina de o progetto',
+'imagepage' => 'Vizualizza a paggina do file',
+'mediawikipage' => 'Vizualizza o messaggio',
+'templatepage' => 'Vizualizza o modello',
+'viewhelppage' => "Vizualizza a paggina d'agiutto",
+'categorypage' => 'Veddi a paggina da categoria',
 'viewtalkpage' => 'Veddi o ciæto',
 'otherlanguages' => 'In âtre lengóe',
 'redirectedfrom' => '(Rendirissou da $1)',
 'redirectpagesub' => 'Paggina de rindirissamento',
 'lastmodifiedat' => "Sta pagina a l'è stæta cangiâ l'urtima votta a e $2 do $1.",
 'viewcount' => "'Sta paggina a l'è stæta vista {{PLURAL:$1|solo 'na vòtta|$1 vòtte}}.",
-'protectedpage' => 'Paggina protea',
+'protectedpage' => 'Paggina protetta',
 'jumpto' => 'Vanni a:',
 'jumptonavigation' => 'Navegaçión',
 'jumptosearch' => 'çerca',
+'view-pool-error' => "Scuza ma a-o momento i server sono stracarreghi.
+Troppi utenti çercan d' amiâ sta paggina.
+Aspeta quarche menuto primma de çercâ torna d'accede a sta pagina.
+
+$1",
+'pool-errorunknown' => 'Aro sconosciuo',
 
 # All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage) and the disambiguation template definition (see disambiguations).
 'aboutsite' => 'Informaçioìn in sciô {{SITENAME}}',
@@ -328,13 +367,20 @@ $messages = array(
 
 'badaccess' => "No ti g'hæ o permisso",
 'badaccess-group0' => "No ti g'hæ o permisso pe fâ quest'assion.",
-'badaccess-groups' => "L'assion che ti vêu fâ a l'è permissa solo a i ûtenti de ûn di grûppi $1.",
+'badaccess-groups' => "L'assion che ti vêu fâ a l'è permissa solo a i ûtenti {{PLURAL:$2|do gruppo|de un de sti gruppi}}: $1.",
+
+'versionrequired' => 'Ghe voeu a verscion $1 de MediaWiki',
+'versionrequiredtext' => "Pe doeuviâ sta paggina ghe voeu a verscion $1 do software MediaWiki. Amia [[Special:Version|l'appoxita paggina]].",
 
 'ok' => "D'accòrdio",
 'retrievedfrom' => 'Estræto da "$1"',
 'youhavenewmessages' => "Ti gh'æ $1 ($2).",
 'newmessageslink' => 'Nêuvi messaggi',
 'newmessagesdifflink' => 'urtima modiffica',
+'youhavenewmessagesfromusers' => "Ti g'hæ $1 da {{PLURAL:$3|un atro utente|$3 utenti}} ($2).",
+'youhavenewmessagesmanyusers' => "Ti g'hæ $1 da tanti utenti ($2).",
+'newmessageslinkplural' => '{{PLURAL:$1|un noeuvo messaggio|noeuvi messaggi}}',
+'newmessagesdifflinkplural' => '{{PLURAL:$1|urtima modifica|urtime modifiche}}',
 'youhavenewmessagesmulti' => "Ti t'æ neuvi messaggi in scia $1",
 'editsection' => 'Càngia',
 'editold' => 'càngia',
@@ -345,30 +391,45 @@ $messages = array(
 'toc' => 'Indiçe',
 'showtoc' => 'Fâ vedde',
 'hidetoc' => 'Asconde',
+'collapsible-collapse' => 'Comprimmi',
+'collapsible-expand' => 'Espandi',
+'thisisdeleted' => 'Amia o ripristina $1?',
 'viewdeleted' => 'Vedde $1?',
+'restorelink' => '{{PLURAL:$1|una modifica scancelâ|$1 modifiche scancelæ}}',
+'feedlinks' => 'Feed:',
+'feed-invalid' => 'Modalitæ de sottoscriçion do feed non vallida.',
 'site-rss-feed' => 'Feed RSS de $1',
 'site-atom-feed' => 'Feed Atom de $1',
 'page-rss-feed' => 'Feed RSS pe "$1"',
 'page-atom-feed' => 'Feed Atom pe "$1"',
 'red-link-title' => '$1 (ancon da scrîve)',
+'sort-descending' => 'Ordine decrescente',
+'sort-ascending' => 'Ordine crescente',
 
 # Short words for each namespace, by default used in the namespace tab in monobook
 'nstab-main' => 'Pàgina',
 'nstab-user' => 'Utente',
+'nstab-media' => 'File murtimediâ',
 'nstab-special' => 'Pàgina speçiâ',
 'nstab-project' => 'Paggina de servissio',
 'nstab-image' => 'Archivio',
+'nstab-mediawiki' => 'Messaggio',
 'nstab-template' => 'Template',
 'nstab-help' => 'Agiûtto',
 'nstab-category' => 'Categorîa',
 
 # Main script and global functions
-'nosuchactiontext' => "L'URL a no corisponde a 'n comando reconosciûo da-o software MediaWiki",
+'nosuchaction' => 'No se poeu',
+'nosuchactiontext' => "L'açion specificâ inta URL a no l'è vallida.
+O che t'hæ scrito mâ, o che donque l'ea sbaliou o colegamento.
+O magara gh'è 'na cammoa into software doeuviou da {{SITENAME}}.",
+'nosuchspecialpage' => "Sta paggina speciale a no gh'è",
 
 # General errors
 'error' => 'Errô',
 'databaseerror' => 'Errô da a base de i dæti',
 'readonly' => 'Database bloccòu',
+'enterlockreason' => "Scrivi o motivo do blocco, e 'na stimma de quande o saiâ rimosso",
 'missing-article' => "O database o no l'à trovòu o testo di 'na pàgina che ghe saiêiva dovûa êse  co-o nómme de \"\$1\" \$2.
 
 Spésse vòtte questo o sucede quande a vegne riciamâ, da stöia ò dò-u confronto tra revixioìn, in colegaménto a 'na pàgina scancelâ, a in confronto tra revixioìn che no ghe son ciù ò a in confronto tra revixioìn sénsa ciù a stöia.
@@ -387,6 +448,16 @@ Pe favô ti peu segnalâ quello che l'é sucesso a in [[Special:ListUsers/sysop|
 'viewsource' => 'Veddi a fonte',
 'protectedpagetext' => "'Sta paggina a l'è stæta protezûa pe impedîghe a modiffica.",
 'viewsourcetext' => "O l'è poscibbile vedde e copiâ o còddice sorgente de 'sta paggina:",
+'customjsprotected' => "No ti gh'æ i permessi pe cangiâ sta pagina de JavaScript percose a contegne e impostaçioin personæ de 'n atro utente",
+'ns-specialprotected' => 'No se pœu modificâ e paggine speciali',
+'titleprotected' => "A creaçion de 'na paggina con sto tittolo a l'è stæta bloccâ da [[User:$1|$1]].
+A raxon a l'è: ''$2''.",
+'exception-nologin' => "No t'ê introu",
+'exception-nologin-text' => "Pe sta paggina ò sta açion ti gh'æ da effettuâ l'accesso inte sta wiki.",
+
+# Virus scanner
+'virus-scanfailed' => 'scansion fallia (codice $1)',
+'virus-unknownscanner' => 'antivirus sconosciuo:',
 
 # Login and logout pages
 'yourname' => 'Nomme',
@@ -394,55 +465,71 @@ Pe favô ti peu segnalâ quello che l'é sucesso a in [[Special:ListUsers/sysop|
 'yourpasswordagain' => 'Riscrivi a pòula segrétta:',
 'remembermypassword' => 'Aregòrda a mæ login in sto navegatô (pe in mascimo de $1 {{PLURAL:$1|giórno|giórni}})',
 'yourdomainname' => 'Indirisso do scito:',
+'password-change-forbidden' => 'No ti peu cangiâ poula segretta in questa wiki.',
 'login' => 'Intra',
 'nav-login-createaccount' => 'Intra / Registrate',
 'loginprompt' => "Pe fâ l'accesso inte {{SITENAME}} ti g'hæ da  abilitâ i cookie.",
 'userlogin' => 'Intra / Registrite',
+'userloginnocreate' => 'Intra',
 'logout' => 'Sciorti',
 'userlogout' => 'Sciorti',
+'notloggedin' => "No t'ê introu",
 'nologin' => "No ti gh'æ ancon in acesso? '''$1'''.",
 'nologinlink' => "Creâ 'n' utensa",
 'createaccount' => "Crea 'n nêuvo account",
 'gotaccount' => "Ti ghe l'æ za 'n' utensa? '''$1'''.",
 'gotaccountlink' => 'Intra',
 'userlogin-resetlink' => "T'æ ascordòu i teu dæti de acesso?",
+'createaccountreason' => 'Raxon:',
 'badretype' => "E paròlle d'ordine che t'hæ scrîo son despægie.",
-'userexists' => "O nomme d'ûtente inserîo o l'è zà in ûso.<br />
-Pe piaxei prêuva a scellie 'n âtro.",
+'userexists' => "O nomme ûtente inserîo o l'è za doeuviao.<br />
+Çernine 'n âtro.",
 'loginerror' => "Errô inte l'accesso",
+'createaccounterror' => "Imposcibbile creâ l'account: $1",
 'noname' => "O nomme d'ûtente o l'è sballiòu.",
 'loginsuccesstitle' => 'Accesso effettuòu',
 'loginsuccess' => "'''O collegamento a-o server de {{SITENAME}} co-o nomme d'ûtente \"\$1\" o l'è attivo.'''",
 'nosuchuser' => 'No gh\'è nisciûn ûtente con quello nomme "$1". Verificâ o nomme inserîo ò creâ \'n nêuvo accesso.',
 'nosuchusershort' => 'No gh\'è nisciûn ûtente con quello nomme "$1". Verificâ o nomme inserîo.',
 'nouserspecified' => "O se deive inserî 'n nomme d'ûtente.",
+'login-userblocked' => "St'utente o l'è bloccou. Accesso negou.",
 'wrongpassword' => "Ti gh'æ scrîo 'na paròlla d'ordine sbaliâ. Tenta torna.",
 'wrongpasswordempty' => "No ti g'hæ scrîo nisciûnn-a paròlla d'ordine. Tenta torna.",
-'passwordtooshort' => "A paròlla d'ordine che ti gh'æ misso a no serve òu a l'é tròppo cûrta.
-A dêve contegnî mìnimo $1 caratteri e esse diverza da-o teu nómme utente.",
+'passwordtooshort' => 'E password devan aveighe aomanco {{PLURAL:$1|1 carattere|$1 caratteri}}.',
+'password-name-match' => "A password a dev'ese despægia da-o nomme utente.",
+'password-login-forbidden' => "L'utilizzo de sto nomme utente e password o l'è stæto proibio.",
 'mailmypassword' => "Invia 'na nêuva paròlla segrétta a-a mæ e-mail",
 'passwordremindertitle' => "Servissio Password Reminder (nêuva paròlla d'ordine temporannia) de {{SITENAME}}",
-'passwordremindertext' => "Quarchedûn (probabilmente ti, con indirisso IP \$1) o g'ha domandòu l'invîo de 'na nêuva paròlla d'ordine pe l'accesso a {{SITENAME}} (\$4).
-A paròlla d'ordine pe l'ûtente \"\$2\" a l'è stæta impostâa a \"\$3\".
-O se conseggia de fâ l'accesso quanto primma e cangiâ a paròlla d'ordine immediatamente.
-Se no ti Ã¨ stæto ti a fâ 'sta domanda, oppûre se ti g'hæ ritrovòu a têu paròlla d'ordine e no ti vêu cangiâla ciû, ti pêu ignorâ 'sto messaggio e andâ avanti Ã»sando a vegia paròlla d'ordine.",
+'passwordremindertext' => "Quarchedûn (probabilmente ti, con indirisso IP \$1) o l'ha domandòu l'invîo de 'na nêuva paròlla d'ordine pe l'accesso a {{SITENAME}} (\$4).
+A paròlla d'ordine pe l'ûtente \"\$2\" a l'è stæta impostâ a \"\$3\".
+Se conseggia de fâ l'accesso quanto primma e cangiâ a paròlla d'ordine immediatamente.
+Se no ti Ãª stæto ti a fâ 'sta domanda, oppûre se ti t'hæ ritrovòu a têu paròlla d'ordine e no ti vêu cangiâla ciû, ti pêu ignorâ 'sto messaggio e andâ avanti deuviando a vegia paròlla d'ordine.",
 'noemail' => 'No gh\'è nisciûn indirisso e-mail registròu pe l\'ûtente "$1".',
+'noemailcreate' => 'Ti devi dâ un addresso e-mail vallido.',
 'passwordsent' => "Ûnn-a nêuva paròlla d'ordine a l'è stæta inviâa a l'indirisso e-mail registròu pe l'ûtente \"\$1\".
 Pe piaxei, fa 'n accesso appenn-a ti a ghe reçeivi.",
 'blocked-mailpassword' => "O teu indirisso IP o l'è affirmoö, e pe sta razon o non se peu usâ a funscion de remandâ a pòula segretta.",
 'eauthentsent' => "'N messaggio e-mail de confermassion o l'è stæto inviòu a l'indirisso indicòu.
 Pe abilitâ l'invîo de messaggi e-mail pe quest'accesso, o se deive seguî l'istrûssioîn indicæ, coscì ti confermi che ti t'è o legittimo propietâjo de l'indirisso.",
-'acct_creation_throttle_hit' => 'O ne dispiâxe, ma ti hæ zà creòu $1 accesci. No ti pêu creâne de ciû!',
-'emailauthenticated' => "O teu indirisso de posta elettronega o l'è stæto autenticoö o $1.",
+'mailerror' => "Errô inte l'invio do messaggio: $1",
+'acct_creation_throttle_hit' => "Ne dispiâxe, ma t'hæ zà creòu $1 accesci. No ti pêu creâne ciû!",
+'emailauthenticated' => "O teu indirisso de posta elettronica o l'è stæto autenticou o $1.",
 'emailconfirmlink' => 'Conferma o teu indirisso de posta elettronega',
 'accountcreated' => 'Graçie pe esëte registroö!!!',
 'accountcreatedtext' => "Utente $1, ti te guägno l'açeiso!",
+'createaccount-title' => "Creaçion de 'n conto pe {{SITENAME}}",
+'usernamehasherror' => 'O nomme utente o no poeu contegnî di caratteri hash',
+'login-abort-generic' => "O to accesso o no l'ha avuo successo - Abortio",
 'loginlanguagelabel' => 'Lengoa: $1',
 
 # Change password dialog
-'resetpass' => 'Reverti a pòula segretta',
-'resetpass_header' => 'Reverti a pòula segretta',
+'resetpass' => 'Cangia a pòula segretta',
+'resetpass_announce' => "T'ê introu co in codiçe temporanio de l'e-mail.Pe completâ l'accesso ti devi çerne 'na neuva poula segretta chì:",
+'resetpass_header' => 'Cangia a pòula segretta do conto',
+'oldpassword' => 'Vegia poula segretta',
+'newpassword' => 'Neuva poula segretta',
 'retypenew' => "Ripette a nêuva paròlla d'ordine:",
+'resetpass_submit' => 'Çerni a poula segretta e intra',
 'resetpass_forbidden' => "No l'é poscìbile cangiâ e paròlle segrétte",
 
 # Edit page toolbar
index 2d456ae..af02732 100644 (file)
@@ -19,11 +19,11 @@ $messages = array(
 'tog-hidepatrolled' => 'Siamţhat venhim tihdanglam thar zingah tilang suh',
 'tog-newpageshidepatrolled' => 'Phêk venhim phêk thar tlarah tilang suh',
 'tog-extendwatchlist' => 'A thar chauh ni lo, tihdanglamna zawng zawng tilang tùrin ralvèn kapparh rawh',
-'tog-usenewrc' => 'Tihdanglam thar belhchhan hmang rawh (JavaScript a ngai)',
+'tog-usenewrc' => 'Tihdanglam tharte leh ralvente a phêk azir zëlin tlar rawh (JavaScript a ngai)',
 'tog-numberheadings' => 'A thupuite amahin nambar inpêktir rawh',
-'tog-showtoolbar' => 'Siamţhatna hmanraw-liang tilang rawh (JavaScript a ngai)',
-'tog-editondblclick' => 'Hmehphìrin phêk siamţha rawh (JavaScript a ngai)',
-'tog-editsection' => 'Hlawm hrang siamţhatna [siamţhatna] zawmna hmangin awmtir rawh',
+'tog-showtoolbar' => 'Siamhatna hmanraw-liang tilang rawh (JavaScript a ngai)',
+'tog-editondblclick' => 'Hmehphìrin phêk siamha rawh (JavaScript a ngai)',
+'tog-editsection' => 'Hlawm hrang siamṭhatna [siamṭhatna] zawmna hmangin awmtir rawh',
 'tog-editsectiononrightclick' => 'Hlawm thupui ding-hmeh hmangin hlawm siamţhat theihna awmtir rawh (JavaScript a ngai)',
 'tog-showtoc' => 'A chhunga thu awm te tilang rawh (thupui 3 aia tam phêk tan)',
 'tog-rememberpassword' => 'He ka rangpuifannaah hian min hre reng rawh (a rei berah ni $1  {{PLURAL:$1}})',
@@ -77,7 +77,7 @@ $messages = array(
 'friday' => 'Zirtawpni',
 'saturday' => 'Inrinni',
 'sun' => 'Ptn',
-'mon' => 'Thţ',
+'mon' => 'Th',
 'tue' => 'Thl',
 'wed' => 'Nil',
 'thu' => 'Nng',
@@ -110,8 +110,8 @@ $messages = array(
 'jan' => 'Pkt',
 'feb' => 'Rtk',
 'mar' => 'Vau',
-'apr' => 'Ţau',
-'may' => 'Ţmr',
+'apr' => 'au',
+'may' => 'mr',
 'jun' => 'Nkr',
 'jul' => 'Vhz',
 'aug' => 'Tţn',
index 7374f76..1a89338 100644 (file)
@@ -258,7 +258,7 @@ $1',
 # All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage) and the disambiguation template definition (see disambiguations).
 'aboutsite' => 'Tantang {{SITENAME}}',
 'aboutpage' => 'Project:Tantang',
-'copyright' => 'Kandungan tasadio dalam $1',
+'copyright' => 'Isi tasadio dalam $1',
 'copyrightpage' => '{{ns:project}}:Hak cipta',
 'currentevents' => 'Kajadian kini ko',
 'currentevents-url' => 'Project:Kajadian kini ko',
@@ -272,15 +272,15 @@ $1',
 'policy-url' => 'Project:Kabijakan',
 'portal' => 'Portal komunitas',
 'portal-url' => 'Project:Portal komunitas',
-'privacy' => 'Kecipehan privasi',
-'privacypage' => 'Project:Kecipehan privasi',
+'privacy' => 'Kacipehan privasi',
+'privacypage' => 'Project:Kacipehan privasi',
 
 'badaccess' => 'Kasalahan hak akses',
 'badaccess-group0' => 'Sanak indak diizinkan untuak malakuan tindakan ko.',
 'badaccess-groups' => 'Tindakan nan Sanak nio babateh untuak pangguno dalam {{PLURAL:$2|kalompok}}: $1.',
 
 'versionrequired' => 'Dibutuahan MediaWiki versi $1',
-'versionrequiredtext' => 'MediaWiki versi $1 dibutuahan untuak manggunoan laman ko. Lihek [[Special:Version|versi laman]]',
+'versionrequiredtext' => 'MediaWiki versi $1 dibutuahan untuak manggunoan laman ko. Caliak [[Special:Version|versi laman]]',
 
 'ok' => 'OK',
 'pagetitle' => '$1 - {{SITENAME}} bahaso Minang',
@@ -303,7 +303,7 @@ $1',
 'editsectionhint' => 'Suntiang bagian: $1',
 'toc' => 'Dafta isi',
 'showtoc' => 'tampilkan',
-'hidetoc' => 'suruakkan',
+'hidetoc' => 'suruakan',
 'collapsible-collapse' => 'Ketekan',
 'collapsible-expand' => 'Kambangan',
 'thisisdeleted' => 'Caliak atau kambalian $1?',
@@ -1144,9 +1144,9 @@ Alamaik surel Sanak indakkan tau dek urang nan manghubungi sanak tu.',
 'userrights-groupsmember' => 'Anggota dari:',
 'userrights-groupsmember-auto' => 'Anggota implisit dari:',
 'userrights-groups-help' => 'Sanak dapek mangubah kalompok pangguno ko:
-* Kotak jo tando cek marupoan kalompok pangguno tasabuik
-* Kotak tanpa tando cek bararti pangguno ko bukan anggota kalompok tasabuik
-* Tando * manandoi Sanak indak dapek mambatalan kalompok tasabuik bilo Sanak alah manambahannyo, atau sabaliaknyo.',
+* Kotak jo tando centang marupoan kalompok pangguno tasabuik
+* Kotak indak ado tando centang bararti pangguno ko bukan anggota kalompok tasabuik
+* Tando * manandoan Sanak indak dapek mambatalan kalompok tasabuik bilo Sanak alah manambahannyo, ataupun sabaliaknyo.',
 'userrights-reason' => 'Alasan:',
 'userrights-no-interwiki' => 'Sanak indak bahak untuak mangubah hak pangguno di wiki lain.',
 'userrights-nodatabase' => 'Basis data $1 indak ado atau bukan disiko.',
@@ -1718,7 +1718,7 @@ Entri log pamblokiran tabaru ado di bawah ko untuak referensi:',
 
 # What links here
 'whatlinkshere' => 'Pautan baliak',
-'whatlinkshere-title' => 'Laman yang bakaik ka "$1"',
+'whatlinkshere-title' => 'Laman nan takaik ka "$1"',
 'whatlinkshere-page' => 'Laman:',
 'linkshere' => "Laman-laman ko bakaik ka '''[[:$1]]''':",
 'nolinkshere' => "Indak ado laman nan punyo tautan ka '''[[:$1]]'''.",
index 0573fbb..2f00177 100644 (file)
@@ -455,6 +455,16 @@ $messages = array(
 'nov' => 'ное',
 'dec' => 'дек',
 
+'monday-at' => 'понеделникот во $1',
+'tuesday-at' => 'вторникот во $1',
+'wednesday-at' => 'средата во $1',
+'thursday-at' => 'четвртокот во $1',
+'friday-at' => 'петокот во $1',
+'saturday-at' => 'саботата во $1',
+'sunday-at' => 'неделата во $1',
+'today-at' => '$1',
+'yesterday-at' => 'вчера во $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Категорија|Категории}}',
 'category_header' => 'Статии во категоријата „$1“',
@@ -465,7 +475,7 @@ $messages = array(
 'hidden-category-category' => 'Скриени категории',
 'category-subcat-count' => '{{PLURAL:$2|Оваа категорија ја содржи само следнава поткатегорија.|Оваа категорија {{PLURAL:$1|ја содржи следнава поткатегорија|ги содржи следниве $1 поткатегории}} од вкупно $2.}}',
 'category-subcat-count-limited' => 'Оваа категорија {{PLURAL:$1|ја содржи следнава поткатегорија|ги содржи следниве $1 поткатегории}}.',
-'category-article-count' => '{{PLURAL:$2|Ð\9aаÑ\82егоÑ\80иÑ\98аÑ\82а Ñ\98а Ñ\81одÑ\80жи Ñ\81амо Ñ\81леднава Ñ\81Ñ\82Ñ\80аниÑ\86а.|Ð\9aаÑ\82егоÑ\80иÑ\98аÑ\82а {{PLURAL:$1|Ñ\98а Ñ\81одÑ\80жи Ñ\81леднава Ñ\81Ñ\82Ñ\80аниÑ\86а|ги Ñ\81одÑ\80жи следниве $1 страници}} од вкупно $2.}}',
+'category-article-count' => '{{PLURAL:$2|Ð\9eваа ÐºÐ°Ñ\82егоÑ\80иÑ\98а Ñ\98а Ñ\81одÑ\80жи Ñ\81амо Ñ\81леднава Ñ\81Ñ\82Ñ\80аниÑ\86а:|Ð\92о ÐºÐ°Ñ\82егоÑ\80иÑ\98аÑ\82а Ñ\81е {{PLURAL:$1|Ñ\81одÑ\80жи Ñ\81леднава Ñ\81Ñ\82Ñ\80аниÑ\86а|Ñ\81одÑ\80жаÑ\82 следниве $1 страници}} од вкупно $2.}}',
 'category-article-count-limited' => '{{PLURAL:$1|Следната страница е|Следните $1 страници се}} во оваа категорија.',
 'category-file-count' => '{{PLURAL:$2|Оваа категорија ја содржи само следната податотека.|{{PLURAL:$1|Следната податотека е|Следните $1 податотеки се}} во оваа категорија, од вкупно $2.}}',
 'category-file-count-limited' => '{{PLURAL:$1|Следнава податотека е|Следниве $1 податотеки се}} во оваа категорија.',
@@ -562,7 +572,7 @@ $messages = array(
 'viewhelppage' => 'Погледајте ја страницата за помош',
 'categorypage' => 'Погледајте ја страницата за категоријата',
 'viewtalkpage' => 'Видете го разговорот',
-'otherlanguages' => 'Ð\94руги јазици',
+'otherlanguages' => 'Ð\9dа Ð´руги јазици',
 'redirectedfrom' => '(Пренасочено од $1)',
 'redirectpagesub' => 'Страница за пренасочување',
 'lastmodifiedat' => 'Оваа страница последен пат е изменета на $1 во $2 ч.',
@@ -733,9 +743,9 @@ $1',
 'protectedpagetext' => 'Оваа страница е заклучена за уредувања и други дејства.',
 'viewsourcetext' => 'Можете да го погледнете и копирате кодот на оваа страница:',
 'viewyourtext' => "Можете да го погледнете и копирате кодот на '''вашите уредувања''' на оваа страница:",
-'protectedinterface' => 'Оваа страница содржи текст од посредникот на софтверот на ова вики и е превентивно заштитена поради можна злоупотреба.
+'protectedinterface' => 'Оваа страница содржи текст од посредникот на програмот на ова вики и е превентивно заштитена поради можна злоупотреба.
 За да додавате или менувате преводи на сите викија, појдете на [//translatewiki.net/wiki/Main_Page?uselang=mk translatewiki.net] - проектот за локализација на МедијаВики.',
-'editinginterface' => "'''Ð\9fÑ\80едÑ\83пÑ\80едÑ\83ваÑ\9aе:''' Ð£Ñ\80едÑ\83ваÑ\82е Ñ\81Ñ\82Ñ\80аниÑ\86а ÐºÐ¾Ñ\98а Ðµ Ð´ÐµÐ» Ð¾Ð´ ÐºÐ¾Ñ\80иÑ\81ниÑ\87киоÑ\82 Ð¿Ð¾Ñ\81Ñ\80едник Ð½Ð° Ð\9cедиÑ\98аÐ\92ики Ñ\81оÑ\84Ñ\82веÑ\80оÑ\82.
+'editinginterface' => "'''Ð\9fÑ\80едÑ\83пÑ\80едÑ\83ваÑ\9aе:''' Ð£Ñ\80едÑ\83ваÑ\82е Ñ\81Ñ\82Ñ\80аниÑ\86а ÐºÐ¾Ñ\98а Ðµ Ð´ÐµÐ» Ð¾Ð´ ÐºÐ¾Ñ\80иÑ\81ниÑ\87киоÑ\82 Ð¿Ð¾Ñ\81Ñ\80едник Ð½Ð° Ð¿Ñ\80огÑ\80амоÑ\82 Ð\9cедиÑ\98аÐ\92ики.
 Промените на оваа страница ќе предизвикаат промени во корисничкиот посредник кај другите корисници на ова вики.
 За да додадете или измените превод на сите викија, појдете на [//translatewiki.net/wiki/Main_Page?setlang=mk translatewiki.net] - проектот за локализација на МедијаВики.",
 'sqlhidden' => '(Барањето до SQL е скриено)',
@@ -1682,7 +1692,7 @@ $1",
 'newuserlogpagetext' => 'Ова е дневник на регистрирани корисници.',
 
 # User rights log
-'rightslog' => 'Ð\94невник Ð½Ð° Ð¼ÐµÐ½Ñ\83ваÑ\9aа Ð½Ð° ÐºÐ¾Ñ\80иÑ\81ниÑ\87ки права',
+'rightslog' => 'Ð\94невник Ð½Ð° ÐºÐ¾Ñ\80иÑ\81ниÑ\87киÑ\82е права',
 'rightslogtext' => 'Ова е дневник на промени на кориснички права.',
 
 # Associated actions - in the sentence "You do not have permission to X"
@@ -1869,7 +1879,7 @@ $1",
 'uploaddisabledtext' => 'Подигањето на податотеки е оневозможено.',
 'php-uploaddisabledtext' => 'Подигањето на податотеки е оневозможено во PHP. 
 Проверете го нагодувањето file_uploads.',
-'uploadscripted' => 'Податотеката содржи HTML или скриптен код што може да биде погрешно протолкуван од прелистувач.',
+'uploadscripted' => 'Податотеката содржи HTML-код или сценарио што може погрешно да се протолкува во прелистувачот.',
 'uploadvirus' => 'Оваа податотека содржи вирус! Повеќе подробности: $1',
 'uploadjava' => 'Податотеката е од типот ZIP што содржи податотека со наставка .class за Java.
 Подигањето на податотеки за Java не е дозволено, бидејќи со нив можат да се заобиколуваат безбедносните ограничувања.',
@@ -2163,11 +2173,11 @@ $1',
 'statistics-users-active-desc' => 'Корисници кои имаат извршено некое дејство {{PLURAL:$1|претходниот ден|во претходните $1 дена}}',
 'statistics-mostpopular' => 'Најпосетувани страници',
 
-'disambiguations' => 'Страници што водат до страници за појаснување',
+'disambiguations' => 'Страници што водат до појаснителни страници',
 'disambiguationspage' => 'Template:Појаснување',
-'disambiguations-text' => "Следните страници имаат барем по една врска што води до '''страница за појаснување'''.
-Наместо тоа, може да имаат врска до посоодветната тема.<br />
-Една страница се смета за страница за појаснување ако го користи шаблонот што води од [[MediaWiki:Disambiguationspage]]",
+'disambiguations-text' => "Следните страници имаат барем по една врска што води до '''појаснителна страница'''.
+Наместо тоа, може да имаат врска до посоодветна страница.<br />
+Една страница се смета за појаснителна ако го користи шаблонот што води од [[MediaWiki:Disambiguationspage]]",
 
 'pageswithprop' => 'Страници со својство',
 'pageswithprop-legend' => 'Страници со својство',
@@ -3341,6 +3351,7 @@ $1',
 'minutes' => '{{PLURAL:$1|$1 минута|$1 минути}}',
 'hours' => '{{PLURAL:$1|$1 час|$1 часа}}',
 'days' => '{{PLURAL:$1|$1 ден|$1 дена}}',
+'weeks' => '{{PLURAL:$1|$1 недела|$1 недели}}',
 'months' => '{{PLURAL:$1|$1 месец|$1 месеци}}',
 'years' => '{{PLURAL:$1|$1 година|$1 години}}',
 'ago' => 'пред $1',
@@ -4223,7 +4234,7 @@ $5
 
 # New logging system
 'logentry-delete-delete' => '$1 {{GENDER:$2|ја избриша}} страницата $3',
-'logentry-delete-restore' => '$1 {{GENDER:$2|ја врати}} страницата $3',
+'logentry-delete-restore' => '$1 {{GENDER:$2|Ñ\98а Ð¿Ð¾Ð²Ñ\80аÑ\82и}} Ñ\81Ñ\82Ñ\80аниÑ\86аÑ\82а $3',
 'logentry-delete-event' => '$1 {{GENDER:$2|ја измени}} видливоста на {{PLURAL:$5|настан во дневникот|$5 настани во дневникот}} на $3: $4',
 'logentry-delete-revision' => '$1 {{GENDER:$2|ја измени}} видливоста на {{PLURAL:$5|ревизија|$5 ревизии}} на страницата $3: $4',
 'logentry-delete-event-legacy' => '$1 {{GENDER:$2|ја измени}} видливоста на настаните во дневникот на $3',
@@ -4333,4 +4344,8 @@ $5
 # Image rotation
 'rotate-comment' => 'Сликата е завртена за $1 {{PLURAL:$1|степен|степени}} вдесно',
 
+# Unknown messages
+'hours-ago' => 'пред $1 {{PLURAL:$1|час|часа}}',
+'minutes-ago' => 'пред $1 {{PLURAL:$1|минута|минути}}',
+'seconds-ago' => 'пред $1 {{PLURAL:$1|секунда|секунди}}',
 );
index a4d8ae4..5892961 100644 (file)
@@ -443,6 +443,16 @@ $messages = array(
 'nov' => 'നവം.',
 'dec' => 'ഡിസം.',
 
+'monday-at' => 'തിങ്കളാഴ്ച്ച $1-നു്',
+'tuesday-at' => 'ചൊവ്വാഴ്ച്ച $1-നു്',
+'wednesday-at' => 'ബുധനാഴ്ച്ച $1-നു്',
+'thursday-at' => 'വ്യാഴാഴ്ച്ച $1-നു്',
+'friday-at' => 'വെള്ളിയാഴ്ച്ച $1-നു്',
+'saturday-at' => 'ശനിയാഴ്ച്ച $1-നു്',
+'sunday-at' => 'ഞായറാഴ്ച്ച $1-നു്',
+'today-at' => 'ഇന്ന് $1-നു്',
+'yesterday-at' => 'ഇന്നലെ $1-നു്',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|വർഗ്ഗം|വർഗ്ഗങ്ങൾ}}',
 'category_header' => '"$1" എന്ന വർഗ്ഗത്തിലെ താളുകൾ',
@@ -895,7 +905,7 @@ $2
 താത്കാലിക രഹസ്യവാക്ക്: $2',
 'passwordreset-emailsent' => 'ഒരു രഹസ്യവാക്ക് പുനർസജ്ജീകരണ ഇമെയിൽ അയച്ചിട്ടുണ്ട്.',
 'passwordreset-emailsent-capture' => 'രഹസ്യവാക്ക് പുനർസജ്ജീകരണ ഇമെയിൽ അയച്ചിട്ടുണ്ട്, അത് താഴെക്കൊടുക്കുന്നു.',
-'passwordreset-emailerror-capture' => 'താഴàµ\86à´\95àµ\8dà´\95àµ\8aà´\9fàµ\81à´¤àµ\8dതിരിà´\95àµ\8dà´\95àµ\81à´¨àµ\8dà´¨, à´°à´¹à´¸àµ\8dയവാà´\95àµ\8dà´\95àµ\8d à´ªàµ\81നർസà´\9càµ\8dà´\9càµ\80à´\95à´°à´£ à´\87à´®àµ\86യിൽ à´¸àµ\83à´·àµ\8dà´\9fà´¿à´\95àµ\8dà´\95ാനായàµ\86à´\99àµ\8dà´\95à´¿à´²àµ\81à´\82, à´\89പയàµ\8bà´\95àµ\8dതാവിനàµ\8d à´\85യയàµ\8dà´\95àµ\8dà´\95ാൻ à´\95à´´à´¿à´\9eàµ\8dà´\9eà´¿à´²àµ\8dà´²: $1',
+'passwordreset-emailerror-capture' => 'താഴàµ\86à´\95àµ\8dà´\95àµ\8aà´\9fàµ\81à´¤àµ\8dതിരിà´\95àµ\8dà´\95àµ\81à´¨àµ\8dà´¨, à´°à´¹à´¸àµ\8dയവാà´\95àµ\8dà´\95àµ\8d à´ªàµ\81നർസà´\9càµ\8dà´\9càµ\80à´\95à´°à´£ à´\87à´®àµ\86യിൽ à´¸àµ\83à´·àµ\8dà´\9fà´¿à´\95àµ\8dà´\95ാനായàµ\86à´\99àµ\8dà´\95à´¿à´²àµ\81à´\82, à´\85à´¤àµ\8d {{GENDER:$2|à´\89പയàµ\8bà´\95àµ\8dതാവിനàµ\8d}} à´\85യയàµ\8dà´\95àµ\8dà´\95àµ\81à´¨àµ\8dനതàµ\8d à´ªà´°à´¾à´\9cയപàµ\8dà´ªàµ\86à´\9fàµ\8dà´\9fàµ\81: $1',
 
 # Special:ChangeEmail
 'changeemail' => 'ഇമെയിൽ വിലാസത്തിൽ മാറ്റംവരുത്തുക',
@@ -1382,6 +1392,7 @@ $1",
 'powersearch-togglenone' => 'ഒന്നുംവേണ്ട',
 'search-external' => 'ബാഹ്യ അന്വേഷണം',
 'searchdisabled' => '{{SITENAME}} സം‌രംഭത്തിൽ തിരച്ചിൽ ദുർബലപ്പെടുത്തിയിരിക്കുന്നു. താങ്കൾക്ക് ഗൂഗിൾ ഉപയോഗിച്ച് തത്കാലം തിരച്ചിൽ നടത്താവുന്നതാണ്‌. പക്ഷെ ഗൂഗിളിൽ {{SITENAME}} സം‌രംഭത്തിന്റെ സൂചിക കാലഹരണപ്പെട്ടതായിരിക്കാൻ സാദ്ധ്യതയുണ്ട്.',
+'search-error' => 'തിരയുന്നതിനിടെ ഒരു പിഴവുണ്ടായി: $1',
 
 # Preferences page
 'preferences' => 'ക്രമീകരണങ്ങൾ',
@@ -2735,6 +2746,7 @@ $1',
 'proxyblocksuccess' => 'ചെയ്തു കഴിഞ്ഞു.',
 'sorbsreason' => '{{SITENAME}} ഉപയോഗിക്കുന്ന DNSBL ൽ താങ്കളുടെ ഐ.പി. വിലാസം ഒരു ഓപ്പൺ പ്രോക്സിയായാണു രേഖപ്പെടുത്തിട്ടുള്ളത്.',
 'sorbs_create_account_reason' => '{{SITENAME}} ഉപയോഗിക്കുന്ന DNSBL ൽ താങ്കളുടെ ഐ.പി. വിലാസം ഒരു ഓപ്പൺ പ്രോക്സിയായാണു രേഖപ്പെടുത്തിട്ടുള്ളത്. താങ്കൾക്ക് അംഗത്വമെടുക്കാൻ സാദ്ധ്യമല്ല.',
+'xffblockreason' => 'എക്സ്-ഫോർവേഡഡ്-ഫോർ ഹെഡറിലെ ഒരു ഐ.പി. വിലാസം, താങ്കളുടേതോ താങ്കൾ ഉപയോഗിക്കുന്ന പ്രോക്സി സെർവറിലേതോ ആകാം, തടയപ്പെട്ടിരിക്കുന്നതാണ്. തടയലിന്റെ കാരണം: $1',
 'cant-block-while-blocked' => 'താങ്കൾ തടയപ്പെട്ടിരിക്കുമ്പോൾ മറ്റുപയോക്താക്കളെ തടയാൻ താങ്കൾക്ക് സാധിക്കില്ല.',
 'cant-see-hidden-user' => 'താങ്കൾ തടയാൻ ശ്രമിക്കുന്ന ഉപയോക്താവ് മുമ്പേ തടയപ്പെടുകയും മറയ്ക്കപ്പെടുകയും ചെയ്യപ്പെട്ടതാണ്. താങ്കൾക്ക് ഉപയോക്താവിനെ മറയ്ക്കാനുള്ള അവകാശം ഇല്ലെങ്കിൽ, ഉപയോക്താവിനെതിരെ ഉള്ള തടയൽ കാണാനോ തിരുത്താനോ കഴിയുന്നതല്ല.',
 'ipbblocked' => 'മറ്റുള്ളവരെ തടയാനോ അവരുടെ തടയൽ നീക്കാനോ താങ്കൾക്ക് കഴിയില്ല. കാരണം താങ്കൾ തന്നെ തടയപ്പെട്ടിരിക്കുകയാണ്',
@@ -3225,6 +3237,7 @@ $1',
 'minutes' => '{{PLURAL:$1|ഒരു മിനിറ്റ്|$1 മിനിറ്റ്}}',
 'hours' => '{{PLURAL:$1|ഒരു മണിക്കൂർ|$1 മണിക്കൂർ}}',
 'days' => '{{PLURAL:$1|ഒരു ദിവസം|$1 ദിവസം}}',
+'weeks' => '{{PLURAL:$1|ഒരാഴ്ച്ച|$1 ആഴ്ച്ച}}',
 'months' => '{{PLURAL:$1|ഒരു മാസം|$1 മാസം}}',
 'years' => '{{PLURAL:$1|ഒരു വർഷം|$1 വർഷം}}',
 'ago' => '$1 മുമ്പ്',
@@ -4065,4 +4078,8 @@ $5
 # Image rotation
 'rotate-comment' => 'ചിത്രം പ്രദക്ഷിണദിശയിൽ {{PLURAL:$1|ഒരു ഡിഗ്രി|$1 ഡിഗ്രി}} തിരിച്ചു',
 
+# Unknown messages
+'hours-ago' => '{{PLURAL:$1|ഒരു മണിക്കൂർ|$1 മണിക്കൂർ}} മുൻപ്',
+'minutes-ago' => '{{PLURAL:$1|ഒരു മിനിറ്റ്|$1 മിനിറ്റ്}} മുൻപ്',
+'seconds-ago' => '{{PLURAL:$1|ഒരു സെക്കന്റ്|$1 സെക്കന്റ്}} മുൻപ്',
 );
index 3b86d67..287001f 100644 (file)
@@ -757,7 +757,7 @@ $2
 Kata laluan sementara: $2',
 'passwordreset-emailsent' => 'E-mel set semula kata laluan telah dihantar.',
 'passwordreset-emailsent-capture' => 'E-mel set semula kata laluan telah dihantar, seperti yang dipaparkan di bawah.',
-'passwordreset-emailerror-capture' => 'E-mel set semula kata laluan telah dihasilkan, seperti yang dipaparkan di bawah, tetapi tidak berjaya dihantar kepada pengguna: $1',
+'passwordreset-emailerror-capture' => 'E-mel set semula kata laluan telah dihasilkan, seperti yang dipaparkan di bawah, tetapi tidak berjaya dihantar kepada {{GENDER:$2|pengguna}} berkenaan: $1',
 
 # Special:ChangeEmail
 'changeemail' => 'Tukar alamat e-mel',
index ae6c6b5..90ca89a 100644 (file)
@@ -886,7 +886,7 @@ passord.',
 Midlertidig passord: $2',
 'passwordreset-emailsent' => 'En passordtilbakestillingslenke har blitt sendt per e-post.',
 'passwordreset-emailsent-capture' => 'Passordtilbakestillingseposten vist under har blitt sendt ut.',
-'passwordreset-emailerror-capture' => 'En passordtilbakestillingsepost ble laget, men det lyktes ikke å sende denne til brukeren: $1',
+'passwordreset-emailerror-capture' => 'En passordtilbakestillingsepost ble laget, men det lyktes ikke å sende denne til {{GENDER:$2|brukeren}}: $1',
 
 # Special:ChangeEmail
 'changeemail' => 'Endre e-postadresse',
index 4768673..6581533 100644 (file)
@@ -354,7 +354,7 @@ $messages = array(
 
 'underline-always' => 'Altied',
 'underline-never' => 'Nooit',
-'underline-default' => 'Standardinstelling',
+'underline-default' => 'Standard in joew vormgeving of webkieker',
 
 # Font style option in Special:Preferences
 'editfont-style' => 'Lettertype veur de tekste t bewarkingsveld:',
@@ -415,6 +415,8 @@ $messages = array(
 'nov' => 'nov',
 'dec' => 'des',
 
+'today-at' => '$1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategorie|Kategorieën}}',
 'category_header' => 'Artikels in kategorie $1',
@@ -439,7 +441,8 @@ $messages = array(
 'newwindow' => '(niej vienster)',
 'cancel' => 'Aofbreken',
 'moredotdotdot' => 'Meer...',
-'mypage' => 'Mien gebrukerszied',
+'morenotlisted' => 'Meer niet in de lieste...',
+'mypage' => 'Gebrukerszied',
 'mytalk' => 'Mien overleg',
 'anontalk' => 'Overlegzied veur dit IP-adres',
 'navigation' => 'Navigasie',
@@ -462,7 +465,7 @@ $messages = array(
 'vector-action-protect' => 'Beveiligen',
 'vector-action-undelete' => 'Weerummeplaotsen',
 'vector-action-unprotect' => 'Beveiliging wiezigen',
-'vector-simplesearch-preference' => 'Verbeterde zeuksuggesties anzetten (allinnig mit Vector-vormgeving)',
+'vector-simplesearch-preference' => 'Vereenvoudigd zeuken anzetten (allinnig mit Vector-vormgeving)',
 'vector-view-create' => 'Anmaken',
 'vector-view-edit' => 'Bewarken',
 'vector-view-history' => 'Geschiedenisse bekieken',
@@ -472,6 +475,7 @@ $messages = array(
 'namespaces' => 'Naamruumtes',
 'variants' => 'Variaanten',
 
+'navigation-heading' => 'Navigasiemenu',
 'errorpagetitle' => 'Foutmelding',
 'returnto' => 'Weerumme naor $1.',
 'tagline' => 'Van {{SITENAME}}',
@@ -679,7 +683,7 @@ Zeukopdrachte: $2',
 'viewsource-title' => 'Bron bekieken van $1',
 'actionthrottled' => 'Haandeling tegenehöllen',
 'actionthrottledtext' => "As maotregel tegen t plaotsen van ongewunste verwiezingen, is t antal keren da'j disse haandeling in n korte tied uutvoeren kunnen beteund. Je hebben de limiet overschrejen. Probeer t over n antal minuten weer.",
-'protectedpagetext' => 'Disse zied is beveiligd um bewarkingen te veurkoemen.',
+'protectedpagetext' => 'Disse zied is beveiligd. Bewarken of aandere haandelingen bin niet meugelik.',
 'viewsourcetext' => 'Je kunnen de brontekste van disse zied bewarken en bekieken:',
 'viewyourtext' => "Je kunnen '''joew bewarkingen''' an de brontekste van disse zied bekieken en kopiëren:",
 'protectedinterface' => "Op disse zied steet tekste die gebruukt wörden veur systeemteksten van disse wiki. Allinnig beheerders kunnen disse zied bewarken.
@@ -712,10 +716,16 @@ De beheerder gaf hierveur de volgende reden: "$3".',
 
 Je kunnen {{SITENAME}} noen anoniem gebruken of je eigen <span class='plainlinks'>[$1 opniej anmelden]</span> onder disse of n aandere gebrukersnaam.
 t Kan ween dat der wat ziejen bin die weeregeven wörden asof je an-emeld bin totda'j t tussengeheugen van joew webkieker leegmaken.",
+'welcomeuser' => 'Welkom, $1!',
 'yourname' => 'Gebrukersnaam',
+'userlogin-yourname' => 'Gebrukersnaam',
+'userlogin-yourname-ph' => 'Geef joew gebrukersnaam op',
 'yourpassword' => 'Wachtwoord',
+'userlogin-yourpassword' => 'Wachtwoord',
+'userlogin-yourpassword-ph' => 'Geef joew wachtwoord op',
 'yourpasswordagain' => 'Opniej invoeren',
 'remembermypassword' => 'Vanzelf anmelden (hooguut $1 {{PLURAL:$1|dag|dagen}})',
+'userlogin-remembermypassword' => 'Vanzelf anmelden',
 'securelogin-stick-https' => "Verbunnen blieven via HTTPS naoda'j an-emeld bin",
 'yourdomainname' => 'Joew domein',
 'password-change-forbidden' => 'Je kunnen joew wachtwoord niet wiezigen op disse wiki.',
@@ -728,13 +738,15 @@ t Kan ween dat der wat ziejen bin die weeregeven wörden asof je an-emeld bin to
 'logout' => 'Aofmelden',
 'userlogout' => 'Aofmelden',
 'notloggedin' => 'Niet an-emeld',
+'userlogin-noaccount' => "He'j nog gien gebrukersnaam?",
+'userlogin-joinproject' => 'Over {{SITENAME}}',
 'nologin' => "He'j nog gien gebrukersnaam? '''$1'''.",
 'nologinlink' => 'Maak n gebrukersprofiel an',
 'createaccount' => 'Niej gebrukersprofiel anmaken',
 'gotaccount' => "Stao'j al in-eschreven? '''$1'''.",
 'gotaccountlink' => 'Anmelden',
 'userlogin-resetlink' => "Bi'j de anmeldgegevens kwiet?",
-'createaccountmail' => 'per netpost',
+'createaccountmail' => 'Gebruuk n tiejelik wachtwoord dat joe netzelde is en stuur t naor t netpostadres dat hieronder steet',
 'createaccountreason' => 'Reden:',
 'badretype' => "De wachtwoorden die'j in-etikt hebben bin niet liek alleens.",
 'userexists' => 'Disse gebrukersnaam is al gebruuk.
@@ -1072,6 +1084,12 @@ t Besteet al.',
 'editwarning-warning' => "A'j disse zied aofsluten dan kan t ween dat der wieziging die'j emaakt hebben kwiet raken.
 A'j an-emeld bin, dan ku'j disse waorschuwing uutzetten in t tabblad \"Bewarken\" in joew veurkeuren.",
 
+# Content models
+'content-model-wikitext' => 'wikitekste',
+'content-model-text' => 'tekste zonder opmaak',
+'content-model-javascript' => 'JavaScript',
+'content-model-css' => 'CSS',
+
 # Parser/template warnings
 'expensive-parserfunction-warning' => 'Waorschuwing: disse zied gebruukt te veule kostbaore parserfunksies.
 
@@ -1321,7 +1339,7 @@ Waorschienlik ku'j der meer gegevens over vienen in t [{{fullurl:{{#Special:Log}
 'search-interwiki-default' => '$1 resultaoten:',
 'search-interwiki-more' => '(meer)',
 'search-relatedarticle' => 'Verwaant',
-'mwsuggest-disable' => 'Anbevelingen via AJAX uutschakelen',
+'mwsuggest-disable' => 'Zeuksuggesties uutzetten',
 'searcheverything-enable' => 'In alle naamruumten zeuken',
 'searchrelated' => 'verwaant',
 'searchall' => 'alles',
@@ -1419,8 +1437,8 @@ Disse haandeling kan niet ongedaonemaakt wörden.',
 'prefs-emailconfirm-label' => 'Netpostbevestiging:',
 'prefs-textboxsize' => 'Aofmetingen bewarkingsscharm',
 'youremail' => 'Netpostadres (niet verplicht) *',
-'username' => 'Gebrukersnaam:',
-'uid' => 'Gebrukersnummer:',
+'username' => '{{GENDER:$1|Gebrukersnaam}}:',
+'uid' => '{{GENDER:$1|Gebrukersnummer}}:',
 'prefs-memberingroups' => 'Lid van {{PLURAL:$1|groep|groepen}}:',
 'prefs-registration' => 'Registrasiedaotum:',
 'yourrealname' => 'Echte naam (niet verplicht)',
@@ -2035,6 +2053,8 @@ Vergeet niet de verwiezingen nao te kieken veurda\'j de mal vortdoon.',
 Feitelik mutten ze rechtstreeks verwiezen naor t juuste onderwarp.<br />
 Ziejen wörden ezien as n deurverwieszied, as de mal gebruukt wörden die vermeld steet op [[MediaWiki:Disambiguationspage]].",
 
+'pageswithprop-submit' => 'Zeuk',
+
 'doubleredirects' => 'Dubbele deurverwiezingen',
 'doubleredirectstext' => 'Op disse lieste staon alle ziejen die deurverwiezen naor aandere deurverwiezingen.
 Op elke regel steet de eerste en de tweede deurverwiezing, daorachter steet de doelzied van de tweede deurverwiezing.
@@ -2509,7 +2529,7 @@ $1',
 'blanknamespace' => '(Heufdnaamruumte)',
 
 # Contributions
-'contributions' => 'Biedragen van disse gebruker',
+'contributions' => '{{GENDER:$1|Biedragen van disse gebruker}}',
 'contributions-title' => 'Biedragen van $1',
 'mycontris' => 'Mien biedragen',
 'contribsub2' => 'Veur $1 ($2)',
@@ -3035,6 +3055,11 @@ Meestentieds kömp dit deur n uutgaonde verwiezing die op de zwarte lieste steet
 'pageinfo-magic-words' => '{{PLURAL:$1|Magies woord|Magiese woorden}} ($1)',
 'pageinfo-hidden-categories' => 'Verbörgen {{PLURAL:$1|kategorie|kategorieën}} ($1)',
 'pageinfo-templates' => '{{PLURAL:$1|Gebruukten mal|Gebruukten mallen}} ($1)',
+'pageinfo-toolboxlink' => 'Informasie over disse zied',
+'pageinfo-redirectsto' => 'Verwis deur naor',
+'pageinfo-redirectsto-info' => 'informasie',
+'pageinfo-contentpage' => 'Eteld as zied mit inhoud',
+'pageinfo-contentpage-yes' => 'Ja',
 
 # Skin names
 'skinname-cologneblue' => 'Keuls blauw',
@@ -3114,6 +3139,7 @@ $1',
 'hours' => '{{PLURAL:$1|$1 ure|$1 uren}}',
 'days' => '{{PLURAL:$1|$1 dag|$1 dagen}}',
 'ago' => '$1 eleen',
+'just-now' => 'onderlest',
 
 # Bad image list
 'bad_image_list' => 'De opmaak is as volgt:
@@ -3825,6 +3851,8 @@ Aandere bestaandstypen wörden gelieke in t mit t MIME-type verbunnen programma
 'htmlform-submit' => 'Opslaon',
 'htmlform-reset' => 'Wiezigingen ongedaonmaken',
 'htmlform-selectorother-other' => 'Aanders',
+'htmlform-no' => 'Nee',
+'htmlform-yes' => 'Ja',
 
 # SQLite database support
 'sqlite-has-fts' => 'Versie $1 mit ondersteuning veur "full-text" zeuken',
index d0c1f30..20fda89 100644 (file)
@@ -463,6 +463,16 @@ $messages = array(
 'nov' => 'nov',
 'dec' => 'dec',
 
+'monday-at' => 'Maandag om $1',
+'tuesday-at' => 'Dinsdag om $1',
+'wednesday-at' => 'Woensdag om $1',
+'thursday-at' => 'Donderdag om $1',
+'friday-at' => 'Vrijdag om $1',
+'saturday-at' => 'Zaterdag om $1',
+'sunday-at' => 'Zondag om $1',
+'today-at' => '$1',
+'yesterday-at' => 'Gisteren om $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Categorie|Categorieën}}',
 'category_header' => 'Pagina’s in categorie "$1"',
@@ -4222,4 +4232,8 @@ Anders kunt u ook het eenvoudige formulier hieronder gebruiken. Uw reactie wordt
 # Image rotation
 'rotate-comment' => 'Afbeelding gedraaid, $1 {{PLURAL:$1|graad|graden}} met de klok mee',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|uur}} geleden',
+'minutes-ago' => '$1 {{PLURAL:$1|minuut|minuten}} geleden',
+'seconds-ago' => '$1 {{PLURAL:$1|seconde|seconden}} geleden',
 );
index ccc71a0..0e93dbf 100644 (file)
@@ -4019,4 +4019,8 @@ MediaWiki ଉପଯୋଗୀ ହେବା ଲକ୍ଷରେ ବଣ୍ଟାଯ
 'duration-centuries' => '$1 {{PLURAL:$1|century|centuries}}',
 'duration-millennia' => '$1 {{PLURAL:$1|millennium|millennia}}',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|ଘଣ୍ଟା}} ଆଗରୁ',
+'minutes-ago' => '$1 {{PLURAL:$1|ମିନିଟ|ମିନିଟ}} ଆଗରୁ',
+'seconds-ago' => '$1 {{PLURAL:$1|ସେକେଣ୍ଡ|ସେକେଣ୍ଡ}} ଆଗରୁ',
 );
index 2395626..6cbbb03 100644 (file)
@@ -198,8 +198,8 @@ $messages = array(
 'tog-usenewrc' => 'ਹਾਲ ’ਚ ਹੋਏ ਬਦਲਾਵ ਅਤੇ ਧਿਆਨਸੂਚੀ ਵਿੱਚ ਪੰਨੇ ਮੁਤਾਬਕ ਬਦਲਾਵ ਦੇ ਗਰੁੱਪ ਬਣਾਓ (ਜਾਵਾਸਕ੍ਰਿਪਟ ਦੀ ਜਰੂਰਤ ਹੈ)',
 'tog-numberheadings' => 'ਆਟੋ-ਨੰਬਰ ਹੈਡਿੰਗ',
 'tog-showtoolbar' => 'ਸੋਧ ਟੂਲਬਾਰ ਵੇਖੋ (JavaScript ਚਾਹੀਦੀ ਹੈ)',
-'tog-editondblclick' => 'ਦà©\82ਹਰà©\87 à¨\95ਲਿੱà¨\95 â\80\99ਤà©\87 à¨ªà©°à¨¨à©\87 à¨¨à©\82à©° à¨¸à©°à¨ªà¨¾à¨¦à¨¤ à¨\95ਰà©\8b (à¨\9cਾਵਾਸà¨\95à©\8dਰਿਪà¨\9f à¨¦à©\80 à¨\9cਰà©\82ਰਤ ਹੈ)',
-'tog-editsection' => '[ਸੰਪਾਦਨ] à¨\95à©\9cà©\80à¨\86à¨\82 à¨¦à©\81à¨\86ਰਾ à¨\85ਨà©\81ਭਾà¨\97 à¨¸à©°à¨ªà¨¾à¨¦à¨¨ à¨¸à¨®à¨°à©±à¨¥à¨¾à¨µà¨¾à¨¨ à¨\95ਰà©\8b',
+'tog-editondblclick' => 'ਦà©\8b à¨µà¨¾à¨° à¨\95ਲਿੱà¨\95 à¨\95ਰਨ à¨¨à¨¾à¨² à¨¸à¨«à¨¼à©\87 à¨¸à©\8bਧà©\8b (à¨\9cਾਵਾਸà¨\95à©\8dਰਿਪà¨\9f à¨\9aਾਹà©\80ਦà©\80 ਹੈ)',
+'tog-editsection' => '[ਸà©\8bਧ] à¨²à¨¿à©°à¨\95 à¨°à¨¾à¨¹à©\80à¨\82 à¨­à¨¾à¨\97 à¨¸à©\8bਧ à¨\95ਰਨਾ à¨\9aਾਲà©\82',
 'tog-editsectiononrightclick' => 'ਭਾਗ ਸਿਰਲੇਖਾਂ ਤੇ ਸੱਜੀ ਕਲਿੱਕ ਦੁਆਰਾ ਸੋਧ ਯੋਗ ਕਰੋ (ਜਾਵਾ ਸਕ੍ਰਿਪਟ ਲੋੜੀਂਦੀ ਹੈ)',
 'tog-showtoc' => 'ਤਤਕਰਾ ਵੇਖਾਓ (3 ਤੋਂ ਵੱਧ ਸਿਰਲੇਖਾਂ ਵਾਲੇ ਪੰਨਿਆਂ ਲਈ)',
 'tog-rememberpassword' => 'ਇਸ ਬਰਾਊਜ਼ਰ ਉੱਤੇ ਮੇਰਾ ਲਾਗਇਨ ਯਾਦ ਰੱਖੋ ($1 {{PLURAL:$1|ਦਿਨ|ਦਿਨਾਂ}} ਲਈ ਵੱਧ ਤੋਂ ਵੱਧ)',
@@ -345,8 +345,8 @@ $messages = array(
 'vector-action-unprotect' => 'ਸੁਰੱਖਿਆ ਬਦਲੋ',
 'vector-simplesearch-preference' => 'ਸਧਾਰਨ ਖੋਜ ਸਲਾਹ ਪੱਟੀ ਯੋਗ ਕਰੋ (ਸਿਰਫ਼ ਵਿਕਟਰ ਸਕਿੰਨ ਵਿਚ)',
 'vector-view-create' => 'ਬਣਾਓ',
-'vector-view-edit' => 'ਸੰਪਾਦਨ',
-'vector-view-history' => 'à¨\87ਤਿਹਾਸ ਵੇਖੋ',
+'vector-view-edit' => 'ਸà©\8bਧ',
+'vector-view-history' => 'à¨\85ਤà©\80ਤ ਵੇਖੋ',
 'vector-view-view' => 'ਪੜ੍ਹੋ',
 'vector-view-viewsource' => 'ਸਰੋਤ ਵੇਖੋ',
 'actions' => 'ਕਾਰਵਾਈਆਂ',
@@ -362,14 +362,14 @@ $messages = array(
 'searchbutton' => 'ਖੋਜ',
 'go' => 'ਜਾਓ',
 'searcharticle' => 'ਜਾਓ',
-'history' => 'ਪੰਨà©\87 à¨¦à¨¾ à¨\87ਤਿਹਾਸ',
-'history_short' => 'à¨\87ਤਿਹਾਸ',
+'history' => 'ਸਫ਼ਾ à¨\85ਤà©\80ਤ',
+'history_short' => 'à¨\85ਤà©\80ਤ',
 'updatedmarker' => 'ਮੇਰੀ ਆਖਰੀ ਫੇਰੀ ਤੋਂ ਬਾਅਦ ਦੇ ਅੱਪਡੇਟ',
 'printableversion' => 'ਛਪਣਯੋਗ ਵਰਜਨ',
 'permalink' => 'ਪੱਕਾ ਲਿੰਕ',
 'print' => 'ਛਾਪੋ',
 'view' => 'ਵੇਖੋ',
-'edit' => 'ਸੰਪਾਦਨ',
+'edit' => 'ਸà©\8bਧ',
 'create' => 'ਬਣਾਓ',
 'editthispage' => 'ਇਹ ਸਫ਼ਾ ਸੋਧੋ',
 'create-this-page' => 'ਇਹ ਸਫ਼ਾ ਬਣਾਓ',
@@ -403,7 +403,7 @@ $messages = array(
 'otherlanguages' => 'ਹੋਰ ਭਾਸ਼ਾਵਾਂ ਵਿੱਚ',
 'redirectedfrom' => '($1 ਤੋਂ ਰੀਡਿਰੈਕਟ)',
 'redirectpagesub' => 'ਰੀਡਿਰੈਕਟ ਸਫ਼ਾ',
-'lastmodifiedat' => 'à¨\87ਸ à¨ªà©°à¨¨à¨¾ à¨¦à¨¾ à¨ªà¨¿à©±à¨\9bਲਾ à¨¬à¨¦à¨²à¨¾à¨\85  $1 à¨¨à©\82à©°  $2 à¨µà¨\9cà©\87 à¨¹à©\8bà¨\87à¨\86 à¨¸à©\80।',
+'lastmodifiedat' => 'à¨\87ਹ à¨¸à¨«à¨¼à©\87 à¨µà¨¿à©±à¨\9a à¨\86à¨\96ਰà©\80 à¨¸à©\8bਧ  $1 à¨¨à©\82à©°  $2 à¨µà¨\9cà©\87 à¨¹à©\8bà¨\88।',
 'viewcount' => 'ਇਹ ਸਫ਼ਾ {{PLURAL:$1|ਇੱਕ ਵਾਰ|$1 ਵਾਰ}} ਵੇਖਿਆ ਗਿਆ।',
 'protectedpage' => 'ਸੁਰੱਖਿਅਤ ਪੇਜ',
 'jumpto' => 'ਇਸ ’ਤੇ ਜਾਓ:',
@@ -432,7 +432,7 @@ $1',
 'mainpage' => 'ਮੁੱਖ ਸਫ਼ਾ',
 'mainpage-description' => 'ਮੁੱਖ ਸਫ਼ਾ',
 'policy-url' => 'Project:ਨੀਤੀ',
-'portal' => 'ਸਮਾà¨\9c à¨®à©\81ੱà¨\96 à¨ªà©°à¨¨à¨¾',
+'portal' => 'ਸਮਾà¨\9c à¨¸à©±à¨¥',
 'portal-url' => 'Project:ਸਮਾਜ ਸੱਥ',
 'privacy' => 'ਪਰਾਈਵੇਸੀ ਨੀਤੀ',
 'privacypage' => 'Project:ਪਰਾਈਵੇਸੀ ਨੀਤੀ',
@@ -1569,7 +1569,7 @@ to upload files.',
 'newpages-username' => 'ਯੂਜ਼ਰ-ਨਾਂ:',
 'ancientpages' => 'ਸਭ ਤੋਂ ਪੁਰਾਣੇ ਪੇਜ',
 'move' => 'ਸਥਾਨਾਂਤਰਨ',
-'movethispage' => 'à¨\87ਹ à¨ªà©\87à¨\9c ਭੇਜੋ',
+'movethispage' => 'à¨\87ਹ à¨¸à¨«à¨¼à¨¾ ਭੇਜੋ',
 'unusedcategoriestext' => 'ਇਹ ਕੈਟੇਗਰੀ ਸਫ਼ੇ ਮੌਜੂਦ ਹਨ ਹਾਲਾਂਕਿ ਕਿਸੇ ਵੀ ਸਫ਼ੇ ਜਾਂ ਕੈਟੇਗਰੀ ਨੇ ਇਹਨਾਂ ਦੀ ਵਰਤੋਂ ਨਹੀਂ ਕੀਤੀ।',
 'notargettitle' => 'ਟਾਰਗੇਟ ਨਹੀਂ',
 'pager-newer-n' => '{{PLURAL:$1|1 ਨਵਾਂ|$1 ਨਵੇਂ}}',
@@ -1673,7 +1673,7 @@ to upload files.',
 
 # Watchlist
 'watchlist' => 'ਨਿਗਰਾਨ-ਸੂਚੀ',
-'mywatchlist' => 'ਧਿà¨\86ਨਸੂਚੀ',
+'mywatchlist' => 'ਨਿà¨\97ਰਾਨ-ਸੂਚੀ',
 'watchlistfor2' => '$1 $2 ਲਈ',
 'nowatchlist' => 'ਤੁਹਾਡੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਵਿਚ ਕੋਈ ਚੀਜ਼ ਨਹੀਂ ਹੈ।',
 'watchlistanontext' => 'ਆਪਣੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਵਿਚਲੀਆਂ ਚੀਜ਼ਾਂ ਵੇਖਣ ਜਾਂ ਸੋਧਣ ਲਈ ਮਿਹਰਬਾਨੀ ਕਰਕੇ $1।',
@@ -1696,7 +1696,7 @@ to upload files.',
 'wlnote' => "$3, $4 ਮੁਤਾਬਕ ਆਖ਼ਰੀ {{PLURAL:$2|ਘੰਟੇ|'''$2''' ਘੰਟਿਆਂ}} ਵਿਚ {{PLURAL:
 $1|ਤਬਦੀਲੀ ਹੋਈ|'''$1''' ਤਬਦੀਲੀਆਂ ਹੋਈਆਂ}}, ਹੇਠਾਂ ਵੇਖੋ।",
 'wlshowlast' => 'ਪਿੱਛਲੇ $1 ਘੰਟੇ $2 ਦਿਨ $3 ਵੇਖੋ',
-'watchlist-options' => 'ਧਿà¨\86ਨਸà©\82à¨\9aà©\80 à¨µà¨¿à¨\95ਲਪ',
+'watchlist-options' => 'ਨਿà¨\97ਰਾਨ-ਸà©\82à¨\9aà©\80 à¨\9aà©\8bਣਾà¨\82',
 
 # Displayed when you click the "watch" button and it is in the process of watching
 'watching' => 'ਨਿਗ੍ਹਾ (ਵਾਚ) ਰੱਖੀ ਜਾ ਰਹੀ ਹੈ...',
index 60a8a21..06d0fe1 100644 (file)
@@ -398,9 +398,6 @@ Erklärung: '''({{int:cur}})''' = Unnerschied zu jetzert,
 'powersearch-field' => 'Suche noch',
 'powersearch-togglenone' => 'Kään',
 
-# Quickbar
-'qbsettings-none' => 'Kään',
-
 # Preferences page
 'preferences' => 'Optione',
 'mypreferences' => 'Oistellunge',
@@ -551,7 +548,7 @@ Saide uff [[Special:Watchlist|Dainer Beowachdungslischt]] sin '''fett'''.",
 # Special:ListGroupRights
 'listgrouprights-members' => '(Midgliederlischd)',
 
-# E-mail user
+# Email user
 'emailuser' => 'E-Mail on de Benutzer',
 'emailsend' => 'Abschigge',
 
@@ -798,7 +795,7 @@ Du kannschd e Grund in dr Zammfassung aagewwe",
 'file-info-size' => '$1 × $2 Pixels, Dateigreß: $3, MIME-Type: $4',
 'file-nohires' => 'Ke hechere Ufflesung verfiechbar.',
 'svg-long-desc' => 'SVG-Datei, Basisgreß $1 × $2 Pixels, Dateigreß: $3',
-'show-big-image' => 'Gsamte Ergebnis',
+'show-big-image' => 'Volli Uflesung',
 
 # Special:NewFiles
 'showhidebots' => '(Bots $1)',
index fdb3698..24929c3 100644 (file)
@@ -409,6 +409,16 @@ $messages = array(
 'nov' => 'lis',
 'dec' => 'gru',
 
+'monday-at' => 'poniedziałek, $1',
+'tuesday-at' => 'wtorek, $1',
+'wednesday-at' => 'środa, $1',
+'thursday-at' => 'czwartek, $1',
+'friday-at' => 'piątek, $1',
+'saturday-at' => 'sobota, $1',
+'sunday-at' => 'niedziela, $1',
+'today-at' => '$1',
+'yesterday-at' => 'wczoraj, $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategoria|Kategorie}}',
 'category_header' => 'Strony w kategorii „$1”',
@@ -981,7 +991,7 @@ Jednak adres IP może być współdzielony przez wielu użytkowników.
 Jeśli jesteś anonimowym użytkownikiem i uważasz, że zamieszczone tu komentarze nie są skierowane do Ciebie, [[Special:UserLogin/signup|utwórz konto]] lub [[Special:UserLogin|zaloguj się]] – dzięki temu unikniesz w przyszłości podobnych nieporozumień.''",
 'noarticletext' => 'Brak strony o tym tytule.
 Możesz [[Special:Search/{{PAGENAME}}|poszukać „{{PAGENAME}}” na innych stronach]],
-<span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} przeszukać log] lub [{{fullurl:{{FULLPAGENAME}}|action=edit}} utworzyć tę stronę]</span>.',
+<span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} przeszukać rejestr] lub [{{fullurl:{{FULLPAGENAME}}|action=edit}} utworzyć tę stronę]</span>.',
 'noarticletext-nopermission' => 'Ta strona nie posiada jeszcze zawartości.
 Możesz [[Special:Search/{{PAGENAME}}|wyszukać ten tytuł]] w treści innych stron
 lub <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} przeszukać powiązane dzienniki]</span>, ale nie masz uprawnień do utworzenia tej strony',
@@ -3246,6 +3256,7 @@ Jeśli go otworzysz, możesz zarazić swój system.",
 'minutes' => '{{PLURAL:$1|$1 minuta|$1 minuty|$1 minut}}',
 'hours' => '{{PLURAL:$1|$1 godzina|$1 godziny|$1 godzin}}',
 'days' => '{{PLURAL:$1|$1 dzień|$1 dni}}',
+'weeks' => '{{PLURAL:$1|$1 tydzień|$1 tygodnie|$1 tygodni}}',
 'months' => '{{PLURAL:$1|$1 miesiąc|$1 miesiące|$1 miesięcy}}',
 'years' => '{{PLURAL:$1|$1 rok|$1 lata|$1 lat}}',
 'ago' => '$1 temu',
@@ -4142,4 +4153,8 @@ W przeciwnym wypadku można użyć prostego formularza poniżej. Komentarz zosta
 # Image rotation
 'rotate-comment' => 'Obraz został odwrócony o $1 {{PLURAL:$1|stopień|stopnie|stopni}} (w kierunku zgodnym z ruchem wskazówek zegara)',
 
+# Unknown messages
+'hours-ago' => '{{PLURAL:$1|przed godziną|$1 godziny temu|$1 godzin temu}}',
+'minutes-ago' => '{{PLURAL:$1|przed minutą|$1 minuty temu|$1 minut temu}}',
+'seconds-ago' => '{{PLURAL:$1|przed sekundą|$1 sekundy temu|$1 sekund temu}}',
 );
index 48d7955..13696ef 100644 (file)
@@ -89,21 +89,21 @@ $messages = array(
 
 'underline-always' => 'Sempe',
 'underline-never' => 'Mai',
-'underline-default' => 'Stàndard dël navigatoro dël tema',
+'underline-default' => 'Stàndard dël navigator o dël tema',
 
 # Font style option in Special:Preferences
-'editfont-style' => "Stil dël font ëd l'àrea ëd modìfica:",
+'editfont-style' => "Stil dij caràter ëd l'àrea ëd modìfica:",
 'editfont-default' => 'Stàndard dël navigator',
-'editfont-monospace' => 'Font mono-spassià',
-'editfont-sansserif' => 'Font sans-serif',
-'editfont-serif' => 'Font serif',
+'editfont-monospace' => 'Caràter mono-spassià',
+'editfont-sansserif' => 'Caràter sensa piòte',
+'editfont-serif' => 'Caràter con piòte',
 
 # Dates
-'sunday' => 'Dumìnica',
-'monday' => 'Lùn-es',
-'tuesday' => 'Màrtes',
-'wednesday' => 'Merco',
-'thursday' => 'Giòbia',
+'sunday' => 'dumìnica',
+'monday' => 'lùn-es',
+'tuesday' => 'màrtes',
+'wednesday' => 'merco',
+'thursday' => 'giòbia',
 'friday' => 'Vënner',
 'saturday' => 'Saba',
 'sun' => 'Dum',
index 022b139..4ef67e5 100644 (file)
@@ -309,6 +309,16 @@ This option means "underline links as in your user skin or your browser", there
 'nov' => 'Abbreviation of November, the eleventh month of the Gregorian calendar',
 'dec' => 'Abbreviation of December, the twelfth month of the Gregorian calendar',
 
+'monday-at' => 'Phrase for indicating that something occurred at a particular time on the most recent Monday. $1 is the time.',
+'tuesday-at' => 'Phrase for indicating that something occurred at a particular time on the most recent Tuesday. $1 is the time.',
+'wednesday-at' => 'Phrase for indicating that something occurred at a particular time on the most recent Wednesday. $1 is the time.',
+'thursday-at' => 'Phrase for indicating that something occurred at a particular time on the most recent Thursday. $1 is the time.',
+'friday-at' => 'Phrase for indicating that something occurred at a particular time on the most recent Friday. $1 is the time.',
+'saturday-at' => 'Phrase for indicating that something occurred at a particular time on the most recent Saturday. $1 is the time.',
+'sunday-at' => 'Phrase for indicating that something occurred at a particular time on the most recent Sunday. $1 is the time.',
+'today-at' => 'Phrase for indicating that something occurred at a particular time today. $1 is the time.',
+'yesterday-at' => 'Phrase for indicating that something occurred at a particular time yesterday. $1 is the time.',
+
 # Categories related messages
 'pagecategories' => 'Used in the categories section of pages. Is followed by a colon and a list of categories.',
 'category_header' => 'In category description page',
@@ -1045,13 +1055,18 @@ In user preferences.
 'userlogin-yourname' => 'In new vertical user login & create account forms, label for username field.
 {{Identical|Username}}',
 'userlogin-yourname-ph' => 'Placeholder text in new userlogin/create account form field.',
+'createacct-helpusername-url' => 'The URL of a page providing username guidance for the wiki.',
+'createacct-helpusername-link' => 'Message in new create account form providing guidance for username.',
 'yourpassword' => 'In user preferences
 
 {{Identical|Password}}',
 'userlogin-yourpassword' => 'In new vertical user login & create account forms, label for password field.
 {{Identical|Password}}',
 'userlogin-yourpassword-ph' => 'Placeholder text in new userlogin form for password field.',
+'createacct-yourpassword-ph' => 'Placeholder text in new create account form for password field.',
 'yourpasswordagain' => 'In user preferences',
+'createacct-yourpasswordagain' => 'In new create account form, label for field to re-enter password',
+'createacct-yourpasswordagain-ph' => 'Placeholder text in new create account form for re-enter password field.',
 'remembermypassword' => 'A check box in [[Special:UserLogin]]
 
 {{Identical|Remember my login on this computer}}',
@@ -1119,12 +1134,33 @@ Wikitext linking to login help.
 
 See also:
 * {{msg-mw|Helplogin-url}}',
+'createacct-join' => 'Subheading of vertical-layout create account form encouraging user to join the wiki.',
+'createacct-emailrequired' => 'Label in vertical-layout create account form for email field when it is required.',
+'createacct-emailoptional' => 'Label in vertical-layout create account form for email field when it is optional.',
+'createacct-email-ph' => 'Placeholder in vertical-layout create account form for email field.',
 'createaccountmail' => 'Button text for creating a new account and sending the new password to the specified e-mail address directly, as used on [[Special:UserLogin/signup]] if creating accounts by e-mail is allowed.',
+'createacct-realname' => 'In vertical-layout create account form, label for field to enter optional real name.',
 'createaccountreason' => '{{Identical|Reason}}',
+'createacct-reason' => 'In vertical-layout create account form, label for field to enter reason to create an account when already logged-in.',
+'createacct-captcha' => 'Label in vertical-layout create account form for CAPTCHA input field when repositioned by JavaScript.',
+'createacct-captcha-help-url' => 'The URL of a page providing CAPTCHA assistance for the wiki.',
+'createacct-imgcaptcha-help' => 'Help text in vertical-layout create account form for image CAPTCHA input field when repositioned by JavaScript.',
+'createacct-imgcaptcha-ph' => 'Placehodler text in vertical-layout create account form for image CAPTCHA input field when repositioned by JavaScript.',
+'createacct-benefit-heading' => 'In vertical-layout create account form, the heading for the section describing the benefits of creating an account.',
+'createacct-benefit-icon1' => 'In vertical-layout create account form, the CSS style for the div next to the first benefit. If you replace this you will need probably need to adjust CSS.',
+'createacct-benefit-head1' => 'In vertical-layout create account form, the text in the heading for the first benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.',
+'createacct-benefit-body1' => 'In vertical-layout create account form, the text for the first benefit.',
+'createacct-benefit-icon2' => 'In vertical-layout create account form, the CSS style for the div next to the second benefit. If you replace this you will need probably need to adjust CSS.',
+'createacct-benefit-head2' => 'In vertical-layout create account form, the text in the heading for the second benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.',
+'createacct-benefit-body2' => 'In vertical-layout create account form, the text for the second benefit.',
+'createacct-benefit-icon3' => 'In vertical-layout create account form, the CSS style for the div next to the third benefit. If you replace this you will need probably need to adjust CSS.',
+'createacct-benefit-head3' => 'In vertical-layout create account form, the text in the heading for the third benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.',
+'createacct-benefit-body3' => 'In vertical-layout create account form, the text for the third benefit.',
 'badretype' => 'Used as error message when the new password and its retype do not match.',
 'userexists' => 'Used as error message in creating a user account.',
 'loginerror' => 'Used as title of error message.
 {{Identical|Login error}}',
+'createacct-error' => 'Title of error message in new vertical create account form.',
 'createaccounterror' => 'Parameters:
 * $1 is an error message',
 'nocookiesnew' => "This message is displayed when a new account was successfully created, but the browser doesn't accept cookies.",
@@ -1170,7 +1206,7 @@ $1 is the minimum number of characters in the password.',
 
 Parameters:
 * $1 is a user name. This parameter can be used with GENDER.',
-'noemailcreate' => 'Used as error message in [[Special:UserLogin]].',
+'noemailcreate' => 'Used as error message when one user creates an account for another and there is no email.',
 'passwordsent' => '* $1 - username',
 'blocked-mailpassword' => 'Used as error message in password recovery.',
 'eauthentsent' => "This message appears after entering an e-mail address in [[Special:Preferences]] > {{int:prefs-personal}} > {{int:email}}, then clicking on '{{int:saveprefs}}'.",
@@ -2259,7 +2295,8 @@ See also:
 
 See also:
 * {{msg-mw|Searchprofile-images|message}}
-* {{msg-mw|Searchprofile-images-tooltip|tooltip}}',
+* {{msg-mw|Searchprofile-images-tooltip|tooltip}}
+{{Identical|Muitimedia}}',
 'searchprofile-everything' => 'Used as an option in [[Special:Search]].
 
 See also:
@@ -2426,7 +2463,8 @@ See also:
 'resetprefs' => 'Button for resetting changes in the preferences page.',
 'restoreprefs' => 'Used in [[Special:Preferences]]',
 'prefs-editing' => 'Title of a tab in [[Special:Preferences]].
-When changing this message, please also update {{msg-mw|vector-editwarning-warning}} which references to this message.',
+When changing this message, please also update {{msg-mw|vector-editwarning-warning}} which references to this message.
+{{Identical|Editing}}',
 'prefs-edit-boxsize' => 'Used on [[Special:Preferences]].',
 'rows' => 'Used on [[Special:Preferences]], "Editing" section in the "Size of editing window" fieldset',
 'columns' => 'Used on [[Special:Preferences]], "Editing" section in the "Size of editing window" fieldset',
@@ -3809,7 +3847,8 @@ $1 is the name of the shared repository. On wikimedia sites, $1 is {{msg-mw|shar
 * $1 - file title
 See also:
 * {{msg-mw|Filedelete-intro}}',
-'filedelete-legend' => '{{Identical|Delete}}',
+'filedelete-legend' => 'Used as fieldset label in the "Delete file" form.
+{{Identical|Delete file}}',
 'filedelete-intro' => 'Used as introduction for FileDelete form.
 See also:
 * {{msg-mw|Filedelete|page title}}',
@@ -4921,7 +4960,8 @@ See also:
 'contribsub2' => 'Contributions for "user" (links)
 {{Identical|For $1}}',
 'nocontribs' => 'Optional parameter: $1 is the user name',
-'uctop' => 'This message is used in [[Special:Contributions]]. It is used to show that a particular edit was the last made to a page. Example: 09:57, 11 February 2008 (hist) (diff) Pagename‎ (edit summary) (top)',
+'uctop' => 'This message is used in [[Special:Contributions]]. It is used to show that a particular edit was the last made to a page. Example: 09:57, 11 February 2008 (hist) (diff) Pagename‎ (edit summary) (top)
+{{Identical|Top}}',
 'month' => 'Used in [[Special:Contributions]] and history pages ([{{fullurl:Sandbox|action=history}} example]), as label for a dropdown box to select a specific month to view the edits made in that month, and the earlier months. See also {{msg-mw|year}}.',
 'year' => 'Used in [[Special:Contributions]] and history pages ([{{fullurl:Sandbox|action=history}} example]), as label for an input box to select a specific year to view the edits made in that year, and the earlier years.
 
@@ -7235,7 +7275,8 @@ See also:
 This contains how the information in the picture is stored. This is most commonly Y, Cr, Cb to specify luma, red, blue. RGB is also possible to specify Red, Green, Blue.
 {{Related|Exif-componentsconfiguration}}',
 'exif-compressedbitsperpixel' => 'Exif is a format for storing metadata in image files. See this [[w:Exchangeable_image_file_format|Wikipedia article]] and the example at the bottom of [[commons:File:Phalacrocorax-auritus-020.jpg|this page on Commons]]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].',
-'exif-pixelydimension' => 'Exif is a format for storing metadata in image files. See this [[w:Exchangeable_image_file_format|Wikipedia article]] and the example at the bottom of [[commons:File:Phalacrocorax-auritus-020.jpg|this page on Commons]]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].',
+'exif-pixelydimension' => 'Exif is a format for storing metadata in image files. See this [[w:Exchangeable_image_file_format|Wikipedia article]] and the example at the bottom of [[commons:File:Phalacrocorax-auritus-020.jpg|this page on Commons]]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].
+{{Identical|Image width}}',
 'exif-pixelxdimension' => 'Exif is a format for storing metadata in image files. See this [[w:Exchangeable_image_file_format|Wikipedia article]] and the example at the bottom of [[commons:File:Phalacrocorax-auritus-020.jpg|this page on Commons]]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].',
 'exif-usercomment' => "Exif is a format for storing metadata in image files. See this [[w:Exchangeable_image_file_format|Wikipedia article]] and the example at the bottom of [[commons:File:Phalacrocorax-auritus-020.jpg|this page on Commons]]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].
 
@@ -8876,4 +8917,8 @@ $4 is the gender of the target user.',
 # Image rotation
 'rotate-comment' => 'Edit summary for the act of rotating an image.',
 
+# Unknown messages
+'hours-ago' => 'Phrase for indicating that something occurred a certain number of hours ago',
+'minutes-ago' => 'Phrase for indicating that something occurred a certain number of minutes ago',
+'seconds-ago' => 'Phrase for indicating that something occurred a certain number of seconds ago',
 );
index 60c2a89..8413906 100644 (file)
@@ -407,6 +407,16 @@ pe titlul secțiunii (JavaScript)',
 'nov' => 'nov',
 'dec' => 'dec',
 
+'monday-at' => 'Luni, la $1',
+'tuesday-at' => 'Marți, la $1',
+'wednesday-at' => 'Miercuri, la $1',
+'thursday-at' => 'Joi,la $1',
+'friday-at' => 'Vineri, la $1',
+'saturday-at' => 'Sâmbătă, la $1',
+'sunday-at' => 'Duminică, la $1',
+'today-at' => '$1',
+'yesterday-at' => 'Ieri, la $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Categorie|Categorii}}',
 'category_header' => 'Pagini din categoria „$1”',
@@ -4056,4 +4066,8 @@ Imaginile sunt afișate la rezoluția lor maximă, în timp ce alte tipuri de fi
 # Image rotation
 'rotate-comment' => 'Imagine rotită în sensul acelor de ceasornic cu $1 {{PLURAL:$1|grad|grade|de grade}}',
 
+# Unknown messages
+'hours-ago' => 'acum $1 {{PLURAL:$1|oră|ore|de ore}}',
+'minutes-ago' => 'acum $1 {{PLURAL:$1|minut|minute|de minute}}',
+'seconds-ago' => 'acum {{PLURAL:$1|o secundă|$1 secunde|$1 de secunde}}',
 );
index 6f726f2..516b376 100644 (file)
@@ -133,6 +133,16 @@ $messages = array(
 'nov' => 'Nov',
 'dec' => 'Dec',
 
+'monday-at' => 'Lunedìe a le $1',
+'tuesday-at' => 'Martedìe a le $1',
+'wednesday-at' => 'Mercrudìe a le $1',
+'thursday-at' => 'Sciuvedìe a le $1',
+'friday-at' => 'Venerdìe a le $1',
+'saturday-at' => 'Sabbète a le $1',
+'sunday-at' => 'Dumeneche a le $1',
+'today-at' => '$1',
+'yesterday-at' => 'Aijere a le $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Categorije|Categorije}}',
 'category_header' => 'Pàggene jndr\'à categorie "$1"',
@@ -3045,6 +3055,7 @@ Ce l'esegue sus a 'u sisteme tue pò essere ca se combromette.",
 'minutes' => '{{PLURAL:$1|$1 minute|$1 minute}}',
 'hours' => '{{PLURAL: $1|$1ore|$1 ore}}',
 'days' => '{{PLURAL: $1|$1 sciurne|$1 sciurne}}',
+'weeks' => '{{PLURAL:$1|$1 sumàne}}',
 'months' => '{{PLURAL:$1|$1 mese|$1 mise}}',
 'years' => '{{PLURAL:$1|$1 anne}}',
 'ago' => '$1 fà',
@@ -4077,4 +4088,8 @@ Ce nò, tu puè ausà 'u module facile aqquà sotte. 'U commende tune avène agg
 # Image rotation
 'rotate-comment' => 'Immaggine rotate de $1 {{PLURAL:$1|grade}} in sienze orarie',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|ore}} fà',
+'minutes-ago' => '$1 {{PLURAL:$1|minute}} fà',
+'seconds-ago' => '$1 {{PLURAL:$1|seconde}} fà',
 );
index eb5f112..b73204b 100644 (file)
@@ -454,9 +454,15 @@ $2',
 'welcomecreation-msg' => 'Аатыҥ бэлиэтэннэ.
 {{SITENAME}} ситим-сиргэ үлэлииргэ табыгастаах буоллун диэн [[Special:Preferences|тус туруорууларгын]] уларытыаххын сөп.',
 'yourname' => 'Кыттааччы аатыҥ:',
+'userlogin-yourname' => 'Бэлиэ-аат',
+'userlogin-yourname-ph' => 'Бэлиэ-ааккын киллэр',
 'yourpassword' => 'Киирии тыла:',
+'userlogin-yourpassword' => 'Киирии тыл',
+'userlogin-yourpassword-ph' => 'Киирии тылгын суруй',
 'yourpasswordagain' => 'Киирии тылгын хатылаа:',
 'remembermypassword' => 'Миигин бу көмпүүтэргэ сигээ ($1 {{PLURAL:$1|күн|күнтэн ордуга суох}})',
+'userlogin-remembermypassword' => 'Долоҕойгор хатаа',
+'userlogin-signwithsecure' => 'Бигэ сиэрбэри туһанан киирии',
 'securelogin-stick-https' => 'Киирэн баран HTTPS нөҥүө холбонууну салгыырга',
 'yourdomainname' => 'Эн дөмүөнүҥ:',
 'password-change-forbidden' => 'Бу биикигэ киирии тылы уоарытар табыллыбат.',
@@ -469,12 +475,16 @@ $2',
 'logout' => 'Тахсыы',
 'userlogout' => 'Тахсыы',
 'notloggedin' => 'Ааккын эппэтиҥ',
+'userlogin-noaccount' => 'Бэлиэтэнэ иликкин дуо?',
+'userlogin-joinproject' => '{{SITENAME}} ситим-сиргэ киирии',
 'nologin' => "Бэлиэтэнэ иликкин дуо? '''$1'''.",
 'nologinlink' => 'Бэлиэтэнии',
 'createaccount' => 'Бэлиэтэнии',
 'gotaccount' => "Бэлиэтэммитиҥ дуо? '''$1'''.",
 'gotaccountlink' => 'Аатыҥ',
 'userlogin-resetlink' => 'Киирэр тылгын умнубуккун дуо?',
+'helplogin-url' => 'Help:Бэлиэ-ааты киллэрии',
+'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Бэлиэтэниигэ көмө]]',
 'createaccountmail' => 'Быстах киирии тылы туһаныы уонна ону email-ынан ыытыы',
 'createaccountreason' => 'Төрүөтэ:',
 'badretype' => 'Киирии тылларыҥ сөп түбэспэтилэр.',
index bd9dee3..0c51e56 100644 (file)
@@ -390,6 +390,16 @@ $messages = array(
 'nov' => 'nov',
 'dec' => 'dec',
 
+'monday-at' => 'v pondelok o $1',
+'tuesday-at' => 'v utorok o $1',
+'wednesday-at' => 'v stredu o $1',
+'thursday-at' => 'vo štvrtok o $1',
+'friday-at' => 'v piatok o $1',
+'saturday-at' => 'v sobotu o $1',
+'sunday-at' => 'v nedeľu o $1',
+'today-at' => '$1',
+'yesterday-at' => 'včera o $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategória|Kategórie|Kategórie}}',
 'category_header' => 'Stránky v kategórii „$1“',
@@ -4048,4 +4058,8 @@ V opačnom prípade môžete použiť zjednodušený formulár nižšie. Váš k
 # Image rotation
 'rotate-comment' => 'Obrázok otočený o $1 {{PLURAL:$1|stupeň|stupne|stupňov}} v smere hodinových ručičiek',
 
+# Unknown messages
+'hours-ago' => 'pred $1 {{PLURAL:$1|hodinou|hodinami}}',
+'minutes-ago' => 'pred $1 {{PLURAL:$1|minútou|minútami}}',
+'seconds-ago' => 'pred $1 {{PLURAL:$1|sekundou|sekundami}}',
 );
index d4b8e0e..100e57c 100644 (file)
@@ -294,6 +294,16 @@ $messages = array(
 'nov' => 'nov.',
 'dec' => 'dec.',
 
+'monday-at' => 'Ponedeljek ob $1',
+'tuesday-at' => 'Torek ob $1',
+'wednesday-at' => 'Sreda ob $1',
+'thursday-at' => 'Četrtek ob $1',
+'friday-at' => 'Petek ob $1',
+'saturday-at' => 'Sobota ob $1',
+'sunday-at' => 'Nedelja ob $1',
+'today-at' => '$1',
+'yesterday-at' => 'Včeraj ob $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategorija|Kategoriji|Kategorije}}',
 'category_header' => 'Strani v kategoriji »$1«',
@@ -773,7 +783,7 @@ svojega starega gesla.',
 Začasno geslo: $2',
 'passwordreset-emailsent' => 'Poslali smo e-pošto za postavitev gesla.',
 'passwordreset-emailsent-capture' => 'Poslali smo e-pošto za ponastavitev gesla, ki je prikazana spodaj.',
-'passwordreset-emailerror-capture' => 'Ustvarili smo e-pošto za ponastavitev gesla, ki je prikazana spodaj, vendar pa pošiljanje uporabniku ni uspelo: $1',
+'passwordreset-emailerror-capture' => 'Ustvarili smo e-pošto za ponastavitev gesla, ki je prikazana spodaj, vendar pa pošiljanje {{GENDER:$2|uporabniku|uporabnici}} ni uspelo: $1',
 
 # Special:ChangeEmail
 'changeemail' => 'Sprememba e-poštnega naslova',
@@ -3135,6 +3145,7 @@ Z njenim zagonom lahko ogrozite vaš sistem.",
 'minutes' => '$1 {{PLURAL:$1|minuta|minuti|minute|minut}}',
 'hours' => '$1 {{PLURAL:$1|ura|uri|ure|ur}}',
 'days' => '$1 {{PLURAL:$1|dan|dneva|dnevi|dni}}',
+'weeks' => '$1 {{PLURAL:$1|teden|tedna|tedni|tednov}}',
 'months' => '$1 {{PLURAL:$1|mesec|meseca|mesece|mesecev}}',
 'years' => '$1 {{PLURAL:$1|leto|leti|leta|let}}',
 'ago' => 'pred $1',
@@ -3988,4 +3999,8 @@ V nasprotnem primeru lahko uporabite preprost obrazec spodaj. Vašo pripombo bom
 # Image rotation
 'rotate-comment' => 'Slika zavrti s  $1  {{PLURAL:$1| degree|degrees}} v smeri urinega kazalca',
 
+# Unknown messages
+'hours-ago' => 'pred $1 {{PLURAL:$1|uro|urama|urami}}',
+'minutes-ago' => 'pred $1 {{PLURAL:$1|minuto|minutama|minutami}}',
+'seconds-ago' => 'pred $1 {{PLURAL:$1|sekundo|sekundama|sekundami}}',
 );
index 60926e3..b67ec27 100644 (file)
@@ -377,7 +377,7 @@ Ita-nia mudansa la armazenadu seidauk!",
 'currentrevisionlink' => 'Versaun atuál',
 'cur' => 'atuál',
 'next' => 'oinmai',
-'last' => 'ikus',
+'last' => 'molok',
 'page_first' => 'uluk',
 'page_last' => 'ikus',
 'histfirst' => 'sedu liu hotu',
@@ -407,12 +407,14 @@ Ita-nia mudansa la armazenadu seidauk!",
 'nextn' => 'oinmai {{PLURAL:$1|$1}}',
 'shown-title' => 'Hatudu {{PLURAL:$1|rezultadu|rezultadu}} $1 kada pájina',
 'viewprevnext' => 'Haree ($1 {{int:pipe-separator}} $2) ($3)',
+'searchmenu-exists' => "'''Iha pájina ho naran \"[[:\$1]]\".'''",
 'searchmenu-new' => "'''Kria pájina \"[[:\$1]]\" iha wiki ne'e!'''",
 'searchprofile-everything' => 'Hotu',
 'searchprofile-articles-tooltip' => 'Buka iha $1',
 'searchprofile-project-tooltip' => 'Buka iha $1',
 'search-result-size' => '$1 ({{PLURAL:$2|liafuan ida|liafuan $2}})',
 'search-section' => '(seksaun $1)',
+'search-suggest' => 'Parese Ita buka: $1',
 'search-interwiki-caption' => 'Projetu seluseluk sira',
 'searchall' => 'hotu',
 'powersearch' => 'Buka',
@@ -643,7 +645,7 @@ Ita-nia mudansa la armazenadu seidauk!",
 'emailsend' => 'Haruka',
 
 # Watchlist
-'watchlist' => "Ha'u-nia lista hateke",
+'watchlist' => 'Lista hateke',
 'mywatchlist' => 'Lista hateke',
 'removedwatchtext' => 'La hateke pájina "[[:$1]]" ona (haree [[Special:Watchlist|"lista hateke"]]).',
 'watch' => 'Hateke',
@@ -667,6 +669,7 @@ Ita-nia mudansa la armazenadu seidauk!",
 'exblank' => 'pájina mamuk',
 'delete-legend' => 'Halakon',
 'actioncomplete' => 'operasaun remata',
+'actionfailed' => 'Asaun la konsege',
 'deletedtext' => 'Ita foin halakon pájina "$1". Haree $2 ba "operasaun halakon" seluk.',
 'dellogpage' => 'Lista halakon',
 'deletionlog' => 'lista halakon',
@@ -713,7 +716,7 @@ Ita-nia mudansa la armazenadu seidauk!",
 'blanknamespace' => '(Prinsipál)',
 
 # Contributions
-'contributions' => "Kontribuisaun uza-na'in",
+'contributions' => "{{GENDER:$1|Kontribuisaun uza-na'in}}",
 'contributions-title' => 'Kontribuisaun "$1" nian',
 'mycontris' => 'Kontribuisaun',
 'contribsub2' => 'Ba $1 ($2)',
@@ -849,10 +852,7 @@ Ita-nia mudansa la armazenadu seidauk!",
 'siteusers' => "{{PLURAL:$2|uza-na'in|uza-na'in}} {{SITENAME}} nian $1",
 
 # Skin names
-'skinname-standard' => 'Klásiku',
 'skinname-cologneblue' => 'Kolónia azúl',
-'skinname-myskin' => 'MySkin',
-'skinname-chick' => 'Manu',
 
 # Browsing diffs
 'previousdiff' => '←Versaun molok',
index f16836a..5d5a996 100644 (file)
@@ -456,6 +456,16 @@ $messages = array(
 'nov' => 'Kas',
 'dec' => 'Ara',
 
+'monday-at' => '$1 Pazartesi günü',
+'tuesday-at' => '$1 Salı günü',
+'wednesday-at' => '$1 Çarşamba günü',
+'thursday-at' => '$1 Perşembe günü',
+'friday-at' => '$1 Cuma günü',
+'saturday-at' => '$1 Cumartesi günü',
+'sunday-at' => '$1 Pazar günü',
+'today-at' => '$1',
+'yesterday-at' => '$1 dün itibariyle',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Kategori|Kategoriler}}',
 'category_header' => '"$1" kategorisindeki sayfalar',
@@ -3963,4 +3973,8 @@ Resimler tam çözünürlükte görüntülenir, diğer dosya tipleri ilgili prog
 'duration-centuries' => '$1 {{PLURAL:$1|yüzyıl|yüzyıl}}',
 'duration-millennia' => '$1 {{PLURAL:$1|bin yıl|bin yıl}}',
 
+# Unknown messages
+'hours-ago' => '$1 {{PLURAL:$1|saat|saat}} önce',
+'minutes-ago' => '$1 {{PLURAL:$1|dakika|dakika}} önce',
+'seconds-ago' => '$1 {{PLURAL:$1|saniye|saniye}} önce',
 );
index 70ce910..f2fc88f 100644 (file)
@@ -36,6 +36,7 @@
  * @author RLuts
  * @author Riwnodennyk
  * @author Sodmy
+ * @author Ua2004
  * @author Urhixidur
  * @author VolodymyrF
  * @author Vox
@@ -2408,7 +2409,7 @@ $1',
 'addedwatchtext' => "Сторінку «[[:$1]]» додано до вашого [[Special:Watchlist|списку спостереження]].
 Подальші редагування цієї сторінки (та пов'язаної з нею сторінки обговорення) відображатимуться в цьому списку.",
 'removewatch' => 'Видалити зі списку спостереження',
-'removedwatchtext' => 'Сторінка «[[:$1]]» вилучена з вашого [[Special:Watchlist|списку спостереження]].',
+'removedwatchtext' => 'Сторінку «[[:$1]]» вилучено з вашого [[Special:Watchlist|списку спостереження]].',
 'watch' => 'Спостерігати',
 'watchthispage' => 'Спостерігати за цією сторінкою',
 'unwatch' => 'Скас. спостереження',
index bdc04b1..dd8ff84 100644 (file)
@@ -410,6 +410,16 @@ $messages = array(
 'nov' => 'tháng 11',
 'dec' => 'tháng 12',
 
+'monday-at' => 'Thứ Hai lúc $1',
+'tuesday-at' => 'Thứ Ba lúc $1',
+'wednesday-at' => 'Thứ Tư lúc $1',
+'thursday-at' => 'Thứ Năm lúc $1',
+'friday-at' => 'Thứ Sáu lúc $1',
+'saturday-at' => 'Thứ Bảy lúc $1',
+'sunday-at' => 'Chủ Nhật lúc $1',
+'today-at' => '$1',
+'yesterday-at' => 'Hôm qua lúc $1',
+
 # Categories related messages
 'pagecategories' => '{{PLURAL:$1|Thể loại|Thể loại}}',
 'category_header' => 'Các trang trong thể loại “$1”',
@@ -861,7 +871,7 @@ mật khẩu cũ.',
 Mật khẩu tạm: $2',
 'passwordreset-emailsent' => 'Đã gửi thư điện tử để tái tạo mật khẩu.',
 'passwordreset-emailsent-capture' => 'Thư điện tử để tái tạo mật khẩu đã được gửi, nội dung như sau.',
-'passwordreset-emailerror-capture' => 'Chúng tôi đã tạo thư tái tạo mật khẩu dưới đây, nhưng không thể gửi đến người dùng: $1',
+'passwordreset-emailerror-capture' => 'Chúng tôi đã tạo thư tái tạo mật khẩu dưới đây, nhưng không thể gửi đến {{GENDER:$2}}người dùng: $1',
 
 # Special:ChangeEmail
 'changeemail' => 'Đổi địa chỉ thư điện tử',
@@ -3215,6 +3225,7 @@ Nếu thực thi nó máy tính của bạn có thể bị tiếm quyền.",
 'minutes' => '$1 phút',
 'hours' => '$1 giờ',
 'days' => '$1 ngày',
+'weeks' => '{{PLURAL:$1|$1 tuần}}',
 'months' => '$1 tháng',
 'years' => '$1 năm',
 'ago' => 'cách đây $1',
@@ -4167,4 +4178,8 @@ Nếu không thì bạn có thể điền biểu mẫu đơn giản ở dưới.
 # Image rotation
 'rotate-comment' => 'Đã quay hình $1 độ theo chiều kim đồng hồ',
 
+# Unknown messages
+'hours-ago' => 'Cách đây $1 {{PLURAL:$1|giờ}}',
+'minutes-ago' => 'Cách đây $1 {{PLURAL:$1|phút}}',
+'seconds-ago' => 'Cách đây $1 {{PLURAL:$1|giây}}',
 );
index 926cb12..cd5cb6f 100644 (file)
@@ -8,6 +8,7 @@
  * @file
  *
  * @author Altaileopard
+ * @author Matma Rex
  * @author Silvicola
  */
 
@@ -80,10 +81,6 @@ $messages = array(
 'tog-shownumberswatching' => 'Dii andsôôl dr beoobachdâr ôôdsajchn',
 'tog-oldsig' => 'foorschau fon dr agduäln signaduur:',
 'tog-fancysig' => 'Signaduur is dhägsd in wighi-sindhags (alsâ ned audomaadisch â lingg)',
-'tog-externaleditor' => 'Schdandardwäässich an ägsdhärnân eedidhâr neemn (nôr for di sich ausghenn, dâdsuu
-mus mr ufm ajchnen rächnâr was ajrichdn gehnn)',
-'tog-externaldiff' => ' ägsdhärns Brogram dsum ôôdsjachn fon dâ wärsjoons-undârschiid neemn (nôr fir dii sich
-ausghenn, mr mus dâdsuu ufm ajchnen rächnâr was âjrichdn ghenn)',
 'tog-uselivepreview' => 'Schnäl-foorschau benudsn (brauchd JavaScript) (ärschd ân fârsuuch)',
 'tog-forceeditsummary' => 'Sich erinärn lasn, wemmâr ghâ dsusamnfasung gschriiwn had',
 'tog-watchlisthideown' => 'Ajchne bearbajdungn ned in dr beoobachdungs-lischdn uffiirn',
@@ -483,14 +480,6 @@ Hirmid sagsd, das Du den dhägsd '''selbâr gschriim''' hasd, das däär dhägsd
 'search-external' => 'Ägsdärne suach',
 'searchdisabled' => 'Diâ {{SITENAME}}-suâch ist ausgschald. Duu ghâusch so lang mid Google suâchn. Dengg drâu, des was mr dôô fir {{SITENAME}} find, ghâu iwârhoold saj.',
 
-# Quickbar
-'qbsettings' => 'Sajdn-lajsdn',
-'qbsettings-none' => 'Ghane',
-'qbsettings-fixedleft' => 'Lings, feschd',
-'qbsettings-fixedright' => 'Rächds, feschd',
-'qbsettings-floatingleft' => 'Lings, schwääbnd',
-'qbsettings-floatingright' => 'Rächds, schwääbnd',
-
 # Preferences page
 'preferences' => 'ajschdelunga',
 'mypreferences' => 'Maj ajschdelunga',
@@ -654,7 +643,7 @@ S'gajd awâr aa â [[Special:WhatLinksHere/$2|lisdn mid alâ fârwajs]].",
 # Special:ListGroupRights
 'listgrouprights-members' => '(Lisdn fon dâ midgliidâr)',
 
-# E-mail user
+# Email user
 'emailuser' => 'Dem ôôgmeldn â iimejl schign',
 
 # Watchlist
@@ -876,23 +865,9 @@ Bidde gug's mi´m foorschau-gnobf ôô fôrm schbajchan",
 
 # Stylesheets
 'common.css' => '/* CSS hiir beâjflusd ale schelfn */',
-'standard.css' => "/* CSS hiir beâjflusd nôr dii Klassik-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an [[MediaWiki:Common.css]] was ändârn. */",
-'nostalgia.css' => "/* CSS hiir beâjflusd nôr dii Nostalgia-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
 'cologneblue.css' => "/* CSS hiir beâjflusd nôr dii Kölnisch-Blau-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
 'monobook.css' => "/* CSS hiir beâjflusd nôr dii Monobook-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
-'myskin.css' => "/* CSS hiir beâjflusd nôr dii MySkin-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
-'chick.css' => "/* CSS hiir beâjflusd nôr dii Küken-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
-'simple.css' => "/* CSS hiir beâjflusd nôr dii Simple-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
-'modern.css' => "/* CSS hiir beâjflusd nôr dii Modern-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */
-
-/* Dii glôôschrajwung im nawigadsjoonsberajch fârhindârd des: */
-.portlet h5,
-.portlet h6,
-#p-personal ul,
-#p-cactions li a,
-#preftoc a {
-     text-transform: none;
-}",
+'modern.css' => "/* CSS hiir beâjflusd nôr dii Modern-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
 'vector.css' => "/* CSS hiir beâjflusd nôr dii Vector-schelfn. Wen'd ale uf ôômôôl beâjflusn wilsch, muâsch an MediaWiki:Common.css was ändârn. */",
 'print.css' => '/* CSS hiir beâjflusd nôr dii drugausgaawe. */',
 'handheld.css' => '/* CSS hiir beâjflusd nôr dii handgerääde, jee nachdeem, welche schelfn in $wgHandheldStyle âjgeschdeld is. */',
index 0714d0a..58f5bc4 100644 (file)
@@ -362,6 +362,16 @@ $messages = array(
 'nov' => '11月',
 'dec' => '12月',
 
+'monday-at' => '於星期一$1',
+'tuesday-at' => '於星期二$1',
+'wednesday-at' => '於星期三$1',
+'thursday-at' => '於星期四$1',
+'friday-at' => '於星期五$1',
+'saturday-at' => '於星期六$1',
+'sunday-at' => '於星期日$1',
+'today-at' => '$1',
+'yesterday-at' => '昨天$1',
+
 # Categories related messages
 'pagecategories' => '$1個分類',
 'category_header' => '「$1」分類中的頁面',
@@ -3122,6 +3132,7 @@ $1',
 'minutes' => '$1分鍾',
 'hours' => '$1小時',
 'days' => '$1天',
+'weeks' => '{{PLURAL:$1|$1周|$1周}}',
 'months' => '{{PLURAL:$1|$1個月|$1個月}}',
 'years' => '{{PLURAL:$1|$1年|$1年}}',
 'ago' => '$1前',
@@ -3981,4 +3992,8 @@ MediaWiki是基於使用目的而加以發佈,然而不負任何擔保責任
 # Image rotation
 'rotate-comment' => '順時針旋轉圖像$1{{PLURAL:$1|度|度}}',
 
+# Unknown messages
+'hours-ago' => '$1小時前',
+'minutes-ago' => '$1分鐘前',
+'seconds-ago' => '$1秒前',
 );
index 9163d69..bcd59f1 100644 (file)
@@ -133,7 +133,7 @@ class BackupDumper {
                        $matches = array();
                        if ( preg_match( '/^--(.+?)(?:=(.+?)(?::(.+?))?)?$/', $arg, $matches ) ) {
                                @list( /* $full */ , $opt, $val, $param ) = $matches;
-                               switch( $opt ) {
+                               switch ( $opt ) {
                                case "plugin":
                                        $this->loadPlugin( $val, $param );
                                        break;
@@ -368,7 +368,7 @@ class BackupDumper {
 
        function fatalError( $msg ) {
                $this->progress( "$msg\n" );
-               die(1);
+               die( 1 );
        }
 }
 
index cc0a7e1..04352b9 100644 (file)
@@ -51,7 +51,7 @@ class BaseDump {
                $this->infiles = explode( ';', $infile );
                $this->reader = new XMLReader();
                $infile = array_shift( $this->infiles );
-               if (defined( 'LIBXML_PARSEHUGE' ) ) {
+               if ( defined( 'LIBXML_PARSEHUGE' ) ) {
                        $this->reader->open( $infile, null, LIBXML_PARSEHUGE );
                }
                else {
@@ -110,8 +110,8 @@ class BaseDump {
                        }
                } else {
                        $this->close();
-                       if (count($this->infiles)) {
-                               $infile = array_shift($this->infiles);
+                       if ( count( $this->infiles ) ) {
+                               $infile = array_shift( $this->infiles );
                                $this->reader->open( $infile );
                                $this->atEnd = false;
                        }
@@ -181,7 +181,7 @@ class BaseDump {
                }
                $buffer = "";
                while ( $this->reader->read() ) {
-                       switch( $this->reader->nodeType ) {
+                       switch ( $this->reader->nodeType ) {
                        case XMLReader::TEXT:
 //                     case XMLReader::WHITESPACE:
                        case XMLReader::SIGNIFICANT_WHITESPACE:
index c99f004..547abab 100644 (file)
@@ -183,7 +183,7 @@ class TextPassDumper extends BackupDumper {
                global $IP;
                $url = $this->processFileOpt( $val, $param );
 
-               switch( $opt ) {
+               switch ( $opt ) {
                case 'prefetch':
                        require_once "$IP/maintenance/backupPrefetch.inc";
                        $this->prefetch = new BaseDump( $url );
@@ -215,7 +215,7 @@ class TextPassDumper extends BackupDumper {
        function processFileOpt( $val, $param ) {
                $fileURIs = explode( ';', $param );
                foreach ( $fileURIs as $URI ) {
-                       switch( $val ) {
+                       switch ( $val ) {
                                case "file":
                                        $newURI = $URI;
                                        break;
index 4c03980..b3d8174 100644 (file)
@@ -657,6 +657,7 @@ class wikiFuzz {
                        "}}",
                        "{{INT:googlesearch|",
                        "}}",
+                        "{{ROOTPAGENAME}}",
                        "{{BASEPAGENAME}}",
                        "{{CONTENTLANGUAGE}}",
                        "{{PAGESINNAMESPACE:}}",
index 83b5b02..53ea597 100644 (file)
@@ -53,7 +53,7 @@ class GetConfiguration extends Maintenance {
                }
 
                $out = null;
-               switch( $this->getOption( 'format' ) ) {
+               switch ( $this->getOption( 'format' ) ) {
                        case 'PHP':
                                $out = serialize( $res );
                                break;
index 413d650..9e583e7 100644 (file)
@@ -46,7 +46,7 @@ class CheckLanguageCLI {
        public function __construct( array $options ) {
                if ( isset( $options['help'] ) ) {
                        echo $this->help();
-                       exit(1);
+                       exit( 1 );
                }
 
                if ( isset( $options['lang'] ) ) {
@@ -488,7 +488,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI {
        public function __construct( array $options, $extension ) {
                if ( isset( $options['help'] ) ) {
                        echo $this->help();
-                       exit(1);
+                       exit( 1 );
                }
 
                if ( isset( $options['lang'] ) ) {
@@ -654,7 +654,7 @@ ENDS;
                                echo $extension->name() . ":\n";
 
                                if ( $this->level > 0 ) {
-                                       switch( $this->output ) {
+                                       switch ( $this->output ) {
                                                case 'plain':
                                                        $this->outputText();
                                                        break;
index f5bcb5d..991788c 100644 (file)
@@ -247,6 +247,13 @@ $wgIgnoredMessages = array(
        'ipb-default-expiry',
        'pageinfo-header',
        'pageinfo-footer',
+       'createacct-benefit-head1',
+       'createacct-benefit-icon1',
+       'createacct-benefit-head2',
+       'createacct-benefit-icon2',
+       'createacct-benefit-head3',
+       'createacct-benefit-icon3',
+       'today-at',
 );
 
 /** Optional messages, which may be translated only if changed in the target language. */
index 3b9fadf..96a6c13 100644 (file)
@@ -431,10 +431,15 @@ $wgMessageStructure = array(
                'yourname',
                'userlogin-yourname',
                'userlogin-yourname-ph',
+               'createacct-helpusername-url',
+               'createacct-helpusername-link',
                'yourpassword',
                'userlogin-yourpassword',
                'userlogin-yourpassword-ph',
+               'createacct-yourpassword-ph',
                'yourpasswordagain',
+               'createacct-yourpasswordagain',
+               'createacct-yourpasswordagain-ph',
                'remembermypassword',
                'userlogin-remembermypassword',
                'userlogin-signwithsecure',
@@ -461,11 +466,32 @@ $wgMessageStructure = array(
                'userlogin-resetlink',
                'helplogin-url',
                'userlogin-helplink',
+               'createacct-join',
+               'createacct-emailrequired',
+               'createacct-emailoptional',
+               'createacct-email-ph',
                'createaccountmail',
+               'createacct-realname',
                'createaccountreason',
+               'createacct-reason',
+               'createacct-captcha',
+               'createacct-captcha-help-url',
+               'createacct-imgcaptcha-help',
+               'createacct-imgcaptcha-ph',
+               'createacct-benefit-heading',
+               'createacct-benefit-icon1',
+               'createacct-benefit-head1',
+               'createacct-benefit-body1',
+               'createacct-benefit-icon2',
+               'createacct-benefit-head2',
+               'createacct-benefit-body2',
+               'createacct-benefit-icon3',
+               'createacct-benefit-head3',
+               'createacct-benefit-body3',
                'badretype',
                'userexists',
                'loginerror',
+               'createacct-error',
                'createaccounterror',
                'nocookiesnew',
                'nocookieslogin',
@@ -2808,11 +2834,26 @@ $wgMessageStructure = array(
                'minutes',
                'hours',
                'days',
+               'weeks',
                'months',
                'years',
                'ago',
                'just-now',
        ),
+       'human-timestamps' => array(
+               'hours-ago',
+               'minutes-ago',
+               'seconds-ago',
+               'monday-at',
+               'tuesday-at',
+               'wednesday-at',
+               'thursday-at',
+               'friday-at',
+               'saturday-at',
+               'sunday-at',
+               'today-at',
+               'yesterday-at',
+       ),
        'badimagelist' => array(
                'bad_image_list',
        ),
@@ -3971,8 +4012,9 @@ XHTML id names.",
        'patrol-log'          => 'Patrol log',
        'imagedeletion'       => 'Image deletion',
        'browsediffs'         => 'Browsing diffs',
-       'newfiles'           => 'Special:NewFiles',
+       'newfiles'            => 'Special:NewFiles',
        'video-info'          => 'Video information, used by Language::formatTimePeriod() to format lengths in the above messages',
+       'human-timestamps'    => 'Human-readable timestamps',
        'badimagelist'        => 'Bad image list',
        'variantname-zh'      => "Short names for language variants used for language conversion links.
 Variants for Chinese language",
index 6148cc4..8aac4b3 100644 (file)
@@ -145,8 +145,8 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath,
 unset( $file );
 
 if ( is_array( $argv ) ) {
-       for ($i = 0; $i < count($argv); $i++ ) {
-               switch( $argv[$i] ) {
+       for ( $i = 0; $i < count( $argv ); $i++ ) {
+               switch ( $argv[$i] ) {
                case '--all':
                        $input = 0;
                        break;
@@ -210,7 +210,7 @@ Other options:
 
 
 END;
-                       exit(0);
+                       exit( 0 );
                        break;
                }
        }
index c5bf569..0f6f365 100644 (file)
@@ -522,12 +522,12 @@ CREATE TABLE &mw_prefix.job (
   job_namespace  NUMBER  DEFAULT 0 NOT NULL,
   job_title      VARCHAR2(255)      NOT NULL,
   job_timestamp         TIMESTAMP(6) WITH TIME ZONE NULL,
-  job_params     CLOB      NOT NULL
-  job_random NUMBER NOT NULL default 0,
+  job_params     CLOB      NOT NULL,
+  job_random NUMBER DEFAULT 0 NOT NULL,
   job_token VARCHAR2(32),
   job_token_timestamp TIMESTAMP(6) WITH TIME ZONE,
   job_sha1 VARCHAR2(32),
-  job_attempts NUMBER NOT NULL default 0
+  job_attempts NUMBER DEFAULT 0 NOT NULL
 );
 ALTER TABLE &mw_prefix.job ADD CONSTRAINT &mw_prefix.job_pk PRIMARY KEY (job_id);
 CREATE INDEX &mw_prefix.job_i01 ON &mw_prefix.job (job_cmd, job_namespace, job_title);
@@ -703,7 +703,7 @@ CREATE TABLE &mw_prefix.site_identifiers (
   si_type VARCHAR2(32) NOT NULL,
   si_key VARCHAR2(32) NOT NULL
 );
-CREATE UNIQUE INDEX &mw_prefix.site_identifiers_u01 ON &mw_prefix.sites (si_type, si_key);
+CREATE UNIQUE INDEX &mw_prefix.site_identifiers_u01 ON &mw_prefix.site_identifiers (si_type, si_key);
 CREATE INDEX &mw_prefix.site_identifiers_i01 ON &mw_prefix.site_identifiers (si_site);
 CREATE INDEX &mw_prefix.site_identifiers_i02 ON &mw_prefix.site_identifiers (si_key);
 
index b9bfe81..505313d 100644 (file)
@@ -443,13 +443,21 @@ class CheckStorage {
 
        function importRevision( &$revision, &$importer ) {
                $id = $revision->getID();
-               $text = $revision->getText();
+               $content = $revision->getContent( Revision::RAW );
+               $id = $id ? $id : '';
+
+               if ( $content === null ) {
+                       echo "Revision $id is broken, we have no content available\n";
+                       return;
+               }
+
+               $text = $content->serialize();
                if ( $text === '' ) {
                        // This is what happens if the revision was broken at the time the
                        // dump was made. Unfortunately, it also happens if the revision was
                        // legitimately blank, so there's no way to tell the difference. To
                        // be safe, we'll skip it and leave it broken
-                       $id = $id ? $id : '';
+
                        echo "Revision $id is blank in the dump, may have been broken before export\n";
                        return;
                }
index c96184e..538ee01 100644 (file)
@@ -944,6 +944,22 @@ return array(
                ),
                'position' => 'top',
        ),
+       'mediawiki.special.createaccount.vform' => array(
+               'styles' => array(
+                       'resources/mediawiki.special/mediawiki.special.vforms.css',
+                       'resources/mediawiki.special/mediawiki.special.createAccount.vform.css',
+               ),
+               'position' => 'top',
+       ),
+       'mediawiki.special.createaccount.vform.js' => array(
+               'scripts' => 'resources/mediawiki.special/mediawiki.special.createAccount.vform.js',
+               'messages' => array(
+                       'createacct-captcha',
+                       'createacct-imgcaptcha-ph'
+               ),
+               'dependencies' => 'mediawiki.jqueryMsg',
+               'position' => 'top',
+       ),
        'mediawiki.special.javaScriptTest' => array(
                'scripts' => 'resources/mediawiki.special/mediawiki.special.javaScriptTest.js',
                'messages' => array_merge( Skin::getSkinNameMessages(), array(
diff --git a/resources/mediawiki.special/images/icon-contributors.png b/resources/mediawiki.special/images/icon-contributors.png
new file mode 100644 (file)
index 0000000..62b37f9
Binary files /dev/null and b/resources/mediawiki.special/images/icon-contributors.png differ
diff --git a/resources/mediawiki.special/images/icon-edits.png b/resources/mediawiki.special/images/icon-edits.png
new file mode 100644 (file)
index 0000000..263832b
Binary files /dev/null and b/resources/mediawiki.special/images/icon-edits.png differ
diff --git a/resources/mediawiki.special/images/icon-pages.png b/resources/mediawiki.special/images/icon-pages.png
new file mode 100644 (file)
index 0000000..0389c84
Binary files /dev/null and b/resources/mediawiki.special/images/icon-pages.png differ
diff --git a/resources/mediawiki.special/mediawiki.special.createAccount.vform.css b/resources/mediawiki.special/mediawiki.special.createAccount.vform.css
new file mode 100644 (file)
index 0000000..a1d78a2
--- /dev/null
@@ -0,0 +1,98 @@
+/* Disable the underline that Vector puts on h2 headings, and bold them. */
+.mw-ui-container h2 {
+       border: 0;
+       font-weight: bold;
+}
+
+/* shuffled CAPTCHA */
+#wpCaptchaWord {
+       margin-top: 6px;
+}
+
+.mw-createacct-captcha-container {
+       background-color: #f8f8f8;
+       border: 1px solid #c9c9c9;
+       padding: 10px;
+       text-align: center;
+}
+
+.mw-createacct-captcha-image-container {
+       background-color: #fff;
+       min-height: 95px;
+}
+
+.mw-createacct-captcha-assisted {
+       display: block;
+       margin-top: 0.5em;
+}
+
+.mw-createacct-captcha-and-reload {
+       border: 1px solid #c9c9c9;
+       display: table-cell;
+       width: 270px;
+       background-color: #FFF;
+}
+
+.mw-createacct-captcha-and-reload .confirmedit-captcha-reload {
+       display: block;
+       float: right;
+}
+
+/* Benefits column CSS to the right (if it fits) of the form. */
+.mw-ui-container #userloginForm {
+       float: left;
+}
+
+div.mw-createacct-benefits-container {
+       float: left
+}
+
+div.mw-createacct-benefits-container h2 {
+       margin-bottom: 30px;
+}
+
+div.mw-benefits-icon {
+       display: inline-block;
+       padding: 0;
+       float: left;
+       width: 80px;
+       height: 75px;
+       margin-right: 15px;
+       border: 0;
+}
+
+.mw-benefits-icon.icon-edits {
+       /* @embed */
+       background: url(images/icon-edits.png) no-repeat right;
+}
+
+.mw-benefits-icon.icon-pages {
+       /* @embed */
+       background: url(images/icon-pages.png) no-repeat right;
+}
+
+.mw-benefits-icon.icon-contributors {
+       /* @embed */
+       background: url(images/icon-contributors.png) no-repeat right;
+}
+
+/* Special font for numbers in benefits*/
+div.mw-number-text h3 {
+       top: 0;
+       margin: 0;
+       padding: 0;
+       color: #252525;
+       font-family: 'Georgia', serif;
+       font-weight: normal;
+       font-size: 2.2em;
+       line-height: 1.2;
+       text-align: center;
+}
+
+div.mw-number-text {
+       display: block;
+       font-size: 1.2em;
+       color: #444;
+       margin-top: 1em;
+       text-align: center;
+}
diff --git a/resources/mediawiki.special/mediawiki.special.createAccount.vform.js b/resources/mediawiki.special/mediawiki.special.createAccount.vform.js
new file mode 100644 (file)
index 0000000..11084fe
--- /dev/null
@@ -0,0 +1,75 @@
+/**
+ * JavaScript for Create account form (Special:UserLogin?type=signup).
+ */
+( function ( mw, $ ) {
+
+       $( document ).ready( function( $ ) {
+               var $content = $( '#mw-content-text' ),
+                       $submit = $content.find( '#wpCreateaccount' ),
+                       tabIndex,
+                       $captchaStuff,
+                       helpMsg = mw.config.get( 'wgCreateacctImgcaptchaHelp' ),
+                       captchaImage;
+
+               /*
+                * CAPTCHA
+                * The CAPTCHA is in a div style="captcha" at the top of the form.
+                * If it's a FancyCaptcha, then we remove it and insert it lower down,
+                * in a customized div with just what we need (e.g. no
+                * fancycaptcha-createaccount message).
+                */
+               if ( !$submit.length) {
+                       return;
+               }
+               tabIndex = $submit.prop( 'tabindex' ) - 1;
+               $captchaStuff = $content.find ( '.captcha' );
+
+               if ( $captchaStuff.length ) {
+
+                       // The FancyCaptcha image has this class in the ConfirmEdit extension
+                       // after 2013-04-18.
+                       captchaImage = $captchaStuff.find( 'img.fancycaptcha-image' );
+                       if ( captchaImage.length !== 1 ) {
+                               return;
+                       }
+
+                       $captchaStuff.remove();
+
+                       // Insert another div before the submit button.
+                       $submit.closest( 'div' )
+                               .before( [
+                       '<div>',
+                               '<label for="wpCaptchaWord">' + mw.message( 'createacct-captcha' ).escaped() + '</label>',
+                               '<div class="mw-createacct-captcha-container">',
+                                       '<div class="mw-createacct-captcha-and-reload">',
+                                               '<div class="mw-createacct-captcha-image-container">',
+                                                       '<img id="mw-createacct-captcha" alt="PLACEHOLDER">',
+                                               '</div>',
+                                       '</div>',
+                                       '<input id="wpCaptchaWord" name="wpCaptchaWord" type="text" placeholder="' +
+                                               mw.message( 'createacct-imgcaptcha-ph' ).escaped() +
+                                               '" tabindex="' + tabIndex + '" autocapitalize="off" autocorrect="off">',
+                                       '<small class="mw-createacct-captcha-assisted">' + helpMsg + '</small>',
+                               '</div>',
+                       '</div>'
+                                       ].join( '' )
+                               );
+
+                       // Replace the placeholder img with the img from the old CAPTCHA.
+                       captchaImage.replaceAll( $content.find( '#mw-createacct-captcha' ) );
+
+                       // Append CAPTCHA reload, if any.
+                       $( '.mw-createacct-captcha-and-reload' ).append( $captchaStuff.find( '.confirmedit-captcha-reload' ) );
+
+                       // Find the input field, add the text (if any) of the existing CAPTCHA
+                       // field (although usually it's blanked out on every redisplay),
+                       // and after it move over the hidden field that tells the CAPTCHA
+                       // what to do.
+                       $content.find( '#wpCaptchaWord' )
+                               .val( $captchaStuff.find( '#wpCaptchaWord' ).val() )
+                               .after( $captchaStuff.find( '#wpCaptchaId' ) );
+               }
+
+       });
+
+}( mediaWiki, jQuery ) );
index d9b950b..2d948ea 100644 (file)
        font-size: 0.8em;
 }
 
+/* Put some space under template's header, which may contain CAPTCHA HTML.*/
+section.mw-form-header {
+       margin-bottom: 10px;
+}
+
 /*
  * Besides errorbox there could be warningbox, successbox, msgbox, though
  * spage has never seen these in practice.
        text-shadow: 0 1px #fae3e3;
        word-wrap: break-word;
 }
+
+/*
+ * Override the right margin of the form to give space in case a benefits
+ * column appears to the side.
+ *
+ */
+.mw-ui-container #userloginForm {
+       margin-right: 100px;
+}
index 2568f5a..c32f54b 100644 (file)
   padding: 0;
   width: 100%;
 }
-/* line 28, sourcefiles/scss/components/default/_forms.scss */
+/* line 27, sourcefiles/scss/components/default/_forms.scss */
 .mw-ui-vform > div input,
-.mw-ui-vform > div label,
 .mw-ui-vform > div .mw-ui-button {
   display: block;
   -webkit-box-sizing: border-box;
   margin: 0;
   width: 100%;
 }
-/* line 35, sourcefiles/scss/components/default/_forms.scss */
+/* line 34, sourcefiles/scss/components/default/_forms.scss */
 .mw-ui-vform > div input {
   outline: 0;
   border-style: solid;
   box-shadow: #4091ed 0px 0px 5px;
   border-color: #4091ed;
 }
-/* line 39, sourcefiles/scss/components/default/_forms.scss */
+/* line 38, sourcefiles/scss/components/default/_forms.scss */
 .mw-ui-vform > div label {
+  display: block;
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
   font-size: 0.9em;
   color: #7d7d7d;
   width: auto;
index fd1ed47..5995439 100644 (file)
   padding: 0;
   width: 100%;
 }
-/* line 28, sourcefiles/scss/components/default/_forms.scss */
+/* line 27, sourcefiles/scss/components/default/_forms.scss */
 .mw-ui-vform > div input,
-.mw-ui-vform > div label,
 .mw-ui-vform > div .mw-ui-button {
   display: block;
   -webkit-box-sizing: border-box;
   margin: 0;
   width: 100%;
 }
-/* line 35, sourcefiles/scss/components/default/_forms.scss */
+/* line 34, sourcefiles/scss/components/default/_forms.scss */
 .mw-ui-vform > div input {
   outline: 0;
   border-style: solid;
   box-shadow: #4091ed 0px 0px 5px;
   border-color: #4091ed;
 }
-/* line 39, sourcefiles/scss/components/default/_forms.scss */
+/* line 38, sourcefiles/scss/components/default/_forms.scss */
 .mw-ui-vform > div label {
+  display: block;
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
   font-size: 0.9em;
   color: #7d7d7d;
   width: auto;
index 86a891a..8bbe3c2 100644 (file)
@@ -24,7 +24,6 @@ $defaultFormWidth: $captchaContainerWidth;
 
         // MW currently doesn't use the type attribute everywhere on inputs.
         input,
-        label,
         .mw-ui-button {
             display: block;
             @include box-sizing(border-box);
@@ -37,8 +36,9 @@ $defaultFormWidth: $captchaContainerWidth;
         }
 
         label {
+            display: block;
+            @include box-sizing(border-box);
             @include agora-label-styling;
-
             width: auto;
             margin: 0 0 0.2em 0;
             padding: 0;
index 2bc7cea..516c58f 100644 (file)
                        return;
                }
 
-               // Placeholder text for search box
-               $searchInput
-                       .attr( 'placeholder', mw.msg( 'searchsuggest-search' ) )
-                       .placeholder();
-
                // Special suggestions functionality for skin-provided search box
                $searchInput.suggestions( {
                        result: {
index 1bd7430..60ef758 100644 (file)
                /**
                 * @property {RegExp}
                 * Regex to match accesskey tooltips.
+                *
+                * Should match:
+                *
+                * - "ctrl-option-"
+                * - "alt-shift-"
+                * - "ctrl-alt-"
+                * - "ctrl-"
+                *
+                * The accesskey is matched in group $6.
                 */
-               tooltipAccessKeyRegexp: /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/,
+               tooltipAccessKeyRegexp: /\[(ctrl-)?(option-)?(alt-)?(shift-)?(esc-)?(.)\]$/,
 
                /**
                 * Add the appropriate prefix to the accesskey shown in the tooltip.
                        }
 
                        $nodes.attr( 'title', function ( i, val ) {
-                               if ( val && util.tooltipAccessKeyRegexp.exec( val ) ) {
+                               if ( val && util.tooltipAccessKeyRegexp.test( val ) ) {
                                        return val.replace( util.tooltipAccessKeyRegexp,
-                                               '[' + util.tooltipAccessKeyPrefix + '$5]' );
+                                               '[' + util.tooltipAccessKeyPrefix + '$6]' );
                                }
                                return val;
                        } );
                        if ( id ) {
                                $item.attr( 'id', id );
                        }
-                       if ( accesskey ) {
-                               $link.attr( 'accesskey', accesskey );
-                               tooltip += ' [' + accesskey + ']';
+
+                       if ( tooltip ) {
+                               // Trim any existing accesskey hint and the trailing space
+                               tooltip = $.trim( tooltip.replace( util.tooltipAccessKeyRegexp, '' ) );
+                               if ( accesskey ) {
+                                       tooltip += ' [' + accesskey + ']';
+                               }
                                $link.attr( 'title', tooltip );
+                               if ( accesskey ) {
+                                       util.updateTooltipAccessKeys( $link );
+                               }
                        }
-                       if ( accesskey && tooltip ) {
-                               util.updateTooltipAccessKeys( $link );
+
+                       if ( accesskey ) {
+                               $link.attr( 'accesskey', accesskey );
                        }
 
                        // Where to put our node ?
                        // - nextnode is a DOM element (was the only option before MW 1.17, in wikibits.js)
                        if ( nextnode && nextnode.parentNode === $ul[0] ) {
-                               $(nextnode).before( $item );
+                               $( nextnode ).before( $item );
 
                        // - nextnode is a CSS selector for jQuery
                        } else if ( typeof nextnode === 'string' && $ul.find( nextnode ).length !== 0 ) {
index f8d55c5..1e4643e 100644 (file)
@@ -187,7 +187,7 @@ class VectorTemplate extends BaseTemplate {
                                <?php } ?>
                                <?php if ( $this->data['newtalk'] ) { ?>
                                <!-- newtalk -->
-                               <div class="usermessage"><?php $this->html( 'newtalk' )  ?></div>
+                               <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
                                <!-- /newtalk -->
                                <?php } ?>
                                <?php if ( $this->data['showjumplinks'] ) { ?>
@@ -304,7 +304,7 @@ class VectorTemplate extends BaseTemplate {
                        }
 
                        echo "\n<!-- {$name} -->\n";
-                       switch( $name ) {
+                       switch ( $name ) {
                                case 'SEARCH':
                                        break;
                                case 'TOOLBOX':
@@ -381,7 +381,7 @@ class VectorTemplate extends BaseTemplate {
                // Render elements
                foreach ( $elements as $name => $element ) {
                        echo "\n<!-- {$name} -->\n";
-                       switch( $element ) {
+                       switch ( $element ) {
                                case 'NAMESPACES':
 ?>
 <div id="p-namespaces" role="navigation" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
index 147cd15..e8c851f 100644 (file)
@@ -384,19 +384,22 @@ input.searchButton {
 #p-personal li.active a:hover {
        background-color: transparent;
 }
-/* the icon in front of the user name, single quotes
-in bg url to hide it from iemac */
+/* The icon in front of the username / login link */
 li#pt-userpage,
 li#pt-anonuserpage,
 li#pt-login {
        /* @embed */
        background: url(user.gif) top left no-repeat;
        padding-left: 20px;
-       text-transform: none;
 }
 #p-personal ul {
        text-transform: lowercase;
 }
+/* Don't lowercase username or IP addresses (IPv6) */
+li#pt-userpage,
+li#pt-anonuserpage {
+       text-transform: none;
+}
 #p-personal li.active {
        font-weight: bold;
 }
index 6acc994..dc4267f 100644 (file)
@@ -789,7 +789,6 @@ div#content a.external[href *=".pdf?"], div#content a.external[href *=".PDF?"],
        /* @embed */
        background-image: linear-gradient(transparent, transparent), url(images/user-icon.svg);
        padding-left: 15px !important;
-       text-transform: none;
 }
 
 .redirectText {
index b7320cb..964b7d6 100644 (file)
@@ -108,7 +108,7 @@ class SeleniumTester extends Maintenance {
        }
 
        protected function stopServer() {
-               if ( !isset ( $this->serverManager ) ) {
+               if ( !isset( $this->serverManager ) ) {
                        echo ( "Warning: Request to stop Selenium Server, but it was " .
                                "not stared by RunSeleniumTests\n" .
                                "RunSeleniumTests cannot stop a Selenium Server it " .
index 83c2fcb..ca92fe3 100644 (file)
@@ -30,6 +30,7 @@ $wgAutoloadClasses += array(
        'DbTestPreviewer' => "$testDir/testHelpers.inc",
        'DbTestRecorder' => "$testDir/testHelpers.inc",
        'DelayedParserTest' => "$testDir/testHelpers.inc",
+       'ParserTestResult' => "$testDir/parser/ParserTestResult.php",
        'TestFileIterator' => "$testDir/testHelpers.inc",
        'TestRecorder' => "$testDir/testHelpers.inc",
 
diff --git a/tests/parser/ParserTestResult.php b/tests/parser/ParserTestResult.php
new file mode 100644 (file)
index 0000000..e846da5
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @copyright Copyright © 2013, Antoine Musso
+ * @copyright Copyright © 2013, Wikimedia Foundation Inc.
+ * @license GNU GPL v2
+ *
+ * @file
+ */
+
+/**
+ * Represent the result of a parser test.
+ *
+ * @since 1.22
+ */
+class ParserTestResult {
+       /**
+        * Description of the parser test.
+        *
+        * This is usually the text used to describe a parser test in the .txt
+        * files.  It is initialized on a construction and you most probably
+        * never want to change it.
+        */
+       public $description;
+       /** Text that was expected */
+       public $expected;
+       /** Actual text rendered */
+       public $actual;
+
+       /**
+        * @param $description string A short text describing the parser test
+        *        usually the text in the parser test .txt file.  The description
+        *        is later available using the property $description.
+        */
+       public function __construct( $description ) {
+               $this->description = $description;
+       }
+
+       /** Whether the test passed */
+       public function isSuccess() {
+               return ($this->expected === $this->actual);
+       }
+}
index 3d34f34..7c8daf2 100644 (file)
@@ -518,18 +518,23 @@ class ParserTest {
                }
 
                $this->teardownGlobals();
-               return $this->showTestResult( $desc, $result, $out );
+
+               $testResult = new ParserTestResult( $desc );
+               $testResult->expected = $result;
+               $testResult->actual = $out;
+
+               return $this->showTestResult( $testResult );
        }
 
        /**
-        *
+        * Refactored in 1.22 to use ParserTestResult
         */
-       function showTestResult( $desc, $result, $out ) {
-               if ( $result === $out ) {
-                       $this->showSuccess( $desc );
+       function showTestResult( ParserTestResult $testResult ) {
+               if ( $testResult->isSuccess() ) {
+                       $this->showSuccess( $testResult );
                        return true;
                } else {
-                       $this->showFailure( $desc, $result, $out );
+                       $this->showFailure( $testResult );
                        return false;
                }
        }
@@ -1095,10 +1100,12 @@ class ParserTest {
        /**
         * Print a happy success message.
         *
-        * @param $desc String: the test name
+        * Refactored in 1.22 to use ParserTestResult
+        *
+        * @param $testResult ParserTestResult
         * @return Boolean
         */
-       protected function showSuccess( $desc ) {
+       protected function showSuccess( ParserTestResult $testResult ) {
                if ( $this->showProgress ) {
                        print $this->term->color( '1;32' ) . 'PASSED' . $this->term->reset() . "\n";
                }
@@ -1110,28 +1117,29 @@ class ParserTest {
         * Print a failure message and provide some explanatory output
         * about what went wrong if so configured.
         *
-        * @param $desc String: the test name
-        * @param $result String: expected HTML output
-        * @param $html String: actual HTML output
+        * Refactored in 1.22 to use ParserTestResult
+        *
+        * @param $testResult ParserTestResult
         * @return Boolean
         */
-       protected function showFailure( $desc, $result, $html ) {
+       protected function showFailure( ParserTestResult $testResult ) {
                if ( $this->showFailure ) {
                        if ( !$this->showProgress ) {
                                # In quiet mode we didn't show the 'Testing' message before the
                                # test, in case it succeeded. Show it now:
-                               $this->showTesting( $desc );
+                               $this->showTesting( $testResult->description );
                        }
 
                        print $this->term->color( '31' ) . 'FAILED!' . $this->term->reset() . "\n";
 
                        if ( $this->showOutput ) {
-                               print "--- Expected ---\n$result\n--- Actual ---\n$html\n";
+                               print "--- Expected ---\n{$testResult->expected}\n";
+                               print "--- Actual ---\n{$testResult->actual}\n";
                        }
 
                        if ( $this->showDiffs ) {
-                               print $this->quickDiff( $result, $html );
-                               if ( !$this->wellFormed( $html ) ) {
+                               print $this->quickDiff( $testResult->expected, $testResult->actual );
+                               if ( !$this->wellFormed( $testResult->actual ) ) {
                                        print "XML error: $this->mXmlError\n";
                                }
                        }
index 540b6f4..0631196 100644 (file)
@@ -3969,6 +3969,33 @@ Link containing "<#" and ">#" as a hex sequences
 </p>
 !! end
 
+!! test
+Link containing an equals sign
+!! input
+[[Special:BookSources/isbn=4-00-026157-6]]
+!! result
+<p><a href="/wiki/Special:BookSources/isbn%3D4-00-026157-6" title="Special:BookSources/isbn=4-00-026157-6">Special:BookSources/isbn=4-00-026157-6</a>
+</p>
+!! end
+
+!! article
+Foo~bar
+!! text
+Just a test of an article title containing a tilde.
+!! endarticle
+
+# note that links containing signatures, like [[Foo~~~~]], are
+# massaged by the pre-save transform (PST) and so the tildes are never
+# seen by the parser.
+!! test
+Link containing a tilde
+!! input
+[[Foo~bar]]
+!! result
+<p><a href="/wiki/Foo%7Ebar" title="Foo~bar">Foo~bar</a>
+</p>
+!! end
+
 !! test
 Link containing double-single-quotes '' (bug 4598)
 !! input
@@ -4230,6 +4257,23 @@ language=kaa
 </p>
 !! end
 
+!! article
+Söfnuður
+!! text
+Test.
+!! endarticle
+
+!! test
+Internal link with is linkprefix
+!! options
+language=is
+!! input
+Aðrir mótmælenda[[söfnuður|söfnuðir]] og
+!! result
+<p>Aðrir <a href="/wiki/S%C3%B6fnu%C3%B0ur" title="Söfnuður">mótmælendasöfnuðir</a> og
+</p>
+!! end
+
 !! test
 Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved
 !! input
@@ -10955,6 +10999,8 @@ Say the magic word
 * {{BASEPAGENAME}}
 * {{SUBPAGENAME}}
 * {{SUBPAGENAMEE}}
+* {{ROOTPAGENAME}}
+* {{ROOTPAGENAMEE}}
 * {{BASEPAGENAME}}
 * {{BASEPAGENAMEE}}
 * {{TALKPAGENAME}}
@@ -10975,6 +11021,8 @@ Say the magic word
 </li><li> Parser_test
 </li><li> Parser test
 </li><li> Parser_test
+</li><li> Parser test
+</li><li> Parser_test
 </li><li> Talk:Parser test
 </li><li> Talk:Parser_test
 </li><li> Parser test
index 0cf6e38..1131385 100644 (file)
@@ -15,6 +15,10 @@ abstract class MediaWikiLangTestCase extends MediaWikiTestCase {
                                "\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" );
                }
 
+               // HACK: Call getLanguage() so the real $wgContLang is cached as the user language
+               // rather than our fake one. This is to avoid breaking other, unrelated tests.
+               RequestContext::getMain()->getLanguage();
+
                $langCode = 'en'; # For mainpage to be 'Main Page'
                $langObj = Language::factory( $langCode );
 
index 12c2e00..b9117fd 100644 (file)
@@ -18,7 +18,6 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
                foreach ( self::$additionalOptions as $option => $default ) {
                        $this->longOptions[$option] = $option . 'Handler';
                }
-
        }
 
        public static function main( $exit = true ) {
@@ -97,5 +96,4 @@ Database options:
 
 EOT;
        }
-
 }
index ecc8ad1..440f866 100644 (file)
@@ -137,6 +137,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        protected function getNewTempFile() {
                $fname = tempnam( wfTempDir(), 'MW_PHPUnit_' . get_class( $this ) . '_' );
                $this->tmpfiles[] = $fname;
+
                return $fname;
        }
 
@@ -158,6 +159,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                // where temporary directory creation is bundled and can be improved
                unlink( $fname );
                $this->assertTrue( wfMkdirParents( $fname ) );
+
                return $fname;
        }
 
@@ -348,7 +350,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * Stub. If a test needs to add additional data to the database, it should
         * implement this method and do so
         */
-       function addDBData() {}
+       function addDBData() {
+       }
 
        private function addCoreDBData() {
                # disabled for performance
@@ -377,7 +380,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                                'page_touched' => $this->db->timestamp(),
                                'page_latest' => 0,
                                'page_len' => 0 ), __METHOD__, array( 'IGNORE' ) );
-
                }
 
                User::resetIdByNameCache();
@@ -394,7 +396,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        $user->saveSettings();
                }
 
-
                //Make 1 page with 1 revision
                $page = WikiPage::factory( Title::newFromText( 'UTPage' ) );
                if ( !$page->getId() == 0 ) {
@@ -461,6 +462,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
                if ( ( $db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) {
                        CloneDatabase::changePrefix( $prefix );
+
                        return;
                } else {
                        $dbClone->cloneTableStructure();
@@ -523,6 +525,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        private static function unprefixTable( $tableName ) {
                global $wgDBprefix;
+
                return substr( $tableName, strlen( $wgDBprefix ) );
        }
 
@@ -547,6 +550,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        unset( $tables['searchindex_segments'] );
                        $tables = array_flip( $tables );
                }
+
                return $tables;
        }
 
@@ -561,13 +565,11 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                if ( isset( MediaWikiPHPUnitCommand::$additionalOptions[$offset] ) ) {
                        return MediaWikiPHPUnitCommand::$additionalOptions[$offset];
                }
-
        }
 
        public function setCliArg( $offset, $value ) {
 
                MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value;
-
        }
 
        /**
@@ -839,6 +841,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        ) {
 
                                $wikitextNS = $ns;
+
                                return $wikitextNS;
                        }
                }
@@ -906,6 +909,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                if ( !$loaded ) {
                        $this->markTestSkipped( "PHP extension '$extName' is not loaded, skipping." );
                }
+
                return $loaded;
        }
 
@@ -934,5 +938,4 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
                $this->assertInstanceOf( $expected, $pokemons, $message );
        }
-
 }
index 01caf8f..3978b8d 100644 (file)
@@ -11,7 +11,7 @@ if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
 You are running these tests directly from phpunit. You may not have all globals correctly set.
 Running phpunit.php instead is recommended.
 EOF;
-       require_once ( __DIR__ . "/phpunit.php" );
+       require_once( __DIR__ . "/phpunit.php" );
 }
 
 // Output a notice when running with older versions of PHPUnit
index 967ffa1..686ab93 100644 (file)
@@ -16,18 +16,17 @@ class ArticleTablesTest extends MediaWikiLangTestCase {
                $wgContLang = Language::factory( 'es' );
 
                $wgLang = Language::factory( 'fr' );
-               $status = $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', 0, false, $user );
+               $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', 0, false, $user );
                $templates1 = $title->getTemplateLinksFrom();
 
                $wgLang = Language::factory( 'de' );
                $page->mPreparedEdit = false; // In order to force the rerendering of the same wikitext
 
                // We need an edit, a purge is not enough to regenerate the tables
-               $status = $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', EDIT_UPDATE, false, $user );
+               $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', EDIT_UPDATE, false, $user );
                $templates2 = $title->getTemplateLinksFrom();
 
                $this->assertEquals( $templates1, $templates2 );
                $this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
        }
-
 }
index 02546fa..32fc2c5 100644 (file)
@@ -59,7 +59,7 @@ class BlockTest extends MediaWikiLangTestCase {
         * debug function : dump the ipblocks table
         */
        function dumpBlocks() {
-               $v = $this->db->query( 'SELECT * FROM unittest_ipblocks' );
+               $v = $this->db->select( 'ipblocks', '*' );
                print "Got " . $v->numRows() . " rows. Full dump follow:\n";
                foreach ( $v as $row ) {
                        print_r( $row );
@@ -72,7 +72,6 @@ class BlockTest extends MediaWikiLangTestCase {
                $this->assertTrue( $this->block->equals( Block::newFromTarget( 'UTBlockee' ) ), "newFromTarget() returns the same block as the one that was made" );
 
                $this->assertTrue( $this->block->equals( Block::newFromID( $this->blockId ) ), "newFromID() returns the same block as the one that was made" );
-
        }
 
        /**
@@ -82,7 +81,6 @@ class BlockTest extends MediaWikiLangTestCase {
                // delta to stop one-off errors when things happen to go over a second mark.
                $delta = abs( $this->madeAt - $this->block->mTimestamp );
                $this->assertLessThan( 2, $delta, "If no timestamp is specified, the block is recorded as time()" );
-
        }
 
        /**
@@ -133,7 +131,6 @@ class BlockTest extends MediaWikiLangTestCase {
                $u->addToDatabase();
                unset( $u );
 
-
                // Sanity check
                $this->assertNull(
                        Block::newFromTarget( $username ),
index add585d..e3d9da7 100644 (file)
@@ -66,7 +66,6 @@ class CdbTest extends MediaWikiTestCase {
                        $this->cdbAssert( "PHP error", $key, $v1, $value );
                        $this->cdbAssert( "DBA error", $key, $v2, $value );
                }
-
        }
 
        private function randomString() {
@@ -75,6 +74,7 @@ class CdbTest extends MediaWikiTestCase {
                for ( $j = 0; $j < $len; $j++ ) {
                        $s .= chr( mt_rand( 0, 255 ) );
                }
+
                return $s;
        }
 
index c746208..f1004fb 100644 (file)
@@ -47,6 +47,7 @@ class CollationTest extends MediaWikiLangTestCase {
                        array( 'en', 'A', 'Aꦲ' ),
                );
        }
+
        /**
         * Opposite of testIsPrefix
         *
@@ -84,6 +85,7 @@ class CollationTest extends MediaWikiLangTestCase {
                $col = Collation::factory( $collation );
                $this->assertEquals( $firstLetter, $col->getFirstLetter( $string ) );
        }
+
        function firstLetterProvider() {
                return array(
                        array( 'uppercase', 'Abc', 'A' ),
index dcd9ddd..53f33d9 100644 (file)
@@ -4,14 +4,17 @@ class DiffHistoryBlobTest extends MediaWikiTestCase {
        protected function setUp() {
                if ( !extension_loaded( 'xdiff' ) ) {
                        $this->markTestSkipped( 'The xdiff extension is not available' );
+
                        return;
                }
                if ( !function_exists( 'xdiff_string_rabdiff' ) ) {
                        $this->markTestSkipped( 'The version of xdiff extension is lower than 1.5.0' );
+
                        return;
                }
                if ( !extension_loaded( 'hash' ) && !extension_loaded( 'mhash' ) ) {
                        $this->markTestSkipped( 'Neither the hash nor mhash extension is available' );
+
                        return;
                }
                parent::setUp();
index 4053683..fb2304d 100644 (file)
@@ -81,5 +81,4 @@ class FormOptionsInitializationTest extends MediaWikiTestCase {
                        $this->object->getOptions()
                );
        }
-
 }
index 2e6417f..166a3ce 100644 (file)
@@ -257,7 +257,6 @@ class GlobalTest extends MediaWikiTestCase {
 
                $sampleUTF = "Östergötland_coat_of_arms.png";
 
-
                //mb_substr
                $substr_params = array(
                        array( 0, 0 ),
@@ -280,7 +279,6 @@ class GlobalTest extends MediaWikiTestCase {
                        );
                }
 
-
                //mb_strlen
                $this->assertEquals(
                        mb_strlen( $sampleUTF ),
@@ -288,7 +286,6 @@ class GlobalTest extends MediaWikiTestCase {
                        'Fallback mb_strlen'
                );
 
-
                //mb_str(r?)pos
                $strpos_params = array(
                        //array( 'ter' ),
@@ -315,7 +312,6 @@ class GlobalTest extends MediaWikiTestCase {
                                'Fallback mb_strrpos with params ' . implode( ', ', $old_param_set )
                        );
                }
-
        }
 
 
@@ -329,7 +325,6 @@ class GlobalTest extends MediaWikiTestCase {
                $old_wgDebugTimestamps = $wgDebugTimestamps;
                $wgDebugTimestamps = false;
 
-
                wfDebug( "This is a normal string" );
                $this->assertEquals( "This is a normal string", file_get_contents( $wgDebugLogFile ) );
                unlink( $wgDebugLogFile );
@@ -338,7 +333,6 @@ class GlobalTest extends MediaWikiTestCase {
                $this->assertEquals( "This is nöt an ASCII string", file_get_contents( $wgDebugLogFile ) );
                unlink( $wgDebugLogFile );
 
-
                wfDebug( "\00305This has böth UTF and control chars\003" );
                $this->assertEquals( " 05This has böth UTF and control chars ", file_get_contents( $wgDebugLogFile ) );
                unlink( $wgDebugLogFile );
@@ -351,7 +345,6 @@ class GlobalTest extends MediaWikiTestCase {
                $this->assertGreaterThan( 5000000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) );
                unlink( $wgDebugLogFile );
 
-
                $wgDebugLogFile = $old_log_file;
                $wgDebugTimestamps = $old_wgDebugTimestamps;
        }
@@ -398,7 +391,6 @@ class GlobalTest extends MediaWikiTestCase {
 
                $this->assertEquals( $var1, 2, 'var1 is swapped' );
                $this->assertEquals( $var2, 1, 'var2 is swapped' );
-
        }
 
        function testWfPercentTest() {
@@ -643,6 +635,7 @@ class GlobalTest extends MediaWikiTestCase {
                                array( "$p//nds-nl.wikipedia.org", array( 'nl.wikipedia.org' ), true, "Substrings of domains match while they shouldn't, $pDesc URL" ),
                        ) );
                }
+
                return $a;
        }
 
@@ -660,6 +653,7 @@ class GlobalTest extends MediaWikiTestCase {
 
        public static function provideWfShellMaintenanceCmdList() {
                global $wgPhpCli;
+
                return array(
                        array( 'eval.php', array( '--help', '--test' ), array(),
                                "'$wgPhpCli' 'eval.php' '--help' '--test'",
index c585726..8bd0849 100644 (file)
@@ -13,6 +13,7 @@ class GlobalWithDBTest extends MediaWikiTestCase {
 
        public static function provideWfIsBadImageList() {
                $blacklist = '* [[File:Bad.jpg]] except [[Nasty page]]';
+
                return array(
                        array( 'Bad.jpg', false, $blacklist, true,
                                'Called on a bad image' ),
index 4bd8c68..4184d15 100644 (file)
@@ -87,7 +87,6 @@ class WfAssembleUrlTest extends MediaWikiTestCase {
                                                                $url .= '#' . $fragment;
                                                        }
 
-
                                                        $cases[] = array(
                                                                $parts,
                                                                $url,
index 10b62b3..c60f223 100644 (file)
@@ -152,6 +152,7 @@ class WfBaseConvertTest extends MediaWikiTestCase {
 
                        $x[] = array( $base, $str );
                }
+
                return $x;
        }
 
index 8c67ced..5b622c1 100644 (file)
@@ -103,6 +103,7 @@ class WfExpandUrlTest extends MediaWikiTestCase {
                                }
                        }
                }
+
                return $retval;
        }
 }
index 87193fa..3521d18 100644 (file)
@@ -18,6 +18,7 @@ class WfGetCallerTest extends MediaWikiTestCase {
                if ( $n > 0 ) {
                        return self::intermediateFunction( $level, $n - 1 );
                }
+
                return wfGetCaller( $level );
        }
 
index e4e33d1..604f901 100644 (file)
@@ -24,5 +24,4 @@ class WfShorthandToIntegerTest extends MediaWikiTestCase {
                        array( '1k', 1024, 'One kb lowercased' ),
                );
        }
-
 }
index ddfffe8..3ac33a4 100644 (file)
@@ -12,6 +12,7 @@ class WfTimestampTest extends MediaWikiTestCase {
 
        public static function provideNormalTimestamps() {
                $t = gmmktime( 12, 34, 56, 1, 15, 2001 );
+
                return array(
                        // TS_UNIX
                        array( $t, TS_MW, '20010115123456', 'TS_UNIX to TS_MW' ),
index 89e789b..81dd487 100644 (file)
@@ -2,81 +2,62 @@
 
 class HooksTest extends MediaWikiTestCase {
 
-       public function testOldStyleHooks() {
-               $foo = 'Foo';
-               $bar = 'Bar';
-
-               $i = new NothingClass();
-
+       function setUp() {
                global $wgHooks;
-
-               $wgHooks['MediaWikiHooksTest001'][] = array( $i, 'someNonStatic' );
-
-               wfRunHooks( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
-
-               $this->assertEquals( 'fOO', $foo, 'Standard method' );
-               $foo = 'Foo';
-
-               $wgHooks['MediaWikiHooksTest001'][] = $i;
-
-               wfRunHooks( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
-
-               $this->assertEquals( 'foo', $foo, 'onEventName style' );
-               $foo = 'Foo';
-
-               $wgHooks['MediaWikiHooksTest001'][] = array( $i, 'someNonStaticWithData', 'baz' );
-
-               wfRunHooks( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
-
-               $this->assertEquals( 'baz', $foo, 'Data included' );
-               $foo = 'Foo';
-
-               $wgHooks['MediaWikiHooksTest001'][] = array( $i, 'someStatic' );
-
-               wfRunHooks( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
-
-               $this->assertEquals( 'bah', $foo, 'Standard static method' );
-               //$foo = 'Foo';
-
+               parent::setUp();
+               Hooks::clear( 'MediaWikiHooksTest001' );
                unset( $wgHooks['MediaWikiHooksTest001'] );
-
        }
 
-       public function testNewStyleHooks() {
-               $foo = 'Foo';
-               $bar = 'Bar';
-
+       public static function provideHooks() {
                $i = new NothingClass();
 
-               Hooks::register( 'MediaWikiHooksTest001', array( $i, 'someNonStatic' ) );
-
-               Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
-
-               $this->assertEquals( 'fOO', $foo, 'Standard method' );
-               $foo = 'Foo';
-
-               Hooks::register( 'MediaWikiHooksTest001', $i );
-
-               Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
-
-               $this->assertEquals( 'foo', $foo, 'onEventName style' );
-               $foo = 'Foo';
+               return array(
+                       array( 'Object and method', array( $i, 'someNonStatic' ), 'changed-nonstatic', 'changed-nonstatic' ),
+                       array( 'Object and no method', array( $i ), 'changed-onevent', 'original' ),
+                       array( 'Object and method with data', array( $i, 'someNonStaticWithData', 'data' ), 'data', 'original' ),
+                       array( 'Object and static method', array( $i, 'someStatic' ), 'changed-static', 'original' ),
+                       array( 'Class::method static call', array( 'NothingClass::someStatic' ), 'changed-static', 'original' ),
+                       array( 'Global function', array( 'NothingFunction' ), 'changed-func', 'original' ),
+                       array( 'Global function with data', array( 'NothingFunctionData', 'data' ), 'data', 'original' ),
+                       array( 'Closure', array( function ( &$foo, $bar ) {
+                               $foo = 'changed-closure';
+
+                               return true;
+                       } ), 'changed-closure', 'original' ),
+                       array( 'Closure with data', array( function ( $data, &$foo, $bar ) {
+                               $foo = $data;
+
+                               return true;
+                       }, 'data' ), 'data', 'original' )
+               );
+       }
 
-               Hooks::register( 'MediaWikiHooksTest001', array( $i, 'someNonStaticWithData', 'baz' ) );
+       /**
+        * @dataProvider provideHooks
+        */
+       public function testOldStyleHooks( $msg, array $hook, $expectedFoo, $expectedBar ) {
+               global $wgHooks;
+               $foo = $bar = 'original';
 
-               Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
+               $wgHooks['MediaWikiHooksTest001'][] = $hook;
+               wfRunHooks( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
 
-               $this->assertEquals( 'baz', $foo, 'Data included' );
-               $foo = 'Foo';
+               $this->assertSame( $expectedFoo, $foo, $msg );
+               $this->assertSame( $expectedBar, $bar, $msg );
+       }
 
-               Hooks::register( 'MediaWikiHooksTest001', array( $i, 'someStatic' ) );
+       /**
+        * @dataProvider provideHooks
+        */
+       public function testNewStyleHooks( $msg, $hook, $expectedFoo, $expectedBar ) {
+               $foo = $bar = 'original';
 
+               Hooks::register( 'MediaWikiHooksTest001', $hook );
                Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
 
-               $this->assertEquals( 'bah', $foo, 'Standard static method' );
-               $foo = 'Foo';
-
-               Hooks::clear( 'MediaWikiHooksTest001' );
+               $this->assertSame( $expectedFoo, $foo, $msg );
+               $this->assertSame( $expectedBar, $bar, $msg );
        }
 
        public function testNewStyleHookInteraction() {
@@ -85,10 +66,6 @@ class HooksTest extends MediaWikiTestCase {
                $a = new NothingClass();
                $b = new NothingClass();
 
-               // make sure to start with a clean slate
-               Hooks::clear( 'MediaWikiHooksTest001' );
-               unset( $wgHooks['MediaWikiHooksTest001'] );
-
                $wgHooks['MediaWikiHooksTest001'][] = $a;
                $this->assertTrue( Hooks::isRegistered( 'MediaWikiHooksTest001' ), 'Hook registered via $wgHooks should be noticed by Hooks::isRegistered' );
 
@@ -101,37 +78,81 @@ class HooksTest extends MediaWikiTestCase {
                Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) );
                $this->assertEquals( 1, $a->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' );
                $this->assertEquals( 1, $b->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' );
+       }
 
-               // clean up
-               Hooks::clear( 'MediaWikiHooksTest001' );
-               unset( $wgHooks['MediaWikiHooksTest001'] );
+       /**
+        * @expectedException MWException
+        */
+       public function testUncallableFunction() {
+               Hooks::register( 'MediaWikiHooksTest001', 'ThisFunctionDoesntExist' );
+               Hooks::run( 'MediaWikiHooksTest001', array() );
        }
+
+       public function testFalseReturn() {
+               Hooks::register( 'MediaWikiHooksTest001', function ( &$foo ) {
+                       return false;
+               } );
+               Hooks::register( 'MediaWikiHooksTest001', function ( &$foo ) {
+                       $foo = 'test';
+
+                       return true;
+               } );
+               $foo = 'original';
+               Hooks::run( 'MediaWikiHooksTest001', array( &$foo ) );
+               $this->assertSame( 'original', $foo, 'Hooks continued processing after a false return.' );
+       }
+
+       /**
+        * @expectedException FatalError
+        */
+       public function testFatalError() {
+               Hooks::register( 'MediaWikiHooksTest001', function () {
+                       return 'test';
+               } );
+               Hooks::run( 'MediaWikiHooksTest001', array() );
+       }
+}
+
+function NothingFunction( &$foo, &$bar ) {
+       $foo = 'changed-func';
+
+       return true;
+}
+
+function NothingFunctionData( $data, &$foo, &$bar ) {
+       $foo = $data;
+
+       return true;
 }
 
 class NothingClass {
        public $calls = 0;
 
        public static function someStatic( &$foo, &$bar ) {
-               $foo = 'bah';
+               $foo = 'changed-static';
+
                return true;
        }
 
        public function someNonStatic( &$foo, &$bar ) {
                $this->calls++;
-               $foo = 'fOO';
-               $bar = 'bAR';
+               $foo = 'changed-nonstatic';
+               $bar = 'changed-nonstatic';
+
                return true;
        }
 
        public function onMediaWikiHooksTest001( &$foo, &$bar ) {
                $this->calls++;
-               $foo = 'foo';
+               $foo = 'changed-onevent';
+
                return true;
        }
 
-       public function someNonStaticWithData( $foo, &$bar ) {
+       public function someNonStaticWithData( $data, &$foo, &$bar ) {
                $this->calls++;
-               $bar = $foo;
+               $foo = $data;
+
                return true;
        }
 }
index 9e3d3a4..4e010d4 100644 (file)
@@ -432,6 +432,7 @@ class HtmlTest extends MediaWikiTestCase {
                foreach ( $types as $type ) {
                        $cases[] = array( $type );
                }
+
                return $cases;
        }
 
@@ -596,6 +597,7 @@ class HtmlTest extends MediaWikiTestCase {
                                isset( $case[3] ) ? $case[3] : ''
                        );
                }
+
                return $ret;
        }
 
@@ -610,5 +612,4 @@ class HtmlTest extends MediaWikiTestCase {
                        'Allow special case "step=any".'
                );
        }
-
 }
index 7698776..12ba226 100644 (file)
@@ -194,6 +194,7 @@ class MWHttpRequestTester extends MWHttpRequest {
                                        throw new MWException( __METHOD__ . ': allow_url_fopen needs to be enabled for pure PHP' .
                                                ' http requests to work. If possible, curl should be used instead. See http://php.net/curl.' );
                                }
+
                                return new PhpHttpRequestTester( $url, $options );
                        default:
                }
index ab93b2b..93ce119 100644 (file)
@@ -123,7 +123,6 @@ class TestConverter extends LanguageConverter {
                        'tg' => new ReplacementArray()
                );
        }
-
 }
 
 class LanguageToTest extends Language {
index c83f7da..ae551c0 100644 (file)
@@ -122,7 +122,6 @@ class LinksUpdateTest extends MediaWikiTestCase {
 
                $po->addImage( "Foo.png" );
 
-
                $this->assertLinksUpdate( $t, $po, 'imagelinks', 'il_to', 'il_from = 111', array(
                        array( 'Foo.png' ),
                ) );
@@ -133,7 +132,6 @@ class LinksUpdateTest extends MediaWikiTestCase {
 
                $po->addLanguageLink( Title::newFromText( "en:Foo" )->getFullText() );
 
-
                $this->assertLinksUpdate( $t, $po, 'langlinks', 'll_lang, ll_title', 'll_from = 111', array(
                        array( 'En', 'Foo' ),
                ) );
index 6c17bf4..becf507 100644 (file)
@@ -59,7 +59,6 @@ class MWFunctionTest extends MediaWikiTestCase {
        public static function someMethod() {
                return func_get_args();
        }
-
 }
 
 class MWBlankClass {
index 6b71b7e..7d6d5a1 100644 (file)
@@ -125,7 +125,6 @@ class MWNamespaceTest extends MediaWikiTestCase {
        public function testGetAssociated() {
                $this->assertEquals( NS_TALK, MWNamespace::getAssociated( NS_MAIN ) );
                $this->assertEquals( NS_MAIN, MWNamespace::getAssociated( NS_TALK ) );
-
        }
 
        ### Exceptions with getAssociated()
@@ -201,7 +200,6 @@ class MWNamespaceTest extends MediaWikiTestCase {
                        NS_SPECIAL, NS_MEDIA,
                        "NS_SPECIAL and NS_MEDIA are different subject namespaces"
                );
-
        }
 
        /**
@@ -350,7 +348,6 @@ class MWNamespaceTest extends MediaWikiTestCase {
                        '$wgContentNamespaces is an array with only NS_MAIN by default'
                );
 
-
                # test !is_array( $wgcontentNamespaces )
                $wgContentNamespaces = '';
                $this->assertEquals( NS_MAIN, MWNamespace::getContentNamespaces() );
index 9e50b4c..386ddb8 100644 (file)
@@ -253,5 +253,4 @@ class PathRouterTest extends MediaWikiTestCase {
                $matches = $router->parse( "/wiki/Foo" );
                $this->assertEquals( $matches, array( 'title' => 'bar%20$1' ) );
        }
-
 }
index 7aa3c4a..b909f26 100644 (file)
@@ -77,6 +77,7 @@ class PreferencesTest extends MediaWikiTestCase {
                        , $this->context
                        , $preferences
                );
+
                return $preferences;
        }
 }
index 948b635..4ddc0b0 100644 (file)
@@ -16,6 +16,7 @@ class MediaWikiProvide {
                for ( $i = 1; $i <= $num; $i++ ) {
                        $ret[] = array( $i );
                }
+
                return $ret;
        }
 
@@ -39,6 +40,7 @@ class MediaWikiProvide {
                                $ret[] = array( $day[0], $month[0] );
                        }
                }
+
                return $ret;
        }
 }
index a1e6236..56967de 100644 (file)
@@ -276,5 +276,4 @@ class RecentChangeTest extends MediaWikiTestCase {
                        $msg
                );
        }
-
 }
index f587171..e3a9cfb 100644 (file)
@@ -25,7 +25,6 @@ class RequestContextTest extends MediaWikiTestCase {
                $context->setTitle( $curTitle );
                $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ),
                        "When a title is updated the WikiPage should be purged and recreated on-demand with the new title." );
-
        }
 
        public function testImportScopedSession() {
@@ -58,7 +57,7 @@ class RequestContextTest extends MediaWikiTestCase {
                $this->assertEquals( $sinfo['userId'], $context->getUser()->getId(), "Correct context user ID." );
                $this->assertEquals( 'UnitTestContextUser', $context->getUser()->getName(), "Correct context user name." );
 
-               unset ( $sc ); // restore previous context
+               unset( $sc ); // restore previous context
 
                $info = $context->exportSession();
                $this->assertEquals( $oInfo['ip'], $info['ip'], "Correct initial IP address." );
index 60618b1..68db9ad 100644 (file)
@@ -11,6 +11,7 @@ class ResourceLoaderTest extends MediaWikiTestCase {
         */
        public static function resourceLoaderRegisterModules( &$resourceLoader ) {
                self::$resourceLoaderRegisterModulesHook = true;
+
                return true;
        }
 
@@ -31,6 +32,7 @@ class ResourceLoaderTest extends MediaWikiTestCase {
                self::$resourceLoaderRegisterModulesHook = false;
                $resourceLoader = new ResourceLoader();
                $this->assertTrue( self::$resourceLoaderRegisterModulesHook );
+
                return $resourceLoader;
        }
 
@@ -84,7 +86,8 @@ class ResourceLoaderTest extends MediaWikiTestCase {
 
 /* Stubs */
 
-class ResourceLoaderTestModule extends ResourceLoaderModule {}
+class ResourceLoaderTestModule extends ResourceLoaderModule {
+}
 
 /* Hooks */
 global $wgHooks;
index 39673c0..968aaba 100644 (file)
@@ -78,5 +78,4 @@ class RevisionTest_ContentHandlerUseDB extends RevisionStorageTest {
                        $this->assertTrue( true ); // ok
                }
        }
-
 }
index 9380928..e3b0844 100644 (file)
@@ -403,7 +403,6 @@ class RevisionTest extends MediaWikiTestCase {
                // for immutable content like wikitext, this should be the same object
                $this->assertSame( $content, $content2 );
        }
-
 }
 
 class RevisionTestModifyableContent extends TextContent {
@@ -422,7 +421,6 @@ class RevisionTestModifyableContent extends TextContent {
        public function setText( $text ) {
                $this->mText = $text;
        }
-
 }
 
 class RevisionTestModifyableContentHandler extends TextContentHandler {
index f5aacab..c84f10c 100644 (file)
@@ -148,7 +148,6 @@ class SanitizerTest extends MediaWikiTestCase {
                        array( array( 'foo.' => 'baz' ), 'foo.=baz', 'A . is allowed as last character' ),
                        array( array( 'foo6' => 'baz' ), 'foo6=baz', 'Numbers are allowed' ),
 
-
                        # This bit is more relaxed than XML rules, but some extensions use
                        # it, like ProofreadPage (see bug 27539)
                        array( array( '1foo' => 'baz' ), '1foo=baz', 'Leading numbers are allowed' ),
@@ -246,5 +245,4 @@ class SanitizerTest extends MediaWikiTestCase {
                        $message
                );
        }
-
 }
index fc7d8d0..4cdf020 100644 (file)
@@ -10,6 +10,7 @@ function getSiteParams( $conf, $wiki ) {
                        break;
                }
        }
+
        return array(
                'suffix' => $site,
                'lang' => $lang,
index 0530b44..842e2fc 100644 (file)
@@ -49,6 +49,7 @@ class StringUtilsTest extends MediaWikiTestCase {
                                $escaped .= $char;
                        }
                }
+
                return $escaped;
        }
 
index a793bab..ffa8c42 100644 (file)
@@ -13,14 +13,14 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase {
                $user = new User();
                $user->mRights = array( 'createpage', 'edit', 'purge' );
 
-               $status = $page->doEditContent( new WikitextContent( '{{Categorising template}}' ), 'Create a page with a template', 0, false, $user );
+               $page->doEditContent( new WikitextContent( '{{Categorising template}}' ), 'Create a page with a template', 0, false, $user );
                $this->assertEquals(
                        array()
                        , $title->getParentCategories()
                );
 
                $template = WikiPage::factory( Title::newFromText( 'Template:Categorising template' ) );
-               $status = $template->doEditContent( new WikitextContent( '[[Category:Solved bugs]]' ), 'Add a category through a template', 0, false, $user );
+               $template->doEditContent( new WikitextContent( '[[Category:Solved bugs]]' ), 'Add a category through a template', 0, false, $user );
 
                // Run the job queue
                JobQueueGroup::destroySingletons();
@@ -33,5 +33,4 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase {
                        , $title->getParentCategories()
                );
        }
-
 }
index c4d8945..2fb0f49 100644 (file)
@@ -53,6 +53,5 @@ class TestUser {
                        }
                }
                $this->user->saveSettings();
-
        }
 }
index 0690683..07dcb7d 100644 (file)
@@ -3,16 +3,12 @@
 /**
  * Tests timestamp parsing and output.
  */
-class TimestampTest extends MediaWikiTestCase {
+class TimestampTest extends MediaWikiLangTestCase {
 
        protected function setUp() {
                parent::setUp();
 
-               $this->setMwGlobals( array(
-                       'wgLanguageCode' => 'en',
-                       'wgContLang' => Language::factory( 'en' ),
-                       'wgLang' => Language::factory( 'en' ),
-               ) );
+               RequestContext::getMain()->setLanguage( Language::factory( 'en' ) );
        }
 
        /**
@@ -38,7 +34,7 @@ class TimestampTest extends MediaWikiTestCase {
         * @expectedException TimestampException
         */
        function testInvalidParse() {
-               $timestamp = new MWTimestamp( "This is not a timestamp." );
+               new MWTimestamp( "This is not a timestamp." );
        }
 
        /**
@@ -50,18 +46,6 @@ class TimestampTest extends MediaWikiTestCase {
                $timestamp->getTimestamp( 98 );
        }
 
-       /**
-        * Test human readable timestamp format.
-        */
-       function testHumanOutput() {
-               $timestamp = new MWTimestamp( time() - 3600 );
-               $this->assertEquals( "1 hour ago", $timestamp->getHumanTimestamp()->inLanguage( 'en' )->text() );
-               $timestamp = new MWTimestamp( time() - 5184000 );
-               $this->assertEquals( "2 months ago", $timestamp->getHumanTimestamp()->inLanguage( 'en' )->text() );
-               $timestamp = new MWTimestamp( time() - 31536000 );
-               $this->assertEquals( "1 year ago", $timestamp->getHumanTimestamp()->inLanguage( 'en' )->text() );
-       }
-
        /**
         * Returns a list of valid timestamps in the format:
         * array( type, timestamp_of_type, timestamp_in_MW )
@@ -83,4 +67,137 @@ class TimestampTest extends MediaWikiTestCase {
                        array( TS_UNIX, '-62135596801', '00001231235959' )
                );
        }
+
+       /**
+        * @test
+        * @dataProvider provideHumanTimestampTests
+        */
+       public function testHumanTimestamp(
+               $tsTime, // The timestamp to format
+               $currentTime, // The time to consider "now"
+               $timeCorrection, // The time offset to use
+               $dateFormat, // The date preference to use
+               $expectedOutput, // The expected output
+               $desc // Description
+       ) {
+               $user = $this->getMock( 'User' );
+               $user->expects( $this->any() )
+                       ->method( 'getOption' )
+                       ->with( 'timecorrection' )
+                       ->will( $this->returnValue( $timeCorrection ) );
+
+               $user->expects( $this->any() )
+                       ->method( 'getDatePreference' )
+                       ->will( $this->returnValue( $dateFormat ) );
+
+               $tsTime = new MWTimestamp( $tsTime );
+               $currentTime = new MWTimestamp( $currentTime );
+
+               $this->assertEquals(
+                       $expectedOutput,
+                       $tsTime->getHumanTimestamp( $currentTime, $user ),
+                       $desc
+               );
+       }
+
+       public static function provideHumanTimestampTests() {
+               return array(
+                       array(
+                               '20111231170000',
+                               '20120101000000',
+                               'Offset|0',
+                               'mdy',
+                               'Yesterday at 17:00',
+                               '"Yesterday" across years',
+                       ),
+                       array(
+                               '20120717190900',
+                               '20120717190929',
+                               'Offset|0',
+                               'mdy',
+                               'just now',
+                               '"Just now"',
+                       ),
+                       array(
+                               '20120717190900',
+                               '20120717191530',
+                               'Offset|0',
+                               'mdy',
+                               '6 minutes ago',
+                               'X minutes ago',
+                       ),
+                       array(
+                               '20121006173100',
+                               '20121006173200',
+                               'Offset|0',
+                               'mdy',
+                               '1 minute ago',
+                               '"1 minute ago"',
+                       ),
+                       array(
+                               '20120617190900',
+                               '20120717190900',
+                               'Offset|0',
+                               'mdy',
+                               'June 17',
+                               'Another month'
+                       ),
+                       array(
+                               '19910130151500',
+                               '20120716193700',
+                               'Offset|0',
+                               'mdy',
+                               '15:15, January 30, 1991',
+                               'Different year',
+                       ),
+                       array(
+                               '20120101050000',
+                               '20120101080000',
+                               'Offset|-360',
+                               'mdy',
+                               'Yesterday at 23:00',
+                               '"Yesterday" across years with time correction',
+                       ),
+                       array(
+                               '20120714184300',
+                               '20120716184300',
+                               'Offset|-420',
+                               'mdy',
+                               'Saturday at 11:43',
+                               'Recent weekday with time correction',
+                       ),
+                       array(
+                               '20120714184300',
+                               '20120715040000',
+                               'Offset|-420',
+                               'mdy',
+                               '11:43',
+                               'Today at another time with time correction',
+                       ),
+                       array(
+                               '20120617190900',
+                               '20120717190900',
+                               'Offset|0',
+                               'dmy',
+                               '17 June',
+                               'Another month with dmy'
+                       ),
+                       array(
+                               '20120617190900',
+                               '20120717190900',
+                               'Offset|0',
+                               'ISO 8601',
+                               '06-17',
+                               'Another month with ISO-8601'
+                       ),
+                       array(
+                               '19910130151500',
+                               '20120716193700',
+                               'Offset|0',
+                               'ISO 8601',
+                               '1991-01-30T15:15:00',
+                               'Different year with ISO-8601',
+                       ),
+               );
+       }
 }
index 476c194..a11c3d9 100644 (file)
@@ -286,5 +286,4 @@ class TitleMethodsTest extends MediaWikiTestCase {
                $title = Title::newFromText( $title );
                $this->assertEquals( $expectedBool, $title->isWikitextPage() );
        }
-
 }
index e2c079a..b8b0391 100644 (file)
@@ -66,7 +66,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
 
                        $this->user = $this->userUser;
                }
-
        }
 
        function setUserPerm( $perm ) {
@@ -317,7 +316,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                                $this->title->userCan( $action, $this->user, true ) );
                        $this->assertEquals( $check[$action][3],
                                $this->title->quickUserCan( $action, $this->user ) );
-
                        # count( User::getGroupsWithPermissions( $action ) ) < 1
                }
        }
@@ -538,7 +536,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        $this->title->userCan( 'edit', $this->user ) );
                $this->assertEquals( array(),
                        $this->title->getUserPermissionsErrors( 'edit', $this->user ) );
-
        }
 
        function testActionPermissions() {
@@ -562,7 +559,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                $this->assertEquals( true,
                        $this->title->userCan( 'create', $this->user ) );
 
-
                $this->setUserPerm( array( 'createpage' ) );
                $this->assertEquals( array( array( 'titleprotected', 'Useruser', 'test' ) ),
                        $this->title->getUserPermissionsErrors( 'create', $this->user ) );
@@ -605,7 +601,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        $this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
                $this->assertEquals( false,
                        $this->title->userCan( 'move-target', $this->user ) );
-
        }
 
        function testUserBlock() {
@@ -648,13 +643,13 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                global $wgLocalTZoffset;
                $wgLocalTZoffset = -60;
                $this->user->mBlockedby = $this->user->getName();
-               $this->user->mBlock = new Block( '127.0.8.1', 0, 1, 'no reason given', $now, 0, 10 );
+               $this->user->mBlock = new Block( '127.0.8.1', 0, $this->user->getId(),
+                       'no reason given', $now, 0, 10 );
                $this->assertEquals( array( array( 'blockedtext',
                                '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
                                'Useruser', null, '23:00, 31 December 1969', '127.0.8.1',
                                $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ) ),
                        $this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
-
                # $action != 'read' && $action != 'createaccount' && $user->isBlockedFrom( $this )
                #   $user->blockedFor() == ''
                #   $user->mBlock->mExpiry == 'infinity'
index 970862b..33bd8d6 100644 (file)
@@ -197,6 +197,7 @@ class TitleTest extends MediaWikiTestCase {
                foreach ( $errors as $error ) {
                        $result[] = $error[0];
                }
+
                return $result;
        }
 
index 4bb6daa..f829509 100644 (file)
@@ -587,6 +587,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
                $text = preg_replace( '!\s*(</p>)!sm', '\1', $text ); # don't let tidy confuse us
 
                $this->assertEquals( $expectedHtml, $text );
+
                return $po;
        }
 
@@ -1014,5 +1015,4 @@ more stuff
 
                $this->assertEquals( $expected, $text );
        }
-
 }
index dca9910..41f3572 100644 (file)
@@ -44,5 +44,4 @@ class WikiPageTest_ContentHandlerUseDB extends WikiPageTest {
                $page = new WikiPage( $page->getTitle() );
                $this->assertEquals( 'WikitextContentHandler', get_class( $page->getContentHandler() ) );
        }
-
 }
index 696b145..50638ca 100644 (file)
@@ -47,13 +47,16 @@ class ApiCreateAccountTest extends ApiTestCase {
                $token = $a['token'];
 
                // Finally create the account
-               $ret = $this->doApiRequest( array(
-                       'action' => 'createaccount',
-                       'name' => 'Apitestnew',
-                       'password' => $password,
-                       'token' => $token,
-                       'email' => 'test@domain.test',
-                       'realname' => 'Test Name' ), $ret[2]
+               $ret = $this->doApiRequest(
+                       array(
+                               'action' => 'createaccount',
+                               'name' => 'Apitestnew',
+                               'password' => $password,
+                               'token' => $token,
+                               'email' => 'test@domain.test',
+                               'realname' => 'Test Name'
+                       ),
+                       $ret[2]
                );
 
                $result = $ret[0];
@@ -107,7 +110,7 @@ class ApiCreateAccountTest extends ApiTestCase {
         * @expectedException UsageException
         */
        function testNoName() {
-               $ret = $this->doApiRequest( array(
+               $this->doApiRequest( array(
                        'action' => 'createaccount',
                        'token' => LoginForm::getCreateaccountToken(),
                        'password' => 'password',
@@ -119,7 +122,7 @@ class ApiCreateAccountTest extends ApiTestCase {
         * @expectedException UsageException
         */
        function testNoPassword() {
-               $ret = $this->doApiRequest( array(
+               $this->doApiRequest( array(
                        'action' => 'createaccount',
                        'name' => 'testName',
                        'token' => LoginForm::getCreateaccountToken(),
index 8842766..a3d39dd 100644 (file)
@@ -6,7 +6,6 @@
  * @group medium
  */
 class ApiBlockTest extends ApiTestCase {
-
        protected function setUp() {
                parent::setUp();
                $this->doLogin();
@@ -36,7 +35,6 @@ class ApiBlockTest extends ApiTestCase {
         * previously always considered valid (bug 34212).
         */
        function testMakeNormalBlock() {
-
                $data = $this->getTokens();
 
                $user = User::newFromName( 'UTApiBlockee' );
@@ -53,7 +51,7 @@ class ApiBlockTest extends ApiTestCase {
                $key = array_pop( $keys );
                $pageinfo = $data[0]['query']['pages'][$key];
 
-               $data = $this->doApiRequest( array(
+               $this->doApiRequest( array(
                        'action' => 'block',
                        'user' => 'UTApiBlockee',
                        'reason' => 'Some reason',
@@ -66,7 +64,6 @@ class ApiBlockTest extends ApiTestCase {
                $this->assertEquals( 'UTApiBlockee', (string)$block->getTarget() );
                $this->assertEquals( 'Some reason', $block->mReason );
                $this->assertEquals( 'infinity', $block->mExpiry );
-
        }
 
        /**
index 7d8e01f..f3b9a67 100644 (file)
@@ -161,13 +161,13 @@ class ApiEditPageTest extends ApiTestCase {
                if ( $text !== null ) {
                        if ( $text === '' ) {
                                // can't create an empty page, so create it with some content
-                               list( $re, , ) = $this->doApiRequestWithToken( array(
+                               $this->doApiRequestWithToken( array(
                                        'action' => 'edit',
                                        'title' => $name,
                                        'text' => '(dummy)', ) );
                        }
 
-                       list( $re, , ) = $this->doApiRequestWithToken( array(
+                       list( $re ) = $this->doApiRequestWithToken( array(
                                'action' => 'edit',
                                'title' => $name,
                                'text' => $text, ) );
@@ -176,7 +176,7 @@ class ApiEditPageTest extends ApiTestCase {
                }
 
                // -- try append/prepend --------------------------------------------
-               list( $re, , ) = $this->doApiRequestWithToken( array(
+               list( $re ) = $this->doApiRequestWithToken( array(
                        'action' => 'edit',
                        'title' => $name,
                        $op . 'text' => $append, ) );
@@ -224,7 +224,7 @@ class ApiEditPageTest extends ApiTestCase {
 
                // try to save edit, expect conflict
                try {
-                       list( $re, , ) = $this->doApiRequestWithToken( array(
+                       $this->doApiRequestWithToken( array(
                                'action' => 'edit',
                                'title' => $name,
                                'text' => 'nix bar!',
@@ -280,7 +280,7 @@ class ApiEditPageTest extends ApiTestCase {
 
                // try again, without following the redirect. Should fail.
                try {
-                       list( $re, , ) = $this->doApiRequestWithToken( array(
+                       $this->doApiRequestWithToken( array(
                                'action' => 'edit',
                                'title' => $rname,
                                'text' => 'nix bar!',
index 902b7b8..ae74e38 100644 (file)
@@ -116,6 +116,7 @@ class ApiOptionsTest extends MediaWikiLangTestCase {
                                $mapping[$key] = 'unused';
                        }
                }
+
                return $mapping;
        }
 
@@ -126,12 +127,14 @@ class ApiOptionsTest extends MediaWikiLangTestCase {
                        'optionname' => null,
                        'optionvalue' => null,
                );
+
                return array_merge( $request, $custom );
        }
 
        private function executeQuery( $request ) {
                $this->mContext->setRequest( new FauxRequest( $request, true, $this->mSession ) );
                $this->mTested->execute();
+
                return $this->mTested->getResult()->getData();
        }
 
@@ -156,6 +159,7 @@ class ApiOptionsTest extends MediaWikiLangTestCase {
                } catch ( UsageException $e ) {
                        $this->assertEquals( 'notloggedin', $e->getCodeString() );
                        $this->assertEquals( 'Anonymous users cannot change preferences', $e->getMessage() );
+
                        return;
                }
                $this->fail( "UsageException was not thrown" );
@@ -169,6 +173,7 @@ class ApiOptionsTest extends MediaWikiLangTestCase {
                } catch ( UsageException $e ) {
                        $this->assertEquals( 'nooptionname', $e->getCodeString() );
                        $this->assertEquals( 'The optionname parameter must be set', $e->getMessage() );
+
                        return;
                }
                $this->fail( "UsageException was not thrown" );
@@ -191,6 +196,7 @@ class ApiOptionsTest extends MediaWikiLangTestCase {
                } catch ( UsageException $e ) {
                        $this->assertEquals( 'nochanges', $e->getCodeString() );
                        $this->assertEquals( 'No changes were requested', $e->getMessage() );
+
                        return;
                }
                $this->fail( "UsageException was not thrown" );
index a42e5aa..b408875 100644 (file)
@@ -16,7 +16,7 @@ class ApiParseTest extends ApiTestCase {
                $somePage = mt_rand();
 
                try {
-                       $data = $this->doApiRequest( array(
+                       $this->doApiRequest( array(
                                'action' => 'parse',
                                'page' => $somePage ) );
 
@@ -26,5 +26,4 @@ class ApiParseTest extends ApiTestCase {
                                "Parse request for nonexistent page must give 'missingtitle' error: " . var_export( $ex->getMessageArray(), true ) );
                }
        }
-
 }
index a7f9229..881eb3f 100644 (file)
@@ -37,5 +37,4 @@ class ApiPurgeTest extends ApiTestCase {
                        $this->assertArrayHasKey( $pages[$v['title']], $v );
                }
        }
-
 }
index 552fbfb..1559bef 100644 (file)
@@ -52,6 +52,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
        protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) {
                $title = Title::newFromText( $pageName, $defaultNs );
                $page = WikiPage::factory( $title );
+
                return $page->doEditContent( ContentHandler::makeContent( $text, $title ), $summary );
        }
 
@@ -131,6 +132,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
                        $session['wsEditToken'] = $session['wsToken'];
                        // add token to request parameters
                        $params['token'] = md5( $session['wsToken'] ) . User::EDIT_TOKEN_SUFFIX;
+
                        return $this->doApiRequest( $params, $session, false, $user );
                } else {
                        throw new Exception( "request data not in right format" );
@@ -164,6 +166,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
                        'titles' => 'Main Page',
                        'intoken' => 'edit|delete|protect|move|block|unblock|watch',
                        'prop' => 'info' ), $session, false, $user->user );
+
                return $data;
        }
 
@@ -204,11 +207,14 @@ class UserWrapper {
 }
 
 class MockApi extends ApiBase {
-       public function execute() {}
+       public function execute() {
+       }
 
-       public function getVersion() {}
+       public function getVersion() {
+       }
 
-       public function __construct() {}
+       public function __construct() {
+       }
 
        public function getAllowedParams() {
                return array(
@@ -234,6 +240,7 @@ class ApiTestContext extends RequestContext {
                if ( $user !== null ) {
                        $context->setUser( $user );
                }
+
                return $context;
        }
 }
index 8028491..7e18b6e 100644 (file)
@@ -47,6 +47,7 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
                        // see if it now doesn't exist; reload
                        $title = Title::newFromText( $title->getText(), NS_FILE );
                }
+
                return !( $title && $title instanceof Title && $title->exists() );
        }
 
@@ -69,6 +70,7 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
                foreach ( $dupes as $dupe ) {
                        $success &= $this->deleteFileByTitle( $dupe->getTitle() );
                }
+
                return $success;
        }
 
@@ -105,7 +107,6 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
                );
 
                return true;
-
        }
 
        function fakeUploadChunk( $fieldName, $fileName, $type, & $chunkData ) {
@@ -145,5 +146,4 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
        function clearFakeUploads() {
                $_FILES = array();
        }
-
 }
index 0d98b04..c418a87 100644 (file)
@@ -27,7 +27,6 @@ require_once( 'ApiTestCaseUpload.php' );
  * This is pretty sucky... needs to be prettified.
  */
 class ApiUploadTest extends ApiTestCaseUpload {
-
        /**
         * Testing login
         * XXX this is a funny way of getting session context
@@ -59,8 +58,8 @@ class ApiUploadTest extends ApiTestCaseUpload {
                $this->assertArrayHasKey( 'lgtoken', $result['login'] );
 
                $this->assertNotEmpty( $session, 'API Login must return a session' );
-               return $session;
 
+               return $session;
        }
 
        /**
@@ -118,7 +117,6 @@ class ApiUploadTest extends ApiTestCaseUpload {
                $this->deleteFileByFileName( $fileName );
                $this->deleteFileByContent( $filePath );
 
-
                if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePath ) ) {
                        $this->markTestIncomplete( "Couldn't upload file!\n" );
                }
@@ -298,7 +296,7 @@ class ApiUploadTest extends ApiTestCaseUpload {
 
                $exception = false;
                try {
-                       list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session,
+                       list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session,
                                self::$users['uploader']->user );
                } catch ( UsageException $e ) {
                        $exception = true;
@@ -307,7 +305,6 @@ class ApiUploadTest extends ApiTestCaseUpload {
                $this->assertEquals( 'Success', $result['upload']['result'] );
                $this->assertFalse( $exception );
 
-
                // second upload with the same content (but different name)
 
                if ( !$this->fakeUploadFile( 'file', $fileNames[1], $mimeType, $filePaths[0] ) ) {
@@ -324,7 +321,7 @@ class ApiUploadTest extends ApiTestCaseUpload {
 
                $exception = false;
                try {
-                       list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session,
+                       list( $result ) = $this->doApiRequestWithToken( $params, $session,
                                self::$users['uploader']->user ); // FIXME: leaks a temporary file
                } catch ( UsageException $e ) {
                        $exception = true;
@@ -341,7 +338,6 @@ class ApiUploadTest extends ApiTestCaseUpload {
                unlink( $filePaths[0] );
        }
 
-
        /**
         * @depends testLogin
         */
@@ -382,7 +378,7 @@ class ApiUploadTest extends ApiTestCaseUpload {
 
                $exception = false;
                try {
-                       list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session,
+                       list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session,
                                self::$users['uploader']->user ); // FIXME: leaks a temporary file
                } catch ( UsageException $e ) {
                        $exception = true;
@@ -411,7 +407,7 @@ class ApiUploadTest extends ApiTestCaseUpload {
                $this->clearFakeUploads();
                $exception = false;
                try {
-                       list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session,
+                       list( $result ) = $this->doApiRequestWithToken( $params, $session,
                                self::$users['uploader']->user );
                } catch ( UsageException $e ) {
                        $exception = true;
@@ -482,7 +478,7 @@ class ApiUploadTest extends ApiTestCaseUpload {
                        if ( !$chunkSessionKey ) {
                                // Upload fist chunk ( and get the session key )
                                try {
-                                       list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session,
+                                       list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session,
                                                self::$users['uploader']->user );
                                } catch ( UsageException $e ) {
                                        $this->markTestIncomplete( $e->getMessage() );
@@ -509,7 +505,7 @@ class ApiUploadTest extends ApiTestCaseUpload {
                        $this->assertEquals( $resultOffset, $params['offset'] );
                        // Upload current chunk
                        try {
-                               list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session,
+                               list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session,
                                        self::$users['uploader']->user );
                        } catch ( UsageException $e ) {
                                $this->markTestIncomplete( $e->getMessage() );
@@ -548,7 +544,7 @@ class ApiUploadTest extends ApiTestCaseUpload {
                $this->clearFakeUploads();
                $exception = false;
                try {
-                       list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session,
+                       list( $result ) = $this->doApiRequestWithToken( $params, $session,
                                self::$users['uploader']->user );
                } catch ( UsageException $e ) {
                        $exception = true;
index aefd939..a9bc43a 100644 (file)
@@ -7,7 +7,6 @@
  * @todo This test suite is severly broken and need a full review
  */
 class ApiWatchTest extends ApiTestCase {
-
        protected function setUp() {
                parent::setUp();
                $this->doLogin();
@@ -95,8 +94,7 @@ class ApiWatchTest extends ApiTestCase {
        /**
         */
        function testGetRollbackToken() {
-
-               $pageinfo = $this->getTokens();
+               $this->getTokens();
 
                if ( !Title::newFromText( 'Help:UTPage' )->exists() ) {
                        $this->markTestSkipped( "The article [[Help:UTPage]] does not exist" ); //TODO: just create it?
@@ -168,7 +166,7 @@ class ApiWatchTest extends ApiTestCase {
                $this->assertArrayHasKey( 'delete', $data[0] );
                $this->assertArrayHasKey( 'title', $data[0]['delete'] );
 
-               $data = $this->doApiRequest( array(
+               $this->doApiRequest( array(
                        'action' => 'query',
                        'list' => 'watchlist' ) );
 
index 3040758..1b815ac 100644 (file)
@@ -108,6 +108,7 @@ class RandomImageGenerator {
                foreach ( $filenames as $filename ) {
                        $this->{$imageWriteMethod}( $this->getImageSpec(), $format, $filename );
                }
+
                return $filenames;
        }
 
@@ -156,7 +157,6 @@ class RandomImageGenerator {
                }
 
                return $filenames;
-
        }
 
 
@@ -196,7 +196,6 @@ class RandomImageGenerator {
                                array( 'x' => $originX, 'y' => $originY - $radius )
                        );
                        $draws[] = $draw;
-
                }
 
                $spec['draws'] = $draws;
@@ -216,6 +215,7 @@ class RandomImageGenerator {
                foreach ( $shape as $point ) {
                        $points[] = $point['x'] . ',' . $point['y'];
                }
+
                return join( " ", $points );
        }
 
@@ -337,6 +337,7 @@ class RandomImageGenerator {
                        }
                        $tSpec['draws'][] = $tDraw;
                }
+
                return $tSpec;
        }
 
@@ -384,6 +385,7 @@ class RandomImageGenerator {
                $command = wfEscapeShellArg( $wgImageMagickConvertCommand ) . " " . implode( " ", $args );
                $retval = null;
                wfShellExec( $command, $retval );
+
                return ( $retval === 0 );
        }
 
@@ -397,6 +399,7 @@ class RandomImageGenerator {
                for ( $i = 0; $i <= 2; $i++ ) {
                        $components[] = mt_rand( 0, 255 );
                }
+
                return 'rgb(' . join( ', ', $components ) . ')';
        }
 
@@ -414,6 +417,7 @@ class RandomImageGenerator {
                for ( $i = 0; $i < $count; $i += 2 ) {
                        $pairs[] = array( $lines[$i], $lines[$i + 1] );
                }
+
                return $pairs;
        }
 
@@ -461,5 +465,4 @@ class RandomImageGenerator {
 
                return $lines;
        }
-
 }
index a59983d..802a0e1 100644 (file)
@@ -13,7 +13,5 @@ class ApiFormatPhpTest extends ApiFormatTestBase {
 
                $this->assertInternalType( 'array', unserialize( $data ) );
                $this->assertGreaterThan( 0, count( (array)$data ) );
-
        }
-
 }
index e0a84e1..7f32e5f 100644 (file)
@@ -68,6 +68,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase {
                                // put 'continue' params at the end - lazy method
                                $a = strpos( $a, 'continue' ) !== false ? 'zzz ' . $a : $a;
                                $b = strpos( $b, 'continue' ) !== false ? 'zzz ' . $b : $b;
+
                                return strcmp( $a, $b );
                        } );
                        $reqStr = http_build_query( $request );
@@ -103,6 +104,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase {
                                if ( $expectedCount > $count ) {
                                        print "***** $id Finished early in $count turns. $expectedCount was expected\n";
                                }
+
                                return $result;
                        } elseif ( !$useContinue ) {
                                $this->assertFalse( 'Non-smart query must be requested all at once' );
index 7fb5307..bc01ec2 100644 (file)
@@ -20,7 +20,6 @@ class ApiQueryTest extends ApiTestCase {
                        'action' => 'query',
                        'titles' => 'Project:articleA|article_B' ) );
 
-
                $this->assertArrayHasKey( 'query', $data[0] );
                $this->assertArrayHasKey( 'normalized', $data[0]['query'] );
 
@@ -42,7 +41,6 @@ class ApiQueryTest extends ApiTestCase {
                        ),
                        $data[0]['query']['normalized'][1]
                );
-
        }
 
        function testTitlesAreRejectedIfInvalid() {
@@ -65,5 +63,4 @@ class ApiQueryTest extends ApiTestCase {
                $this->assertArrayHasKey( 'missing', $data[0]['query']['pages'][-2] );
                $this->assertArrayHasKey( 'invalid', $data[0]['query']['pages'][-1] );
        }
-
 }
index 3d96beb..d712bc0 100644 (file)
@@ -24,7 +24,6 @@
  * @file
  */
 
-
 /** This class has some common functionality for testing query module
  */
 abstract class ApiQueryTestBase extends ApiTestCase {
@@ -48,6 +47,7 @@ STR;
                        $request = array_merge_recursive( $request, $req );
                        $this->mergeExpected( $expected, $exp );
                }
+
                return array( $request, $expected );
        }
 
@@ -62,6 +62,7 @@ STR;
                $this->assertArrayHasKey( 1, $v, self::PARAM_ASSERT );
                $this->assertType( 'array', $v[0], self::PARAM_ASSERT );
                $this->assertType( 'array', $v[1], self::PARAM_ASSERT );
+
                return $v;
        }
 
index c7e75d9..1c81ea7 100644 (file)
@@ -52,6 +52,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase {
                for ( $i = $firstKey; $i <= $lastKey; $i++ ) {
                        $expected["cache-key-$i"] = array( "prop-$i" => "value-$i" );
                }
+
                return $expected;
        }
 
@@ -70,7 +71,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase {
         * @expectedException MWException
         */
        function testConstructorGivenInvalidValue( $maxSize ) {
-               $c = new ProcessCacheLRUTestable( $maxSize );
+               new ProcessCacheLRUTestable( $maxSize );
        }
 
        /**
@@ -125,7 +126,6 @@ class ProcessCacheLRUTest extends MediaWikiTestCase {
                        $cache->getCache(),
                        "Filling a $cacheMaxEntries entries cache with $entryToFill entries"
                );
-
        }
 
        /**
@@ -218,9 +218,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase {
                        ),
                        $cache->getCache()
                );
-
        }
-
 }
 
 /**
index 67d4fde..c345513 100644 (file)
@@ -317,6 +317,7 @@ class DummyContentHandlerForTesting extends ContentHandler {
         */
        public function unserializeContent( $blob, $format = null ) {
                $d = unserialize( $blob );
+
                return new DummyContentForTesting( $d );
        }
 
index 8f53dd3..1c45820 100644 (file)
@@ -77,5 +77,4 @@ class CssContentTest extends MediaWikiTestCase {
        public function testEquals( Content $a, Content $b = null, $equal = false ) {
                $this->assertEquals( $equal, $a->equals( $b ) );
        }
-
 }
index 2d693fe..6632edd 100644 (file)
@@ -269,5 +269,4 @@ class JavaScriptContentTest extends TextContentTest {
                        array( new JavaScriptContent( "hallo" ), new JavaScriptContent( "HALLO" ), false ),
                );
        }
-
 }
index 4fc2d51..28c006c 100644 (file)
@@ -423,5 +423,4 @@ class TextContentTest extends MediaWikiLangTestCase {
                        $this->assertEquals( $expectedNative, $converted->getNativeData() );
                }
        }
-
 }
index 0f6a968..45d8140 100644 (file)
@@ -181,5 +181,4 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
        /*
        public function testGetUndoContent( Revision $current, Revision $undo, Revision $undoafter = null ) {}
        */
-
 }
index caa3368..965a5f3 100644 (file)
@@ -231,7 +231,7 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                ),
                                "DELETE FROM table " .
                                        "WHERE field IN (" .
-                                               "SELECT field_join FROM table_join WHERE alias = 'text'" .
+                                       "SELECT field_join FROM table_join WHERE alias = 'text'" .
                                        ")"
                        ),
                        array(
@@ -244,7 +244,7 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                ),
                                "DELETE FROM table " .
                                        "WHERE field IN (" .
-                                               "SELECT field_join FROM table_join " .
+                                       "SELECT field_join FROM table_join " .
                                        ")"
                        ),
                );
@@ -296,8 +296,8 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "INSERT IGNORE INTO table " .
                                        "(field,field2) " .
                                        "VALUES " .
-                                               "('text','2')," .
-                                               "('multi','3')"
+                                       "('text','2')," .
+                                       "('multi','3')"
                        ),
                );
        }
@@ -330,7 +330,7 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "INSERT INTO insert_table " .
                                        "(field_insert,field) " .
                                        "SELECT field_select,field2 " .
-                                               "FROM select_table"
+                                       "FROM select_table"
                        ),
                        array(
                                array(
@@ -342,8 +342,8 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "INSERT INTO insert_table " .
                                        "(field_insert,field) " .
                                        "SELECT field_select,field2 " .
-                                               "FROM select_table " .
-                                               "WHERE field = '2'"
+                                       "FROM select_table " .
+                                       "WHERE field = '2'"
                        ),
                        array(
                                array(
@@ -357,9 +357,9 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "INSERT IGNORE INTO insert_table " .
                                        "(field_insert,field) " .
                                        "SELECT field_select,field2 " .
-                                               "FROM select_table " .
-                                               "WHERE field = '2' " .
-                                               "ORDER BY field"
+                                       "FROM select_table " .
+                                       "WHERE field = '2' " .
+                                       "ORDER BY field"
                        ),
                );
        }
@@ -388,8 +388,8 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "DELETE FROM replace_table " .
                                        "WHERE ( field='text' ); " .
                                        "INSERT INTO replace_table " .
-                                               "(field,field2) " .
-                                               "VALUES ('text','text2')"
+                                       "(field,field2) " .
+                                       "VALUES ('text','text2')"
                        ),
                        array(
                                array(
@@ -404,8 +404,8 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "DELETE FROM module_deps " .
                                        "WHERE ( md_module='module' AND md_skin='skin' ); " .
                                        "INSERT INTO module_deps " .
-                                               "(md_module,md_skin,md_deps) " .
-                                               "VALUES ('module','skin','deps')"
+                                       "(md_module,md_skin,md_deps) " .
+                                       "VALUES ('module','skin','deps')"
                        ),
                        array(
                                array(
@@ -426,13 +426,13 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "DELETE FROM module_deps " .
                                        "WHERE ( md_module='module' AND md_skin='skin' ); " .
                                        "INSERT INTO module_deps " .
-                                               "(md_module,md_skin,md_deps) " .
-                                               "VALUES ('module','skin','deps'); " .
-                               "DELETE FROM module_deps " .
+                                       "(md_module,md_skin,md_deps) " .
+                                       "VALUES ('module','skin','deps'); " .
+                                       "DELETE FROM module_deps " .
                                        "WHERE ( md_module='module2' AND md_skin='skin2' ); " .
                                        "INSERT INTO module_deps " .
-                                               "(md_module,md_skin,md_deps) " .
-                                               "VALUES ('module2','skin2','deps2')"
+                                       "(md_module,md_skin,md_deps) " .
+                                       "VALUES ('module2','skin2','deps2')"
                        ),
                        array(
                                array(
@@ -453,13 +453,13 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                                "DELETE FROM module_deps " .
                                        "WHERE ( md_module='module' ) OR ( md_skin='skin' ); " .
                                        "INSERT INTO module_deps " .
-                                               "(md_module,md_skin,md_deps) " .
-                                               "VALUES ('module','skin','deps'); " .
-                               "DELETE FROM module_deps " .
+                                       "(md_module,md_skin,md_deps) " .
+                                       "VALUES ('module','skin','deps'); " .
+                                       "DELETE FROM module_deps " .
                                        "WHERE ( md_module='module2' ) OR ( md_skin='skin2' ); " .
                                        "INSERT INTO module_deps " .
-                                               "(md_module,md_skin,md_deps) " .
-                                               "VALUES ('module2','skin2','deps2')"
+                                       "(md_module,md_skin,md_deps) " .
+                                       "VALUES ('module2','skin2','deps2')"
                        ),
                        array(
                                array(
index 097e57a..815edd2 100644 (file)
@@ -9,6 +9,7 @@ class MockDatabaseSqlite extends DatabaseSqliteStandalone {
 
        function query( $sql, $fname = '', $tempIgnore = false ) {
                $this->lastQuery = $sql;
+
                return true;
        }
 
@@ -327,6 +328,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase {
                $db->sourceFile( "$IP/tests/phpunit/data/db/sqlite/tables-$version.sql" );
                $updater = DatabaseUpdater::newForDB( $db, false, $maint );
                $updater->doUpdates( array( 'core' ) );
+
                return $db;
        }
 
@@ -348,6 +350,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase {
                }
                $list = array_flip( $list );
                sort( $list );
+
                return $list;
        }
 
@@ -359,6 +362,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase {
                        $cols[$col->name] = $col;
                }
                ksort( $cols );
+
                return $cols;
        }
 
@@ -376,6 +380,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase {
                        $indexes[$index->name] = $index;
                }
                ksort( $indexes );
+
                return $indexes;
        }
 
index 1efa279..57df08e 100644 (file)
@@ -36,6 +36,7 @@ class DatabaseTestHelper extends DatabaseBase {
        public function getLastSqls() {
                $lastSqls = implode( '; ', $this->lastSqls );
                $this->lastSqls = array();
+
                return $lastSqls;
        }
 
@@ -78,6 +79,7 @@ class DatabaseTestHelper extends DatabaseBase {
 
        public function tableExists( $table, $fname = __METHOD__ ) {
                $this->checkFunctionName( $fname );
+
                return in_array( $table, (array)$this->tablesExists );
        }
 
index 596d0bd..27d4d0e 100644 (file)
@@ -76,6 +76,7 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
         */
        protected function getRowInstance( array $data, $loadDefaults ) {
                $class = $this->getRowClass();
+
                return new $class( $this->getTableInstance(), $data, $loadDefaults );
        }
 
index 4cadf31..e583d1b 100644 (file)
@@ -45,6 +45,7 @@ class ORMTableTest extends MediaWikiTestCase {
         */
        public function getTable() {
                $class = $this->getTableClass();
+
                return $class::singleton();
        }
 
@@ -84,7 +85,6 @@ class ORMTableTest extends MediaWikiTestCase {
 
                $db->ignoreErrors( false );
        }
-
 }
 
 /**
index 263553a..f32610b 100644 (file)
@@ -122,10 +122,10 @@ class TestORMRowTest extends ORMRowTest {
                        'blob' => new stdClass()
                );
        }
-
 }
 
-class TestORMRow extends ORMRow {}
+class TestORMRow extends ORMRow {
+}
 
 class TestORMTable extends ORMTable {
 
@@ -194,6 +194,4 @@ class TestORMTable extends ORMTable {
        protected function getFieldPrefix() {
                return 'test_';
        }
-
-
 }
index 3991c93..0d6e4d5 100644 (file)
@@ -315,6 +315,7 @@ class FileBackendTest extends MediaWikiTestCase {
                                "Source file $source does not exist ($backendName)." );
                        $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $dest ) ),
                                "Destination file $dest does not exist ($backendName)." );
+
                        return; // done
                }
 
@@ -434,6 +435,7 @@ class FileBackendTest extends MediaWikiTestCase {
                                "Source file $source does not exist ($backendName)." );
                        $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $dest ) ),
                                "Destination file $dest does not exist ($backendName)." );
+
                        return; // done
                }
 
@@ -1369,6 +1371,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
        public static function provider_testPrepareAndClean() {
                $base = self::baseStorePath();
+
                return array(
                        array( "$base/unittest-cont1/e/a/z/some_file1.txt", true ),
                        array( "$base/unittest-cont2/a/z/some_file2.txt", true ),
@@ -2192,6 +2195,7 @@ class FileBackendTest extends MediaWikiTestCase {
        // test helper wrapper for backend prepare() function
        private function create( array $params ) {
                $params['op'] = 'create';
+
                return $this->backend->doQuickOperations( array( $params ) );
        }
 
index 7cc25b1..033ae0b 100644 (file)
@@ -1,26 +1,25 @@
 <?php
 
 class FileRepoTest extends MediaWikiTestCase {
-
        /**
         * @expectedException MWException
         */
        function testFileRepoConstructionOptionCanNotBeNull() {
-               $f = new FileRepo();
+               new FileRepo();
        }
 
        /**
         * @expectedException MWException
         */
        function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
-               $f = new FileRepo( array() );
+               new FileRepo( array() );
        }
 
        /**
         * @expectedException MWException
         */
        function testFileRepoConstructionOptionNeedNameKey() {
-               $f = new FileRepo( array(
+               new FileRepo( array(
                        'backend' => 'foobar'
                ) );
        }
@@ -29,7 +28,7 @@ class FileRepoTest extends MediaWikiTestCase {
         * @expectedException MWException
         */
        function testFileRepoConstructionOptionNeedBackendKey() {
-               $f = new FileRepo( array(
+               new FileRepo( array(
                        'name' => 'foobar'
                ) );
        }
index a89ef98..71a585e 100644 (file)
@@ -69,6 +69,7 @@ class StoreBatchTest extends MediaWikiTestCase {
                $result = $this->repo->store( $srcPath, 'temp', $dstRel, $flags );
                $result->value = $this->repo->getVirtualUrl( 'temp' ) . '/' . $dstUrlRel;
                $this->createdFiles[] = $result->value;
+
                return $result;
        }
 
index 820f8c5..787b431 100644 (file)
@@ -46,7 +46,8 @@ class JobQueueTest extends MediaWikiTestCase {
                                if ( !( $this->$q instanceof JobQueueDB ) ) {
                                        $this->$q->setTestingPrefix( 'unittests-' . wfRandomString( 32 ) );
                                }
-                       } catch ( MWException $e ) {}; // unsupported? (@TODO: what if it was another error?)
+                       } catch ( MWException $e ) {
+                       }; // unsupported? (@TODO: what if it was another error?)
                }
        }
 
@@ -109,7 +110,6 @@ class JobQueueTest extends MediaWikiTestCase {
                $jobs = iterator_to_array( $queue->getAllQueuedJobs() );
                $this->assertEquals( 2, count( $jobs ), "Queue iterator size is correct ($desc)" );
 
-
                $job1 = $queue->pop();
                $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" );
 
index 0782e4e..ef263c4 100644 (file)
@@ -88,7 +88,6 @@ class FormatJsonTest extends MediaWikiTestCase {
                        strtolower( FormatJson::encode( "\xf0\xa0\x80\x80" ) ),
                        'Test encoding an broken json_encode character (U+20000)'
                );
-
        }
 
        public function testDecodeReturnType() {
@@ -156,6 +155,7 @@ class FormatJsonTest extends MediaWikiTestCase {
                                $cases[] = array( $from, '"' . ( $leaveUnescaped ? $from : $to ) . '"' );
                        }
                }
+
                return $cases;
        }
 }
index 37a9b34..7436c43 100644 (file)
@@ -73,6 +73,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase {
         */
        protected function getNew( array $elements = array() ) {
                $class = $this->getInstanceClass();
+
                return new $class( $elements );
        }
 
@@ -197,6 +198,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase {
        public function testOffsetSet( array $elements ) {
                if ( $elements === array() ) {
                        $this->assertTrue( true );
+
                        return;
                }
 
@@ -258,5 +260,4 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase {
 
                $this->assertArrayEquals( $list, $copy, true, true );
        }
-
 }
index 117a072..ffa6084 100644 (file)
@@ -146,5 +146,4 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase {
                $res = $handler->getTiffByteOrder( $this->filePath . 'test.tiff' );
                $this->assertEquals( 'LE', $res );
        }
-
 }
index e7e95f7..6ad28ac 100644 (file)
@@ -39,6 +39,4 @@ class ExifTest extends MediaWikiTestCase {
                );
                $this->assertEquals( $expected, $data );
        }
-
-
 }
index c9648a7..81a58dd 100644 (file)
@@ -56,5 +56,4 @@ class IPTCTest extends MediaWikiTestCase {
                $res = IPTC::Parse( $iptcData );
                $this->assertEquals( array( '¼' ), $res['Keywords'] );
        }
-
 }
index 3bbce2b..58d791f 100644 (file)
@@ -52,7 +52,6 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
                // encoded as just \xA9.
                $expected = "© 2010 Bawolff";
 
-
                $this->assertArrayHasKey( 'text', $meta );
                $meta = $meta['text'];
                $this->assertArrayHasKey( 'Copyright', $meta );
@@ -149,5 +148,4 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
                        'greyscale-na-png.png' );
                $this->assertEquals( 'greyscale', $meta['colorType'] );
        }
-
 }
index 97a0000..3bf9c59 100644 (file)
@@ -21,6 +21,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
                $r = new XMLReader();
                if ( !method_exists( $r, 'readInnerXML' ) ) {
                        $this->markTestSkipped( 'XMLReader::readInnerXML() does not exist (libxml >2.6.20 needed).' );
+
                        return;
                }
                $this->assertMetadata( $infile, $expected );
@@ -41,6 +42,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
 
        public static function provideSvgFiles() {
                $base = __DIR__ . '/../../data/media';
+
                return array(
                        array(
                                "$base/Wikimedia-logo.svg",
index 86c722b..3e39675 100644 (file)
@@ -65,6 +65,7 @@ class XMPTest extends MediaWikiTestCase {
                        include( $xmpPath . $file[0] . '.result.php' );
                        $data[] = array( $xmp, $result, '[' . $file[0] . '.xmp] ' . $file[1] );
                }
+
                return $data;
        }
 
@@ -157,5 +158,4 @@ class XMPTest extends MediaWikiTestCase {
 
                $this->assertEquals( $expected, $actual );
        }
-
 }
index a2b4e1c..257c40a 100644 (file)
@@ -41,7 +41,5 @@ class XMPValidateTest extends MediaWikiTestCase {
                        array( '2001-05-12T15', null ),
                        array( '2001-12T15:13', null ),
                );
-
        }
-
 }
index 88b07f0..be603e5 100644 (file)
@@ -15,7 +15,6 @@ class BagOStuffTest extends MediaWikiTestCase {
                        $name = $this->getCliArg( 'use-bagostuff=' );
 
                        $this->cache = ObjectCache::newFromId( $name );
-
                } else {
                        // no type defined - use simple hash
                        $this->cache = new HashBagOStuff;
index 067a7c4..3939c4f 100644 (file)
@@ -16,19 +16,32 @@ class MediaWikiParserTest {
 
                $suite = new PHPUnit_Framework_TestSuite;
 
-               foreach ( $wgParserTestFiles as $filename ) {
-                       $testsName = basename( $filename, '.txt' );
+               foreach ( $wgParserTestFiles as $fileName ) {
+                       $testsName = basename( $fileName, '.txt' );
+                       $escapedFileName = strtr( $fileName, array( "'" => "\\'", '\\' => '\\\\' ) );
                        /* This used to be ucfirst( basename( dirname( $filename ) ) )
                         * and then was ucfirst( basename( $filename, '.txt' )
                         * but that didn't work with names like foo.tests.txt
                         */
-                       $className = str_replace( '.', '_', ucfirst( $testsName ) );
+                       $parserTestClassName = str_replace( '.', '_', ucfirst( $testsName ) );
+                       $parserTestClassDefinition = <<<EOT
+/**
+ * @group Database
+ * @group Parser
+ * @group ParserTests
+ * @group ParserTests_$parserTestClassName
+ */
+class $parserTestClassName extends NewParserTest {
+       protected \$file = '$escapedFileName';
+}
+EOT;
 
-                       eval( "/** @group Database\n@group Parser\n*/ class $className extends NewParserTest { protected \$file = '" . strtr( $filename, array( "'" => "\\'", '\\' => '\\\\' ) ) . "'; } " );
+                       eval( $parserTestClassDefinition );
 
-                       $parserTester = new $className( $testsName );
+                       $parserTester = new $parserTestClassName( $testsName );
                        $suite->addTestSuite( new ReflectionClass ( $parserTester ) );
                }
+
                return $suite;
        }
 }
index 77311b9..934f181 100644 (file)
@@ -86,7 +86,6 @@ class NewParserTest extends MediaWikiTestCase {
                        $tmpGlobals['wgStyleDirectory'] = "$IP/skins";
                }
 
-
                foreach ( $tmpGlobals as $var => $val ) {
                        if ( array_key_exists( $var, $GLOBALS ) ) {
                                $this->savedInitialGlobals[$var] = $GLOBALS[$var];
@@ -432,6 +431,7 @@ class NewParserTest extends MediaWikiTestCase {
                // wfDebug( "Creating upload directory $dir\n" );
                if ( file_exists( $dir ) ) {
                        wfDebug( "Already exists!\n" );
+
                        return $dir;
                }
 
@@ -543,6 +543,7 @@ class NewParserTest extends MediaWikiTestCase {
                        global $wgParserTestFiles;
                        $this->file = $wgParserTestFiles[0];
                }
+
                return new TestFileIterator( $this->file, $this );
        }
 
@@ -717,7 +718,6 @@ class NewParserTest extends MediaWikiTestCase {
                        }
 
                        $id++;
-
                }
        }
 
@@ -911,6 +911,7 @@ class NewParserTest extends MediaWikiTestCase {
                                }
                        }
                }
+
                return $opts;
        }
 
@@ -922,6 +923,7 @@ class NewParserTest extends MediaWikiTestCase {
                if ( substr( $opt, 0, 2 ) == '[[' ) {
                        return substr( $opt, 2, -2 );
                }
+
                return $opt;
        }
 
index 50fe0e4..cacbb85 100644 (file)
@@ -44,6 +44,5 @@ class ParserMethodsTest extends MediaWikiLangTestCase {
                        'text' => '<pre style="margin-left: 1.6em">foo</pre>',
                ), $ret, 'callParserFunction works for {{#tag:pre|foo|style=margin-left: 1.6em}}' );
        }
-
        // TODO: Add tests for cleanSig() / cleanSigInSig(), getSection(), replaceSection(), getPreloadText()
 }
index e16b407..c609164 100644 (file)
@@ -68,5 +68,4 @@ class ParserPreloadTest extends MediaWikiTestCase {
                        $msg
                );
        }
-
 }
index 6abca6d..47c47f6 100644 (file)
@@ -87,6 +87,7 @@ class SearchEngineTest extends MediaWikiLangTestCase {
                # sort them numerically so we will compare simply that we received
                # the expected matches.
                sort( $matches );
+
                return $matches;
        }
 
@@ -172,5 +173,4 @@ class SearchEngineTest extends MediaWikiLangTestCase {
                        $this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
                        "Title power search failed" );
        }
-
 }
index 7d867bc..d19cdd0 100644 (file)
@@ -28,6 +28,7 @@ class SearchUpdateTest extends MediaWikiTestCase {
        function update( $text, $title = 'Test', $id = 1 ) {
                $u = new SearchUpdate( $id, $title, $text );
                $u->doUpdate();
+
                return array( MockSearch::$title, MockSearch::$text );
        }
 
index b86636f..e0092a5 100644 (file)
@@ -85,5 +85,4 @@ class MediaWikiSiteTest extends SiteTest {
                $this->assertContains( $path, $site->getPageUrl() );
                $this->assertContains( $expected, $site->getPageUrl( $page ) );
        }
-
 }
index c329839..bd2ae07 100644 (file)
@@ -186,5 +186,4 @@ class SiteListTest extends MediaWikiTestCase {
                        $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) );
                }
        }
-
 }
index cf4ce94..cf652e9 100644 (file)
@@ -119,5 +119,4 @@ class SiteSQLStoreTest extends MediaWikiTestCase {
                $sites = $store->getSites();
                $this->assertEquals( 0, $sites->count() );
        }
-
 }
index 8033784..b453e74 100644 (file)
@@ -263,5 +263,4 @@ class SiteTest extends MediaWikiTestCase {
 
                $this->assertEquals( $serialization, serialize( $newInstance ) );
        }
-
 }
index a5656a7..f224b7d 100644 (file)
@@ -97,5 +97,4 @@ class TestSites {
                $sitesTable->clear();
                $sitesTable->saveSites( TestSites::getSites() );
        }
-
 }
index add830b..436eb2e 100644 (file)
@@ -42,7 +42,6 @@ class SpecialRecentchangesTest extends MediaWikiTestCase {
        /** return false if condition begin with 'rc_timestamp ' */
        private static function filterOutRcTimestampCondition( $var ) {
                return ( false === strpos( $var, 'rc_timestamp ' ) );
-
        }
 
        public function testRcNsFilter() {
@@ -123,5 +122,4 @@ class SpecialRecentchangesTest extends MediaWikiTestCase {
                        array( NS_TALK, NS_MAIN ),
                );
        }
-
 }
index 15a11ed..c737f05 100644 (file)
@@ -53,7 +53,6 @@ class SpecialSearchTest extends MediaWikiTestCase {
                        )
                        , $message
                );
-
        }
 
        public static function provideSearchOptionsTests() {
@@ -105,6 +104,7 @@ class SpecialSearchTest extends MediaWikiTestCase {
                foreach ( $opt as $name => $value ) {
                        $u->setOption( $name, $value );
                }
+
                return $u;
        }
 
@@ -135,6 +135,5 @@ class SpecialSearchTest extends MediaWikiTestCase {
                        $pageTitle,
                        "Search term '{$term}' should not be expanded in Special:Search <title>"
                );
-
        }
 }
index ac93aa7..a75fba6 100644 (file)
@@ -6,7 +6,6 @@
  * @group Database
  */
 class UploadFromUrlTest extends ApiTestCase {
-
        protected function setUp() {
                parent::setUp();
 
@@ -31,6 +30,7 @@ class UploadFromUrlTest extends ApiTestCase {
                $module->execute();
 
                wfSetupSession( $sessionId );
+
                return array( $module->getResultData(), $req );
        }
 
@@ -175,7 +175,6 @@ class UploadFromUrlTest extends ApiTestCase {
 
                $this->user->addGroup( 'users' );
 
-
                $data = $this->doAsyncUpload( $token );
 
                $this->assertEquals( $data[0]['upload']['result'], 'Warning' );
@@ -236,7 +235,7 @@ class UploadFromUrlTest extends ApiTestCase {
 
                $this->assertFalse( (bool)$talk->getArticleID( Title::GAID_FOR_UPDATE ), 'User talk does not exist' );
 
-               $data = $this->doApiRequest( array(
+               $this->doApiRequest( array(
                        'action' => 'upload',
                        'filename' => 'UploadFromUrlTest.png',
                        'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png',
@@ -260,7 +259,7 @@ class UploadFromUrlTest extends ApiTestCase {
 
                $exception = false;
                try {
-                       $data = $this->doApiRequest( array(
+                       $this->doApiRequest( array(
                                'action' => 'upload',
                                'filename' => 'UploadFromUrlTest.png',
                                'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png',
@@ -278,7 +277,6 @@ class UploadFromUrlTest extends ApiTestCase {
                $this->assertFalse( $job );
 
                return;
-
                /*
                // Broken until using leavemessage with ignorewarnings is supported
                $job->run();
@@ -331,7 +329,6 @@ class UploadFromUrlTest extends ApiTestCase {
                return $data;
        }
 
-
        /**
         *
         */
index b809d32..94c78dc 100644 (file)
@@ -130,15 +130,15 @@ class UploadTest extends MediaWikiTestCase {
 }
 
 class UploadTestHandler extends UploadBase {
-       public function initializeFromRequest( &$request ) {}
+       public function initializeFromRequest( &$request ) {
+       }
 
        public function testTitleValidation( $name ) {
                $this->mTitle = false;
                $this->mDesiredDestName = $name;
                $this->mTitleError = UploadBase::OK;
                $this->getTitle();
+
                return $this->mTitleError;
        }
-
-
 }
index 6659dad..4274335 100644 (file)
@@ -96,5 +96,4 @@ abstract class LanguageClassesTestCase extends MediaWikiTestCase {
                unset( $this->languageObject );
                parent::tearDown();
        }
-
 }
index d5dbfb2..80f76a5 100644 (file)
@@ -202,7 +202,6 @@ class LanguageTest extends LanguageClassesTestCase {
                                'formatTimePeriod() rounding, recursion, (>48h)'
                        ),
                );
-
        }
 
        function testTruncate() {
index 464a310..6358ac0 100644 (file)
@@ -56,5 +56,4 @@ class LanguageTrTest extends LanguageClassesTestCase {
 
                );
        }
-
 }
index 73d5dcc..3bf7414 100644 (file)
@@ -89,7 +89,7 @@ class CLDRPluralRuleEvaluatorTest extends MediaWikiTestCase {
                        array( 'n', 'just n' ),
                        array( 'n is in 5', 'is in' ),
                );
+
                return $tests;
        }
-
 }
index f82898f..78a5153 100644 (file)
@@ -124,6 +124,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                                return true;
                        }
                }
+
                return false;
        }
 
@@ -145,6 +146,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                                return true;
                        }
                }
+
                return false;
        }
 
@@ -271,7 +273,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                $this->assertTextNode( "title", $name );
                $this->assertTextNode( "ns", $ns );
                $this->assertTextNode( "id", $id );
-
        }
 
        /**
@@ -299,8 +300,8 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * @param $parentid int|false: (optional) id of the parent revision
         */
        protected function assertRevision( $id, $summary, $text_id, $text_bytes, $text_sha1, $text = false, $parentid = false,
-                                                                          $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT ) {
-
+               $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT
+       ) {
                $this->assertNodeStart( "revision" );
                $this->skipWhitespace();
 
index 741f8b7..f4b61af 100644 (file)
@@ -128,7 +128,6 @@ class MaintenanceFixup extends Maintenance {
        public function execute() {
                $this->testCase->fail( __METHOD__ . " called unexpectedly" );
        }
-
 }
 
 class MaintenanceTest extends MediaWikiTestCase {
@@ -186,7 +185,6 @@ class MaintenanceTest extends MediaWikiTestCase {
        // test.*Intermittent.* tests), the objective of these tests is not to describe
        // consistent behavior, but rather currently existing behavior.
 
-
        function testOutputEmpty() {
                $this->m->output( "" );
                $this->assertOutputPrePostShutdown( "", false );
@@ -815,6 +813,4 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foobar\n\n", false );
        }
-
-
 }
index cc00e6e..bc2d737 100644 (file)
@@ -36,7 +36,6 @@ class BaseDumpTest extends MediaWikiTestCase {
        private function assertPrefetchEquals( $expected, $page, $revision ) {
                $this->assertEquals( $expected, $this->dump->prefetch( $page, $revision ),
                        "Prefetch of page $page revision $revision" );
-
        }
 
        function testSequential() {
@@ -181,7 +180,6 @@ class BaseDumpTest extends MediaWikiTestCase {
   </siteinfo>
 ';
 
-
                // An array holding the pages that are available for prefetch
                $available_pages = array();
 
@@ -274,5 +272,4 @@ class BaseDumpTest extends MediaWikiTestCase {
 
                return $fname;
        }
-
 }
index 0962344..7fe48dd 100644 (file)
@@ -80,7 +80,6 @@ class TextPassDumperTest extends DumpTestCase {
                        // DumpTestCase
                        $this->exceptionFromAddDBData = $e;
                }
-
        }
 
        protected function setUp() {
@@ -94,7 +93,6 @@ class TextPassDumperTest extends DumpTestCase {
                        array( $this->pageId2, $this->pageId3, $this->pageId4 ),
                        array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ),
                        "Page ids increasing without holes" );
-
        }
 
        function testPlain() {
@@ -214,7 +212,6 @@ class TextPassDumperTest extends DumpTestCase {
                $this->assertPageEnd();
 
                $this->assertDumpEnd();
-
        }
 
        /**
@@ -239,7 +236,6 @@ class TextPassDumperTest extends DumpTestCase {
                $minDuration = 2; // We want the dump to take at least this many seconds
                $checkpointAfter = 0.5; // Generate checkpoint after this many seconds
 
-
                // Until a dump takes at least $minDuration seconds, perform a dump and check
                // duration. If the dump did not take long enough increase the iteration
                // count, to generate a bigger stub file next time.
@@ -579,6 +575,7 @@ class TextPassDumperTest extends DumpTestCase {
                $content .= $tail;
                $this->assertEquals( strlen( $content ), file_put_contents(
                        $fname, $content ), "Length of prepared stub" );
+
                return $fname;
        }
 }
index 5cf172e..98d8165 100644 (file)
@@ -39,6 +39,7 @@ class BackupDumperLoggerTest extends DumpTestCase {
                if ( $parameters !== null ) {
                        $logEntry->setParameters( $parameters );
                }
+
                return $logEntry->insert();
        }
 
@@ -75,14 +76,12 @@ class BackupDumperLoggerTest extends DumpTestCase {
                                $user2, NS_MAIN, "PageA", "SomeOtherComment",
                                array( 'key1' => 1, 3 => 'value3' ) );
                        $this->assertGreaterThan( 0, $this->logId3 );
-
                } catch ( Exception $e ) {
                        // We'd love to pass $e directly. However, ... see
                        // documentation of exceptionFromAddDBData in
                        // DumpTestCase
                        $this->exceptionFromAddDBData = $e;
                }
-
        }
 
 
@@ -226,5 +225,4 @@ class BackupDumperLoggerTest extends DumpTestCase {
                // the following statement to catch good output
                $this->expectOutputString( '' );
        }
-
 }
index 07c7670..535e61e 100644 (file)
@@ -79,7 +79,6 @@ class BackupDumperPageTest extends DumpTestCase {
                        // DumpTestCase
                        $this->exceptionFromAddDBData = $e;
                }
-
        }
 
        protected function setUp() {
@@ -93,7 +92,6 @@ class BackupDumperPageTest extends DumpTestCase {
                        array( $this->pageId2, $this->pageId3, $this->pageId4 ),
                        array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ),
                        "Page ids increasing without holes" );
-
        }
 
        function testFullTextPlain() {
@@ -403,6 +401,4 @@ class BackupDumperPageTest extends DumpTestCase {
 
                $this->expectETAOutput();
        }
-
-
 }
index 4d1d45d..e8df199 100644 (file)
@@ -63,7 +63,6 @@ class SemiMockedFetchText extends FetchText {
 
                return fopen( 'data://text/plain,' . $this->mockStdinText, 'r' );
        }
-
 }
 
 /**
@@ -236,5 +235,4 @@ class FetchTextTest extends MediaWikiTestCase {
                                $this->textId3 . "\n23\nFetchTextTestPage2Text2"
                        ) ) );
        }
-
 }
index 699571b..2c84886 100644 (file)
@@ -64,6 +64,4 @@ class GetSlaveServerTest extends MediaWikiTestCase {
                $this->expectOutputRegex( "/^[[:space:]]*\[wgDBprefix\][[:space:]]*=> "
                        . $wgDBprefix . "$/m" );
        }
-
-
 }
index 2a1ebc3..b425d86 100755 (executable)
@@ -89,7 +89,6 @@ class PHPUnitMaintClass extends Maintenance {
                        unset( $_SERVER['argv'][$key] ); // the option
                        unset( $_SERVER['argv'][$key + 1] ); // its value
                        $_SERVER['argv'] = array_values( $_SERVER['argv'] );
-
                }
        }
 
index 71b8c67..3af805a 100644 (file)
@@ -91,7 +91,7 @@ class ResourcesTest extends MediaWikiTestCase {
                                $property = $reflectedModule->getProperty( $propName );
                                $property->setAccessible( true );
                                $lists = $property->getValue( $module );
-                               foreach ( $lists as $group => $list ) {
+                               foreach ( $lists as $list ) {
                                        foreach ( $list as $key => $value ) {
                                                // We need the same filter as for 'lists',
                                                // due to 'skinStyles'.
@@ -116,7 +116,6 @@ class ResourcesTest extends MediaWikiTestCase {
                                        $file,
                                );
                        }
-
                }
 
                // Restore settings
@@ -124,5 +123,4 @@ class ResourcesTest extends MediaWikiTestCase {
 
                return $cases;
        }
-
 }
index 876876b..850d39c 100644 (file)
@@ -100,7 +100,6 @@ class SideBarTest extends MediaWikiLangTestCase {
 ** http://valid.no.desc.org/
 '
                );
-
        }
 
        /**
index 3200e0b..b1496a9 100644 (file)
@@ -57,7 +57,6 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
                $wgNamespaceAliases['Image'] = NS_FILE;
                $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
 
-
                $wgEnableParserCache = false;
                DeferredUpdates::clearPendingUpdates();
                $wgMemc = wfGetMainCache();
@@ -185,6 +184,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
 
                if ( file_exists( $dir ) ) {
                        wfDebug( "Already exists!\n" );
+
                        return $dir;
                }
 
@@ -202,6 +202,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
                // the UploadFromUrlTest class
                class_exists( 'UploadFromUrlTest' );
                $suite = new UploadFromUrlTestSuite( 'UploadFromUrlTest' );
+
                return $suite;
        }
 }
index bba3160..713ec4b 100644 (file)
@@ -1,5 +1,13 @@
 ( function ( mw, $ ) {
-       QUnit.module( 'mediawiki.util', QUnit.newMwEnvironment() );
+       QUnit.module( 'mediawiki.util', QUnit.newMwEnvironment( {
+               setup: function () {
+                       this.taPrefix = mw.util.tooltipAccessKeyPrefix;
+                       mw.util.tooltipAccessKeyPrefix = 'ctrl-alt-';
+               },
+               teardown: function () {
+                       mw.util.tooltipAccessKeyPrefix = this.taPrefix;
+               }
+       } ) );
 
        QUnit.test( 'rawurlencode', 1, function ( assert ) {
                assert.equal( mw.util.rawurlencode( 'Test:A & B/Here' ), 'Test%3AA%20%26%20B%2FHere' );
                assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' );
        } );
 
-       QUnit.test( 'tooltipAccessKey', 3, function ( assert ) {
-               assert.equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'mw.util.tooltipAccessKeyPrefix must be a string' );
-               assert.ok( mw.util.tooltipAccessKeyRegexp instanceof RegExp, 'mw.util.tooltipAccessKeyRegexp instance of RegExp' );
-               assert.ok( mw.util.updateTooltipAccessKeys, 'mw.util.updateTooltipAccessKeys' );
+       QUnit.test( 'tooltipAccessKey', 4, function ( assert ) {
+               assert.equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'tooltipAccessKeyPrefix must be a string' );
+               assert.equal( $.type( mw.util.tooltipAccessKeyRegexp ), 'regexp', 'tooltipAccessKeyRegexp is a regexp' );
+               assert.ok( mw.util.updateTooltipAccessKeys, 'updateTooltipAccessKeys is non-empty' );
+
+               'Example [a]'.replace( mw.util.tooltipAccessKeyRegexp, function ( sub, m1, m2, m3, m4, m5, m6 ) {
+                       assert.equal( m6, 'a', 'tooltipAccessKeyRegexp finds the accesskey hint' );
+               } );
        } );
 
        QUnit.test( '$content', 2, function ( assert ) {
         * Previously, test elements where invisible to the selector since only
         * one element can have a given id.
         */
-       QUnit.test( 'addPortletLink', 8, function ( assert ) {
+       QUnit.test( 'addPortletLink', 10, function ( assert ) {
                var pTestTb, pCustom, vectorTabs, tbRL, cuQuux, $cuQuux, tbMW, $tbMW, tbRLDM, caFoo;
 
                pTestTb = '\
                $( '#qunit-fixture' ).append( pTestTb, pCustom, vectorTabs );
 
                tbRL = mw.util.addPortletLink( 'p-test-tb', '//mediawiki.org/wiki/ResourceLoader',
-                       'ResourceLoader', 't-rl', 'More info about ResourceLoader on MediaWiki.org ', 'l' );
+                       'ResourceLoader', 't-rl', 'More info about ResourceLoader on MediaWiki.org ', 'l'
+               );
 
                assert.ok( $.isDomElement( tbRL ), 'addPortletLink returns a valid DOM Element according to $.isDomElement' );
 
                        'MediaWiki.org', 't-mworg', 'Go to MediaWiki.org ', 'm', tbRL );
                $tbMW = $( tbMW );
 
+               assert.propEqual(
+                       $tbMW.getAttrs(),
+                       {
+                               id: 't-mworg'
+                       },
+                       'Validate attributes of created element'
+               );
+
+               assert.propEqual(
+                       $tbMW.find( 'a' ).getAttrs(),
+                       {
+                               href: '//mediawiki.org/',
+                               title: 'Go to MediaWiki.org [ctrl-alt-m]',
+                               accesskey: 'm'
+                       },
+                       'Validate attributes of anchor tag in created element'
+               );
 
-               assert.equal( $tbMW.attr( 'id' ), 't-mworg', 'Link has correct ID set' );
                assert.equal( $tbMW.closest( '.portlet' ).attr( 'id' ), 'p-test-tb', 'Link was inserted within correct portlet' );
                assert.equal( $tbMW.next().attr( 'id' ), 't-rl', 'Link is in the correct position (by passing nextnode)' );
 
-               cuQuux = mw.util.addPortletLink( 'p-test-custom', '#', 'Quux' );
+               cuQuux = mw.util.addPortletLink( 'p-test-custom', '#', 'Quux', null, 'Example [shift-x]', 'q' );
                $cuQuux = $( cuQuux );
 
+               assert.equal( $cuQuux.find( 'a' ).attr( 'title' ), 'Example [ctrl-alt-q]', 'Existing accesskey is stripped and updated' );
+
                assert.equal(
                        $( '#p-test-custom #c-barmenu ul li' ).length,
                        1,
index 2803ff2..1237bb5 100644 (file)
@@ -105,8 +105,6 @@ class AddContentToNewPageTestCase extends SeleniumTestCase {
 
        // Add level 2 headline and verify output in the preview
        public function testAddLevel2HeadLine() {
-               $blnElementPresent = false;
-               $blnTextPresent = false;
                $this->getExistingPage();
                $this->clickEditLink();
                $this->loadWikiEditor();
index 02fcf24..88e5885 100644 (file)
  * @ingroup Testing
  */
 
-class TestRecorder {
+/**
+ * Interface to record parser test results.
+ *
+ * The ITestRecorder is a very simple interface to record the result of
+ * MediaWiki parser tests. One should call start() before running the
+ * full parser tests and end() once all the tests have been finished.
+ * After each test, you should use record() to keep track of your tests
+ * results. Finally, report() is used to generate a summary of your
+ * test run, one could dump it to the console for human consumption or
+ * register the result in a database for tracking purposes.
+ *
+ * @since 1.22
+ */
+interface ITestRecorder {
+
+       /** Called at beginning of the parser test run */
+       public function start();
+
+       /** Called after each test */
+       public function record( $test, $result );
+
+       /** Called before finishing the test run */
+       public function report();
+
+       /** Called at the end of the parser test run */
+       public function end();
+
+}
+
+class TestRecorder implements ITestRecorder {
        var $parent;
        var $term;
 
@@ -481,7 +510,7 @@ class TestFileIterator implements Iterator {
                                        return true;
                                }
 
-                               if ( isset ( $this->sectionData[$this->section] ) ) {
+                               if ( isset( $this->sectionData[$this->section] ) ) {
                                        throw new MWException( "duplicate section '$this->section' at line {$this->lineNum} of $this->file\n" );
                                }