From cecb985bee3bdd252e1b8dc0bd500b37cd52be01 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 16 May 2007 20:58:53 +0000 Subject: Aktualisierung auf MediaWiki 1.10.0 Plugins angepasst und verbessert kleine Korrekturen am Design --- HISTORY | 691 ++++ Makefile | 7 + RELEASE-NOTES | 1266 +++--- Test.php | 307 ++ bin/svnstat | 2 + bin/ulimit4.sh | 4 + config/index.php | 169 +- docs/database.txt | 10 +- docs/deferred.txt | 8 + docs/design.txt | 19 +- docs/hooks.txt | 61 + docs/memcached.txt | 10 +- docs/title.txt | 15 +- extensions/FunnyDot.php | 16 +- extensions/LLAuthPlugin.php | 202 +- extensions/README | 17 +- img_auth.php | 1 + includes/AjaxDispatcher.php | 23 +- includes/AjaxFunctions.php | 95 +- includes/AjaxResponse.php | 70 +- includes/Article.php | 463 ++- includes/AuthPlugin.php | 8 +- includes/AutoLoader.php | 49 +- includes/BagOStuff.php | 41 +- includes/Block.php | 100 +- includes/CacheDependency.php | 21 +- includes/CategoryPage.php | 35 +- includes/Categoryfinder.php | 73 +- includes/ChangesList.php | 78 +- includes/CoreParserFunctions.php | 23 +- includes/Credits.php | 1 - includes/Database.php | 295 +- includes/DatabaseFunctions.php | 53 +- includes/DatabaseOracle.php | 788 ++-- includes/DatabasePostgres.php | 332 +- includes/DateFormatter.php | 10 +- includes/DefaultSettings.php | 198 +- includes/Defines.php | 1 - includes/DifferenceEngine.php | 127 +- includes/DjVuImage.php | 134 +- includes/EditPage.php | 615 +-- includes/Exception.php | 30 +- includes/Exif.php | 30 +- includes/Export.php | 38 +- includes/ExternalEdit.php | 4 +- includes/ExternalStore.php | 1 - includes/ExternalStoreDB.php | 2 - includes/ExternalStoreHttp.php | 1 - includes/FakeTitle.php | 3 +- includes/Feed.php | 18 +- includes/FileStore.php | 16 +- includes/GlobalFunctions.php | 197 +- includes/HTMLCacheUpdate.php | 9 +- includes/HTMLFileCache.php | 4 +- includes/HTMLForm.php | 4 +- includes/HistoryBlob.php | 98 +- includes/Hooks.php | 3 +- includes/IP.php | 279 +- includes/Image.php | 1279 +++---- includes/ImageFunctions.php | 2 +- includes/ImageGallery.php | 137 +- includes/ImagePage.php | 256 +- includes/ImageQueryPage.php | 68 + includes/JobQueue.php | 125 +- includes/Licenses.php | 12 +- includes/LinkBatch.php | 7 +- includes/LinkCache.php | 15 +- includes/LinkFilter.php | 46 +- includes/Linker.php | 322 +- includes/LinksUpdate.php | 16 +- includes/LoadBalancer.php | 13 +- includes/LogPage.php | 56 +- includes/MacBinary.php | 7 +- includes/MagicWord.php | 7 +- includes/Math.php | 8 +- includes/MediaTransformOutput.php | 166 + includes/MemcachedSessions.php | 1 - includes/MessageCache.php | 10 +- includes/Metadata.php | 5 +- includes/MimeMagic.php | 39 +- includes/Namespace.php | 16 +- includes/ObjectCache.php | 6 +- includes/OutputHandler.php | 64 + includes/OutputPage.php | 122 +- includes/PageHistory.php | 59 +- includes/PageQueryPage.php | 26 + includes/Pager.php | 57 +- includes/Parser.php | 522 +-- includes/ParserCache.php | 28 +- includes/ParserOptions.php | 119 + includes/ParserOutput.php | 133 + includes/PatrolLog.php | 83 + includes/Profiler.php | 11 +- includes/ProfilerSimple.php | 19 +- includes/ProfilerSimpleUDP.php | 11 +- includes/ProtectionForm.php | 183 +- includes/ProxyTools.php | 50 +- includes/QueryPage.php | 223 +- includes/RawPage.php | 35 +- includes/RecentChange.php | 12 +- includes/Revision.php | 85 +- includes/Sanitizer.php | 184 +- includes/SearchEngine.php | 48 +- includes/SearchMySQL.php | 13 +- includes/SearchMySQL4.php | 12 +- includes/SearchOracle.php | 235 ++ includes/SearchPostgres.php | 176 +- includes/SearchTsearch2.php | 20 +- includes/SearchUpdate.php | 16 +- includes/Setup.php | 4 +- includes/SiteConfiguration.php | 10 +- includes/SiteStats.php | 53 +- includes/Skin.php | 111 +- includes/SkinTemplate.php | 114 +- includes/SpecialAllmessages.php | 9 +- includes/SpecialAllpages.php | 61 +- includes/SpecialAncientpages.php | 10 +- includes/SpecialBlockip.php | 293 +- includes/SpecialBlockme.php | 3 +- includes/SpecialBooksources.php | 9 +- includes/SpecialBrokenRedirects.php | 43 +- includes/SpecialCategories.php | 103 +- includes/SpecialConfirmemail.php | 16 +- includes/SpecialContributions.php | 568 ++- includes/SpecialDeadendpages.php | 18 +- includes/SpecialDisambiguations.php | 129 +- includes/SpecialDoubleRedirects.php | 30 +- includes/SpecialEmailuser.php | 23 +- includes/SpecialExport.php | 71 +- includes/SpecialFewestrevisions.php | 65 + includes/SpecialImagelist.php | 22 +- includes/SpecialImport.php | 123 +- includes/SpecialIpblocklist.php | 61 +- includes/SpecialListredirects.php | 10 +- includes/SpecialListusers.php | 301 +- includes/SpecialLockdb.php | 10 +- includes/SpecialLog.php | 173 +- includes/SpecialLonelypages.php | 11 +- includes/SpecialLongpages.php | 15 +- includes/SpecialMIMEsearch.php | 14 +- includes/SpecialMostcategories.php | 9 +- includes/SpecialMostimages.php | 29 +- includes/SpecialMostlinked.php | 13 +- includes/SpecialMostlinkedcategories.php | 10 +- includes/SpecialMostrevisions.php | 8 +- includes/SpecialMovepage.php | 35 +- includes/SpecialNewimages.php | 33 +- includes/SpecialNewpages.php | 31 +- includes/SpecialPage.php | 41 +- includes/SpecialPopularpages.php | 34 +- includes/SpecialPreferences.php | 49 +- includes/SpecialPrefixindex.php | 13 +- includes/SpecialProtectedpages.php | 260 ++ includes/SpecialRandompage.php | 142 +- includes/SpecialRandomredirect.php | 47 +- includes/SpecialRecentchanges.php | 17 +- includes/SpecialRecentchangeslinked.php | 54 +- includes/SpecialResetpass.php | 9 +- includes/SpecialRevisiondelete.php | 9 +- includes/SpecialSearch.php | 22 +- includes/SpecialShortpages.php | 8 +- includes/SpecialSpecialpages.php | 5 +- includes/SpecialStatistics.php | 17 +- includes/SpecialUncategorizedcategories.php | 8 +- includes/SpecialUncategorizedimages.php | 26 +- includes/SpecialUncategorizedpages.php | 10 +- includes/SpecialUndelete.php | 204 +- includes/SpecialUnlockdb.php | 6 +- includes/SpecialUnusedcategories.php | 8 +- includes/SpecialUnusedimages.php | 39 +- includes/SpecialUnusedtemplates.php | 13 +- includes/SpecialUnwatchedpages.php | 14 +- includes/SpecialUpload.php | 151 +- includes/SpecialUploadMogile.php | 10 +- includes/SpecialUserlogin.php | 88 +- includes/SpecialUserlogout.php | 3 +- includes/SpecialUserrights.php | 89 +- includes/SpecialVersion.php | 28 +- includes/SpecialWantedcategories.php | 12 +- includes/SpecialWantedpages.php | 10 +- includes/SpecialWatchlist.php | 46 +- includes/SpecialWhatlinkshere.php | 170 +- includes/SpecialWithoutinterwiki.php | 56 + includes/SquidUpdate.php | 6 +- includes/StringUtils.php | 4 +- includes/StubObject.php | 7 +- includes/Title.php | 829 ++-- includes/User.php | 249 +- includes/UserMailer.php | 42 +- includes/Utf8Case.php | 3 +- includes/WatchedItem.php | 29 +- includes/WebRequest.php | 46 +- includes/WebResponse.php | 14 +- includes/WebStart.php | 12 + includes/Wiki.php | 107 +- includes/WikiError.php | 9 +- includes/Xml.php | 12 +- includes/XmlFunctions.php | 2 +- includes/ZhClient.php | 2 - includes/ZhConversion.php | 1 - includes/api/ApiBase.php | 9 +- includes/api/ApiFeedWatchlist.php | 6 +- includes/api/ApiFormatBase.php | 9 +- includes/api/ApiFormatJson.php | 8 +- includes/api/ApiFormatJson_json.php | 51 +- includes/api/ApiFormatPhp.php | 8 +- includes/api/ApiFormatWddx.php | 8 +- includes/api/ApiFormatXml.php | 8 +- includes/api/ApiFormatYaml.php | 8 +- includes/api/ApiFormatYaml_spyc.php | 13 +- includes/api/ApiHelp.php | 8 +- includes/api/ApiLogin.php | 6 +- includes/api/ApiMain.php | 9 +- includes/api/ApiOpenSearch.php | 8 +- includes/api/ApiPageSet.php | 16 +- includes/api/ApiQuery.php | 10 +- includes/api/ApiQueryAllpages.php | 8 +- includes/api/ApiQueryBacklinks.php | 10 +- includes/api/ApiQueryBase.php | 9 +- includes/api/ApiQueryInfo.php | 6 +- includes/api/ApiQueryLogEvents.php | 8 +- includes/api/ApiQueryRecentChanges.php | 10 +- includes/api/ApiQueryRevisions.php | 8 +- includes/api/ApiQuerySiteinfo.php | 8 +- includes/api/ApiQueryUserContributions.php | 8 +- includes/api/ApiQueryWatchlist.php | 6 +- includes/api/ApiResult.php | 8 +- includes/media/BMP.php | 31 + includes/media/Bitmap.php | 236 ++ includes/media/DjVu.php | 206 + includes/media/Generic.php | 298 ++ includes/media/SVG.php | 97 + includes/memcached-client.php | 2 +- includes/mime.info | 5 +- includes/mime.types | 1 + includes/normal/CleanUpTest.php | 36 +- includes/normal/Makefile | 36 +- includes/normal/README | 4 + includes/normal/RandomTest.php | 4 +- includes/normal/Utf8Test.php | 2 +- includes/normal/UtfNormal.php | 39 +- includes/normal/UtfNormalBench.php | 10 +- includes/normal/UtfNormalData.inc | 9 +- includes/normal/UtfNormalDataK.inc | 3 +- includes/normal/UtfNormalGenerate.php | 4 +- includes/normal/UtfNormalTest.php | 2 +- includes/normal/UtfNormalUtil.php | 2 +- includes/proxy_check.php | 1 - includes/templates/Userlogin.php | 9 +- includes/tidy.conf | 18 + index.php | 41 + install-utils.inc | 50 +- languages/Language.php | 83 +- languages/LanguageConverter.php | 12 +- languages/Names.php | 60 +- languages/classes/LanguageAr.php | 28 + languages/classes/LanguageAz.php | 3 +- languages/classes/LanguageBe.php | 8 +- languages/classes/LanguageBe_x_old.php | 88 + languages/classes/LanguageBg.php | 6 +- languages/classes/LanguageBs.php | 3 +- languages/classes/LanguageCs.php | 3 +- languages/classes/LanguageCu.php | 3 +- languages/classes/LanguageEo.php | 3 +- languages/classes/LanguageEt.php | 3 +- languages/classes/LanguageFi.php | 10 +- languages/classes/LanguageFr.php | 3 +- languages/classes/LanguageGa.php | 3 +- languages/classes/LanguageGsw.php | 3 +- languages/classes/LanguageHe.php | 3 +- languages/classes/LanguageHr.php | 3 +- languages/classes/LanguageHsb.php | 3 +- languages/classes/LanguageHu.php | 3 +- languages/classes/LanguageHy.php | 73 + languages/classes/LanguageJa.php | 3 +- languages/classes/LanguageKk.php | 48 +- languages/classes/LanguageKk_kz.php | 3 +- languages/classes/LanguageKo.php | 4 +- languages/classes/LanguageKsh.php | 3 +- languages/classes/LanguageLa.php | 57 +- languages/classes/LanguageLt.php | 3 +- languages/classes/LanguageLv.php | 3 +- languages/classes/LanguagePt_br.php | 3 +- languages/classes/LanguageRu.php | 3 +- languages/classes/LanguageSk.php | 3 +- languages/classes/LanguageSl.php | 111 +- languages/classes/LanguageSr.php | 5 +- languages/classes/LanguageSr_ec.php | 3 +- languages/classes/LanguageSr_el.php | 3 +- languages/classes/LanguageTr.php | 3 +- languages/classes/LanguageTyv.php | 3 +- languages/classes/LanguageUk.php | 88 + languages/classes/LanguageWa.php | 3 +- languages/classes/LanguageZh.php | 3 +- languages/classes/LanguageZh_cn.php | 3 +- languages/classes/LanguageZh_yue.php | 3 +- languages/messages/MessagesAf.php | 39 +- languages/messages/MessagesAr.php | 2481 +++++++++--- languages/messages/MessagesArc.php | 3 +- languages/messages/MessagesAs.php | 3 +- languages/messages/MessagesAst.php | 3 +- languages/messages/MessagesAv.php | 3 +- languages/messages/MessagesAy.php | 7 +- languages/messages/MessagesAz.php | 953 +++-- languages/messages/MessagesBa.php | 362 +- languages/messages/MessagesBar.php | 3 +- languages/messages/MessagesBat_smg.php | 3 +- languages/messages/MessagesBe.php | 1786 +++++---- languages/messages/MessagesBe_x_old.php | 1028 +++++ languages/messages/MessagesBg.php | 3208 ++++++++++------ languages/messages/MessagesBh.php | 20 + languages/messages/MessagesBm.php | 3 +- languages/messages/MessagesBn.php | 3 +- languages/messages/MessagesBo.php | 3 +- languages/messages/MessagesBpy.php | 572 +-- languages/messages/MessagesBr.php | 2778 +++++++++----- languages/messages/MessagesBs.php | 219 +- languages/messages/MessagesCa.php | 3015 +++++++++------ languages/messages/MessagesCe.php | 3 +- languages/messages/MessagesCs.php | 3007 ++++++++------- languages/messages/MessagesCsb.php | 17 +- languages/messages/MessagesCu.php | 2 +- languages/messages/MessagesCv.php | 414 +- languages/messages/MessagesCy.php | 68 +- languages/messages/MessagesDa.php | 257 +- languages/messages/MessagesDe.php | 1031 ++--- languages/messages/MessagesDv.php | 3 +- languages/messages/MessagesDz.php | 3 +- languages/messages/MessagesEl.php | 296 +- languages/messages/MessagesEn.php | 651 ++-- languages/messages/MessagesEo.php | 2096 +++++----- languages/messages/MessagesEs.php | 235 +- languages/messages/MessagesEt.php | 49 +- languages/messages/MessagesEu.php | 229 +- languages/messages/MessagesFa.php | 26 +- languages/messages/MessagesFi.php | 3174 +++++++-------- languages/messages/MessagesFiu_vro.php | 2023 ++++++++++ languages/messages/MessagesFo.php | 13 +- languages/messages/MessagesFr.php | 3061 +++++++++------ languages/messages/MessagesFur.php | 45 +- languages/messages/MessagesFy.php | 39 +- languages/messages/MessagesGa.php | 272 +- languages/messages/MessagesGn.php | 3 +- languages/messages/MessagesGsw.php | 168 +- languages/messages/MessagesGu.php | 3 +- languages/messages/MessagesHe.php | 851 ++-- languages/messages/MessagesHi.php | 158 +- languages/messages/MessagesHr.php | 225 +- languages/messages/MessagesHsb.php | 3465 +++++++++-------- languages/messages/MessagesHu.php | 2197 ++++++----- languages/messages/MessagesHy.php | 1008 +++++ languages/messages/MessagesIa.php | 25 +- languages/messages/MessagesId.php | 3428 +++++++++-------- languages/messages/MessagesIi.php | 3 +- languages/messages/MessagesIs.php | 172 +- languages/messages/MessagesIt.php | 3542 ++++++++--------- languages/messages/MessagesJa.php | 3303 ++++++++-------- languages/messages/MessagesJbo.php | 3 +- languages/messages/MessagesJv.php | 454 ++- languages/messages/MessagesKa.php | 542 ++- languages/messages/MessagesKaa.php | 3 +- languages/messages/MessagesKab.php | 1639 ++++++++ languages/messages/MessagesKg.php | 3 +- languages/messages/MessagesKk.php | 3 +- languages/messages/MessagesKk_cn.php | 3186 ++++++++------- languages/messages/MessagesKk_kz.php | 1347 ++++--- languages/messages/MessagesKk_tr.php | 1314 ++++--- languages/messages/MessagesKm.php | 3 +- languages/messages/MessagesKn.php | 5 +- languages/messages/MessagesKo.php | 2388 +++++++----- languages/messages/MessagesKs.php | 16 +- languages/messages/MessagesKsh.php | 4047 +++++++++----------- languages/messages/MessagesKu.php | 245 +- languages/messages/MessagesKv.php | 3 +- languages/messages/MessagesLa.php | 1858 +++++---- languages/messages/MessagesLg.php | 287 ++ languages/messages/MessagesLi.php | 1735 +++++---- languages/messages/MessagesLn.php | 5 +- languages/messages/MessagesLo.php | 3 +- languages/messages/MessagesLt.php | 995 ++--- languages/messages/MessagesLv.php | 1744 +++++---- languages/messages/MessagesMi.php | 4 +- languages/messages/MessagesMk.php | 190 +- languages/messages/MessagesMl.php | 3 +- languages/messages/MessagesMr.php | 272 ++ languages/messages/MessagesMs.php | 21 +- languages/messages/MessagesMt.php | 4 +- languages/messages/MessagesMzn.php | 3 +- languages/messages/MessagesNah.php | 3 +- languages/messages/MessagesNap.php | 3 +- languages/messages/MessagesNds.php | 2172 ++++++----- languages/messages/MessagesNds_nl.php | 8 +- languages/messages/MessagesNe.php | 20 + languages/messages/MessagesNew.php | 39 + languages/messages/MessagesNl.php | 3296 ++++++++-------- languages/messages/MessagesNn.php | 199 +- languages/messages/MessagesNo.php | 201 +- languages/messages/MessagesNon.php | 3 +- languages/messages/MessagesNv.php | 3 +- languages/messages/MessagesOc.php | 2606 +++++++++---- languages/messages/MessagesOr.php | 3 +- languages/messages/MessagesOs.php | 12 +- languages/messages/MessagesPa.php | 22 +- languages/messages/MessagesPi.php | 20 + languages/messages/MessagesPl.php | 580 ++- languages/messages/MessagesPms.php | 3151 +++++++-------- languages/messages/MessagesPs.php | 3 +- languages/messages/MessagesPt.php | 198 +- languages/messages/MessagesPt_br.php | 15 +- languages/messages/MessagesQu.php | 3 +- languages/messages/MessagesRmy.php | 644 ++-- languages/messages/MessagesRo.php | 3097 ++++++++------- languages/messages/MessagesRu.php | 3065 +++++++-------- languages/messages/MessagesSa.php | 84 + languages/messages/MessagesSc.php | 23 +- languages/messages/MessagesScn.php | 85 + languages/messages/MessagesSd.php | 3 +- languages/messages/MessagesSk.php | 3487 +++++++++-------- languages/messages/MessagesSl.php | 2937 +++++++------- languages/messages/MessagesSq.php | 204 +- languages/messages/MessagesSr.php | 3 +- languages/messages/MessagesSr_ec.php | 196 +- languages/messages/MessagesSr_el.php | 197 +- languages/messages/MessagesSr_jc.php | 3 +- languages/messages/MessagesSr_jl.php | 3 +- languages/messages/MessagesSu.php | 2289 ++++++----- languages/messages/MessagesSv.php | 3273 +++++++++------- languages/messages/MessagesTa.php | 27 +- languages/messages/MessagesTe.php | 12 +- languages/messages/MessagesTg.php | 3 +- languages/messages/MessagesTh.php | 13 +- languages/messages/MessagesTlh.php | 3 +- languages/messages/MessagesTr.php | 171 +- languages/messages/MessagesTt.php | 177 +- languages/messages/MessagesTy.php | 8 + languages/messages/MessagesTyv.php | 6 +- languages/messages/MessagesUdm.php | 3 +- languages/messages/MessagesUg.php | 3 +- languages/messages/MessagesUk.php | 2823 ++++++++++---- languages/messages/MessagesUr.php | 615 +++ languages/messages/MessagesUz.php | 424 +- languages/messages/MessagesVec.php | 189 +- languages/messages/MessagesVi.php | 266 +- languages/messages/MessagesVls.php | 3 +- languages/messages/MessagesWa.php | 226 +- languages/messages/MessagesXal.php | 3 +- languages/messages/MessagesYi.php | 203 +- languages/messages/MessagesZa.php | 3 +- languages/messages/MessagesZea.php | 34 + languages/messages/MessagesZh_classical.php | 1223 ++++++ languages/messages/MessagesZh_cn.php | 2831 ++++++++++---- languages/messages/MessagesZh_hk.php | 3 +- languages/messages/MessagesZh_sg.php | 3 +- languages/messages/MessagesZh_tw.php | 2824 ++++++++++---- languages/messages/MessagesZh_yue.php | 719 ++-- maintenance/Doxyfile | 4 +- maintenance/FiveUpgrade.inc | 48 +- maintenance/Makefile | 17 +- maintenance/addwiki.php | 4 +- maintenance/archives/patch-ar_deleted.sql | 3 + maintenance/archives/patch-ar_len.sql | 3 + maintenance/archives/patch-categorylinks.sql | 2 +- maintenance/archives/patch-externallinks.sql | 2 +- maintenance/archives/patch-fa_deleted.sql | 3 + maintenance/archives/patch-filearchive.sql | 2 +- maintenance/archives/patch-indexes.sql | 2 +- maintenance/archives/patch-interwiki.sql | 2 +- maintenance/archives/patch-ipb_anon_only.sql | 2 +- maintenance/archives/patch-ipb_deleted.sql | 3 + maintenance/archives/patch-job.sql | 2 +- maintenance/archives/patch-langlinks.sql | 2 +- maintenance/archives/patch-linkscc.sql | 2 +- maintenance/archives/patch-linktables.sql | 8 +- maintenance/archives/patch-log_deleted.sql | 3 + maintenance/archives/patch-log_id.sql | 8 + maintenance/archives/patch-logging.sql | 2 +- maintenance/archives/patch-math.sql | 2 +- maintenance/archives/patch-objectcache.sql | 2 +- maintenance/archives/patch-page_restrictions.sql | 22 + .../archives/patch-page_restrictions_sortkey.sql | 8 + maintenance/archives/patch-pagelinks.sql | 2 +- maintenance/archives/patch-parsercache.sql | 2 +- maintenance/archives/patch-querycache.sql | 2 +- maintenance/archives/patch-querycacheinfo.sql | 2 +- maintenance/archives/patch-querycachetwo.sql | 2 +- maintenance/archives/patch-rc_deleted.sql | 8 + maintenance/archives/patch-redirect.sql | 2 +- maintenance/archives/patch-rev_len.sql | 3 + maintenance/archives/patch-rev_parent_id.sql | 9 + maintenance/archives/patch-templatelinks.sql | 2 +- maintenance/archives/patch-transcache.sql | 2 +- maintenance/archives/patch-user_groups.sql | 2 +- maintenance/archives/patch-user_rights.sql | 2 +- maintenance/archives/patch-userlevels.sql | 4 +- maintenance/archives/patch-validate.sql | 2 +- maintenance/archives/rebuildRecentchanges.inc | 3 +- maintenance/archives/upgradeWatchlist.php | 3 +- maintenance/attachLatest.php | 5 +- maintenance/attribute.php | 5 +- maintenance/backup.inc | 26 +- maintenance/benchmarkPurge.php | 3 +- maintenance/changePassword.php | 5 +- maintenance/checkUsernames.php | 2 +- maintenance/cleanupCaps.php | 6 +- maintenance/cleanupDupes.inc | 7 +- maintenance/cleanupDupes.php | 3 +- maintenance/cleanupImages.php | 3 +- maintenance/cleanupSpam.php | 9 +- maintenance/cleanupTable.inc | 2 +- maintenance/cleanupTitles.php | 9 +- maintenance/cleanupWatchlist.php | 9 +- maintenance/clear_interwiki_cache.php | 5 +- maintenance/commandLine.inc | 5 +- maintenance/convertLinks.inc | 9 +- maintenance/convertLinks.php | 3 +- maintenance/createAndPromote.php | 3 +- maintenance/deleteBatch.php | 2 +- maintenance/deleteDefaultMessages.php | 4 +- maintenance/deleteImageMemcached.php | 4 +- maintenance/deleteOldRevisions.inc | 5 +- maintenance/deleteOldRevisions.php | 3 +- maintenance/deleteOrphanedRevisions.inc.php | 3 +- maintenance/deleteOrphanedRevisions.php | 5 +- maintenance/deleteRevision.php | 2 +- maintenance/dumpBackup.php | 3 +- maintenance/dumpHTML.inc | 26 +- maintenance/dumpHTML.php | 7 +- maintenance/dumpInterwiki.inc | 27 +- maintenance/dumpInterwiki.php | 3 +- maintenance/dumpLinks.php | 7 +- maintenance/dumpReplayLog.php | 9 +- maintenance/dumpSisterSites.php | 3 +- maintenance/dumpTextPass.php | 5 +- maintenance/eval.php | 3 +- maintenance/findhooks.php | 5 +- maintenance/fixSlaveDesync.php | 19 +- maintenance/fixTimestamps.php | 2 +- maintenance/fixUserRegistration.php | 4 +- maintenance/fuzz-tester.php | 397 +- maintenance/generateSitemap.php | 40 +- maintenance/getLagTimes.php | 3 +- maintenance/getSlaveServer.php | 12 +- maintenance/importDump.php | 13 +- maintenance/importImages.inc.php | 5 +- maintenance/importImages.php | 19 +- maintenance/importLogs.inc | 11 +- maintenance/importLogs.php | 3 +- maintenance/importPhase2.php | 18 +- maintenance/importTextFile.php | 34 +- maintenance/importUseModWiki.php | 12 +- maintenance/initStats.inc | 55 + maintenance/initStats.php | 56 +- maintenance/installExtension.php | 51 +- maintenance/interwiki.sql | 2 + maintenance/language/alltrans.php | 3 +- maintenance/language/checkExtensioni18n.php | 279 ++ maintenance/language/checkLanguage.inc | 92 + maintenance/language/checkLanguage.php | 88 +- maintenance/language/date-formats.php | 1 + maintenance/language/diffLanguage.php | 8 +- maintenance/language/dumpMessages.php | 3 +- maintenance/language/lang2po.php | 21 +- maintenance/language/languages.inc | 36 +- maintenance/language/messageTypes.inc | 68 +- maintenance/language/messages.inc | 400 +- maintenance/language/rebuildLanguage.php | 38 +- maintenance/language/transstat.php | 5 +- maintenance/language/writeMessagesArray.inc | 71 +- maintenance/mcc.php | 9 +- maintenance/mctest.php | 4 +- maintenance/moveBatch.php | 5 +- maintenance/mwdocgen.php | 3 +- maintenance/mwdoxygen.cfg | 946 +---- maintenance/namespaceDupes.php | 2 +- maintenance/nextJobDB.php | 48 + maintenance/nukeNS.php | 108 + maintenance/nukePage.inc | 15 +- maintenance/nukePage.php | 3 +- maintenance/ora/tables.sql | 437 +++ maintenance/orphans.php | 9 +- maintenance/ourusers.php | 3 +- maintenance/parserTests.inc | 359 +- maintenance/parserTests.php | 12 +- maintenance/parserTests.txt | 291 +- maintenance/parserTestsParserHook.php | 3 +- maintenance/parserTestsParserTime.php | 3 +- maintenance/parserTestsStaticParserHook.php | 3 +- .../postgres/archives/patch-archive-ar_deleted.sql | 1 + maintenance/postgres/archives/patch-archive2.sql | 15 + .../postgres/archives/patch-archive_delete.sql | 5 + .../postgres/archives/patch-archive_insert.sql | 6 + .../postgres/archives/patch-mediawiki_version.sql | 18 + maintenance/postgres/archives/patch-mwuser.sql | 1 + .../postgres/archives/patch-page_deleted.sql | 11 + .../postgres/archives/patch-page_restrictions.sql | 10 + .../postgres/archives/patch-pagecontent.sql | 1 + maintenance/postgres/archives/patch-profiling.sql | 7 + .../postgres/archives/patch-querycachetwo.sql | 12 + .../postgres/archives/patch-rc_cur_id-not-null.sql | 1 + maintenance/postgres/archives/patch-redirect.sql | 7 + .../postgres/archives/patch-remove-archive2.sql | 3 + .../postgres/archives/patch-rev_text_id_idx.sql | 1 + .../archives/patch-revision_rev_user_fkey.sql | 4 + maintenance/postgres/compare_schemas.pl | 30 +- maintenance/postgres/mediawiki_mysql2postgres.pl | 444 +++ maintenance/postgres/tables.sql | 78 +- maintenance/purgeList.php | 3 + maintenance/purgeOldText.inc | 8 +- maintenance/purgeOldText.php | 3 +- maintenance/reassignEdits.inc.php | 7 +- maintenance/reassignEdits.php | 3 +- maintenance/rebuildImages.php | 7 +- maintenance/rebuildInterwiki.inc | 10 +- maintenance/rebuildInterwiki.php | 3 +- maintenance/rebuildall.php | 3 +- maintenance/rebuildrecentchanges.inc | 14 +- maintenance/rebuildrecentchanges.php | 3 +- maintenance/rebuildtextindex.inc | 5 +- maintenance/rebuildtextindex.php | 3 +- maintenance/refreshImageCount.php | 2 +- maintenance/refreshLinks.inc | 9 +- maintenance/refreshLinks.php | 3 +- maintenance/removeUnusedAccounts.inc | 5 +- maintenance/removeUnusedAccounts.php | 7 +- maintenance/renamewiki.php | 60 + maintenance/renderDump.php | 3 +- maintenance/runJobs.php | 9 +- maintenance/showJobs.php | 2 +- maintenance/showStats.php | 2 +- maintenance/sql.php | 67 + maintenance/storage/blobs.sql | 6 +- maintenance/storage/checkStorage.php | 12 +- maintenance/storage/compressOld.inc | 38 +- maintenance/storage/compressOld.php | 7 +- maintenance/storage/dumpRev.php | 9 +- maintenance/storage/moveToExternal.php | 128 +- maintenance/storage/resolveStubs.php | 17 +- maintenance/tables.sql | 131 +- maintenance/update.php | 3 +- maintenance/updateArticleCount.inc.php | 7 +- maintenance/updateArticleCount.php | 5 +- maintenance/updateRestrictions.php | 67 + maintenance/updateSearchIndex.inc | 11 +- maintenance/updateSearchIndex.php | 3 +- maintenance/updateSpecialPages.php | 8 +- maintenance/updaters.inc | 574 ++- maintenance/userDupes.inc | 6 +- maintenance/userDupes.php | 2 +- maintenance/userOptions.inc | 237 ++ maintenance/userOptions.php | 21 + maintenance/waitForSlave.php | 16 + maintenance/wikipedia-interwiki.sql | 53 +- serialized/README | 4 +- skins/Chick.deps.php | 2 +- skins/Chick.php | 8 +- skins/CologneBlue.php | 6 +- skins/MonoBook.php | 48 +- skins/MySkin.deps.php | 2 +- skins/MySkin.php | 8 +- skins/Nostalgia.php | 6 +- skins/Simple.deps.php | 2 +- skins/Simple.php | 8 +- skins/Standard.php | 8 +- skins/archlinux/handheld.css | 32 +- skins/archlinux/main.css | 38 +- skins/archlinux/rtl.css | 5 + skins/chick/main.css | 22 +- skins/common/IEFixes.js | 8 +- skins/common/ajax.js | 32 +- skins/common/ajaxsearch.js | 6 +- skins/common/block.js | 47 + skins/common/common.css | 55 +- skins/common/commonPrint.css | 8 +- skins/common/common_rtl.css | 6 +- skins/common/images/Checker-16x16.png | Bin 0 -> 81 bytes skins/common/metadata.js | 18 +- skins/common/preview.js | 91 +- skins/common/protect.js | 41 +- skins/common/sticky.js | 10 +- skins/common/wikibits.js | 538 ++- skins/disabled/HTMLDump.php | 8 +- skins/disabled/MonoBookCBT.php | 6 +- skins/monobook/handheld.css | 32 +- skins/monobook/main.css | 58 +- skins/monobook/rtl.css | 5 + skins/simple/main.css | 18 +- t/00-test.t | 8 + t/README | 54 + t/inc/IP.t | 60 + t/inc/Licenses.t | 29 + t/inc/Sanitizer.t | 62 + t/inc/Title.t | 33 + t/inc/Xml.t | 56 + t/maint/eol-style.t | 35 + t/maint/php-lint.t | 33 + t/maint/php-tag.t | 29 + t/maint/unix-newlines.t | 28 + thumb.php | 103 +- trackback.php | 8 +- 699 files changed, 92173 insertions(+), 56022 deletions(-) create mode 100644 Test.php create mode 100755 bin/svnstat create mode 100755 bin/ulimit4.sh create mode 100644 includes/ImageQueryPage.php create mode 100644 includes/MediaTransformOutput.php create mode 100644 includes/OutputHandler.php create mode 100644 includes/PageQueryPage.php create mode 100644 includes/ParserOptions.php create mode 100644 includes/ParserOutput.php create mode 100644 includes/PatrolLog.php create mode 100644 includes/SearchOracle.php create mode 100644 includes/SpecialFewestrevisions.php create mode 100644 includes/SpecialProtectedpages.php create mode 100644 includes/SpecialWithoutinterwiki.php create mode 100644 includes/media/BMP.php create mode 100644 includes/media/Bitmap.php create mode 100644 includes/media/DjVu.php create mode 100644 includes/media/Generic.php create mode 100644 includes/media/SVG.php create mode 100644 includes/tidy.conf create mode 100644 languages/classes/LanguageAr.php create mode 100644 languages/classes/LanguageBe_x_old.php create mode 100644 languages/classes/LanguageHy.php create mode 100644 languages/classes/LanguageUk.php create mode 100644 languages/messages/MessagesBe_x_old.php create mode 100644 languages/messages/MessagesBh.php create mode 100644 languages/messages/MessagesFiu_vro.php create mode 100644 languages/messages/MessagesHy.php create mode 100644 languages/messages/MessagesKab.php create mode 100644 languages/messages/MessagesLg.php create mode 100644 languages/messages/MessagesMr.php create mode 100644 languages/messages/MessagesNe.php create mode 100644 languages/messages/MessagesNew.php create mode 100644 languages/messages/MessagesPi.php create mode 100644 languages/messages/MessagesSa.php create mode 100644 languages/messages/MessagesScn.php create mode 100644 languages/messages/MessagesTy.php create mode 100644 languages/messages/MessagesZea.php create mode 100644 languages/messages/MessagesZh_classical.php create mode 100644 maintenance/archives/patch-ar_deleted.sql create mode 100644 maintenance/archives/patch-ar_len.sql create mode 100644 maintenance/archives/patch-fa_deleted.sql create mode 100644 maintenance/archives/patch-ipb_deleted.sql create mode 100644 maintenance/archives/patch-log_deleted.sql create mode 100644 maintenance/archives/patch-log_id.sql create mode 100644 maintenance/archives/patch-page_restrictions.sql create mode 100644 maintenance/archives/patch-page_restrictions_sortkey.sql create mode 100644 maintenance/archives/patch-rc_deleted.sql create mode 100644 maintenance/archives/patch-rev_len.sql create mode 100644 maintenance/archives/patch-rev_parent_id.sql create mode 100644 maintenance/initStats.inc create mode 100644 maintenance/language/checkExtensioni18n.php create mode 100644 maintenance/language/checkLanguage.inc create mode 100644 maintenance/nextJobDB.php create mode 100644 maintenance/nukeNS.php create mode 100644 maintenance/ora/tables.sql create mode 100644 maintenance/postgres/archives/patch-archive-ar_deleted.sql create mode 100644 maintenance/postgres/archives/patch-archive2.sql create mode 100644 maintenance/postgres/archives/patch-archive_delete.sql create mode 100644 maintenance/postgres/archives/patch-archive_insert.sql create mode 100644 maintenance/postgres/archives/patch-mediawiki_version.sql create mode 100644 maintenance/postgres/archives/patch-mwuser.sql create mode 100644 maintenance/postgres/archives/patch-page_deleted.sql create mode 100644 maintenance/postgres/archives/patch-page_restrictions.sql create mode 100644 maintenance/postgres/archives/patch-pagecontent.sql create mode 100644 maintenance/postgres/archives/patch-profiling.sql create mode 100644 maintenance/postgres/archives/patch-querycachetwo.sql create mode 100644 maintenance/postgres/archives/patch-rc_cur_id-not-null.sql create mode 100644 maintenance/postgres/archives/patch-redirect.sql create mode 100644 maintenance/postgres/archives/patch-remove-archive2.sql create mode 100644 maintenance/postgres/archives/patch-rev_text_id_idx.sql create mode 100644 maintenance/postgres/archives/patch-revision_rev_user_fkey.sql create mode 100644 maintenance/postgres/mediawiki_mysql2postgres.pl create mode 100644 maintenance/renamewiki.php create mode 100644 maintenance/sql.php create mode 100644 maintenance/updateRestrictions.php create mode 100644 maintenance/userOptions.inc create mode 100644 maintenance/userOptions.php create mode 100644 maintenance/waitForSlave.php create mode 100644 skins/common/block.js create mode 100644 skins/common/images/Checker-16x16.png create mode 100644 t/00-test.t create mode 100644 t/README create mode 100644 t/inc/IP.t create mode 100644 t/inc/Licenses.t create mode 100644 t/inc/Sanitizer.t create mode 100644 t/inc/Title.t create mode 100644 t/inc/Xml.t create mode 100644 t/maint/eol-style.t create mode 100644 t/maint/php-lint.t create mode 100644 t/maint/php-tag.t create mode 100644 t/maint/unix-newlines.t diff --git a/HISTORY b/HISTORY index 302f9b0f..6e710a09 100644 --- a/HISTORY +++ b/HISTORY @@ -5,6 +5,697 @@ Security reminder: MediaWiki does not require PHP's register_globals setting since version 1.2.0. If you have it on, turn it *off* if you can. + +== Changes since 1.8 == + +* (bug 8200) Make category lists sorted by name when using Postgres. +* (bug 7841) Support 'IGNORE' inserts for Postgres, fixes watchlist + adding problem. +* (bug 6835) Removing the includes/Parser.php::getTemplateArgs() function, + because it seems to be unused. +* (bug 7139) Increasing the visual width of the edit summary field on larger + screen sizes, for the default monobook skin. +* Fix PHP notice and estimates for dumpBackup.php and friends +* Improved register_globals paranoia checks +* (bug 7545) Fix PHP version check on install +* Disable PHP exception backtrace printing unless $wgShowExceptionDetails + is set. Backtraces may contain sensitive information in function call + parameters. +* (bug 6164) Avoid smashing Cite state if message transformation triggers + during bad image list check, by skipping message transformation. + This isn't a good permanent fix. +* (bug 6918) Stopped borders and backgrounds from showing through floated + tables in Monobook +* (bug 6868) Un-hardcode section edit link style +* (bug 3205) Stop right floats from stacking horizontally in non-Monobook skins +* Added global $wgStyleVersion to centralize bumping CSS and JS file versions + for cache-friendly style and script updating +* (bug 7562) Fix non-ASCII namespaces on Windows/XAMPP servers +* Friendlier check for PHP 5 in command-line scripts; it's common for parallel + PHP 4 and 5 installations to interfere on the command-line. +* Fix regression in autoconfirm permission check +* (bug 3015) Add CSS ids to subcategory and page sections on category pages +* (bug 7587) Fix erroneous id for specialpage tab, enabling informative popup +* (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge +* (bug 7581) Update language name for cbk-zam +* (bug 7444) Update namespace translations for Telugu (te), kept old values as + alias for compatibility +* (bug 4525) Move section links down visually to same level as headings + (editsection links are now inside the heading elements) +* Workaround for http://bugs.php.net/bug.php?id=31892 , PATH_INFO and hence + URLs of the style /index.php/Main_Page were broken on some CGI installations. +* (bug 7623) Validate custom HTML id's correctly in Monobook interface +* (bug 2241) Fix collision of 'w' and 'd' accesskeys +* (bug 5795) CSS class added to body based on page name for page-specific + styling +* (bug 6276) Stopped search field from getting too large in Cologne Blue +* (bug 7644) User creations that are aborted by hooks shouldn't be counted + against account creations per day limit +* (bug 7636) Show Firefox 2 users correct accesskey prefix +* (bug 6427) Block blocked IPs from using the mail password function + to allow blocking of flooders +* Include common.css from classic-style skins in main HTML with the bump URL +* (bug 7607) Add Karakalpak (kaa) to Names.php and stub message file for linktrail +* (bug 7582) Add 'tog-nolangconversion' to MessagesEn.php. + This key is need for languages with variants (zh, sr, kk) +* (bug 7606) MediaWiki messages for "rss" and "atom" missing +* (bug 7609) Add some more '*-summary' messages to MessagesEn.php with empty + strings to allow better localisation via Special:Allmessages. Mark this new + messages as optional for localisation. +* Fix user_newpass upgrade for prefixed tables (reported by Fyren) +* (bug 7663) Include language variant switcher links on Nostalgia skin +* (bug 6531) Fix PHP fatal error on installation page with bad username input. +* (bug 6977) Remove 404 link for autogenerated database documentation. +* (bug 7369) Allow "Show Changes" without requiring edit token. +* (bug 7687) Fix movetalk box checks itself when confirming a delete and move. +* (bug 7684) Obey watchcreated preference for Special:Upload watch checkbox +* (bug 7686) Include id attribute on delete form confirmation button +* Allow compound interwiki prefixes in $wgImportSources +* (bug 7304) Added redirect table to store redirect targets. +* Added querycachetwo table (similar to querycache but has two titles) +* PageArchive can now return a Revision object for more convenient processing + of deleted revision data +* Added 'UndeleteShowRevision' hook in Special:Undelete +* Error message on attempt to view invalid or missing deleted revisions +* Remove unsightly "_" from namespace in Special:Allpages, Special:Prefixindex +* (bug 3224) Allow minor edits by bots to skip new message notification on + user talk pages. This can be disabled by adjusting the 'nominornewtalk' + permission. Patch by Werdna. +* (bug 7741) MATH: fixed broken syntax of underbrace etc. Fixed arrays +* Fix purging for updated SVG files +* (bug 7745) Add id attribute to search button in Monobook +* (bug 7749) MATH: added some more LaTeX symbols, e.g. parallel, diamond, ast, ... +* (bug 7304) Added code in Article.php to keep redirect table up to date. +* Made special page names case-insensitive and localisable. Care has been taken + to maintain backwards compatibility. +* Used special page subpages in a few more places, instead of query parameters. +* (bug 7758) Added wrapper span to "templates used" explanation to allow CSS + styling (class="mw-templatesUsedExplanation"). +* Added {{#special:}} parser function, to give the local default title for + special pages +* (bug 7766) Remove redundant / from AJAX requests, can break some servers +* Add tab links from extensions to classic-based skins (SkinTemplateTab hook) + Provides better cross-skin compatibility for extensions using the modern + skin hooks, such as Oversight +* Moved variant language links on Cologne Blue and Nostalgia to before the + login/logout link +* Fix for parser tests with MySQL 5 in strict mode +* Added block option "enable autoblocks" +* Amend Special:Ipblocklist to note when a block has autoblock DISABLED. +* (bug 7780) Fix regression in editing redirects +* Add whitespace above "templates included on this page" using CSS, not + hardcoded line break. +* Remove entries from redirect table on article deletion +* (bug 7788) Force section headers in new section links for users who have + 'prompt for blank edit summaries' on. +* (bug 1133) Special:Emailuser: add an option to send yourself a copy of your mail. +* (bug 461) Allow "Categories:" link at bottom of pages to be customized via + pagecategorieslink message. +* Sort the list of skins in "My Preferences" -> Skins by alphabetical order. +* (bug 7785) Postgres compatibility for timestamps in RC feeds +* (bug 7550) Normalize user parameter normally on Special:Log +* (bug 7294) Fix PATH search for diff3 on install +* Various fixes related to the blocking change re: autoblocks. On inserting + an IP block, the ipb_enable_autoblock field is now automagically blanked, + because it doesn't make any sense for an IP. Additionally, IP blocks + without the ipb_enable_autoblock option no longer show up as "autoblock + disabled" on Special:Ipblocklist. +* (bug 7774) MATH: aded more amstex functions +* (bug 1182) MATH: fixed inconsistent rendering of upper case Greek letters in TeX +* Fix regression in streaming page dump generation +* (bug 7801) Add support for parser function hooks in parser tests +* checkUsernames.php now uses wfDebugLog instead of hardcoded path to log +* (bug 7810) Update talk namespaces for Occitan +* Allow case-sensitive URLs to be used for uploading from URLs. +* (bug 1109) Correct fix for compressed 304 responses when additional output + buffers have been installed within the compression handler +* (bug 7819) Move automatic redirect edit summary after pre-save transform + to work properly with subst: fun +* (bug 7826) Fix typos in two English messages. +* (bug 5365) Stop users being prompted to enter an edit summary for null edits, + if they have selected that option in preferences. +* (bug 5936) Show an 'm' to the left of the edit summary on diff pages for minor edits. +* (bug 7820) Improve error reporting for uploads via URL. +* (bug 5149) When autoblocks are enabled, retroactively apply an autoblock to the most + recently used IP of a user when they are blocked. +* Add an index on (rc_user_text,rc_timestamp) on the recentchanges table. This will + make CheckUser.php and the new retroactive autoblock functionality faster. +* Fix regression in Special:Undelete for revisions deleted under MediaWiki 1.4 + with compression or legacy encoding +* (bug 6737) Fixes for MySQL 5 schema in strict mode +* Approximate height for client-side scaling fallback instead of passing -1 + into the HTML output. +* Make the DNSBL to check for proxy blocking configurable via $wgSorbsUrl +* Add experimental recording/reporting mode to parser tests runner, to + compare changes against the previous run. + Additional tables 'testrun' and 'testitem' are in maintenance/testRunner.sql, + source this and pass --record option to parserTests.php +* Make the set of default parser test input files extensible via + $wgParserTestFiles. This can now be appended to by extensions or local + configuration files so that extension or custom tests can be automatically + run along with the main batch. +* Run PHP install version checks on update.php so command-line updaters see + new version requirements +* Do a check for the PHP 5.0.x 64-bit bug, since this is much more disruptive + as of MW 1.8 than it used to be. Install or upgrade now aborts with a + warning and a request to upgrade. +* (bug 6440) Updated indexes to improve backlinking queries (links, templates, images) +* Switched 'anon-only' block mode to default for IP blocks +* (bug 3687, 7892) Add distinct heading for media files in category display, + with count. +* (bug 1578) Add different icons for external links to audio, video, or PDF in + Monobook. +* Made autoblocks block account creation if the user block has that option enabled. +* Add auto-summaries to blankings and large removals without summaries. +* (bug 7811) Allow preview of edit summaries. +* (bug 6839) Wikibits.js minor changes to make JS-lint happier. +* (bug 7932) Make sure that edit toolbar clears floats so it appears correctly. +* (bug 6873) When viewing old revisions, add link to diff to current version. +* (bug 3315) Provide rollback link directly on history page. +* Replace 'old-revision-navigation' message with 'revision-info' and + 'revision-nav' messages, wrapped in divs with appropriate id's. +* (bug 4178) MediaWiki:Common.js will now be included for all users if + $wgUseSiteJs is enabled, in addition to (if applicable) MediaWiki:Monobook.js + and user JS subpages. +* (bug 7918) "Templates used on this page" changes during preview to reflect + any added or removed templates, and works as expected for section edits. +* (bug 7919) "Templates used on this page" is now shown for read-only pages. +* (bug 7688) When viewing diff, section anchors in autosummary jump to section + on current page instead of loading the latest version. +* (bug 7970) Use current connection explicitly on Database::getServerVersion +* (bug 2001) Tables with class="sortable" can now be dynamically sorted via + JavaScript. +* Added autosummary for new pages with 500 or less characters, and refactor + the autosummary code so it's all done in one function. doEdit is getting too + big! +* (bug 7554) The correct MIME type for SVG images is now displayed on the + image page (image/svg+xml, not image/svg). +* (bug 7883) Added autoblock whitelisting feature, using which specific ranges + can be protected from autoblocking. These ranges are specified, in list format, + in the autoblock_whitelist system message. +* Added placeholders for text injection by hooks to EditPage.php +* (bug 8009) Automatic edit summary for redirects is not filled for edits in existing pages +* Installer support for experimental MySQL 4.1/5.0 binary-safe schema +* Use INSERT IGNORE for db-based BagOStuff add/insert, for more memcache-like + behavior when keys already exist on add (instead of dying with an error...) +* Add a hook 'UploadForm:initial' before the upload form is generated, and two + member variable for text injection into the form, which can be filled by the hooks. +* (bug 6295) Add a "revision patching" functionality, where an edit can be undone + (with a functionality similar to diff rev1 rev2 | patch -R rev3 -o rev3). + This is triggered by including &undo=revid in an edit URL. A link to a URL + that will undo a given edit is shown on NEW revision headers on diff pages. + The link leads to a "Show Changes" page showing what will be done to undo the + edit. +* Fix display of link in "already rolled back" message for image/category pages +* (bug 6016) Left-aligned images should stack vertically, like right-aligned + images, not horizontally. +* Patch from LeonWP: added UploadForm:BeforeProcessing hook in SpecialUpload.php +* Add AuthPluginSetup hook to override $wgAuth after configuration +* Fix regression in authentication hook auto-creation on login +* (bug 8110) Allow spaces in ISBNs +* (bug 8024) Introduce "send me copies of emails I send to others" preference +* Added 'EditPage::attemptSave' hook before an article is saved. +* (bug 8083) Applied patch for sk localisation +* Add a backslash character to the edit token, to prevent edits via certain + broken proxies that mangle such characters in form submissions +* (bug 7461) Allow overwriting pages using importTextFile.php +* (bug 7946) importTextFile.php doesn't perform pre-save transform +* (bug 8117) {{REVISIONTIMESTAMP}} showed weird default if $wgLocalTZoffset set; + now uses current time for previews and if timestamp can't be loaded from DB +* {{REVISIONTIMESTAMP}} now uses site local timezone instead of user timezone + to ensure consistent behavior +* {{REVISIONTIMESTAMP}} and friends should now work on non-MySQL backends +* (bug 7671) Observe canonical media namespace prefix in Linker::formatComment +* Added js variable wgCurRevisionId to the output +* (bug 8141) Cleanup of Parser::doTableStuff, patch by AzaTht +* (bug 8042) Make miser mode caching limits settable via $wgQueryCacheLimit + instead of hardcoding to 1000 +* Enable QueryPage classes to override list formatting +* (bug 5485) Show number of intervening revisions in diff view +* (bug 8100) Fix XHTML validity in Taiwanese localization +* Added redirect to section feature. Use it wisely. +* Added a configuration variable allowing the "break out of framesets" feature + to be switched on and off ($wgBreakFrames). Off by default. +* Allow Xml::check() $attribs parameter to override 'value' attribute +* DB schema change: added two columns (rc_old_len and rc_new_len) to the recentchanges table to store + the text lengths before and after the edit +* (bug 1085) Made Special:Recentchanges show the character difference between the changed revisions +* Removed a redundant tag from diff pages that was causing display issues for some users +* (bug 8203) The keyboard shortcut for "log out" was removed, because users were pressing it + when they intended to press the shortcut for "preview". +* (bug 8148) Handle non-removable output buffers gracefully when cleaning + buffers for HTTP 304 responses, StreamFile, and Special:Export. + Duplicated code merged into wfResetOutputBuffers() and wfClearOutputBuffers() +* Special:AllPages : 'next page' link now point to the first title of the next + chunk instead of pointing to the last title of current chunk. +* (bug 4673) Special:AllPages : add a 'previous' link (new message 'prevpage') +* (bug 8121) wfRandom() was not between 0 and 1 +* Add static method Parser::createAssocArgs($args), so parser functions can + use the same code to parse arguments as the templates do. +* Change behavior of logins using the temporary e-mailed password (as stored + in user_newpassword hash field). Instead of just logging in silently and + leaving the previous user_password field in place indefinitely, the user + is now prompted to set a new password. + + The password-changing form is at Special:Resetpass; currently it's only + usable for changing from the temporary password during login, but it + could perhaps be generalized, replacing the subform in preferences. + + Once the new password is set successfully, the temporary password is wiped + so it cannot be used to login a second time, and the login process + is completed. +* Suppress 'mail new password' button on login form if $wgAuth forbids + changing user passwords; it wouldn't work very well... +* Consolidate password length checks and $wgAuth manipulation into + User::setPassword() to avoid duplicate code in different places + that set passwords. +* User::setPassword() now throws PasswordError exceptions if the password + is illegal or cannot be set via $wgAuth. These can be caught and a human- + readable error message displayed by UI code. +* Added Title::isSubpage() +* (bug 8241) Don't consider user pages of User:Foo.css to be CSS subpages +* Set an explicit class on framed thumbnail inner divs and images, changed some + CSS to use these instead of using descendent selectors. +* Accept null parameter to User::setPassword() as indicating the password + field should be cleared to an unusable state. Login will only be possible + after the password is reset, for instance by e-mail. +* (bug 6394) Invalidate the password set for "by e-mail" account creations + to avoid accidental empty password creations. +* Made the show change size function work on page moves, page creations, and + log entries. Also fixed it in the javascript recentchanges. +* (bug 8239) correctly get 50 new contributions when clicking '(50 next)' +* (bug 2259) Fix old regression where e-mail addresses were no longer + confirmed on login with mailed password. +* Add a notification about the confirmation mail sent during account + creation, so people don't immediately go off to request a second one. +* Add a warning on Special:Confirmemail if a code was already sent and has + not yet expired. +* Add user_editcount field to provide data for heuristics on account use. + Incremented on edit, with lazy initialization from past revision data. + Can batch-initialize with maintenance/initEditCount.php (not yet friendly + to replication environments, this will do all accounts in one query). +* Allow raw SQL subsections in Database::update() SET portion as well as + for WHERE portion. Handy for increments and such. +* User::getOption now accept a default value to override default user values + this makes it consistent with WebRequest::get* methods. Corrected code in + various places accordingly. +* (bug 8264) Fix JavaScript global vars for XHTML mode +* Make $wgSiteNotice value wikitext again, for consistency with editable + MediaWiki:Sitenotice and MediaWiki:Anonnotice. +* (bug 8044) When redirecting from the canonical name of the special page + to the localised one, parameters/subpages are omitted +* (bug 8164) Special:Booksources should use GET for form submission +* Rewrite Special:Booksources to clean up interface and remove redundant code +* (bug 7925) Change Special:Allmessages message name filter javascript to be + a bit more responsive and easier on the CPU +* (bug 4488) Support watching pages on deletion; introduces new user preference +* Minor restructuring of Special:Preferences; "watch pages I edit" and "watch + pages I create" options now accessible under "Watchlist" options +* (bug 8153) doesn't work in site notice +* (bug 6690) wfMsgNoTrans() transforms messages +* (bug 8274) Wrap edit tools in a
with a specified class +* Detect PHP 5.0.x 64-bit bug and abort in WebStart.php; too many things break + mysteriously otherwise (detection code copied from install-utils.inc) +* (bug 8295) Change handling of
tags in doBlockLevels() to match that + of
+* (bug 8110) Make magic ISBN linking stricter: only match ten-digit sequences + (plus optional ISBN-13 prefix) with no immediately following alphanumeric + character, disallow multiple consecutive internal redirects +* (bug 2785) Accept optional colon prefix in links when formatting comments +* Don't show "you can view and copy the source of this page" message for + pages which don't exist +* (bug 8310) Blank line added to top of 'post' when page is blank +* (bug 8109) Template parameters ignored in "recentchangestext" +* Gracefully skip redirect-to-fragment on WebKit versions less than 420; + it messes up on current versions of Safari but is ok in the latest + nightlies. Checking the version number will allow it to automatically + work when new releases of Safari appear. +* Fix regression in thumb styles; size and padding didn't match with + new arrangement. +* (bug 8333) Fix quick user data update on login password change on + replication database setups. User data is now pulled from master + instead of slave in User::loadFromDatabase, ensuring that it is + fresh and accurate when read and then saved back into cache. + This was breaking with the Special:Rename operation which + automatically logs the user in with the new password after changing + it; pulling from slave meant the record was often not the updated + one. +* (bug 8335) Set image width to the first valid parameter found. +* (bug 8350) Fix watchlist viewing bug when using Postgres. +* (bug 6603) When warning about invalid file extensions, output the bit + of the extension we actually checked +* (bug 7669) Drop defaults on BLOB/TEXT columns for better compatibility + with MySQL's strict mode, often enabled by the Windows installer. + The defaults are ignored anyway when strict mode is off... +* (bug 7685) Use explicit values for ar_text and ar_flags when deleting, + for better compatibility with MySQL's strict mode +* Update default interwiki values to reflect changed location of ursine: +* (bug 5411) Remove autopatrol preference +* Users who have the "autopatrol" permission will have their edits marked as + patrolled automatically +* Users who do not have the "autopatrol" permission will no longer be able + to mark their own edits as patrolled +* Introduce 'PingLimiter' hook; see docs/hooks.txt for more information +* (bug 532) Tweaked alt text for some interface messages +* (bug 8231) Gave useful alt text to the main on image pages +* (bug 371) Remove alt text for "Enlarge" icon on thumbnails +* Initialize user_editcount to 0 instead of NULL for newly created accounts +* (bug 3696) Strip LRM and RLM characters from titles to work around the + problem some people have where titles cut-and-pasted from lists include + the bidi override characters appended to the lists. + A more thorough blacklist for forbidden and translatable characters would + be wise, though, as might a cleaner method for the lists in the first place. +* Fix regression in email password resets on read-restricted sites +* Set tabindex on fields in deletion form so you don't have to tab through + the links in the sitenotice +* (bug 8271) Show full time and date on viewer for individual deleted + revisions +* (bug 8214) Output file size limit and actual file size in appropriate units + on Special:Upload +* (bug 8016) Purge objectcache table during upgrade processes - use the --nopurge + option to prevent this when running maintenance/update.php +* (bug 7612) Remove superfluous link to Special:Categories from result items + on Special:Mostcategories +* {{PLURAL:}} now handles formatted numbers correctly +* (bug 8331) Added the change size value to watchlists; therefore made + watchlists use RecentChange::newFromRow() instead of newFromCurRow() +* (bug 8351) Fix undo for simple reverts +* (bug 6856) User::clearNotification() does not respect read-only mode +* (bug 6853) Use a checkbox on the installer form to indicate that a superuser + account should be used; this is clearer than the old check which relied on + the password never being an obscure value +* Remove old unused watchlist cache, which was a leftover from the old schema + where watchlists were more expensive to generate +* Minor cosmetic changes to Special:Userrights +* Added wgCanonicalSpecialPageName to JavaScript variables +* Fix image deleting when using Postgres. +* Output both source and destination titles in maintenance/moveBatch.php +* Added basic parser tests for language variants +* Enable selflinks and categories to be written in some of the language variants +* Prevent conversion of JavaScript code in language variants +* Output software version number in maintenance/parserTests.php +* (bug 7169) Use Ajax to watch/unwatch articles if enabled +* Make variant table caching a little more robust, using main language code + in cache key. Probably this is still a bit wonky, though. Was breaking + parser tests when Chinese tables were getting loaded into Serbian code. +* (bug 8380) Be nicer about blank lines in deleteBatch.php +* (bug 8401) Fix regression in SORBS lookup for some DNS setups +* Use raw file descriptor in posix_isatty() check to avoid warning on + Linux systems with at least some versions of PHP +* (bug 5908) Allow overriding the default category sort key for all items on + a page using {{DEFAULTSORT}} +* (bug 6449) Throw a more definitive error message when installation fails + due to an invalid database name +* (bug 5827) Use full text for option link labels on Special:Watchlist +* (bug 8018) Allow hiding minor edits from the watchlist +* (bug 8427) MonoBook RTL IE 7.0 tweaks failed when sidebar's navigation + section is renamed; no longer relies on first section name +* Stabilize client-side table sorting even if the underlying Javascript sort() + implementation is unstable +* Add hook for extensions to add user information to the panel in preferences, + next to the user name and ID. +* (bug 8392) Display protection status of transcluded pages in the edit page + template list. Patch by Fyren, with i18n naming tweak. +* Fix for interwiki transclusion where target wiki uses query string for title +* Resolve namespaces on interwiki Title objects using canonical namespace names + if possible (should not happen, though, outside interwiki transclusion... and + maybe not even then, but it does) +* (bug 8447) Fix SQL typo breaking non-default $wgHitcounterUpdateFreq +* Do not allow previews of deleted images to be cached +* Add global variable $wgDefaultLanguageVariant used to set the default language + variant of a wiki to something different than the main language code +* Add 'variant' option to parserTests - runs test with the given variant as + preferred, utilize it for more parser tests of language variants code +* (bug 6503) Fix bug that stopped certain irrelevant links from being hidden + for printing +* Avoid PHP warning in Creative Commons metadata when a creative commons + license is not actually set up +* (bug 8463) Don't print external link icons for Monobook +* (bug 8461) Support watching pages on move +* (bug 8041) Work around bug with debug_backtrace when Zend Optimizer is + loaded by skipping the function. Use wfDebugBacktrace() wrapper function. +* Reduce config file clutter by setting various script and upload paths + based on $IP or $wgScriptPath in Setup.php. They can still be explicitly + overridden in LocalSettings.php if desired... +* Attempt to detect redirect loops for the canonical title redirect, and + give some hints to the poor confused administrator. +* Introduce new flag 'R' - raw output for language variant escape tags +* Advise users when updates for a query page have been disabled using + $wgDisableQueryPageUpdate +* (bug 8413) Improve comments for $wgNamespaceRobotPolicies +* (bug 8330) Show "bytes" suffix on recent changes diff counter + optionally... if set in rc-changes-size message (default empty for now) +* (bug 8489) Support basic links in caption attribute +* (bug 8485) Correct Lingala number formatting +* The MediaWiki namespace is no longer pre-filled with default messages on + install. All default messages will be removed from the MediaWiki namespace + on upgrade. +* Recentchanges RSS/Atom feeds now use a separate message for the description + to avoid cluttering it with useless wiki formatting +* (bug 8417) Handle EXIF unknown dates +* (bug 8372) Return nothing on empty tags. +* New maintenance script to show the cached statistics : showStats.php. +* Count deleted edits when regenerating total edits in maintenance/initStats.php +* (bug 3706) Allow users to be exempted from IP blocks. The ipblock-exempt permission + key has been added to enable this behaviour, by default assigned to sysops. +* (bug 7948) importDump.php now warn that Recentchanges need to be rebuild. +* (bug 7667) allow XHTML namespaces customization +* (bug 8531) Correct local name of Lingála (patch by Raymond) +* Fix regression with default lock file and cache directories; threw visible + warning with open_basedir + + +== 1.8 Compatibility changes == + +=== Zend Optimizer === + +A bug in some versions of PHP 5 and Zend Optimizer which was triggered under +MediaWiki 1.8.x has been worked around by disabling some internal debugging +features when Zend Optimizer is loaded. This should solve some common +"blank page" problems. + +=== PHP 5.0 64-bit === + +MediaWiki now checks for a condition where PHP 5.0.x corrupts array data +on 64-bit systems and warns you to upgrade PHP to solve the problem. This +bug causes Special: pages to fail on affected systems under MediaWiki 1.8 +and higher, and subtler data corruption on earlier versions. + +The only known workaround is to upgrade PHP to 5.1 or later, which you +probably should do anyway for security reasons! + +=== MySQL 5 === + +MediaWiki should now install and run correctly on MySQL 5.0 and higher when +MySQL's "strict mode" is enabled. (This is now the default for many Windows +installations, though it seems to remain off by default on Unix.) + +This fixes errors about "cannot default default value for BLOB/TEXT fields". + +=== ImageMagick === + +Note that ImageMagick older than 6.x may no longer work for image resizing +due to use of the -thumbnail option. + + +== 1.8 Behavior changes == + +=== Localized special pages === + +The names of Special: pages can now be localized, so links and URLs to them +are more legible in languages that aren't English. + +Not all languages have included localized names yet. + +=== E-mail password === + +Users are now required to set a new password for themselves when they first +log in with a newly generated e-mailed password. + +Requesting passwords frequently is prevented to reduce abusive mailbombing. + +=== Undo revision === + +An "undo" link now appears in diff view for easier reverting of older edits. +When GNU diff3 is available for edit conflict merging, this can make it much +easier to "undo" the changes of an older edit when there are surrounding +changes elsewhere in the page. + +The changes must be manually reviewed and approved, as with conventional +full-revision reverts. + +=== Blocking === + +User blocks can be set to disable the automatic blocking of IP addresses the +account logs in with. + + +== 1.8 Database changes == + +* new 'redirect' table stores data on page redirects +* new 'querycachetwo' table used for some cached special pages +* 'ipblocks' table adds 'ipb_enable_autoblock' +* 'recentchanges' table adds 'rc_old_len', 'rc_new_len' for size tracking +* 'user' table has added 'user_newpass_time' and 'user_editcount' fields +* some indexes have been updated on 'recentchanges' + +== 1.8 Configuration changes == + +Several configuration options have changed since 1.8: + +=== $wgEnableAPI === + +The experimental machine API interface is now enabled by default, read-only. +You can disable it by setting $wgEnableAPI = false; in LocalSettings.php. + +=== $wgPathInfo === + +The use of PATH_INFO (the text after the script name in 'index.php/Blah') +is controlled by the $wgUsePathInfo setting. This is now explicitly disabled +for CGI, apache2filter, and ISAPI configurations of PHP, for more consistency +with the autodetection from the installer. + +In some rarer configurations you may have to switch $wgUsePathInfo from false +to true or, perhaps, from true to false to make things work properly if bad +PATH_INFO data comes through the server. + +The wiki now tries to detect this condition and should show you an error +message describing what to change instead of sending the browser into an +infinite redirect loop. + +=== $wgScript and other path settings === + +The following configuration variables are now automatically set in Setup.php +if they are not overridden in LocalSettings.php: + +from $wgScriptPath: + + $wgScript + | \- $wgArticlePath + + $wgRedirectScript + + $wgStylePath + + $wgUploadPath + \- $wgLogo + + $wgMathPath + +from $IP: + - $wgStyleDirectory + + $wgUploadDirectory + \- $wgMathDirectory + + $wgTmpDirectory + +Newly generated configuration files will by default include only $wgScriptPath +(hardcoded from the installer) and $IP (detected at runtime). + +Old configuration files which specify all these values explicitly should +continue to work just fine, but if you use the defaults you can remove them +to reduce clutter. + +=== $wgGroupPermissions === + +The sysop group now holds the "autopatrol" and "ipblock-exempt" rights by +default. + +"autopatrol" replaces the preference for marking ones own edits patrolled +by default; users holding this permission will automatically have their +edits patrolled, while others cannot mark their own edits as patrolled +even if they have patrolling rights. + +"ipblock-exempt" excludes the user from IP blocks; accounts which are blocked +explicitly by name will still be blocked, however. This is given to sysops +to minimize annoyance from accidental "collateral damage"; remember that a +sysop will be able to lift the block if they desire. + +The bot group now holds the "nominornewtalk" right. A user with this right +will not trigger new message notifications when making minor edits to user +talk pages. This is meant to minimize annoyance from maintenance bot +processes. + +=== $wgUseWatchlistCache === + +Watchlist caching has been removed. The feature was not maintained, and has +been unnecessary since switching to the 'recentchanges' database table +reduced server pressure for Wikipedia's watchlists. + +=== $wgBreakFrames === + +MediaWiki in the past attempted to detect when it was embedded in a frameset +and "break out" of it, assuming it to be hostile. + +This behavior is now disabled by default, but can be reenabled by setting +$wgBreakFrames to true in LocalSettings.php. + + +== 1.8 New settings == + +=== $wgVariantArticlePath === + +For languages with script variant support (Chinese, Serbian, and others), +it's possible to use alternate URL paths to select the variant for article +display, setting $wgVariantArticlePath. + +Documentation for this setting would be useful. + +=== $wgMaxMsgCacheEntrySize === + +The message cache can now skip items larger than a given size; this allows +it to better handle the primary caching case when large CSS and JS blobs are +present. + +=== $wgStyleVersion === + +When making significant changes to skin stylesheets and JavaScript files, +you can append a string to this variable to tweak the generated URLs, +forcing newly rendered pages to bring in a fresh version despite server- +or browser-side caching. + +Normally this will be set in the course of MediaWiki development, but +if doing development on a custom skin you may wish to poke it as well. + +=== $wgRCShowChangedSize === + +Special:Recentchanges and Special:Watchlist now show the number of bytes +added or removed to an article to give an idea of the size of the edit. +This information was previously available only in the IRC update feeds. + +To disable this site-wide, set $wgRCShowChangedSize to false. +(Individual users can suppress the data in custom CSS.) + +Adjust $wgRCChangedSizeThreshold to trigger highlighting of particularly +large changes. + +The formatting of the size figure can be adjusted through the +[[MediaWiki:Rc-change-size]] message. + +=== $wgQueryCacheLimit === + +The number of rows stored for "expensive" special pages in miser mode +can now be adjusted up or down from the default 1000. + +=== $wgDisableQueryPageUpdate === + +Individual "expensive" special pages can be skipped in processing by +updateSpecialPages if added to this list. + +=== $wgSorbsUrl === + +The base hostname for the DNS-based proxy blacklist can now be overridden +when $wgEnableSorbs is set, to use a different blacklist instead of SORBS. +The blacklist would need to respond the same was as SORBS; any positive +response will be taken as a proxy. + +=== $wgAjaxWatch === + +Experimental AJAX mode for the watch/unwatch tabs to execute inline. +Does not include the UI messages describing how to reach the watchlist, +so you may not want it on a general-audience site just yet. + +=== $wgParserTestFiles === + +MediaWiki's parser test suite can now be expanded with additional test +files. Custom extensions can add their test files to this array, and +they will be run along with the main tests by maintenance/parserTests.php + + == Changes since 1.7 == * Introduced AjaxResponse object, superceding AjaxCachePolicy diff --git a/Makefile b/Makefile index 0cfba45a..b659cad2 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,9 @@ +# +# This Makefile is used to test some MediaWiki functions. If you +# want to install MediaWiki, point your browser to ./config/ +# test: Test.php prove -r t + +verbose: + prove -v -r t | egrep -v '^ok' diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 472409da..95172e56 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -3,856 +3,499 @@ Security reminder: MediaWiki does not require PHP's register_globals setting since version 1.2.0. If you have it on, turn it *off* if you can. -== MediaWiki 1.9.3 == +== MediaWiki 1.10.0 == -February 20, 2007 +May 9, 2007 -This is a security and bug-fix update to the Winter 2007 quarterly release. -Minor compatibility fixes for IIS and PostgreSQL are included. +This is the quarterly release snapshot for Spring 2007. See below for a full +list of changes since the 1.9.x series. -An XSS injection vulnerability based on Microsoft Internet Explorer's UTF-7 -charset autodetection was located in the AJAX support module, affecting MSIE -users on MediaWiki 1.6.x and up when the optional setting $wgUseAjax is -enabled. +Changes since 1.10.0rc2: -If you are using an extension based on the optional Ajax module, -either disable it or upgrade to a version containing the fix: +* (bug 9808) Fix regression that ignored user 'rclimit' option for Special:Contributions -* 1.9: fixed in 1.9.3 -* 1.8: fixed in 1.8.4 -* 1.7: fixed in 1.7.3 -* 1.6: fixed in 1.6.10 -There is no known danger in the default configuration, with $wgUseAjax off. +== MediaWiki 1.10.0rc2 == -* (bug 8992) Fix a remaining raw use of REQUEST_URI in history -* (bug 8984) Fix a database error in Special:Recentchangeslinked - when using the PostgreSQL database. -* Add 'charset' to Content-Type headers on various HTTP error responses - to forestall additional UTF-7-autodetect XSS issues. PHP sends only - 'text/html' by default when the script didn't specify more details, - which some inconsiderate browsers consider a license to autodetect - the deadly, hard-to-escape UTF-7. - This fixes an issue with the Ajax interface error message on MSIE when - $wgUseAjax is enabled (not default configuration); this UTF-7 variant - on a previously fixed attack vector was discovered by Moshe BA from BugSec: - http://www.bugsec.com/articles.php?Security=24 -* Trackback responses now specify XML content type - - -== MediaWiki 1.9.2 == +May 4, 2007 -February 4, 2007 +THIS IS A RELEASE CANDIDATE MADE AVAILABLE FOR TESTING! +A FINAL 1.10.0 RELEASE WILL APPEAR WITHIN A FEW DAYS. -This is a bug-fix update that fixes some installation and other minor -issues with the 1.9.1 release as well as a security issue which was -introduced in the 1.9 branch. +Changes since 1.10.0rc1: +* Various l10n fixes and updates +* Fix for upgrade of page_restrictions table +* (bug 9780) Fix normalization of titles with initial colon followed by whitespace +* Fix for regression in upload: wrong size info saved into image table +* Avoid cyclic stub problems when authorization hooks do funny things with + the user and the database at load time -JavaScript code which regenerated the "sortable tables" feature did -not properly sanitize input, leading to an HTML injection vulnerability. - -* (bug 8774) Fix path for GNU FDL rights icon on new installs -* (bug 8819) Fix full path disclosure with skins dependencies -* (bug 4268) Fixed data-loss bug in compressOld batch text compression - affecting pages which had null edits (move, protect, etc) as second - edit in a batch group. Isolated and patched by Travis Derouin. -* Security fix for sortable tables JavaScript - - -== MediaWiki 1.9.1 == - -January 24, 2007 - -This is a bug-fix update that fixes some installation and upgrade issues -with the original 1.9.0 release. - -* (bug 3000) Fall back to SCRIPT_NAME plus QUERY_STRING when REQUEST_URI is - not available, as on IIS with PHP-CGI -* Security fix for DjVu images. (Only affects servers where .djvu file - uploads are enabled and $wgDjvuToXML is set.) -* (bug 8638) Fix update from 1.4 and earlier -* (bug 8641) Fix order of updates to ipblocks table for updates from <=1.7 -* (bug 8673) Minor fix for web service API content-type header -* Fix API revision list on PHP 5.2.1; bad reference assignment -* Fixed up the AjaxSearch -* Exclude settings files when generating documentation. That could - expose the database user and password to remote users. -* ar: fix the 'create a new page' on search page when no exact match found -* Correct tooltip accesskey hint for Opera on the Macintosh - (uses Shift-Esc-, not Ctrl-). -* (bug 8719) Firefox release notes lie! Fix tooltips for Firefox 2 on x11; - accesskeys default settings appear to be same as Windows. +== MediaWiki 1.10.0rc1 == +April 30, 2007 -== MediaWiki 1.9 == - -January 10, 2007 - -This is the quarterly release snapshot for Winter 2007. While the code -has been running on Wikipedia for some time, installation and upgrade -bits may be less well tested. Bug fix releases may follow in the coming -days or weeks. - +THIS IS A RELEASE CANDIDATE MADE AVAILABLE FOR TESTING! +A FINAL 1.10.0 RELEASE WILL APPEAR WITHIN A FEW DAYS. MediaWiki is now using a "continuous integration" development model with quarterly snapshot releases. The latest development code is always kept "ready to run", and in fact runs our own sites on Wikipedia. Release branches will continue to receive security updates for about a year -from first release, but nonessential bugfixes and feature development happen +from first release, but nonessential bugfixes and feature developments will be made on the development trunk and appear in the next quarterly release. Those wishing to use the latest code instead of a branch release can obtain it from source control: http://www.mediawiki.org/wiki/Download_from_SVN - -== Security fixes == - -An XSS injection vulnerability was located in the AJAX support module, -affecting MediaWiki 1.6.x and up when the optional setting $wgUseAjax -is enabled. - -There is no danger in the default configuration, with $wgUseAjax off. - -If you are using an extension based on the optional Ajax module, -either disable it or upgrade to a version containing the fix: - -* 1.9: fixed in 1.9.0rc2 -* 1.8: fixed in 1.8.3 -* 1.7: fixed in 1.7.2 -* 1.6: fixed in 1.6.9 - - -== Compatibility changes == - -=== Zend Optimizer === - -A bug in some versions of PHP 5 and Zend Optimizer which was triggered under -MediaWiki 1.8.x has been worked around by disabling some internal debugging -features when Zend Optimizer is loaded. This should solve some common -"blank page" problems. - -=== PHP 5.0 64-bit === - -MediaWiki now checks for a condition where PHP 5.0.x corrupts array data -on 64-bit systems and warns you to upgrade PHP to solve the problem. This -bug causes Special: pages to fail on affected systems under MediaWiki 1.8 -and higher, and subtler data corruption on earlier versions. - -The only known workaround is to upgrade PHP to 5.1 or later, which you -probably should do anyway for security reasons! - -=== MySQL 5 === - -MediaWiki should now install and run correctly on MySQL 5.0 and higher when -MySQL's "strict mode" is enabled. (This is now the default for many Windows -installations, though it seems to remain off by default on Unix.) - -This fixes errors about "cannot default default value for BLOB/TEXT fields". - -=== ImageMagick === - -Note that ImageMagick older than 6.x may no longer work for image resizing -due to use of the -thumbnail option. - - -== Behavior changes == - -=== Localized special pages === - -The names of Special: pages can now be localized, so links and URLs to them -are more legible in languages that aren't English. - -Not all languages have included localized names yet. - -=== E-mail password === - -Users are now required to set a new password for themselves when they first -log in with a newly generated e-mailed password. - -Requesting passwords frequently is prevented to reduce abusive mailbombing. - -=== Undo revision === - -An "undo" link now appears in diff view for easier reverting of older edits. -When GNU diff3 is available for edit conflict merging, this can make it much -easier to "undo" the changes of an older edit when there are surrounding -changes elsewhere in the page. - -The changes must be manually reviewed and approved, as with conventional -full-revision reverts. - -=== Blocking === - -User blocks can be set to disable the automatic blocking of IP addresses the -account logs in with. - - -== Database changes == - -* new 'redirect' table stores data on page redirects -* new 'querycachetwo' table used for some cached special pages -* 'ipblocks' table adds 'ipb_enable_autoblock' -* 'recentchanges' table adds 'rc_old_len', 'rc_new_len' for size tracking -* 'user' table has added 'user_newpass_time' and 'user_editcount' fields -* some indexes have been updated on 'recentchanges' - - == Configuration changes == -Several configuration options have changed since 1.8: - -=== $wgEnableAPI === - -The experimental machine API interface is now enabled by default, read-only. -You can disable it by setting $wgEnableAPI = false; in LocalSettings.php. - -=== $wgPathInfo === - -The use of PATH_INFO (the text after the script name in 'index.php/Blah') -is controlled by the $wgUsePathInfo setting. This is now explicitly disabled -for CGI, apache2filter, and ISAPI configurations of PHP, for more consistency -with the autodetection from the installer. - -In some rarer configurations you may have to switch $wgUsePathInfo from false -to true or, perhaps, from true to false to make things work properly if bad -PATH_INFO data comes through the server. - -The wiki now tries to detect this condition and should show you an error -message describing what to change instead of sending the browser into an -infinite redirect loop. - -=== $wgScript and other path settings === - -The following configuration variables are now automatically set in Setup.php -if they are not overridden in LocalSettings.php: - -from $wgScriptPath: - + $wgScript - | \- $wgArticlePath - + $wgRedirectScript - + $wgStylePath - + $wgUploadPath - \- $wgLogo - + $wgMathPath - -from $IP: - - $wgStyleDirectory - + $wgUploadDirectory - \- $wgMathDirectory - + $wgTmpDirectory - + $wgReadOnlyFile - + $wgFileCacheDirectory - -Newly generated configuration files will by default include only $wgScriptPath -(hardcoded from the installer) and $IP (detected at runtime). - -Old configuration files which specify all these values explicitly should -continue to work just fine, but if you use the defaults you can remove them -to reduce clutter. - -=== $wgGroupPermissions === - -The sysop group now holds the "autopatrol" and "ipblock-exempt" rights by -default. - -"autopatrol" replaces the preference for marking ones own edits patrolled -by default; users holding this permission will automatically have their -edits patrolled, while others cannot mark their own edits as patrolled -even if they have patrolling rights. - -"ipblock-exempt" excludes the user from IP blocks; accounts which are blocked -explicitly by name will still be blocked, however. This is given to sysops -to minimize annoyance from accidental "collateral damage"; remember that a -sysop will be able to lift the block if they desire. - -The bot group now holds the "nominornewtalk" right. A user with this right -will not trigger new message notifications when making minor edits to user -talk pages. This is meant to minimize annoyance from maintenance bot -processes. - -=== $wgUseWatchlistCache === - -Watchlist caching has been removed. The feature was not maintained, and has -been unnecessary since switching to the 'recentchanges' database table -reduced server pressure for Wikipedia's watchlists. - -=== $wgBreakFrames === - -MediaWiki in the past attempted to detect when it was embedded in a frameset -and "break out" of it, assuming it to be hostile. - -This behavior is now disabled by default, but can be reenabled by setting -$wgBreakFrames to true in LocalSettings.php. - - -== New settings == - -=== $wgVariantArticlePath === - -For languages with script variant support (Chinese, Serbian, and others), -it's possible to use alternate URL paths to select the variant for article -display, setting $wgVariantArticlePath. - -Documentation for this setting would be useful. - -=== $wgMaxMsgCacheEntrySize === - -The message cache can now skip items larger than a given size; this allows -it to better handle the primary caching case when large CSS and JS blobs are -present. - -=== $wgStyleVersion === - -When making significant changes to skin stylesheets and JavaScript files, -you can append a string to this variable to tweak the generated URLs, -forcing newly rendered pages to bring in a fresh version despite server- -or browser-side caching. - -Normally this will be set in the course of MediaWiki development, but -if doing development on a custom skin you may wish to poke it as well. - -=== $wgRCShowChangedSize === - -Special:Recentchanges and Special:Watchlist now show the number of bytes -added or removed to an article to give an idea of the size of the edit. -This information was previously available only in the IRC update feeds. - -To disable this site-wide, set $wgRCShowChangedSize to false. -(Individual users can suppress the data in custom CSS.) - -Adjust $wgRCChangedSizeThreshold to trigger highlighting of particularly -large changes. - -The formatting of the size figure can be adjusted through the -[[MediaWiki:Rc-change-size]] message. - -=== $wgQueryCacheLimit === - -The number of rows stored for "expensive" special pages in miser mode -can now be adjusted up or down from the default 1000. - -=== $wgDisableQueryPageUpdate === - -Individual "expensive" special pages can be skipped in processing by -updateSpecialPages if added to this list. - -=== $wgSorbsUrl === - -The base hostname for the DNS-based proxy blacklist can now be overridden -when $wgEnableSorbs is set, to use a different blacklist instead of SORBS. -The blacklist would need to respond the same was as SORBS; any positive -response will be taken as a proxy. - -=== $wgAjaxWatch === - -Experimental AJAX mode for the watch/unwatch tabs to execute inline. -Does not include the UI messages describing how to reach the watchlist, -so you may not want it on a general-audience site just yet. - -=== $wgParserTestFiles === - -MediaWiki's parser test suite can now be expanded with additional test -files. Custom extensions can add their test files to this array, and -they will be run along with the main tests by maintenance/parserTests.php - - -== Changes since 1.8 == - -* (bug 8200) Make category lists sorted by name when using Postgres. -* (bug 7841) Support 'IGNORE' inserts for Postgres, fixes watchlist - adding problem. -* (bug 6835) Removing the includes/Parser.php::getTemplateArgs() function, - because it seems to be unused. -* (bug 7139) Increasing the visual width of the edit summary field on larger - screen sizes, for the default monobook skin. -* Fix PHP notice and estimates for dumpBackup.php and friends -* Improved register_globals paranoia checks -* (bug 7545) Fix PHP version check on install -* Disable PHP exception backtrace printing unless $wgShowExceptionDetails - is set. Backtraces may contain sensitive information in function call - parameters. -* (bug 6164) Avoid smashing Cite state if message transformation triggers - during bad image list check, by skipping message transformation. - This isn't a good permanent fix. -* (bug 6918) Stopped borders and backgrounds from showing through floated - tables in Monobook -* (bug 6868) Un-hardcode section edit link style -* (bug 3205) Stop right floats from stacking horizontally in non-Monobook skins -* Added global $wgStyleVersion to centralize bumping CSS and JS file versions - for cache-friendly style and script updating -* (bug 7562) Fix non-ASCII namespaces on Windows/XAMPP servers -* Friendlier check for PHP 5 in command-line scripts; it's common for parallel - PHP 4 and 5 installations to interfere on the command-line. -* Fix regression in autoconfirm permission check -* (bug 3015) Add CSS ids to subcategory and page sections on category pages -* (bug 7587) Fix erroneous id for specialpage tab, enabling informative popup -* (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge -* (bug 7581) Update language name for cbk-zam -* (bug 7444) Update namespace translations for Telugu (te), kept old values as - alias for compatibility -* (bug 4525) Move section links down visually to same level as headings - (editsection links are now inside the heading elements) -* Workaround for http://bugs.php.net/bug.php?id=31892 , PATH_INFO and hence - URLs of the style /index.php/Main_Page were broken on some CGI installations. -* (bug 7623) Validate custom HTML id's correctly in Monobook interface -* (bug 2241) Fix collision of 'w' and 'd' accesskeys -* (bug 5795) CSS class added to body based on page name for page-specific - styling -* (bug 6276) Stopped search field from getting too large in Cologne Blue -* (bug 7644) User creations that are aborted by hooks shouldn't be counted - against account creations per day limit -* (bug 7636) Show Firefox 2 users correct accesskey prefix -* (bug 6427) Block blocked IPs from using the mail password function - to allow blocking of flooders -* Include common.css from classic-style skins in main HTML with the bump URL -* (bug 7607) Add Karakalpak (kaa) to Names.php and stub message file for linktrail -* (bug 7582) Add 'tog-nolangconversion' to MessagesEn.php. - This key is need for languages with variants (zh, sr, kk) -* (bug 7606) MediaWiki messages for "rss" and "atom" missing -* (bug 7609) Add some more '*-summary' messages to MessagesEn.php with empty - strings to allow better localisation via Special:Allmessages. Mark this new - messages as optional for localisation. -* Fix user_newpass upgrade for prefixed tables (reported by Fyren) -* (bug 7663) Include language variant switcher links on Nostalgia skin -* (bug 6531) Fix PHP fatal error on installation page with bad username input. -* (bug 6977) Remove 404 link for autogenerated database documentation. -* (bug 7369) Allow "Show Changes" without requiring edit token. -* (bug 7687) Fix movetalk box checks itself when confirming a delete and move. -* (bug 7684) Obey watchcreated preference for Special:Upload watch checkbox -* (bug 7686) Include id attribute on delete form confirmation button -* Allow compound interwiki prefixes in $wgImportSources -* (bug 7304) Added redirect table to store redirect targets. -* Added querycachetwo table (similar to querycache but has two titles) -* PageArchive can now return a Revision object for more convenient processing - of deleted revision data -* Added 'UndeleteShowRevision' hook in Special:Undelete -* Error message on attempt to view invalid or missing deleted revisions -* Remove unsightly "_" from namespace in Special:Allpages, Special:Prefixindex -* (bug 3224) Allow minor edits by bots to skip new message notification on - user talk pages. This can be disabled by adjusting the 'nominornewtalk' - permission. Patch by Werdna. -* (bug 7741) MATH: fixed broken syntax of underbrace etc. Fixed arrays -* Fix purging for updated SVG files -* (bug 7745) Add id attribute to search button in Monobook -* (bug 7749) MATH: added some more LaTeX symbols, e.g. parallel, diamond, ast, ... -* (bug 7304) Added code in Article.php to keep redirect table up to date. -* Made special page names case-insensitive and localisable. Care has been taken - to maintain backwards compatibility. -* Used special page subpages in a few more places, instead of query parameters. -* (bug 7758) Added wrapper span to "templates used" explanation to allow CSS - styling (class="mw-templatesUsedExplanation"). -* Added {{#special:}} parser function, to give the local default title for - special pages -* (bug 7766) Remove redundant / from AJAX requests, can break some servers -* Add tab links from extensions to classic-based skins (SkinTemplateTab hook) - Provides better cross-skin compatibility for extensions using the modern - skin hooks, such as Oversight -* Moved variant language links on Cologne Blue and Nostalgia to before the - login/logout link -* Fix for parser tests with MySQL 5 in strict mode -* Added block option "enable autoblocks" -* Amend Special:Ipblocklist to note when a block has autoblock DISABLED. -* (bug 7780) Fix regression in editing redirects -* Add whitespace above "templates included on this page" using CSS, not - hardcoded line break. -* Remove entries from redirect table on article deletion -* (bug 7788) Force section headers in new section links for users who have - 'prompt for blank edit summaries' on. -* (bug 1133) Special:Emailuser: add an option to send yourself a copy of your mail. -* (bug 461) Allow "Categories:" link at bottom of pages to be customized via - pagecategorieslink message. -* Sort the list of skins in "My Preferences" -> Skins by alphabetical order. -* (bug 7785) Postgres compatibility for timestamps in RC feeds -* (bug 7550) Normalize user parameter normally on Special:Log -* (bug 7294) Fix PATH search for diff3 on install -* Various fixes related to the blocking change re: autoblocks. On inserting - an IP block, the ipb_enable_autoblock field is now automagically blanked, - because it doesn't make any sense for an IP. Additionally, IP blocks - without the ipb_enable_autoblock option no longer show up as "autoblock - disabled" on Special:Ipblocklist. -* (bug 7774) MATH: aded more amstex functions -* (bug 1182) MATH: fixed inconsistent rendering of upper case Greek letters in TeX -* Fix regression in streaming page dump generation -* (bug 7801) Add support for parser function hooks in parser tests -* checkUsernames.php now uses wfDebugLog instead of hardcoded path to log -* (bug 7810) Update talk namespaces for Occitan -* Allow case-sensitive URLs to be used for uploading from URLs. -* (bug 1109) Correct fix for compressed 304 responses when additional output - buffers have been installed within the compression handler -* (bug 7819) Move automatic redirect edit summary after pre-save transform - to work properly with subst: fun -* (bug 7826) Fix typos in two English messages. -* (bug 5365) Stop users being prompted to enter an edit summary for null edits, - if they have selected that option in preferences. -* (bug 5936) Show an 'm' to the left of the edit summary on diff pages for minor edits. -* (bug 7820) Improve error reporting for uploads via URL. -* (bug 5149) When autoblocks are enabled, retroactively apply an autoblock to the most - recently used IP of a user when they are blocked. -* Add an index on (rc_user_text,rc_timestamp) on the recentchanges table. This will - make CheckUser.php and the new retroactive autoblock functionality faster. -* Fix regression in Special:Undelete for revisions deleted under MediaWiki 1.4 - with compression or legacy encoding -* (bug 6737) Fixes for MySQL 5 schema in strict mode -* Approximate height for client-side scaling fallback instead of passing -1 - into the HTML output. -* Make the DNSBL to check for proxy blocking configurable via $wgSorbsUrl -* Add experimental recording/reporting mode to parser tests runner, to - compare changes against the previous run. - Additional tables 'testrun' and 'testitem' are in maintenance/testRunner.sql, - source this and pass --record option to parserTests.php -* Make the set of default parser test input files extensible via - $wgParserTestFiles. This can now be appended to by extensions or local - configuration files so that extension or custom tests can be automatically - run along with the main batch. -* Run PHP install version checks on update.php so command-line updaters see - new version requirements -* Do a check for the PHP 5.0.x 64-bit bug, since this is much more disruptive - as of MW 1.8 than it used to be. Install or upgrade now aborts with a - warning and a request to upgrade. -* (bug 6440) Updated indexes to improve backlinking queries (links, templates, images) -* Switched 'anon-only' block mode to default for IP blocks -* (bug 3687, 7892) Add distinct heading for media files in category display, - with count. -* (bug 1578) Add different icons for external links to audio, video, or PDF in - Monobook. -* Made autoblocks block account creation if the user block has that option enabled. -* Add auto-summaries to blankings and large removals without summaries. -* (bug 7811) Allow preview of edit summaries. -* (bug 6839) Wikibits.js minor changes to make JS-lint happier. -* (bug 7932) Make sure that edit toolbar clears floats so it appears correctly. -* (bug 6873) When viewing old revisions, add link to diff to current version. -* (bug 3315) Provide rollback link directly on history page. -* Replace 'old-revision-navigation' message with 'revision-info' and - 'revision-nav' messages, wrapped in divs with appropriate id's. -* (bug 4178) MediaWiki:Common.js will now be included for all users if - $wgUseSiteJs is enabled, in addition to (if applicable) MediaWiki:Monobook.js - and user JS subpages. -* (bug 7918) "Templates used on this page" changes during preview to reflect - any added or removed templates, and works as expected for section edits. -* (bug 7919) "Templates used on this page" is now shown for read-only pages. -* (bug 7688) When viewing diff, section anchors in autosummary jump to section - on current page instead of loading the latest version. -* (bug 7970) Use current connection explicitly on Database::getServerVersion -* (bug 2001) Tables with class="sortable" can now be dynamically sorted via - JavaScript. -* Added autosummary for new pages with 500 or less characters, and refactor - the autosummary code so it's all done in one function. doEdit is getting too - big! -* (bug 7554) The correct MIME type for SVG images is now displayed on the - image page (image/svg+xml, not image/svg). -* (bug 7883) Added autoblock whitelisting feature, using which specific ranges - can be protected from autoblocking. These ranges are specified, in list format, - in the autoblock_whitelist system message. -* Added placeholders for text injection by hooks to EditPage.php -* (bug 8009) Automatic edit summary for redirects is not filled for edits in existing pages -* Installer support for experimental MySQL 4.1/5.0 binary-safe schema -* Use INSERT IGNORE for db-based BagOStuff add/insert, for more memcache-like - behavior when keys already exist on add (instead of dying with an error...) -* Add a hook 'UploadForm:initial' before the upload form is generated, and two - member variable for text injection into the form, which can be filled by the hooks. -* (bug 6295) Add a "revision patching" functionality, where an edit can be undone - (with a functionality similar to diff rev1 rev2 | patch -R rev3 -o rev3). - This is triggered by including &undo=revid in an edit URL. A link to a URL - that will undo a given edit is shown on NEW revision headers on diff pages. - The link leads to a "Show Changes" page showing what will be done to undo the - edit. -* Fix display of link in "already rolled back" message for image/category pages -* (bug 6016) Left-aligned images should stack vertically, like right-aligned - images, not horizontally. -* Patch from LeonWP: added UploadForm:BeforeProcessing hook in SpecialUpload.php -* Add AuthPluginSetup hook to override $wgAuth after configuration -* Fix regression in authentication hook auto-creation on login -* (bug 8110) Allow spaces in ISBNs -* (bug 8024) Introduce "send me copies of emails I send to others" preference -* Added 'EditPage::attemptSave' hook before an article is saved. -* (bug 8083) Applied patch for sk localisation -* Add a backslash character to the edit token, to prevent edits via certain - broken proxies that mangle such characters in form submissions -* (bug 7461) Allow overwriting pages using importTextFile.php -* (bug 7946) importTextFile.php doesn't perform pre-save transform -* (bug 8117) {{REVISIONTIMESTAMP}} showed weird default if $wgLocalTZoffset set; - now uses current time for previews and if timestamp can't be loaded from DB -* {{REVISIONTIMESTAMP}} now uses site local timezone instead of user timezone - to ensure consistent behavior -* {{REVISIONTIMESTAMP}} and friends should now work on non-MySQL backends -* (bug 7671) Observe canonical media namespace prefix in Linker::formatComment -* Added js variable wgCurRevisionId to the output -* (bug 8141) Cleanup of Parser::doTableStuff, patch by AzaTht -* (bug 8042) Make miser mode caching limits settable via $wgQueryCacheLimit - instead of hardcoding to 1000 -* Enable QueryPage classes to override list formatting -* (bug 5485) Show number of intervening revisions in diff view -* (bug 8100) Fix XHTML validity in Taiwanese localization -* Added redirect to section feature. Use it wisely. -* Added a configuration variable allowing the "break out of framesets" feature - to be switched on and off ($wgBreakFrames). Off by default. -* Allow Xml::check() $attribs parameter to override 'value' attribute -* DB schema change: added two columns (rc_old_len and rc_new_len) to the recentchanges table to store - the text lengths before and after the edit -* (bug 1085) Made Special:Recentchanges show the character difference between the changed revisions -* Removed a redundant tag from diff pages that was causing display issues for some users -* (bug 8203) The keyboard shortcut for "log out" was removed, because users were pressing it - when they intended to press the shortcut for "preview". -* (bug 8148) Handle non-removable output buffers gracefully when cleaning - buffers for HTTP 304 responses, StreamFile, and Special:Export. - Duplicated code merged into wfResetOutputBuffers() and wfClearOutputBuffers() -* Special:AllPages : 'next page' link now point to the first title of the next - chunk instead of pointing to the last title of current chunk. -* (bug 4673) Special:AllPages : add a 'previous' link (new message 'prevpage') -* (bug 8121) wfRandom() was not between 0 and 1 -* Add static method Parser::createAssocArgs($args), so parser functions can - use the same code to parse arguments as the templates do. -* Change behavior of logins using the temporary e-mailed password (as stored - in user_newpassword hash field). Instead of just logging in silently and - leaving the previous user_password field in place indefinitely, the user - is now prompted to set a new password. - - The password-changing form is at Special:Resetpass; currently it's only - usable for changing from the temporary password during login, but it - could perhaps be generalized, replacing the subform in preferences. - - Once the new password is set successfully, the temporary password is wiped - so it cannot be used to login a second time, and the login process - is completed. -* Suppress 'mail new password' button on login form if $wgAuth forbids - changing user passwords; it wouldn't work very well... -* Consolidate password length checks and $wgAuth manipulation into - User::setPassword() to avoid duplicate code in different places - that set passwords. -* User::setPassword() now throws PasswordError exceptions if the password - is illegal or cannot be set via $wgAuth. These can be caught and a human- - readable error message displayed by UI code. -* Added Title::isSubpage() -* (bug 8241) Don't consider user pages of User:Foo.css to be CSS subpages -* Set an explicit class on framed thumbnail inner divs and images, changed some - CSS to use these instead of using descendent selectors. -* Accept null parameter to User::setPassword() as indicating the password - field should be cleared to an unusable state. Login will only be possible - after the password is reset, for instance by e-mail. -* (bug 6394) Invalidate the password set for "by e-mail" account creations - to avoid accidental empty password creations. -* Made the show change size function work on page moves, page creations, and - log entries. Also fixed it in the javascript recentchanges. -* (bug 8239) correctly get 50 new contributions when clicking '(50 next)' -* (bug 2259) Fix old regression where e-mail addresses were no longer - confirmed on login with mailed password. -* Add a notification about the confirmation mail sent during account - creation, so people don't immediately go off to request a second one. -* Add a warning on Special:Confirmemail if a code was already sent and has - not yet expired. -* Add user_editcount field to provide data for heuristics on account use. - Incremented on edit, with lazy initialization from past revision data. - Can batch-initialize with maintenance/initEditCount.php (not yet friendly - to replication environments, this will do all accounts in one query). -* Allow raw SQL subsections in Database::update() SET portion as well as - for WHERE portion. Handy for increments and such. -* User::getOption now accept a default value to override default user values - this makes it consistent with WebRequest::get* methods. Corrected code in - various places accordingly. -* (bug 8264) Fix JavaScript global vars for XHTML mode -* Make $wgSiteNotice value wikitext again, for consistency with editable - MediaWiki:Sitenotice and MediaWiki:Anonnotice. -* (bug 8044) When redirecting from the canonical name of the special page - to the localised one, parameters/subpages are omitted -* (bug 8164) Special:Booksources should use GET for form submission -* Rewrite Special:Booksources to clean up interface and remove redundant code -* (bug 7925) Change Special:Allmessages message name filter javascript to be - a bit more responsive and easier on the CPU -* (bug 4488) Support watching pages on deletion; introduces new user preference -* Minor restructuring of Special:Preferences; "watch pages I edit" and "watch - pages I create" options now accessible under "Watchlist" options -* (bug 8153) doesn't work in site notice -* (bug 6690) wfMsgNoTrans() transforms messages -* (bug 8274) Wrap edit tools in a
with a specified class -* Detect PHP 5.0.x 64-bit bug and abort in WebStart.php; too many things break - mysteriously otherwise (detection code copied from install-utils.inc) -* (bug 8295) Change handling of
tags in doBlockLevels() to match that - of
-* (bug 8110) Make magic ISBN linking stricter: only match ten-digit sequences - (plus optional ISBN-13 prefix) with no immediately following alphanumeric - character, disallow multiple consecutive internal redirects -* (bug 2785) Accept optional colon prefix in links when formatting comments -* Don't show "you can view and copy the source of this page" message for - pages which don't exist -* (bug 8310) Blank line added to top of 'post' when page is blank -* (bug 8109) Template parameters ignored in "recentchangestext" -* Gracefully skip redirect-to-fragment on WebKit versions less than 420; - it messes up on current versions of Safari but is ok in the latest - nightlies. Checking the version number will allow it to automatically - work when new releases of Safari appear. -* Fix regression in thumb styles; size and padding didn't match with - new arrangement. -* (bug 8333) Fix quick user data update on login password change on - replication database setups. User data is now pulled from master - instead of slave in User::loadFromDatabase, ensuring that it is - fresh and accurate when read and then saved back into cache. - This was breaking with the Special:Rename operation which - automatically logs the user in with the new password after changing - it; pulling from slave meant the record was often not the updated - one. -* (bug 8335) Set image width to the first valid parameter found. -* (bug 8350) Fix watchlist viewing bug when using Postgres. -* (bug 6603) When warning about invalid file extensions, output the bit - of the extension we actually checked -* (bug 7669) Drop defaults on BLOB/TEXT columns for better compatibility - with MySQL's strict mode, often enabled by the Windows installer. - The defaults are ignored anyway when strict mode is off... -* (bug 7685) Use explicit values for ar_text and ar_flags when deleting, - for better compatibility with MySQL's strict mode -* Update default interwiki values to reflect changed location of ursine: -* (bug 5411) Remove autopatrol preference -* Users who have the "autopatrol" permission will have their edits marked as - patrolled automatically -* Users who do not have the "autopatrol" permission will no longer be able - to mark their own edits as patrolled -* Introduce 'PingLimiter' hook; see docs/hooks.txt for more information -* (bug 532) Tweaked alt text for some interface messages -* (bug 8231) Gave useful alt text to the main on image pages -* (bug 371) Remove alt text for "Enlarge" icon on thumbnails -* Initialize user_editcount to 0 instead of NULL for newly created accounts -* (bug 3696) Strip LRM and RLM characters from titles to work around the - problem some people have where titles cut-and-pasted from lists include - the bidi override characters appended to the lists. - A more thorough blacklist for forbidden and translatable characters would - be wise, though, as might a cleaner method for the lists in the first place. -* Fix regression in email password resets on read-restricted sites -* Set tabindex on fields in deletion form so you don't have to tab through - the links in the sitenotice -* (bug 8271) Show full time and date on viewer for individual deleted - revisions -* (bug 8214) Output file size limit and actual file size in appropriate units - on Special:Upload -* (bug 8016) Purge objectcache table during upgrade processes - use the --nopurge - option to prevent this when running maintenance/update.php -* (bug 7612) Remove superfluous link to Special:Categories from result items - on Special:Mostcategories -* {{PLURAL:}} now handles formatted numbers correctly -* (bug 8331) Added the change size value to watchlists; therefore made - watchlists use RecentChange::newFromRow() instead of newFromCurRow() -* (bug 8351) Fix undo for simple reverts -* (bug 6856) User::clearNotification() does not respect read-only mode -* (bug 6853) Use a checkbox on the installer form to indicate that a superuser - account should be used; this is clearer than the old check which relied on - the password never being an obscure value -* Remove old unused watchlist cache, which was a leftover from the old schema - where watchlists were more expensive to generate -* Minor cosmetic changes to Special:Userrights -* Added wgCanonicalSpecialPageName to JavaScript variables -* Fix image deleting when using Postgres. -* Output both source and destination titles in maintenance/moveBatch.php -* Added basic parser tests for language variants -* Enable selflinks and categories to be written in some of the language variants -* Prevent conversion of JavaScript code in language variants -* Output software version number in maintenance/parserTests.php -* (bug 7169) Use Ajax to watch/unwatch articles if enabled -* Make variant table caching a little more robust, using main language code - in cache key. Probably this is still a bit wonky, though. Was breaking - parser tests when Chinese tables were getting loaded into Serbian code. -* (bug 8380) Be nicer about blank lines in deleteBatch.php -* (bug 8401) Fix regression in SORBS lookup for some DNS setups -* Use raw file descriptor in posix_isatty() check to avoid warning on - Linux systems with at least some versions of PHP -* (bug 5908) Allow overriding the default category sort key for all items on - a page using {{DEFAULTSORT}} -* (bug 6449) Throw a more definitive error message when installation fails - due to an invalid database name -* (bug 5827) Use full text for option link labels on Special:Watchlist -* (bug 8018) Allow hiding minor edits from the watchlist -* (bug 8427) MonoBook RTL IE 7.0 tweaks failed when sidebar's navigation - section is renamed; no longer relies on first section name -* Stabilize client-side table sorting even if the underlying Javascript sort() - implementation is unstable -* Add hook for extensions to add user information to the panel in preferences, - next to the user name and ID. -* (bug 8392) Display protection status of transcluded pages in the edit page - template list. Patch by Fyren, with i18n naming tweak. -* Fix for interwiki transclusion where target wiki uses query string for title -* Resolve namespaces on interwiki Title objects using canonical namespace names - if possible (should not happen, though, outside interwiki transclusion... and - maybe not even then, but it does) -* (bug 8447) Fix SQL typo breaking non-default $wgHitcounterUpdateFreq -* Do not allow previews of deleted images to be cached -* Add global variable $wgDefaultLanguageVariant used to set the default language - variant of a wiki to something different than the main language code -* Add 'variant' option to parserTests - runs test with the given variant as - preferred, utilize it for more parser tests of language variants code -* (bug 6503) Fix bug that stopped certain irrelevant links from being hidden - for printing -* Avoid PHP warning in Creative Commons metadata when a creative commons - license is not actually set up -* (bug 8463) Don't print external link icons for Monobook -* (bug 8461) Support watching pages on move -* (bug 8041) Work around bug with debug_backtrace when Zend Optimizer is - loaded by skipping the function. Use wfDebugBacktrace() wrapper function. -* Reduce config file clutter by setting various script and upload paths - based on $IP or $wgScriptPath in Setup.php. They can still be explicitly - overridden in LocalSettings.php if desired... -* Attempt to detect redirect loops for the canonical title redirect, and - give some hints to the poor confused administrator. -* Introduce new flag 'R' - raw output for language variant escape tags -* Advise users when updates for a query page have been disabled using - $wgDisableQueryPageUpdate -* (bug 8413) Improve comments for $wgNamespaceRobotPolicies -* (bug 8330) Show "bytes" suffix on recent changes diff counter - optionally... if set in rc-changes-size message (default empty for now) -* (bug 8489) Support basic links in caption attribute -* (bug 8485) Correct Lingala number formatting -* The MediaWiki namespace is no longer pre-filled with default messages on - install. All default messages will be removed from the MediaWiki namespace - on upgrade. -* Recentchanges RSS/Atom feeds now use a separate message for the description - to avoid cluttering it with useless wiki formatting -* (bug 8417) Handle EXIF unknown dates -* (bug 8372) Return nothing on empty tags. -* New maintenance script to show the cached statistics : showStats.php. -* Count deleted edits when regenerating total edits in maintenance/initStats.php -* (bug 3706) Allow users to be exempted from IP blocks. The ipblock-exempt permission - key has been added to enable this behaviour, by default assigned to sysops. -* (bug 7948) importDump.php now warn that Recentchanges need to be rebuild. -* (bug 7667) allow XHTML namespaces customization -* (bug 8531) Correct local name of Lingála (patch by Raymond) -* Fix regression with default lock file and cache directories; threw visible - warning with open_basedir +* A new switch $wgCommandLineDarkBg used by maintenance scripts (parserTests.php). + It lets you specify if your terminal use a dark background, the colorized + output will be made lighter making things easier to read. +* The minimum permissions needed to edit a page in each namespace can now be + customized via the $wgNamespaceProtection array. By default, editing pages in + the MediaWiki namespace requires "editinterface" permission, as before. +* Allow restriction of autoconfirmed permission by edit count. New global setting + $wgAutoConfirmCount (defaulting to zero, naturally). +* Added rate limiter for Special:Emailuser +* Private logs can now be created using $wgLogRestrictions +* (Bug 8590) limited HTML is now always enabled ($wgUserHtml = true). +* Deprecated $wgUseImageResize, thumbnailing will be enabled unconditionally. + +== New features since 1.9 == + +* (bug 6937) Introduce "statistics-footer" message, appended to + Special:Statistics +* (bug 6638) List block flags in block log entries +* (bugs 5051, 5376) Tooltips and accesskeys no longer require JavaScript +* Added SkinTemplateOutputPageBeforeExec hook before SkinTemplate::outputPage() + starts page output + (http://lists.wikimedia.org/pipermail/wikitech-l/2007-January/028554.html) +* Introduce "cascading protection" -- implicit protection on pages transcluded + into a page protected with this option enabled +* (bug 8567) Added hook RawPageViewBeforeOutput just before the text is blown + out in action=raw, so extensions might influence the output. +* (bug 3446) Add user preference to hide page content below diffs, can be + overridden by adding diffonly=1 or diffonly=0 to the URL of the diff page +* Add 'purge' privilege to replace the hardcoded check for login state in + determining whether action=purge can be done via GET. Switching the + permission on for anons can be helpful for benchmarking. +* (bug 7842) Link back to deleted revision list from deleted revision preview +* (bug 8619) Add user-aware "unblock" link to Special:Blockip +* (bug 8522) Provide a "delete" link on Special:Brokenredirects for users with + the appropriate permission +* (bug 8628) Add user-aware block list link to Special:Blockip +* (bug 8621) Log revisions marked as patrolled +* Introduce "BookInformation" hook; see docs/hooks.txt for more details +* Add title prefix search for Special:Undelete +* Remove full-archive list from Special:Undelete +* (bug 8136) Introduce 'ArticleUndelete' hook; see docs/hooks.txt for more info +* (bug 8712) Expose user groups as a JavaScript global +* Introduce 'CustomEditor' hook; see docs/hooks.txt for more information +* New special page, Special:Protectedpages, which shows all protected pages + and their protection status (full protection status is not pulled out due + to performance considerations, so it just shows "full protected" or + "semi protected". +* (bug 4133) Allow page protections to be made with an expiry date, in the same + format as block expiry dates. Existing protections are assumed to be infinite, + as are protections made with the new field left blank. +* (bug 8535) Allow certain vertical alignment attributes to be used as image + keywords +* (bug 6987) Allow perrow, widths, and heights attributes for +* (bug 3678) Allow disabling MediaWiki:Aboutsite in the same way as + MediaWiki:Disclaimers; Also means that if any of the footer links are + disabled in the wiki's default language (by setting to "-"), they'll also + be disabled in other languages too (e.g. if the user specifies uselang=fr). +* Sort log types in Special:Log +* Added a classname ("mw-toolbar-editbutton") and unique IDs to the edit + toolbar buttons +* Hide irrelevant block options in Special:Blockip based on whether an + IP address/range or username is listed. (Dynamic using JS.) +* (bug 9032) Make quickbarSettings localizable through Special:Allmessages +* (bug 7782) Standardisation of file info at image description pages. +* (bug 1035) View contributions / recentchanges for an IP range. +* (bug 8747) When unwatching pages from Special:Watchlist/edit, put the + confirmation messages in a proper list with a CSS class and id. +* (bug 9118) Show relevant log fragments on deletion confirmatio page +* (bug 9009) Add username entry field to Special:Contributions +* (bug 1723) Article size in history +* (bug 9223) Disallow magic tilde sequences in page titles and usernames +* (bug 6997) Link from Special:log/block to unblock form +* (bug 9117) Link from Special:log/delete to undelete form +* Link from Special:log/protect to change protection form +* (bug 1196) Add IPv6 support added to blocks, more consistancy for IPv6 contribs +* (bug 3984) Searching in logs by title% +* Show thumbnail of existing image if image exists already under this filename +* (bug 5546) Watchlist reflects logged actions like move, protection, undelete +* Support protocols other than HTTP in LinkFilter, use $wgUrlProtocols +* (bug 3069) Warning on upload of scaled down images +* Warning on upload of images with uppercase extension if image with lowercase + extension exists +* (bug 4624) Namespace selection for Special:Whatlinkshere +* Introduce PageHistoryBeforeList and PageHistoryLineEnding hooks; see docs/hooks.txt + for more information +* (bug 9397) Introduce "sp-contributions-footer" and "sp-contributions-footer-anon" + messages, shown at the end of Special:Contributions as appropriate for the target +* (bug 8421) Expose current action in JavaScript globals (as 'wgAction') +* (bug 9069) Use galleries in query pages dedicated to images +* (bug 9177) Installer now warns of various conditions affecting session.save_path + which can lead to broken session storage +* (bug 9046) Special page to list pages without language links +* (bug 9508) Special page to list articles with the fewest revisions +* Introduce 'FileUpload' hook; see docs/hooks.txt for more information +* Introduce 'SearchUpdate' hook; see docs/hooks.txt for more information +* Introduce 'mywatchlist' message; used on personal menu to link to watchlist page +* Introduce magic word {{NUMBEROFEDITS}} +* Introduced media handlers for file-type specific operations. +* Improved error reporting for image thumbnailing +* Added sharpening option for ImageMagick thumbnailing +* (bug 9656) Autosummaries will be generated for deletion of pages longer than + 500 characters +* Predefined block reasons added to Special:Blockip +* (bug 9196) Installer now check that zend.ze1_compatibility_mode is off +* (bug 9697) Introduce 'InternalParseBeforeLinks' hook; see docs/hooks.txt for more information +* 'contribsub' message changed to 'contribsub2' with two parameters to permit + better localization. Change is reverse-compatible and can be ignored for + most wikis. +* Adding a 'reason' field to Special:Userrights + +== Bugfixes since 1.9 == + +* (bug 7292) Fix site statistics when moving pages in/out of content namespaces +* (bug 8531) Correct local name of Lingála +* Made the PLURAL: parser function return singular on -1 per default +* Fixed up the AjaxSearch +* Fix SpecialVersion->formatCredits input. Version and Url parameters should be + null to be treated properly with isset. +* Page restrictions moved into a new, dedicated table +* Correct tooltip accesskey hint for Opera on the Macintosh + (uses Shift-Esc-, not Ctrl-). +* (bug 8002) Math should render left-to-right even in right-to-left wikis +* Pass e-mail and real name fields to AuthPlugin::addUser, as additional + optional fields, which may be considered useful at registration time. +* PostgreSQL upgrade scripts fixed and updated +* (bug 8613) Fix error when viewing "Recent Changes" and using Postgres. +* Initialise site_stats table at upgrade time if data was missing +* (bug 7250) Updated Unicode normalization tables to Unicode 5.0 +* Unmaintained Oracle support files have been removed. +* Use browser default for printing size, don't force to 11pt +* (bug 8632) Fix regression in page protection null edit update +* (bug 8407) Disallow indexing of "printable" versions +* (bug 8643) Correctly escape the page-specific CSS class for non-Monobook skins +* (bug 8629) Document $wgFilterCallback +* (bug 1000) Clarify warning about memory_limit in installer +* Suppress PHP warning about set_time_limit in installer when safe mode is on +* (bug 3000) Fall back to SCRIPT_NAME plus QUERY_STRING when REQUEST_URI is + not available, as on IIS with PHP-CGI +* Missing interwiki row for English Wikipedia restored (as "wikipedia:") +* use configured cache servers for mctest.php +* bucket details in mcc.php +* fix input validation and remove debugging code in compressOld +* full ID range for moveToExternal +* fix resolveStubs.php for compatibility with older serialized data +* maximum line length for bar graphs in getLagTimes.php +* recognize specieswiki in rebuildInterwiki.inc +* profile unicode cleanup in Xml +* log slow parses in Article.php +* profile wfMsgReal +* log mkdir failures +* profile AutoLoader +* rebuild empty DjVu metadata containing '' +* security fix for DjVu metadata retrieval +* Undelete page list can use plural marker +* (bug 8638) Fix update from 1.4 and earlier +* (bug 8641) Fix order of updates to ipblocks table +* (bug 8678) Fix detection of self-links for numeric titles in Parser +* (bug 6171) Magically close tags in tables when not using Tidy. +* Sanitizer now correctly escapes lonely '>' occurring before the first wikitag. +* Ignore self closing on closing tags ( '
' now gives '
') +* (bug 8673) Minor fix for web service API content-type header +* Fix API revision list on PHP 5.2.1; bad reference assignment +* (bug 8688) Handle underscores/spaces in Special:Blockip and Special:Ipblocklist + in a consistent manner +* (bug 8701) Check database lock status when blocking/unblocking users +* ParserOptions and ParserOutput classes are now in their own files +* (bug 8708) Namespace translations for Zealandic language +* Renamed constructor methods to PHP 5 __construct reserved name +* (bug 8715) Warn users when editing an interface message whether or not the + message page exists +* ar: fix the 'create a new page' on search page when no exact match found +* (bug 8703) Corrected talk and image namespace name for Limburgish (li) +* (bug 8671) Expose "wpDestFile" as a parameter to "uploadtext" +* (bug 8403) Respect bad image list exceptions in galleries on wiki pages +* Allow sending per-user contribution requests to "contributions" query group +* (bug 3717) Update user count for AuthPlugin account autocreation +* (bug 8719) Firefox release notes lie! Fix tooltips for Firefox 2 on x11; + accesskeys default settings appear to be same as Windows. +* Added an option to make Linker::userToolLinks() show the contribs link + red when the user has no edits. Linker::userToolLinksRedContribs() is an + alias to that which should be used to make it more self documentating. +* (bug 8749) Bring MySQL 5 table defs back into sync +* (bug 8751) Set session cookies to HTTPS-only to match other cookies +* (bug 8652) Catch exceptions generated by malformed XML in multipage media +* (bug 8782) Help text in Makefile +* (bug 8777) Suppress 'previous' link on Special:Allpages when at first page +* (bug 8774) Fix path for GNU FDL rights icon on new installs +* Fix multipage selector drop-down for DjVu images to work when title + is passed as a query string parameter; we have to pass the title as + a form parameter or it gets dropped from the form submission URL +* (bug 8819) Fix full path disclosure in with skins dependencies +* Fixed bug affecting HTML formatting in sortable table column titles +* Merged table sorting code into wikibits.js +* (bug 8711) Stop floats in previews from spilling into edit area +* (bug 8858) Safer handling when $wgImageLimits is changed. Added a note + in DefaultSettings to make it clear. +* (bug 4268) Fixed data-loss bug in compressOld batch text compression + affecting pages which had null edits (move, protect, etc) as second + edit in a batch group. Isolated and patched by Travis Derouin. +* Fix for paths in 1.4->1.5 special-case updater script +* (bug 8789) AJAX search: IE users can now use the return key +* (bug 6844) Use and tags to emphase the differences +* (bug 6684) Fix improper javascript array iteration +* (bug 4347) use MailAddress object for reply-to +* Add AlphabeticPager abstract class +* Use faster AlphabeticPager for Special:Categories +* (bug 8875) Show printable link in MonoBook sidebar for locally nonexistent + pages; perhaps useful for categories and shared images +* Clean up session checks to better handle the case where the session was + opened during the current request. May help with some caching corner + cases. +* (bug 8897) Fix whitespace removal for interlanguage links with link prefix +* Add 'ParserTestTables' hook to expand the list of temporary tables copied + by the parser test harness; use for extensions which require the presence + of other tables while they work. +* Message names changed for AlphabeticPager introduced with r19758 + for better localisations. +* (bug 8944) The deprecated is_a() function is used in StubObjects.php +* (bug 8992) Fix a remaining raw use of REQUEST_URI in history +* (bug 8999) User.php gives "undefined user editcount" PHP notice. +* (bug 8984) Fix a database error in Special:Recentchangeslinked + when using the Postgres database. +* Moved the main ob_start() from the default LocalSettings.php to WebStart.php. + The ob_start() section should preferably be removed from older + LocalSettings.php files. +* Give Content-Length header for HTTP/1.0 clients. +* Partial support for Flash cross-domain-policy filtering. +* Lazy-initialize site_stats row on load when empty. Somewhat kinder to + dump-based installations, avoiding PHP warnings when NUMBEROFARTICLES + and such are used. +* Add 'charset' to Content-Type headers on various HTTP error responses + to forestall additional UTF-7-autodetect XSS issues. PHP sends only + 'text/html' by default when the script didn't specify more details, + which some inconsiderate browsers consider a license to autodetect + the deadly, hard-to-escape UTF-7. + This fixes an issue with the Ajax interface error message on MSIE when + $wgUseAjax is enabled (not default configuration); this UTF-7 variant + on a previously fixed attack vector was discovered by Moshe BA from BugSec: + http://www.bugsec.com/articles.php?Security=24 +* Trackback responses now specify XML content type +* (bug 9044) Send a comment with action=raw pages in CSS/JS output mode + to work around IE/Mac bug where empty pages time out verrrrryyyyy slowly, + particularly with new keepalive-friendly HTTP on Wikipedia +* (bug 8919) Suppress paging links and related messages where there are no + rows to list for query pages +* (bug 9057) Standardize MediaWiki: namespace for oc +* (bug 8132) Suppress "Pages in this category" heading in categories when + there are none +* (bug 8958) Handle search operators better when using tsearch2 (Postgres) +* (bug 8799) Use redirect table for Special:BrokenRedirects and + Special:DoubleRedirects +* (bug 8918) Enable PLURAL option for MediaWiki:showingresults and + MediaWiki:showingresultsnum +* (bug 9122) Fix minor display issue in RTL with section edit link margin +* (bug 5805) Enable PLURAL option for some messages of watchlist and statistic +* (bug 3953) Work around poor display of parenthesis in the in other + languages section of MonoBook skin +* (bug 8539) Enable PLURAL option for another message of recentchanges. +* (bug 8728) MediaWiki:Badfiletype splitted into 3 messages +* (bug 9131) Allow SpecialContributions to work with Postgres +* (bug 9155) Allow footer info to wrap in Monobook +* (bug 8847) Strip spurious #fragments from request URI to fix redirect + loops on some server configurations +* (bug 9097) column "pr_pagetype" does not exist +* (bug 9217) Balance wfProfile calls in Skin::outputPage +* (bug 9222) PostgreSQL updater should not be version-specific +* Fix fallback implementation of mb_strlen so it works and isn't insanely + slow for large strings, since it's used for page edit lengths +* (bug 8815) Setting password in initUser() breaks LdapAuthentication plugin +* (bug 9256) Add a quick note to index.php header comments +* Make Special:Listusers caseinsensitive for first letter +* Default tidy.conf has been moved from extensions module into includes. +* Ignore lonely ''''' +* (bug 9244) When calling edit page for nonexistent section, generate error + inside of just discarding edits, since edit links sometimes go to the wrong + place. +* (bug 9019) No warning during upload if image description page exists, but no + image +* (bug 8582) Allow thumbnailing when imagesize has a space. +* (bug 8716) Change math_inputhash and math_outputhash to byte for Postgres +* (bug 9343) Correct internal name for Wolof language +* (bug 9363) Fix Postgres error on Recentchangeslinked +* (bug 5142) Fixed call of hook ArticleViewHeader +* (bug 4777) Separate prev/next messages for Special:Whatlinkshere +* Merge approx 15 missing Wikipedia language codes into wikipedia-interwiki.sql + based on Jeff Merkey's mediawiki-1.9.3.WG-20070316.tar.gz.bz2 archive. +* (bug 9411) Fix for shared image descriptions using query-string titles +* (bug 4756) Add user tool links for self created accounts at special:log + instead of sometimes broken block links from newuserlog extension +* (bug 5817) Special:Recentchangeslinked now shows red link for nonexistent + target page instead of silently redirecting +* (bug 8914) Don't transform colons in {{anchorencode:}} +* (bug 9241) Handle edit section links and include size links for cached + templates the same as the first transclusion. +* (bug 9466) "Rollback failed" page doesn't format edit comment +* (bug 9472) Invalid XHTML on cached special pages +* (bug 9472) Invalid XHTML on Special:Newpages +* (bug 4764) "My contributions" not bold when viewing own contributions +* (bug 9194) Add {{PLURAL:...}} to navigation bar of Special:Whatlinkshere +* (bug 9033) Use a more specific error message when users are not able/allowed + to edit page protection levels due to a block, database lock or permissions +* Fixed $wgFeedLimit +* (bug 9270) Corrected help namespace name for Dutch Lower Saxon (nds-nl) +* (bug 929, 4215) Expose "rcdays" user preference in Special:Preferences +* (bug 9554) Extension-provided group name messages not used +* (bug 9565) Translate template namespace name for Hindi (hi) +* (bug 8599) Correct localized names of zh-variants +* (bug 3366) Require skins based on SkinTemplate to override the skinname + property. +* (bug 9220) Removed obsoletes functions in install-utils.inc. +* Removed obsoletes Title::getRelatedCache and Title:touchArray +* (bug 7285) Check MySQL username length during install +* (bug 6910) Correct date/time formats in Vietnamese (vi) +* (bug 9608) Correctly use ORDER BY in dumpLinks.php +* (bug 9609) Correctly use ORDER BY in SpecialWhatlinkshere.php +* Special:Random and Special:Randomredirect now try harder to send the user to + a random page, and will give an error message if none really can be found + instead of sending the user to the main page like they used to +* Fix object variable used for displaying "not-patrolled" CSS class on list +* Fixed interaction of page parameter to ImagePage with the HTML file cache +* Fixed MIME type for SVG files, will be silently changed from image/svg + to image/svg+xml after loading from the database. +* Workaround for djvutoxml bug #1704049 (poor performance). Use djvudump + instead. +* Fixed odd behaviour in ImagePage on DjVu thumbnailing errors +* (bug 5439) "Go" title search will now jump to shared/foreign Image: and + MediaWiki: pages that have not been locally edited. +* (bug 9630) Limits links in Whatlinkshere forgot about namespace filter +* Fixed upgrade for the non-standard MySQL schemas +* Disable MySQL's strict mode at session start for MySQL 4.1+, to avoid the + various problems that occur when it is on. +* (bug 9585) Fix regression in tidy usage in Special:Undelete previews +* (bug 3826) Normalize some invalid cookie name characters when setting + up $wgCookiePrefix. Completes application of patch by Anders Kaseorg. +* (bug 9649) Fix RTL form alignment for Special:Movepage +* (bug 9582) Members of bot group now mark edits patrolled by default +* (bug 9669) Fix limit ordering for rebuildrecentchanges; broken since + converted from 1.4 to 1.5 schema +* (bug 9682) Revert PHP 5.1 dependency on warning suppression for SVN info +* (bug 5959) Anchors dropped from stub links +* (bug 3348) Some additional weak password checks: password which is same + as username will now be rejected. +* (bug 8602) Converted Special:Contributions to use an IndexPager. The + interpretation of the offset parameter has changed, and the go parameter + has been removed. +* (bug 7629) Fix $wgBrowserBlackList to avoid false positive on MSIE + when certain plugins are present which alter the user agent + + +== Maintenance == + +* New script maintenance/language/checkExtensioni18n.php used to check i18n + progress in the extension repository. +* Running maintenance/parserTests.php with '--record' option, will now + automatically attempt to create the required tables +* --purge option to do additional parser-cache purging for purgeList.php +* Fix hardcoded background color in parserTests.php +* parserTests.php : removed the 'light' option for --color argument, replacing + it with a new global switch : $wgCommandLineDarkBg +* (bug 8780) Clarify message for command-line scripts if LocalSettings.php + exists but is not readable +* dumpBackup / importDump now work with PostgreSQL +* (bug 8975) Use "Maintenance script" as the default username for importImages.php + and importTextFile.php scripts +* (bug 8933) Fix maintenance/reassignEdits.php script +* (bug 9440) Added "mediawikiwiki" interwiki prefix to MediaWiki.org +* (bug 2979) Import now gracefully skips invalid titles with a warning +* Restore '--norc' option for maintenance/importTextFile.php +* Help information for maintenance/importTextFile.php now easier to read on + consoles +* Doxygen documentation now show the revision number of each file, generate + graphs using dot and include a search engine. == Languages updated == +* Arabic (ar) +* Aramaic (arc) +* Aymara (ay) +* Belarusian normative (be) +* Belarusian alternative (be-x-old) +* Bulgarian (bg) +* Bihara (bh) +* Breton (br) +* Catalan (ca) +* Czech (cs) +* Danish (da) +* German (de) +* Greek (el) +* Esperanto (eo) +* Spanish (es) +* Estonian (et) * Basque (eu) -* Bishnupriya Manipuri (bpy) -* Cantonese (zh-yue) * Finnish (fi) -* Frisian (fy) -* German (de) +* Võro (fiu-vro) +* French (fr) * Hebrew (he) +* Hindi (hi) +* Upper Sorbian (hsb) +* Hungarian (hu) +* Armenian (hy) * Indonesian (id) * Italian (it) * Japanese (ja) +* Javanese (jv) +* Georgian (ka) +* Kabyle (kab) * Kazakh (kk) -* Kongo (kg) +* Korean (ko) +* Kashmiri (ks) +* Ripuarian (ksh) * Latin (la) +* Luganda (lg) * Limburgish (li) -* Lingala (ln) * Lithuanian (lt) -* Maltese (mt) -* Maori (mi) -* Norwegian (no) +* Latvian (lv) +* Marathi (mr) +* Low Saxon (nds) +* Dutch Lower Saxon (nds-nl) +* Nepali (ne) +* Nepal Bhasa (new) +* Dutch (nl) * Occitan (oc) -* Old Church Slavonic (cu) +* Pali (pi) * Polish (pl) -* Portuguese (pt) -* Ripurian (ksh) +* Romanian (ro) * Russian (ru) +* Sanskrit (sa) +* Sicilian (scn) * Slovak (sk) +* Sundanese (su) * Swedish (sv) -* Taiwanese/Holo: (bug 8217) changed language code to nan (from zh-min-nan) - due to http://www.sil.org/iso639-3/codes.asp?order=639_3&letter=n -* Upper Sorbian (hsb) +* Tahitian (ty) +* Ukrainian (uk) +* Urdu (ur) +* Uzbek (uz) * Vietnamese (vi) +* Zealandic (zea) +* Old Chinese / Late Middle Chinese (zh-classical) +* Chinese (PRC) (zh-cn) +* Chinese (Taiwan) (zh-tw) +* Cantonese (zh-yue) == Compatibility == -MediaWiki 1.9 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported. +MediaWiki 1.10 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported. PHP 5.0.x fails on 64-bit systems due to serious bugs with array processing: http://bugs.php.net/bug.php?id=34879 @@ -864,13 +507,11 @@ At this time we still recommend 4.0, but 4.1/5.0 will work fine in most cases. == Upgrading == -Some minor database changes have been made since 1.7: -* new fields and indexes on ipblocks -* index change on recentchanges +1.10 has several database changes since 1.9, and will not work without schema +updates. -Several changes from 1.5 and 1.6 do require updates to be run on upgrade. -To ensure that these tables are filled with data, run refreshLinks.php after -the upgrade. +If upgrading from before 1.7, you may want to run refreshLinks.php to ensure +new database fields are filled with data. If you are upgrading from MediaWiki 1.4.x or earlier, some major database changes are made, and there is a slightly higher chance that things could @@ -878,8 +519,6 @@ break. Don't forget to always back up your database before upgrading! See the file UPGRADE for more detailed upgrade instructions. - - === Caveats === Some output, particularly involving user-supplied inline HTML, may not @@ -889,14 +528,15 @@ cases, but this is not recommended on live sites. (This must be set for MathML to display properly in Mozilla.) -For notes on 1.8.x and older releases, see HISTORY. +For notes on 1.9.x and older releases, see HISTORY. === Online documentation === Documentation for both end-users and site administrators is currently being -built up on Meta-Wikipedia, and is covered under the GNU Free Documentation -License: +built up on MediaWiki.org, and is covered under the GNU Free Documentation +License (except for pages that explicitly state that their contents are in +the public domain) : http://www.mediawiki.org/wiki/Documentation diff --git a/Test.php b/Test.php new file mode 100644 index 00000000..bad931a4 --- /dev/null +++ b/Test.php @@ -0,0 +1,307 @@ + for PHP + +=head1 SYNOPSIS + + require 'Test.php'; + + plan( $num ); # plan $num tests + # or + plan( 'no_plan' ); # We don't know how many + # or + plan( 'skip_all' ); # Skip all tests + # or + plan( 'skip_all', $reason ); # Skip all tests with a reason + + diag( 'message in test output' ) # Trailing \n not required + + # $test_name is always optional and should be a short description of + # the test, e.g. "some_function() returns an integer" + + # Various ways to say "ok" + ok( $got == $expected, $test_name ); + + # Compare with == and != + is( $got, $expected, $test_name ); + isnt( $got, $expected, $test_name ); + + # Run a preg match on some data + like( $got, $regex, $test_name ); + unlike( $got, $regex, $test_name ); + + # Compare something with a given comparison operator + cmp_ok( $got, '==', $expected, $test_name ); + # Compare something with a comparison function (should return bool) + cmp_ok( $got, $func, $expected, $test_name ); + + # Recursively check datastructures for equalness + is_deeply( $got, $expected, $test_name ); + + # Always pass or fail a test under an optional name + pass( $test_name ); + fail( $test_name ); + +=head1 DESCRIPTION + +F is an implementation of Perl's L and Pugs's B for +PHP. Like those two modules it produces TAP output (see L) which +can then be gathered, formatted and summarized by a program that +understands TAP such as L. + +=cut + +*/ + +register_shutdown_function('test_ends'); + +$Test = array( + 'run' => 0, + 'failed' => 0, + 'badpass' => 0, + 'planned' => null +); + +function plan( $plan, $why = '' ) +{ + global $Test; + + $Test['planned'] = true; + + switch ( $plan ) + { + case 'no_plan': + $Test['planned'] = false; + break; + case 'skip_all'; + printf( "1..0%s\n", $why ? " # Skip $why" : '' ); + exit; + default: + printf( "1..%d\n", $plan ); + break; + } +} + +function pass( $desc = '' ) +{ + return proclaim(true, $desc); +} + +function fail( $desc = '' ) +{ + return proclaim( false, $desc ); +} + +function ok( $cond, $desc = '' ) { + return proclaim( $cond, $desc ); +} + +function is( $got, $expected, $desc = '' ) { + $pass = $got == $expected; + return proclaim( $pass, $desc, /* todo */ false, $got, $expected ); +} + +function isnt( $got, $expected, $desc = '' ) { + $pass = $got != $expected; + return proclaim( $pass, $desc, /* todo */ false, $got, $expected, /* negated */ true ); +} + +function like( $got, $expected, $desc = '' ) { + $pass = preg_match( $expected, $got ); + return proclaim( $pass, $desc, /* todo */ false, $got, $expected ); +} + +function unlike( $got, $expected, $desc = '' ) { + $pass = ! preg_match( $expected, $got ); + return proclaim( $pass, $desc, /* todo */ false, $got, $expected, /* negated */ true ); +} + +function cmp_ok($got, $op, $expected, $desc = '') +{ + $pass = null; + + /* See http://www.php.net/manual/en/language.operators.comparison.php */ + switch ($op) + { + case '==': + $pass = $got == $expected; + break; + case '===': + $pass = $got === $expected; + break; + case '!=': + case '<>': + $pass = $got != $expected; + break; + case '!==': + $pass = $got !== $expected; + break; + case '<': + $pass = $got < $expected; + break; + case '>': + $pass = $got > $expected; + break; + case '<=': + $pass = $got <= $expected; + break; + case '>=': + $pass = $got >= $expected; + break; + default: + if ( function_exists( $op ) ) { + $pass = $op( $got, $expected ); + } else { + die("No such operator or function $op\n"); + } + } + + return proclaim( $pass, $desc, /* todo */ false, $got, "$op $expected" ); +} + +function diag($message) +{ + if (is_array($message)) + { + $message = implode("\n", $message); + } + + $messages = explode("\n", $message); + + foreach ($messages as $msg) + { + echo "# $msg\n"; + } +} + +function include_ok( $file, $desc = '' ) +{ + $pass = include $file; + return proclaim( $pass, $desc == '' ? "include $file" : $desc ); +} + +function require_ok( $file, $desc = '' ) +{ + $pass = require $file; + return proclaim( $pass, $desc == '' ? "require $file" : $desc ); +} + +function is_deeply( $got, $expected, $desc = '' ) +{ + // hack + $s_got = serialize( $got ); + $s_exp = serialize( $expected ); + + $pass = $s_got == $s_exp; + + proclaim( $pass, $desc, /* todo */ false, $got, $expected ); +} + +function isa_ok( $obj, $expected, $desc = '' ) { + $name = get_class( $obj ); + $pass = $name == $expected; + proclaim( $pass, $desc, /* todo */ false, $name, $expected ); +} + +function proclaim( + $cond, // bool + $desc = '', + $todo = false, + $got = null, + $expected = null, + $negate = false ) { + + global $Test; + + $Test['run'] += 1; + + # TODO: force_todo + + # Everything after the first # is special, so escape user-supplied messages + $desc = str_replace( '#', '\\#', $desc ); + $desc = str_replace( "\n", '\\n', $desc ); + + $ok = $cond ? "ok" : "not ok"; + $directive = $todo === false ? '' : '# TODO aoeu'; + + printf( "%s %d %s%s\n", $ok, $Test['run'], $desc, $directive ); + + if ( ! $cond ) { + report_failure( $desc, $got, $expected, $negate, $todo ); + } + + return $cond; +} + +function report_failure( $desc, $got, $expected, $negate, $todo ) { + # Every public function in this file proclaim which then calls + # this function, so our culprit is the third item in the stack + $caller = debug_backtrace(); + $call = $caller['2']; + + diag( + sprintf( " Failed%stest '%s'\n in %s at line %d\n got: %s\n expected: %s", + $todo ? ' TODO ' : ' ', + $desc, + $call['file'], + $call['line'], + $got, + $expected + ) + ); +} + +function test_ends () +{ + global $Test; + + if ( $Test['planned'] === false ) { + printf( "1..%d\n", $Test['run'] ); + } +} + +/* + +=head1 TODO + +=over + +=item * Fully document this file + +=item * + +Add TODO support, maybe via C +C 'fix this'))>. + +=back + +=head1 SEE ALSO + +=over + +=item L - The TAP protocol + +=item L + +=item Pugs's Test.pm + +=back + +=head1 AUTHOR + +Ævar Arnfjörð Bjarmason + +=head1 LICENSING + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=cut + +*/ + +?> diff --git a/bin/svnstat b/bin/svnstat new file mode 100755 index 00000000..b134cdc2 --- /dev/null +++ b/bin/svnstat @@ -0,0 +1,2 @@ +#!/bin/sh +svn stat -v $1 | sed -n 's/^[ A-Z?\*|!]\{1,15\}/r/;s/ \{1,15\}/\/r/;s/ .*//p' diff --git a/bin/ulimit4.sh b/bin/ulimit4.sh new file mode 100755 index 00000000..2a840d2f --- /dev/null +++ b/bin/ulimit4.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +ulimit -t $1 -v $2 -f $3 +eval "$4" diff --git a/config/index.php b/config/index.php index 69394e69..d036e8c8 100644 --- a/config/index.php +++ b/config/index.php @@ -226,6 +226,26 @@ class ConfigData { function getSitename() { return $this->getEncoded( $this->Sitename ); } function getSysopName() { return $this->getEncoded( $this->SysopName ); } function getSysopPass() { return $this->getEncoded( $this->SysopPass ); } + + function setSchema( $schema ) { + $this->DBschema = $schema; + switch ( $this->DBschema ) { + case 'mysql5': + $this->DBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=utf8'; + $this->DBmysql5 = 'true'; + break; + case 'mysql5-binary': + $this->DBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=binary'; + $this->DBmysql5 = 'true'; + break; + default: + $this->DBTableOptions = 'TYPE=InnoDB'; + $this->DBmysql5 = 'false'; + } + # Set the global for use during install + global $wgDBTableOptions; + $wgDBTableOptions = $this->DBTableOptions; + } } ?> @@ -245,7 +265,7 @@ class ConfigData {
  • Fatal: zend.ze1_compatibility_mode is active! + This option causes horrible bugs with MediaWiki; you cannot install or use + MediaWiki unless this option is disabled. +

    Cannot install MediaWiki.

    " ); } @@ -360,20 +389,42 @@ if( $conf->xml ) { If you're running Mandrake, install the php-xml package." ); } -# Crude check for session support +# Check for session support if( !function_exists( 'session_name' ) ) dieout( "PHP's session module is missing. MediaWiki requires session support in order to function." ); -# Likewise for PCRE +# session.save_path doesn't *have* to be set, but if it is, and it's +# not valid/writable/etc. then it can cause problems +$sessionSavePath = ini_get( 'session.save_path' ); +# Warn the user if it's not set, but let them proceed +if( !$sessionSavePath ) { + print "
  • Warning: A value for session.save_path + has not been set in PHP.ini. If the default value causes problems with + saving session data, set it to a valid path which is read/write/execute + for the user your web server is running under.
  • "; +} elseif ( is_dir( $sessionSavePath ) && is_writable( $sessionSavePath ) ) { + # All good? Let the user know + print "
  • Session save path appears to be valid.
  • "; +} else { + # Something not right? Halt the installation so the user can fix it up + dieout( "Your session save path appears to be invalid or is not writable. + PHP needs to be able to save data to this location in order for correct + session operation. Please check that session.save_path in + PHP.ini points to a valid path, and is read/write/execute for + the user your web server is running under." ); +} + +# Check for PCRE support if( !function_exists( 'preg_match' ) ) - dieout( "The PCRE regular expression functions are missing. MediaWiki requires these in order to function." ); + dieout( "The PCRE support module appears to be missing. MediaWiki requires the + Perl-compatible regular expression functions." ); $memlimit = ini_get( "memory_limit" ); $conf->raiseMemory = false; if( empty( $memlimit ) || $memlimit == -1 ) { print "
  • PHP is configured with no memory_limit.
  • \n"; } else { - print "
  • PHP's memory_limit is " . htmlspecialchars( $memlimit ) . ". If this is too low, installation may fail! "; + print "
  • PHP's memory_limit is " . htmlspecialchars( $memlimit ) . ". "; $n = intval( $memlimit ); if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) { $n = intval( $m[1] * (1024*1024) ); @@ -381,7 +432,7 @@ if( empty( $memlimit ) || $memlimit == -1 ) { if( $n < 20*1024*1024 ) { print "Attempting to raise limit to 20M... "; if( false === ini_set( "memory_limit", "20M" ) ) { - print "failed."; + print "failed.
    " . htmlspecialchars( $memlimit ) . " seems too low, installation may fail!"; } else { $conf->raiseMemory = true; print "ok."; @@ -390,13 +441,6 @@ if( empty( $memlimit ) || $memlimit == -1 ) { print "
  • \n"; } -$conf->zlib = function_exists( "gzencode" ); -if( $conf->zlib ) { - print "
  • Have zlib support; enabling output compression.
  • \n"; -} else { - print "
  • No zlib support.
  • \n"; -} - $conf->turck = function_exists( 'mmcache_get' ); if ( $conf->turck ) { print "
  • Turck MMCache installed
  • \n"; @@ -415,7 +459,7 @@ if ( $conf->eaccel ) { if( !$conf->turck && !$conf->eaccel && !$conf->apc ) { echo( '
  • Couldn\'t find Turck MMCache, - eAccelerator or + eAccelerator, or APC. Object caching functions cannot be used.
  • ' ); } @@ -468,8 +512,6 @@ if( $conf->HaveGD ) { } } -$conf->UseImageResize = $conf->HaveGD || $conf->ImageMagick; - $conf->IP = dirname( dirname( __FILE__ ) ); print "
  • Installation directory: " . htmlspecialchars( $conf->IP ) . "
  • \n"; @@ -509,10 +551,7 @@ print "
  • Environment check ## MySQL specific: $conf->DBprefix = importPost( "DBprefix" ); - $conf->DBschema = importPost( "DBschema", "mysql4" ); - $conf->DBmysql5 = ($conf->DBschema == "mysql5" || - $conf->DBschema == "mysql5-binary") - ? "true" : "false"; + $conf->setSchema( importPost( "DBschema", "mysql4" ) ); $conf->LanguageCode = importPost( "LanguageCode", "en" ); ## Postgres specific: @@ -529,7 +568,10 @@ if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki" || $conf->Sitename = if( $conf->DBuser == "" ) { $errs["DBuser"] = "Must not be blank"; } -if( $conf->DBpassword == "" ) { +if( ($conf->DBtype == 'mysql') && (strlen($conf->DBuser) > 16) ) { + $errs["DBuser"] = "Username too long"; +} +if( $conf->DBpassword == "" && $conf->DBtype != "postgres" ) { $errs["DBpassword"] = "Must not be blank"; } if( $conf->DBpassword != $conf->DBpassword2 ) { @@ -654,7 +696,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { >http://dev.mysql.com/doc/mysql/en/old-client.html for help.
  • \n"; } $ok = true; # Let's be optimistic - + # Decide if we're going to use the superuser or the regular database user $conf->Root = $useRoot; if( $conf->Root ) { @@ -664,7 +706,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $db_user = $wgDBuser; $db_pass = $wgDBpassword; } - + # Attempt to connect echo( "
  • Attempting to connect to database server as $db_user..." ); $wgDatabase = Database::newFromParams( $wgDBserver, $db_user, $db_pass, '', 1 ); @@ -706,14 +748,14 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { break; } # switch } #conn. att. - + if( !$ok ) { continue; } } else /* not mysql */ { error_reporting( E_ALL ); $wgSuperUser = ''; ## Possible connect as a superuser - if( $conf->Root ) { + if( $useRoot ) { $wgDBsuperuser = $conf->RootUser; echo( "
  • Attempting to connect to database \"postgres\" as superuser \"$wgDBsuperuser\"..." ); $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBsuperuser, $conf->RootPW, "postgres", 1); @@ -797,6 +839,32 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { if( $wgDatabase->tableExists( "cur" ) || $wgDatabase->tableExists( "revision" ) ) { print "
  • There are already MediaWiki tables in this database. Checking if updates are needed...
  • \n"; + # Determine existing default character set + if ( $wgDatabase->tableExists( "revision" ) ) { + $revision = $wgDatabase->escapeLike( $conf->DBprefix . 'revision' ); + $res = $wgDatabase->query( "SHOW TABLE STATUS LIKE '$revision'" ); + $row = $wgDatabase->fetchObject( $res ); + if ( !$row ) { + echo "
  • SHOW TABLE STATUS query failed!
  • \n"; + $existingSchema = false; + } elseif ( preg_match( '/^latin1/', $row->Collation ) ) { + $existingSchema = 'mysql4'; + } elseif ( preg_match( '/^utf8/', $row->Collation ) ) { + $existingSchema = 'mysql5'; + } elseif ( preg_match( '/^binary/', $row->Collation ) ) { + $existingSchema = 'mysql5-binary'; + } else { + $existingSchema = false; + echo "
  • Warning: Unrecognised existing collation
  • \n"; + } + if ( $existingSchema && $existingSchema != $conf->DBschema ) { + print "
  • Warning: you requested the {$conf->DBschema} schema, " . + "but the existing database has the $existingSchema schema. This upgrade script ". + "can't convert it, so it will remain $existingSchema.
  • \n"; + $conf->setSchema( $existingSchema ); + } + } + # Create user if required (todo: other databases) if ( $conf->Root && $conf->DBtype == 'mysql') { $conn = $dbc->newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 ); @@ -812,33 +880,18 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { dbsource( "../maintenance/users.sql", $wgDatabase ); } } - print "
    \n";
    +			print "
    \n";
     			chdir( ".." );
     			flush();
     			do_all_updates();
     			chdir( "config" );
     			print "
    \n"; - print "
  • Finished update checks.
  • \n"; + print "
    • Finished update checks.
    • \n"; } else { # FIXME: Check for errors print "
    • Creating tables..."; if ($conf->DBtype == 'mysql') { - switch( $conf->DBschema ) { - case "mysql4": - print " using MySQL 4 table defs..."; - dbsource( "../maintenance/tables.sql", $wgDatabase ); - break; - case "mysql5": - print " using MySQL 5 UTF-8 table defs..."; - dbsource( "../maintenance/mysql5/tables.sql", $wgDatabase ); - break; - case "mysql5-binary": - print " using MySQL 5 binary table defs..."; - dbsource( "../maintenance/mysql5/tables-binary.sql", $wgDatabase ); - break; - default: - dieout( " invalid schema selection!
    • " ); - } + dbsource( "../maintenance/tables.sql", $wgDatabase ); dbsource( "../maintenance/interwiki.sql", $wgDatabase ); } else if ($conf->DBtype == 'postgres') { $wgDatabase->setup_database(); @@ -900,7 +953,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $newid = $article->insertOn( $wgDatabase ); $revision = new Revision( array( 'page' => $newid, - 'text' => wfMsg( 'mainpagetext' ) . "\n\n" . wfMsg( 'mainpagedocfooter' ), + 'text' => wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ), 'comment' => '', 'user' => 0, 'user_text' => 'MediaWiki default', @@ -912,7 +965,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { /* Write out the config file now that all is well */ print "
    • \n"; print "

      Creating LocalSettings.php...

      \n\n"; - $localSettings = "<" . "?php$endl$local$endl?" . ">\r\n"; + $localSettings = "<" . "?php$endl$local$endl\r\n"; // Fix up a common line-ending problem (due to CVS on Windows) $localSettings = str_replace( "\r\n", "\n", $localSettings ); $f = fopen( "LocalSettings.php", 'xt' ); @@ -1063,7 +1116,7 @@ if( count( $errs ) ) {

      Using a shared memory system such as Turck MMCache, APC, eAccelerator, or Memcached will speed up MediaWiki significantly. Memcached is the best solution but needs to be - installed. Specify the server addresses and ports in a comma-separted list. Only + installed. Specify the server addresses and ports in a comma-separated list. Only use Turck shared memory if the wiki will be running on a single Apache server.

    @@ -1079,7 +1132,7 @@ if( count( $errs ) ) {

    - Use this to disable all e-mail functions (password reminders, user-to-user e-mail and e-mail notifications) + Use this to disable all e-mail functions (password reminders, user-to-user e-mail, and e-mail notifications) if sending mail doesn't work on your server.

    @@ -1157,7 +1210,7 @@ if( count( $errs ) ) { enter those here. If you have database root access (see below) you can specify new accounts/databases to be created. This account will not be created if it pre-exists. If this is the case, ensure that it - has SELECT, INSERT, UPDATE and DELETE permissions on the MediaWiki database. + has SELECT, INSERT, UPDATE, and DELETE permissions on the MediaWiki database.

    @@ -1175,7 +1228,7 @@ if( count( $errs ) ) { aField( $conf, "RootPW", "Superuser password:", "password" ); ?>
    - +

    If the database user specified above does not exist, or does not have access to create the database (if needed) or tables within it, please check the box and provide details @@ -1188,7 +1241,7 @@ if( count( $errs ) ) { ?>

    If you need to share one database between multiple wikis, or - MediaWiki and another web application, you may choose to + between MediaWiki and another web application, you may choose to add a prefix to all the table names to avoid conflicts.

    Avoid exotic characters; something like mw_ is good.

    @@ -1221,8 +1274,9 @@ if( count( $errs ) ) { aField( $conf, "DBts2schema", "Schema for tsearch2:" ); ?>
    -

    The username specified above will have it's search path set to the above schemas, - so it is recommended that you create a new user.

    +

    The username specified above (at "DB username") will have its search path set to the above schemas, + so it is recommended that you create a new user. The above schemas are generally correct: + only change them if you are sure you need to.

    @@ -1283,9 +1337,7 @@ function escapePhpString( $string ) { } function writeLocalSettings( $conf ) { - $conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false'; $conf->PasswordSender = $conf->EmergencyContact; - $zlib = ($conf->zlib ? "" : "# "); $magic = ($conf->ImageMagick ? "" : "# "); $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" ); $rights = ($conf->RightsUrl) ? "" : "# "; @@ -1380,10 +1432,9 @@ if ( \$wgCommandLineMode ) { if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) { die( \"This script must be run from the command line\\n\" ); } -} elseif ( empty( \$wgNoOutputBuffer ) ) { - ## Compress output if the browser supports it - {$zlib}if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' ); } +## Uncomment this to disable output compression +# \$wgDisableOutputCompression = true; \$wgSitename = \"{$slconf['Sitename']}\"; @@ -1417,6 +1468,9 @@ if ( \$wgCommandLineMode ) { \$wgDBport = \"{$slconf['DBport']}\"; \$wgDBprefix = \"{$slconf['DBprefix']}\"; +# MySQL table options to use during installation or update +\$wgDBTableOptions = \"{$slconf['DBTableOptions']}\"; + # Schemas for Postgres \$wgDBmwschema = \"{$slconf['DBmwschema']}\"; \$wgDBts2schema = \"{$slconf['DBts2schema']}\"; @@ -1431,7 +1485,6 @@ if ( \$wgCommandLineMode ) { ## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: \$wgEnableUploads = false; -\$wgUseImageResize = {$conf->UseImageResize}; {$magic}\$wgUseImageMagick = true; {$magic}\$wgImageMagickConvertCommand = \"{$convert}\"; diff --git a/docs/database.txt b/docs/database.txt index 25dce8b7..80044734 100644 --- a/docs/database.txt +++ b/docs/database.txt @@ -7,7 +7,7 @@ By Tim Starling, January 2006. For information about the MediaWiki database layout, such as a description of the tables and their contents, please see: - http://meta.wikimedia.org/wiki/Help:Database_layout + http://www.mediawiki.org/wiki/Manual:Database_layout http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/tables.sql?view=markup @@ -17,7 +17,7 @@ description of the tables and their contents, please see: To make a read query, something like this usually suffices: -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( /* ...see docs... */ ); while ( $row = $dbr->fetchObject( $res ) ) { ... @@ -28,7 +28,7 @@ Note the assignment operator in the while condition. For a write query, use something like: -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $dbw->insert( /* ...see docs... */ ); We use the convention $dbr for read and $dbw for write to help you keep @@ -103,7 +103,7 @@ regularly lag by several minutes, making review of recent edits difficult. In addition to this, MediaWiki attempts to ensure that the user sees -events occuring on the wiki in chronological order. A few seconds of lag +events occurring on the wiki in chronological order. A few seconds of lag can be tolerated, as long as the user sees a consistent picture from subsequent requests. This is done by saving the master binlog position in the session, and then at the start of each request, waiting for the @@ -157,7 +157,7 @@ Often this approach is not good enough, and it becomes necessary to enclose small groups of queries in their own transaction. Use the following syntax: -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $dbw->immediateBegin(); /* Do queries */ $dbw->immediateCommit(); diff --git a/docs/deferred.txt b/docs/deferred.txt index 445eb0e4..06155c56 100644 --- a/docs/deferred.txt +++ b/docs/deferred.txt @@ -17,3 +17,11 @@ smart like collating updates to the same table or such because the list is almost always going to have just one item on it, if that, so it's not worth the trouble. + +Since 1.6 there is a 'job queue' in the jobs table, which is used +to update link tables of transcluding pages after edits; this +may be extended in the future to more general background tasks. + +Job queue items are fetched out of the queue and run either +at a random rate during regular page views (by default) or by +a batch process which can be run via maintenance/runJobs.php. diff --git a/docs/design.txt b/docs/design.txt index 5fff9fd0..8f24d0d8 100644 --- a/docs/design.txt +++ b/docs/design.txt @@ -1,5 +1,8 @@ This is a brief overview of the new design. +More thorough and up-to-date information is available on the documentation +wiki at http://www.mediawiki.org/ + Primary source files/objects: index.php @@ -42,10 +45,15 @@ Primary source files/objects: don't involve their text, such as access rights. Article - Encapsulates access to the "cur" table of the database. The + Encapsulates access to the "page" table of the database. The object represents a an article, and maintains state such as text (in Wikitext format), flags, etc. + Revision + Encapsulates individual page revision data and access to the + revision/text/blobs storage system. Higher-level code should + never touch text storage directly; this class mediates it. + Skin Encapsulates a "look and feel" for the wiki. All of the functions that render HTML, and make choices about how to @@ -117,12 +125,3 @@ Naming/coding conventions: of session variables are wsName, cookies wcName, and form field values wpName ("p" for "POST"). - - Be kind to your release manager and don't use CVS keywords (Id, - Revision, etc.) to mark file versions. They make merging code - between different branches a pain for CVS, and are kind of sketchy - for versions after that. (Yes, you can use the '-kk' flag so that - merges ignore keywords, but that messes up binary files. See - https://www.cvshome.org/docs/manual/cvs-1.11.18/cvs_5.html#SEC64). - - - diff --git a/docs/hooks.txt b/docs/hooks.txt index d5a17660..9f5d289f 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -286,6 +286,11 @@ $isminor: minor flag $iswatch: watch flag $section: section # +'ArticleUndeleted': When one or more revisions of an article are restored +$title: Title corresponding to the article restored +$create: Whether or not the restoration caused the page to be created +(i.e. it didn't exist before) + 'AuthPluginSetup': update or replace authentication plugin object ($wgAuth) Gives a chance for an extension to set it programattically to a variable class. &$auth: the $wgAuth object, probably a stub @@ -308,6 +313,18 @@ $user: the user _doing_ the block (not the one being blocked) $block: the Block object that was saved $user: the user who did the block (not the one being blocked) +'BookInformation': Before information output on Special:Booksources +$isbn: ISBN to show information for +$output: OutputPage object in use + +'CustomEditor': When invoking the page editor +$article: Article being edited +$user: User performing the edit + +Return true to allow the normal editor to be used, or false +if implementing a custom editor, e.g. for a special namespace, +etc. + 'DiffViewHeader': called before diff display $diff: DifferenceEngine object that's calling $oldRev: Revision object of the "old" revision (may be null/invalid) @@ -321,6 +338,11 @@ saved, that is before insertNewArticle() is called &$text: Text to preload with &$title: Title object representing the page being created +'EditPage::showEditForm:fields': allows injection of form field into edit form +&$editor: the EditPage instance for reference +&$out: an OutputPage instance to write to +return value is ignored (should always return true) + 'EditFilter': Perform checks on an edit $editor: Edit form (see includes/EditPage.php) $text: Contents of the edit box @@ -356,6 +378,9 @@ $text: text of the mail &$list: List object (defaults to NULL, change it to an object instance and return false override the list derivative used) +'FileUpload': When a file upload occurs +$file : Image object representing the file that was uploaded + 'GetInternalURL': modify fully-qualified URLs used for squid cache purging $title: Title object of page $url: string value as output (out parameter, can modify) @@ -371,6 +396,12 @@ $title: Title object of page $url: string value as output (out parameter, can modify) $query: query options passed to Title::getFullURL() +'InternalParseBeforeLinks': during Parser's internalParse method before links but +after noinclude/includeonly/onlyinclude and other processing. +&$this: Parser object +&$text: string containing partially parsed text +&$this->mStripState: Parser's internal StripState object + 'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes &$type: array of strings @@ -405,11 +436,23 @@ the resulting HTML is about to be displayed. $parserOutput: the parserOutput (object) that corresponds to the page $text: the text that will be displayed, in HTML (string) +'PageHistoryBeforeList': When a history page list is about to be constructed. +$article: the article that the history is loading for + +'PageHistoryLineEnding' : right before the end
  • is added to a history line +$row: the revision row for this line +$s: the string representing this parsed line + 'PageRenderingHash': alter the parser cache option hash key A parser extension which depends on user options should install this hook and append its values to the key. $hash: reference to a hash key string which can be modified +'ParserTestTables': alter the list of tables to duplicate when parser tests +are run. Use when page save hooks require the presence of custom tables +to ensure that tests continue to run properly. +&$tables: array of table names + 'PersonalUrls': Alter the user-specific navigation links (e.g. "my page, my talk page, my contributions" etc). @@ -427,6 +470,16 @@ the built-in rate limiting checks are used, if enabled. $form : PreferencesForm object &$html : HTML to append to +'RawPageViewBeforeOutput': Right before the text is blown out in action=raw +&$obj: RawPage object +&$text: The text that's going to be the output + +'SearchUpdate': Prior to search update completion +$id : Page id +$namespace : Page namespace +$title : Page title +$text : Current text being indexed + 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed &$siteNotice: HTML returned as the sitenotice Return true to allow the normal method of notice selection/rendering to work, @@ -436,6 +489,10 @@ or change the value of $siteNotice and return false to alter it. &$siteNotice: HTML sitenotice Alter the contents of $siteNotice to add to/alter the sitenotice/anonnotice. +'SkinTemplateOutputPageBeforeExec': Before SkinTemplate::outputPage() starts page output +&$sktemplate: SkinTemplate object +&$tpl: Template engine object + 'TitleMoveComplete': after moving an article (title) $old: old title $nt: new title @@ -529,5 +586,9 @@ $content_actions: The array of content actions Can be used to set custom CSS/JS $out: OutputPage object +'AjaxAddScript': Called in output page just before the initialisation +of the javascript ajax engine. The hook is only called when ajax +is enabled ( $wgUseAjax = true; ). + More hooks might be available but undocumented, you can execute ./maintenance/findhooks.php to find hidden one. diff --git a/docs/memcached.txt b/docs/memcached.txt index 6752e9c8..d4e2915f 100644 --- a/docs/memcached.txt +++ b/docs/memcached.txt @@ -29,7 +29,6 @@ can run multiple servers on one machine or on multiple machines on a network; storage can be distributed across multiple servers, and multiple web servers can use the same cache cluster. - ********************* W A R N I N G ! ! ! ! ! *********************** Memcached has no security or authentication. Please ensure that your server is appropriately firewalled, and that the port(s) used for @@ -54,8 +53,8 @@ on port 11000, using up to 64MB of memory) In your LocalSettings.php file, set: - $wgUseMemCached = true; - $wgMemCachedServers = array( "127.0.0.1:11000" ); + $wgMainCacheType = CACHE_MEMCACHED;; + $wgMemCachedServers = array( "127.0.0.1:11000" ); The wiki should then use memcached to cache various data. To use multiple servers (physically separate boxes or multiple caches @@ -66,10 +65,9 @@ usage evenly), make its entry a subarray: $wgMemCachedServers = array( "127.0.0.1:11000", # one gig on this box - array("192.168.0.1:11000", 2) # two gigs on the other box + array("192.168.0.1:11000", 2 ) # two gigs on the other box ); - == PHP client for memcached == As of this writing, MediaWiki includes version 1.0.10 of the PHP @@ -129,4 +127,4 @@ IP blocks: stores: array of arrays, for the BlockCache class cleared by: BlockCache:clear() -... more to come ... +... more to come ... \ No newline at end of file diff --git a/docs/title.txt b/docs/title.txt index b404bd3c..5d9bd417 100644 --- a/docs/title.txt +++ b/docs/title.txt @@ -35,9 +35,14 @@ and the colon is just removed. Note that because of these rules, it is possible to have articles with colons in their names. "E. Coli 0157:H7" is a valid title, as is "2001: A Space Odyssey", because "E. Coli 0157" and "2001" are not valid -interwikis or namespaces. Likewise, ":de:name" is a link to -the article "de:name"--even though "de" is a valid interwiki, -the initial colon stops all prefix matching. +interwikis or namespaces. + +It is not possible to have an article whose bare name includes +a namespace or interwiki prefix. + +An initial colon in a title listed in wiki text may however +suppress special handling for interlanguage links, image links, +and category links. Character mapping rules: Once prefixes have been stripped, the rest of the title processed this way: spaces and underscores are @@ -64,9 +69,9 @@ lowercase. The namespace will use underscores when returned alone; it will use spaces only when attached to the text title. getArticleID() needs some explanation: for "internal" articles, -it should return the "cur_id" field if the article exists, else +it should return the "page_id" field if the article exists, else it returns 0. For all external articles it returns 0. All of the IDs for all instances of Title created during a request are -cached, so they can be looked up wuickly while rendering wiki +cached, so they can be looked up quickly while rendering wiki text with lots of internal links. diff --git a/extensions/FunnyDot.php b/extensions/FunnyDot.php index 418575e2..d9d932ae 100644 --- a/extensions/FunnyDot.php +++ b/extensions/FunnyDot.php @@ -1,9 +1,6 @@ 'FunnyDot', @@ -12,13 +9,15 @@ $wgExtensionCredits['other'][] = array( 'url' => 'http://www.laber-land.de', ); -function hexVal($in) +class FunnyDot { + +private static function hexVal($in) { $result = preg_replace('/[^0-9a-fA-F]/', '', $in); return (empty($result) ? 0 : $result); } -function checkAntiSpamHash() +public static function checkAntiSpamHash() { global $wgAntiSpamHash, $wgAntiSpamTimeout, $wgAntiSpamWait; @@ -27,7 +26,7 @@ function checkAntiSpamHash() if (!empty($_COOKIE['AntiSpamTime']) && !empty($_COOKIE['AntiSpamHash'])) { $time = intval($_COOKIE['AntiSpamTime']); - $hash = hexVal($_COOKIE['AntiSpamHash']); + $hash = self::hexVal($_COOKIE['AntiSpamHash']); if ($hash != sha1($time.$wgAntiSpamHash)) { @@ -51,5 +50,6 @@ function checkAntiSpamHash() return true; } -} # End invocation guard +} + ?> \ No newline at end of file diff --git a/extensions/LLAuthPlugin.php b/extensions/LLAuthPlugin.php index 2d903b28..f5bb718f 100644 --- a/extensions/LLAuthPlugin.php +++ b/extensions/LLAuthPlugin.php @@ -1,40 +1,6 @@ -# http://www.mediawiki.org/ -# -# 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 -/** - * Authentication plugin interface. Instantiate a subclass of AuthPlugin - * and set $wgAuth to it to authenticate against some external tool. - * - * The default behavior is not to do anything, and use the local user - * database for all authentication. A subclass can require that all - * accounts authenticate externally, or use it only as a fallback; also - * you can transparently create internal wiki accounts the first time - * someone logs in who can be authenticated externally. - * - * This interface is new, and might change a bit before 1.4.0 final is - * done... - * - * @package MediaWiki - */ +$wgHooks['isValidPassword'][] = 'LLAuthPlugin::isValidPassword'; $wgExtensionCredits['other'][] = array( 'name' => 'LLAuthPlugin', @@ -47,218 +13,92 @@ require_once('includes/AuthPlugin.php'); class LLAuthPlugin extends AuthPlugin { + public static function isValidPassword($password) { + $length = strlen($password); + return ($length >= 6 && $length <= 25); + } + private $dbLink = null; - function __construct() - { + function __construct() { global $wgDBuser, $wgDBpassword; $this->dbLink = mysqli_connect('localhost', $wgDBuser, $wgDBpassword, 'current'); - } + } - function __destruct() - { + function __destruct() { mysqli_close($this->dbLink); - } + } - function getUserData($username) - { + function getUserData($username) { $result = mysqli_query($this->dbLink, 'SELECT id, email, realname FROM users WHERE name = \''.mysqli_escape_string($this->dbLink, $username).'\''); $data = mysqli_fetch_assoc($result); mysqli_free_result($result); return $data; - } - /** - * Check whether there exists a user account with the given name. - * The name will be normalized to MediaWiki's requirements, so - * you might need to munge it (for instance, for lowercase initial - * letters). - * - * @param $username String: username. - * @return bool - * @public - */ + } + function userExists( $username ) { $result = mysqli_query($this->dbLink, 'SELECT id FROM users WHERE name = \''.mysqli_escape_string($this->dbLink, $username).'\''); $exists = mysqli_num_rows($result) > 0; mysqli_free_result($result); - return $exists; + return $exists; } - /** - * Check if a username+password pair is a valid login. - * The name will be normalized to MediaWiki's requirements, so - * you might need to munge it (for instance, for lowercase initial - * letters). - * - * @param $username String: username. - * @param $password String: user password. - * @return bool - * @public - */ function authenticate( $username, $password ) { $result = mysqli_query($this->dbLink, 'SELECT id FROM users WHERE name = \''.mysqli_escape_string($this->dbLink, $username).'\' AND password = \''.mysqli_escape_string($this->dbLink, sha1($password)).'\' '); $authenticated = mysqli_num_rows($result) > 0; mysqli_free_result($result); - return $authenticated; + return $authenticated; } - /** - * Modify options in the login template. - * - * @param $template UserLoginTemplate object. - * @public - */ function modifyUITemplate( &$template ) { - # Override this! $template->set( 'usedomain', false ); $template->set('link', 'Um Dich hier anzumelden, nutze Deine Konto-Daten aus dem archlinux.de-Forum.'); } - /** - * Set the domain this plugin is supposed to use when authenticating. - * - * @param $domain String: authentication domain. - * @public - */ function setDomain( $domain ) { $this->domain = $domain; } - /** - * Check to see if the specific domain is a valid domain. - * - * @param $domain String: authentication domain. - * @return bool - * @public - */ function validDomain( $domain ) { - # Override this! return true; } - /** - * When a user logs in, optionally fill in preferences and such. - * For instance, you might pull the email address or real name from the - * external user database. - * - * The User object is passed by reference so it can be modified; don't - * forget the & on your function declaration. - * - * @param User $user - * @public - */ function updateUser( &$user ) { return $this->initUser($user); } - - /** - * Return true if the wiki should create a new local account automatically - * when asked to login a user who doesn't exist locally but does in the - * external auth database. - * - * If you don't automatically create accounts, you must still create - * accounts in some way. It's not possible to authenticate without - * a local account. - * - * This is just a question, and shouldn't perform any actions. - * - * @return bool - * @public - */ function autoCreate() { return true; } - /** - * Can users change their passwords? - * - * @return bool - */ function allowPasswordChange() { - return true; + return false; } - /** - * Set the given password in the authentication database. - * As a special case, the password may be set to null to request - * locking the password to an unusable value, with the expectation - * that it will be set later through a mail reset or other method. - * - * Return true if successful. - * - * @param $user User object. - * @param $password String: password. - * @return bool - * @public - */ function setPassword( $user, $password ) { - return true; + return false; } - /** - * Update user information in the external authentication database. - * Return true if successful. - * - * @param $user User object. - * @return bool - * @public - */ function updateExternalDB( $user ) { + // this way userdata is allways overwritten by external db return $this->initUser($user); } - /** - * Check to see if external accounts can be created. - * Return true if external accounts can be created. - * @return bool - * @public - */ function canCreateAccounts() { return false; } - /** - * Add a user to the external authentication database. - * Return true if successful. - * - * @param User $user - * @param string $password - * @return bool - * @public - */ - function addUser( $user, $password ) { + function addUser( $user, $password, $email = '', $realname = '' ) { return false; } - - /** - * Return true to prevent logins that don't authenticate here from being - * checked against the local database's password fields. - * - * This is just a question, and shouldn't perform any actions. - * - * @return bool - * @public - */ function strict() { return true; } - /** - * When creating a user account, optionally fill in preferences and such. - * For instance, you might pull the email address or real name from the - * external user database. - * - * The User object is passed by reference so it can be modified; don't - * forget the & on your function declaration. - * - * @param $user User object. - * @public - */ function initUser( &$user ) { $data = $this->getUserData($user->getName()); $user->setEmail($data['email']); @@ -267,10 +107,6 @@ class LLAuthPlugin extends AuthPlugin { return true; } - /** - * If you want to munge the case of an account name before the final - * check, now is your chance. - */ function getCanonicalName( $username ) { return $username; } diff --git a/extensions/README b/extensions/README index cc931160..85f4943b 100644 --- a/extensions/README +++ b/extensions/README @@ -1,3 +1,14 @@ -Some extensions (such as the hieroglyphic module WikiHiero) are -distributed separately. Drop them into this extensions directory -and enable as per the extension's directions. +Extensions (such as the hieroglyphic module WikiHiero) are distributed +separately. Drop them into this extensions directory and enable as +per the extension's directions. + +If you are a developer, you want to fetch the extension tree in another +directory and make a symbolic link: + + mediawiki/extensions$ ln -s ../../extensions-trunk/FooBarExt + +The extensions are available through svn at: + http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ + +You can find documentation and additional extensions on MediaWiki website: + http://www.mediawiki.org/wiki/Category:Extensions diff --git a/img_auth.php b/img_auth.php index e0a6459f..11684b37 100644 --- a/img_auth.php +++ b/img_auth.php @@ -7,6 +7,7 @@ * to an array of pages you want everyone to be able to access. Your server must * support PATH_INFO, CGI-based configurations generally don't. */ +define( 'MW_NO_OUTPUT_COMPRESSION', 1 ); require_once( './includes/WebStart.php' ); wfProfileIn( 'img_auth.php' ); require_once( './includes/StreamFile.php' ); diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 39ec19f8..ca129029 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -1,7 +1,8 @@ mode = ""; @@ -28,14 +33,14 @@ class AjaxDispatcher { } if ($this->mode == "get") { - $this->func_name = $_GET["rs"]; + $this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : ''; if (! empty($_GET["rsargs"])) { $this->args = $_GET["rsargs"]; } else { $this->args = array(); } } else { - $this->func_name = $_POST["rs"]; + $this->func_name = isset( $_POST["rs"] ) ? $_POST["rs"] : ''; if (! empty($_POST["rsargs"])) { $this->args = $_POST["rsargs"]; } else { @@ -47,7 +52,7 @@ class AjaxDispatcher { function performAction() { global $wgAjaxExportList, $wgOut; - + if ( empty( $this->mode ) ) { return; } @@ -59,7 +64,7 @@ class AjaxDispatcher { } else { try { $result = call_user_func_array($this->func_name, $this->args); - + if ( $result === false || $result === NULL ) { wfHttpError( 500, 'Internal Error', "{$this->func_name} returned no data" ); @@ -68,7 +73,7 @@ class AjaxDispatcher { if ( is_string( $result ) ) { $result= new AjaxResponse( $result ); } - + $result->sendHeaders(); $result->printText(); } @@ -82,7 +87,7 @@ class AjaxDispatcher { } } } - + wfProfileOut( __METHOD__ ); $wgOut = null; } diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index eee2a1a4..86f853db 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -1,7 +1,13 @@ ucfirst( @@ -81,7 +86,7 @@ function wfSajaxSearch( $term ) { if ( strlen( str_replace( '_', '', $term ) )<3 ) return; - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $res = $db->select( 'page', 'page_title', array( 'page_namespace' => 0, "page_title LIKE '". $db->strencode( $term) ."%'" ), @@ -108,8 +113,8 @@ function wfSajaxSearch( $term ) { $subtitlemsg = ( Title::newFromText($term) ? 'searchsubtitle' : 'searchsubtitleinvalid' ); $subtitle = $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ); #FIXME: parser is missing mTitle ! - $term = htmlspecialchars( $term ); - $html = '
    ' + $term = urlencode( $term ); + $html = '' . '

    '.wfMsg('search') . '

    '. $subtitle . '
    • ' @@ -121,11 +126,11 @@ function wfSajaxSearch( $term ) { "search=$term&go=Go" ) . "

    " . wfMsg( 'articletitles', $term ) . "

    " . '
      ' .$r .'
    '.$more; - + $response = new AjaxResponse( $html ); - + $response->setCacheDuration( 30*60 ); - + return $response; } @@ -152,14 +157,14 @@ function wfAjaxWatch($pageID = "", $watch = "") { if($watch) { if(!$watching) { - $dbw =& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); $dbw->begin(); $article->doWatch(); $dbw->commit(); } } else { if($watching) { - $dbw =& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); $dbw->begin(); $article->doUnwatch(); $dbw->commit(); diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index a59c73bb..cb4af1b5 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -1,28 +1,32 @@ mCacheDuration = NULL; $this->mVary = NULL; - + $this->mDisabled = false; $this->mText = ''; $this->mResponseCode = '200 OK'; $this->mLastModified = false; $this->mContentType= 'text/html; charset=utf-8'; - + if ( $text ) { $this->addText( $text ); } @@ -39,15 +43,15 @@ class AjaxResponse { function setResponseCode( $code ) { $this->mResponseCode = $code; } - + function setContentType( $type ) { $this->mContentType = $type; } - + function disable() { $this->mDisabled = true; } - + function addText( $text ) { if ( ! $this->mDisabled && $text ) { $this->mText .= $text; @@ -59,62 +63,62 @@ class AjaxResponse { print $this->mText; } } - + function sendHeaders() { global $wgUseSquid, $wgUseESI; - + if ( $this->mResponseCode ) { $n = preg_replace( '/^ *(\d+)/', '\1', $this->mResponseCode ); header( "Status: " . $this->mResponseCode, true, (int)$n ); } - + header ("Content-Type: " . $this->mContentType ); - + if ( $this->mLastModified ) { header ("Last-Modified: " . $this->mLastModified ); } else { header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); } - + if ( $this->mCacheDuration ) { - + # If squid caches are configured, tell them to cache the response, # and tell the client to always check with the squid. Otherwise, # tell the client to use a cached copy, without a way to purge it. - + if( $wgUseSquid ) { - + # Expect explicite purge of the proxy cache, but require end user agents # to revalidate against the proxy on each visit. # Surrogate-Control controls our Squid, Cache-Control downstream caches - + if ( $wgUseESI ) { header( 'Surrogate-Control: max-age='.$this->mCacheDuration.', content="ESI/1.0"'); header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' ); } else { header( 'Cache-Control: s-maxage='.$this->mCacheDuration.', must-revalidate, max-age=0' ); } - + } else { - + # Let the client do the caching. Cache is not purged. header ("Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->mCacheDuration ) . " GMT"); header ("Cache-Control: s-max-age={$this->mCacheDuration},public,max-age={$this->mCacheDuration}"); } - + } else { # always expired, always modified header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 } - + if ( $this->mVary ) { header ( "Vary: " . $this->mVary ); } } - + /** * checkLastModified tells the client to use the client-cached response if * possible. If sucessful, the AjaxResponse is disabled so that @@ -154,9 +158,9 @@ class AjaxResponse { $this->setResponseCode( "304 Not Modified" ); $this->disable(); $this->mLastModified = $lastmod; - + wfDebug( "$fname: CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false ); - + return true; } else { wfDebug( "$fname: READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false ); @@ -167,11 +171,11 @@ class AjaxResponse { $this->mLastModified = $lastmod; } } - + function loadFromMemcached( $mckey, $touched ) { global $wgMemc; if ( !$touched ) return false; - + $mcvalue = $wgMemc->get( $mckey ); if ( $mcvalue ) { # Check to see if the value has been invalidated @@ -183,20 +187,20 @@ class AjaxResponse { wfDebug( "$mckey has expired\n" ); } } - + return false; } - + function storeInMemcached( $mckey, $expiry = 86400 ) { global $wgMemc; - - $wgMemc->set( $mckey, + + $wgMemc->set( $mckey, array( 'timestamp' => wfTimestampNow(), 'value' => $this->mText ), $expiry ); - + return true; } } diff --git a/includes/Article.php b/includes/Article.php index 6b4f5270..0130ceba 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1,7 +1,6 @@ mTitle =& $title; $this->mOldId = $oldId; $this->clear(); @@ -57,14 +55,14 @@ class Article { function setRedirectedFrom( $from ) { $this->mRedirectedFrom = $from; } - + /** * @return mixed false, Title of in-wiki target, or string with URL */ function followRedirect() { $text = $this->getContent(); $rt = Title::newFromRedirect( $text ); - + # process if title object is valid and not special:userlogout if( $rt ) { if( $rt->getInterwiki() != '' ) { @@ -73,7 +71,7 @@ class Article { // // This can be hard to reverse and may produce loops, // so they may be disabled in the site configuration. - + $source = $this->mTitle->getFullURL( 'redirect=no' ); return $rt->getFullURL( 'rdfrom=' . urlencode( $source ) ); } @@ -84,7 +82,7 @@ class Article { // the rest of the page we're on. // // This can be hard to reverse, so they may be disabled. - + if( $rt->isSpecial( 'Userlogout' ) ) { // rolleyes } else { @@ -94,7 +92,7 @@ class Article { return $rt; } } - + // No or invalid redirect return false; } @@ -247,7 +245,7 @@ class Article { * @param array $conditions * @private */ - function pageData( &$dbr, $conditions ) { + function pageData( $dbr, $conditions ) { $fields = array( 'page_id', 'page_namespace', @@ -273,7 +271,7 @@ class Article { * @param Database $dbr * @param Title $title */ - function pageDataFromTitle( &$dbr, $title ) { + function pageDataFromTitle( $dbr, $title ) { return $this->pageData( $dbr, array( 'page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey() ) ); @@ -283,7 +281,7 @@ class Article { * @param Database $dbr * @param int $id */ - function pageDataFromId( &$dbr, $id ) { + function pageDataFromId( $dbr, $id ) { return $this->pageData( $dbr, array( 'page_id' => $id ) ); } @@ -296,17 +294,18 @@ class Article { */ function loadPageData( $data = 'fromdb' ) { if ( $data === 'fromdb' ) { - $dbr =& $this->getDB(); + $dbr = $this->getDB(); $data = $this->pageDataFromId( $dbr, $this->getId() ); } - + $lc =& LinkCache::singleton(); if ( $data ) { $lc->addGoodLinkObj( $data->page_id, $this->mTitle ); $this->mTitle->mArticleID = $data->page_id; + + # Old-fashioned restrictions. $this->mTitle->loadRestrictions( $data->page_restrictions ); - $this->mTitle->mRestrictionsLoaded = true; $this->mCounter = $data->page_counter; $this->mTouched = wfTimestamp( TS_MW, $data->page_touched ); @@ -333,7 +332,7 @@ class Article { return $this->mContent; } - $dbr =& $this->getDB(); + $dbr = $this->getDB(); # Pre-fill content with error message so that if something # fails we'll have something telling us what we intended. @@ -405,9 +404,8 @@ class Article { * * @return Database */ - function &getDB() { - $ret =& wfGetDB( DB_MASTER ); - return $ret; + function getDB() { + return wfGetDB( DB_MASTER ); } /** @@ -455,7 +453,7 @@ class Article { if ( $id == 0 ) { $this->mCounter = 0; } else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $this->mCounter = $dbr->selectField( 'page', 'page_counter', array( 'page_id' => $id ), 'Article::getCount', $this->getSelectOptions() ); } @@ -471,12 +469,12 @@ class Article { * @return bool */ function isCountable( $text ) { - global $wgUseCommaCount, $wgContentNamespaces; + global $wgUseCommaCount; $token = $wgUseCommaCount ? ',' : '[['; return - array_search( $this->mTitle->getNamespace(), $wgContentNamespaces ) !== false - && ! $this->isRedirect( $text ) + $this->mTitle->isContentPage() + && !$this->isRedirect( $text ) && in_string( $token, $text ); } @@ -573,7 +571,7 @@ class Article { # XXX: this is expensive; cache this info somewhere. $contribs = array(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $revTable = $dbr->tableName( 'revision' ); $userTable = $dbr->tableName( 'user' ); $user = $this->getUser(); @@ -613,7 +611,7 @@ class Article { $parserCache =& ParserCache::singleton(); $ns = $this->mTitle->getNamespace(); # shortcut - + # Get variables from query string $oldid = $this->getOldID(); @@ -627,16 +625,21 @@ class Article { $diff = $wgRequest->getVal( 'diff' ); $rcid = $wgRequest->getVal( 'rcid' ); $rdfrom = $wgRequest->getVal( 'rdfrom' ); + $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) ); $wgOut->setArticleFlag( true ); - if ( isset( $wgNamespaceRobotPolicies[$ns] ) ) { + + # Discourage indexing of printable versions, but encourage following + if( $wgOut->isPrintable() ) { + $policy = 'noindex,follow'; + } elseif( isset( $wgNamespaceRobotPolicies[$ns] ) ) { + # Honour customised robot policies for this namespace $policy = $wgNamespaceRobotPolicies[$ns]; } else { - # The default policy. Dev note: make sure you change the documentation - # in DefaultSettings.php before changing it. + # Default to encourage indexing and following links $policy = 'index,follow'; } - $wgOut->setRobotpolicy( $policy ); + $wgOut->setRobotPolicy( $policy ); # If we got diff and oldid in the query, we want to see a # diff page instead of the article. @@ -647,8 +650,8 @@ class Article { $de = new DifferenceEngine( $this->mTitle, $oldid, $diff, $rcid ); // DifferenceEngine directly fetched the revision: $this->mRevIdFetched = $de->mNewid; - $de->showDiffPage(); - + $de->showDiffPage( $diffOnly ); + // Needed to get the page's current revision $this->loadPageData(); if( $diff == 0 || $diff == $this->mLatest ) { @@ -658,7 +661,7 @@ class Article { wfProfileOut( __METHOD__ ); return; } - + if ( empty( $oldid ) && $this->checkTouched() ) { $wgOut->setETag($parserCache->getETag($this, $wgUser)); @@ -713,11 +716,11 @@ class Article { $wasRedirected = true; } } - + $outputDone = false; + wfRunHooks( 'ArticleViewHeader', array( &$this ) ); if ( $pcache ) { if ( $wgOut->tryParserCache( $this, $wgUser ) ) { - wfRunHooks( 'ArticleViewHeader', array( &$this ) ); $outputDone = true; } } @@ -764,17 +767,12 @@ class Article { } } if( !$outputDone ) { - /** - * @fixme: this hook doesn't work most of the time, as it doesn't - * trigger when the parser cache is used. - */ - wfRunHooks( 'ArticleViewHeader', array( &$this ) ) ; $wgOut->setRevisionId( $this->getRevIdFetched() ); # wrap user css and user js in pre and don't parse # XXX: use $this->mTitle->usCssJsSubpage() when php is fixed/ a workaround is found if ( $ns == NS_USER && - preg_match('/\\/[\\w]+\\.(css|js)$/', $this->mTitle->getDBkey()) + preg_match('/\\/[\\w]+\\.(?:css|js)$/', $this->mTitle->getDBkey()) ) { $wgOut->addWikiText( wfMsg('clearyourcache')); $wgOut->addHTML( '
    '.htmlspecialchars($this->mContent)."\n
    " ); @@ -795,7 +793,7 @@ class Article { $wgOut->addParserOutputNoText( $parseout ); } else if ( $pcache ) { # Display content and save to parser cache - $wgOut->addPrimaryWikiText( $text, $this ); + $this->outputWikiText( $text ); } else { # Display content, don't attempt to save to parser cache # Don't show section-edit links on old revisions... this way lies madness. @@ -803,11 +801,21 @@ class Article { $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false ); } # Display content and don't save to parser cache - $wgOut->addPrimaryWikiText( $text, $this, false ); + # With timing hack -- TS 2006-07-26 + $time = -wfTime(); + $this->outputWikiText( $text, false ); + $time += wfTime(); + + # Timing hack + if ( $time > 3 ) { + wfDebugLog( 'slow-parse', sprintf( "%-5.2f %s", $time, + $this->mTitle->getPrefixedDBkey())); + } if( !$this->isCurrent() ) { $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); } + } } /* title may have been set from the cache */ @@ -827,8 +835,9 @@ class Article { if ( $wgUseRCPatrol && !is_null( $rcid ) && $rcid != 0 && $wgUser->isAllowed( 'patrol' ) ) { $wgOut->addHTML( "' ); @@ -845,7 +854,7 @@ class Article { function addTrackbacks() { global $wgOut, $wgUser; - $dbr =& wfGetDB(DB_SLAVE); + $dbr = wfGetDB(DB_SLAVE); $tbs = $dbr->select( /* FROM */ 'trackbacks', /* SELECT */ array('tb_id', 'tb_title', 'tb_url', 'tb_ex', 'tb_name'), @@ -891,7 +900,7 @@ class Article { return; } - $db =& wfGetDB(DB_MASTER); + $db = wfGetDB(DB_MASTER); $db->delete('trackbacks', array('tb_id' => $wgRequest->getInt('tbid'))); $wgTitle->invalidateCache(); $wgOut->addWikiText(wfMsg('trackbackdeleteok')); @@ -910,7 +919,7 @@ class Article { function purge() { global $wgUser, $wgRequest, $wgOut; - if ( $wgUser->isLoggedIn() || $wgRequest->wasPosted() ) { + if ( $wgUser->isAllowed( 'purge' ) || $wgRequest->wasPosted() ) { if( wfRunHooks( 'ArticlePurge', array( &$this ) ) ) { $this->doPurge(); } @@ -928,7 +937,7 @@ class Article { $wgOut->addHTML( $msg ); } } - + /** * Perform the actions of a page purging */ @@ -957,11 +966,10 @@ class Article { * Best if all done inside a transaction. * * @param Database $dbw - * @param string $restrictions * @return int The newly created page_id key * @private */ - function insertOn( &$dbw, $restrictions = '' ) { + function insertOn( $dbw ) { wfProfileIn( __METHOD__ ); $page_id = $dbw->nextSequenceValue( 'page_page_id_seq' ); @@ -970,7 +978,7 @@ class Article { 'page_namespace' => $this->mTitle->getNamespace(), 'page_title' => $this->mTitle->getDBkey(), 'page_counter' => 0, - 'page_restrictions' => $restrictions, + 'page_restrictions' => '', 'page_is_redirect' => 0, # Will set this shortly... 'page_is_new' => 1, 'page_random' => wfRandom(), @@ -996,7 +1004,7 @@ class Article { * when different from the currently set value. * Giving 0 indicates the new page flag should * be set on. - * @param bool $lastRevIsRedirect If given, will optimize adding and + * @param bool $lastRevIsRedirect If given, will optimize adding and * removing rows in redirect table. * @return bool true on success, false on failure * @private @@ -1006,7 +1014,7 @@ class Article { $text = $revision->getText(); $rt = Title::newFromRedirect( $text ); - + $conditions = array( 'page_id' => $this->getId() ); if( !is_null( $lastRevision ) ) { # An extra check against threads stepping on each other @@ -1028,20 +1036,20 @@ class Article { if ($result) { // FIXME: Should the result from updateRedirectOn() be returned instead? - $this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect ); + $this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect ); } - + wfProfileOut( __METHOD__ ); return $result; } /** - * Add row to the redirect table if this is a redirect, remove otherwise. + * Add row to the redirect table if this is a redirect, remove otherwise. * * @param Database $dbw * @param $redirectTitle a title object pointing to the redirect target, - * or NULL if this is not a redirect - * @param bool $lastRevIsRedirect If given, will optimize adding and + * or NULL if this is not a redirect + * @param bool $lastRevIsRedirect If given, will optimize adding and * removing rows in redirect table. * @return bool true on success, false on failure * @private @@ -1067,7 +1075,7 @@ class Article { $dbw->replace( 'redirect', array( 'rd_from' ), $set, __METHOD__ ); } else { - // This is not a redirect, remove row from redirect table + // This is not a redirect, remove row from redirect table $where = array( 'rd_from' => $this->getId() ); $dbw->delete( 'redirect', $where, __METHOD__); } @@ -1075,7 +1083,7 @@ class Article { wfProfileOut( __METHOD__ ); return ( $dbw->affectedRows() != 0 ); } - + return true; } @@ -1119,14 +1127,14 @@ class Article { */ function replaceSection($section, $text, $summary = '', $edittime = NULL) { wfProfileIn( __METHOD__ ); - + if( $section == '' ) { // Whole-page edit; let the text through unmolested. } else { if( is_null( $edittime ) ) { $rev = Revision::newFromTitle( $this->mTitle ); } else { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime ); } if( is_null( $rev ) ) { @@ -1166,10 +1174,10 @@ class Article { if ( $comment && $summary != "" ) { $text = "== {$summary} ==\n\n".$text; } - + $this->doEdit( $text, $summary, $flags ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ($watchthis) { if (!$this->mTitle->userIsWatching()) { $dbw->begin(); @@ -1196,7 +1204,7 @@ class Article { $good = $this->doEdit( $text, $summary, $flags ); if ( $good ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ($watchthis) { if (!$this->mTitle->userIsWatching()) { $dbw->begin(); @@ -1219,7 +1227,7 @@ class Article { /** * Article::doEdit() * - * Change an existing article or create a new article. Updates RC and all necessary caches, + * Change an existing article or create a new article. Updates RC and all necessary caches, * optionally via the deferred update array. * * $wgUser must be set before calling this function. @@ -1241,9 +1249,9 @@ class Article { * Defer some of the updates until the end of index.php * EDIT_AUTOSUMMARY * Fill in blank summaries with generated text where possible - * - * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected. - * If EDIT_UPDATE is specified and the article doesn't exist, the function will return false. If + * + * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected. + * If EDIT_UPDATE is specified and the article doesn't exist, the function will return false. If * EDIT_NEW is specified and the article does exist, a duplicate key error will cause an exception * to be thrown from the Database. These two conditions are also possible with auto-detection due * to MediaWiki's performance-optimised locking strategy. @@ -1267,7 +1275,7 @@ class Article { if( !wfRunHooks( 'ArticleSave', array( &$this, &$wgUser, &$text, &$summary, $flags & EDIT_MINOR, - null, null, &$flags ) ) ) + null, null, &$flags ) ) ) { wfDebug( __METHOD__ . ": ArticleSave hook aborted save!\n" ); wfProfileOut( __METHOD__ ); @@ -1288,9 +1296,9 @@ class Article { $text = $this->preSaveTransform( $text ); $newsize = strlen( $text ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $now = wfTimestampNow(); - + if ( $flags & EDIT_UPDATE ) { # Update article, but only if changed. @@ -1316,7 +1324,7 @@ class Article { wfProfileOut( __METHOD__ ); return false; } - + $revision = new Revision( array( 'page' => $this->getId(), 'comment' => $summary, @@ -1340,10 +1348,11 @@ class Article { $rcid = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary, $lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize, $revisionId ); - + # Mark as patrolled if the user can do so - if( $wgUser->isAllowed( 'autopatrol' ) ) { + if( $GLOBALS['wgUseRCPatrol'] && $wgUser->isAllowed( 'autopatrol' ) ) { RecentChange::markPatrolled( $rcid ); + PatrolLog::record( $rcid, true ); } } $wgUser->incEditCount(); @@ -1362,19 +1371,19 @@ class Article { } if ( $good ) { - # Invalidate cache of this article and all pages using this article + # Invalidate cache of this article and all pages using this article # as a template. Partly deferred. Article::onArticleEdit( $this->mTitle ); - + # Update links tables, site stats, etc. $changed = ( strcmp( $oldtext, $text ) != 0 ); $this->editUpdates( $text, $summary, $isminor, $now, $revisionId, $changed ); } } else { # Create new article - + # Set statistics members - # We work out if it's countable after PST to avoid counter drift + # We work out if it's countable after PST to avoid counter drift # when articles are created with {{subst:}} $this->mGoodAdjustment = (int)$this->isCountable( $text ); $this->mTotalAdjustment = 1; @@ -1403,8 +1412,9 @@ class Article { $rcid = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, $bot, '', strlen( $text ), $revisionId ); # Mark as patrolled if the user can - if( $wgUser->isAllowed( 'autopatrol' ) ) { + if( $GLOBALS['wgUseRCPatrol'] && $wgUser->isAllowed( 'autopatrol' ) ) { RecentChange::markPatrolled( $rcid ); + PatrolLog::record( $rcid, true ); } } $wgUser->incEditCount(); @@ -1429,7 +1439,7 @@ class Article { array( &$this, &$wgUser, $text, $summary, $flags & EDIT_MINOR, null, null, &$flags ) ); - + wfProfileOut( __METHOD__ ); return $good; } @@ -1457,7 +1467,7 @@ class Article { } $wgOut->redirect( $this->mTitle->getFullURL( $query ) . $sectionAnchor ); } - + /** * Mark this particular edit as patrolled */ @@ -1470,25 +1480,25 @@ class Article { $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' ); return; } - + # Check permissions if( !$wgUser->isAllowed( 'patrol' ) ) { $wgOut->permissionRequired( 'patrol' ); return; } - + # If we haven't been given an rc_id value, we can't do anything $rcid = $wgRequest->getVal( 'rcid' ); if( !$rcid ) { $wgOut->errorPage( 'markedaspatrollederror', 'markedaspatrollederrortext' ); return; } - + # Handle the 'MarkPatrolled' hook if( !wfRunHooks( 'MarkPatrolled', array( $rcid, &$wgUser, false ) ) ) { return; } - + $return = SpecialPage::getTitleFor( 'Recentchanges' ); # If it's left up to us, check that the user is allowed to patrol this edit # If the user has the "autopatrol" right, then we'll assume there are no @@ -1507,11 +1517,12 @@ class Article { return; } } - + # Mark the edit as patrolled RecentChange::markPatrolled( $rcid ); + PatrolLog::record( $rcid ); wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, false ) ); - + # Inform the user $wgOut->setPageTitle( wfMsg( 'markedaspatrolled' ) ); $wgOut->addWikiText( wfMsgNoTrans( 'markedaspatrolledtext' ) ); @@ -1534,7 +1545,7 @@ class Article { $wgOut->readOnlyPage(); return; } - + if( $this->doWatch() ) { $wgOut->setPagetitle( wfMsg( 'addedwatch' ) ); $wgOut->setRobotpolicy( 'noindex,nofollow' ); @@ -1546,7 +1557,7 @@ class Article { $wgOut->returnToMain( true, $this->mTitle->getPrefixedText() ); } - + /** * Add this page to $wgUser's watchlist * @return bool true on successful watch operation @@ -1556,13 +1567,13 @@ class Article { if( $wgUser->isAnon() ) { return false; } - + if (wfRunHooks('WatchArticle', array(&$wgUser, &$this))) { $wgUser->addWatch( $this->mTitle ); return wfRunHooks('WatchArticleComplete', array(&$wgUser, &$this)); } - + return false; } @@ -1581,7 +1592,7 @@ class Article { $wgOut->readOnlyPage(); return; } - + if( $this->doUnwatch() ) { $wgOut->setPagetitle( wfMsg( 'removedwatch' ) ); $wgOut->setRobotpolicy( 'noindex,nofollow' ); @@ -1593,7 +1604,7 @@ class Article { $wgOut->returnToMain( true, $this->mTitle->getPrefixedText() ); } - + /** * Stop watching a page * @return bool true on successful unwatch @@ -1609,7 +1620,7 @@ class Article { return wfRunHooks('UnwatchArticleComplete', array(&$wgUser, &$this)); } - + return false; } @@ -1618,7 +1629,7 @@ class Article { */ function protect() { $form = new ProtectionForm( $this ); - $form->show(); + $form->execute(); } /** @@ -1635,14 +1646,21 @@ class Article { * @param string $reason * @return bool true on success */ - function updateRestrictions( $limit = array(), $reason = '' ) { + function updateRestrictions( $limit = array(), $reason = '', $cascade = 0, $expiry = null ) { global $wgUser, $wgRestrictionTypes, $wgContLang; - + $id = $this->mTitle->getArticleID(); if( !$wgUser->isAllowed( 'protect' ) || wfReadOnly() || $id == 0 ) { return false; } + if (!$cascade) { + $cascade = false; + } + + // Take this opportunity to purge out expired restrictions + Title::purgeExpiredRestrictions(); + # FIXME: Same limitations as described in ProtectionForm.php (line 37); # we expect a single selection, but the schema allows otherwise. $current = array(); @@ -1651,48 +1669,89 @@ class Article { $current = Article::flattenRestrictions( $current ); $updated = Article::flattenRestrictions( $limit ); - + $changed = ( $current != $updated ); + $changed = $changed || ($this->mTitle->areRestrictionsCascading() != $cascade); + $changed = $changed || ($this->mTitle->mRestrictionsExpiry != $expiry); $protect = ( $updated != '' ); - + # If nothing's changed, do nothing if( $changed ) { + global $wgGroupPermissions; if( wfRunHooks( 'ArticleProtect', array( &$this, &$wgUser, $limit, $reason ) ) ) { - $dbw =& wfGetDB( DB_MASTER ); - + $dbw = wfGetDB( DB_MASTER ); + + $encodedExpiry = Block::encodeExpiry($expiry, $dbw ); + + $expiry_description = ''; + if ( $encodedExpiry != 'infinity' ) { + $expiry_description = ' (' . wfMsgForContent( 'protect-expiring', $wgContLang->timeanddate( $expiry ) ).')'; + } + # Prepare a null revision to be added to the history $comment = $wgContLang->ucfirst( wfMsgForContent( $protect ? 'protectedarticle' : 'unprotectedarticle', $this->mTitle->getPrefixedText() ) ); + + foreach( $limit as $action => $restrictions ) { + # Check if the group level required to edit also can protect pages + # Otherwise, people who cannot normally protect can "protect" pages via transclusion + $cascade = ( $cascade && isset($wgGroupPermissions[$restrictions]['protect']) && $wgGroupPermissions[$restrictions]['protect'] ); + } + + $cascade_description = ''; + if ($cascade) { + $cascade_description = ' ['.wfMsg('protect-summary-cascade').']'; + } + if( $reason ) $comment .= ": $reason"; if( $protect ) $comment .= " [$updated]"; + if ( $expiry_description && $protect ) + $comment .= "$expiry_description"; + if ( $cascade ) + $comment .= "$cascade_description"; + $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true ); $nullRevId = $nullRevision->insertOn( $dbw ); - + + # Update restrictions table + foreach( $limit as $action => $restrictions ) { + if ($restrictions != '' ) { + $dbw->replace( 'page_restrictions', array(array('pr_page', 'pr_type')), + array( 'pr_page' => $id, 'pr_type' => $action + , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ? 1 : 0 + , 'pr_expiry' => $encodedExpiry ), __METHOD__ ); + } else { + $dbw->delete( 'page_restrictions', array( 'pr_page' => $id, + 'pr_type' => $action ), __METHOD__ ); + } + } + # Update page record $dbw->update( 'page', array( /* SET */ 'page_touched' => $dbw->timestamp(), - 'page_restrictions' => $updated, + 'page_restrictions' => '', 'page_latest' => $nullRevId ), array( /* WHERE */ 'page_id' => $id ), 'Article::protect' ); wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) ); - + # Update the protection log $log = new LogPage( 'protect' ); + if( $protect ) { - $log->addEntry( 'protect', $this->mTitle, trim( $reason . " [$updated]" ) ); + $log->addEntry( 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) ); } else { $log->addEntry( 'unprotect', $this->mTitle, $reason ); } - + } # End hook } # End "changed" check - + return true; } @@ -1745,9 +1804,9 @@ class Article { } $wgOut->setPagetitle( wfMsg( 'confirmdelete' ) ); - + # Better double-check that it hasn't been deleted yet! - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $conds = $this->mTitle->pageCond(); $latest = $dbw->selectField( 'page', 'page_latest', $conds, __METHOD__ ); if ( $latest === false ) { @@ -1769,7 +1828,7 @@ class Article { # and insert a warning if it does $maxRevisions = 20; $authors = $this->getLastNAuthors( $maxRevisions, $latest ); - + if( count( $authors ) > 1 && !$confirm ) { $skin=$wgUser->getSkin(); $wgOut->addHTML( '' . wfMsg( 'historywarning' ) . ' ' . $skin->historyLink() . '' ); @@ -1813,7 +1872,7 @@ class Article { $reason = wfMsgForContent( 'exblank' ); } - if( $length < 500 && $reason === '' ) { + if( $reason === '' ) { # comment field=255, let's grep the first 150 to have some user # space left global $wgContLang; @@ -1849,7 +1908,7 @@ class Article { // First try the slave // If that doesn't have the latest revision, try the master $continue = 2; - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); do { $res = $db->select( array( 'page', 'revision' ), array( 'rev_id', 'rev_user_text' ), @@ -1868,7 +1927,7 @@ class Article { } $row = $db->fetchObject( $res ); if ( $continue == 2 && $revLatest && $row->rev_id != $revLatest ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); $continue--; } else { $continue = 0; @@ -1882,7 +1941,7 @@ class Article { wfProfileOut( __METHOD__ ); return $authors; } - + /** * Output deletion confirmation dialog */ @@ -1929,6 +1988,23 @@ class Article { \n" ); $wgOut->returnToMain( false ); + + $this->showLogExtract( $wgOut ); + } + + + /** + * Fetch deletion log + */ + function showLogExtract( &$out ) { + # Show relevant lines from the deletion log: + $out->addHTML( "

    " . htmlspecialchars( LogPage::logName( 'delete' ) ) . "

    \n" ); + $logViewer = new LogViewer( + new LogReader( + new FauxRequest( + array( 'page' => $this->mTitle->getPrefixedText(), + 'type' => 'delete' ) ) ) ); + $logViewer->showList( $out ); } @@ -1969,7 +2045,7 @@ class Article { wfDebug( __METHOD__."\n" ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $ns = $this->mTitle->getNamespace(); $t = $this->mTitle->getDBkey(); $id = $this->mTitle->getArticleID(); @@ -2004,12 +2080,16 @@ class Article { 'ar_text_id' => 'rev_text_id', 'ar_text' => '\'\'', // Be explicit to appease 'ar_flags' => '\'\'', // MySQL's "strict mode"... + 'ar_len' => 'rev_len' ), array( 'page_id' => $id, 'page_id = rev_page' ), __METHOD__ ); + # Delete restrictions for it + $dbw->delete( 'page_restrictions', array ( 'pr_page' => $id ), __METHOD__ ); + # Now that it's safely backed up, delete it $dbw->delete( 'page', array( 'page_id' => $id ), __METHOD__); @@ -2078,7 +2158,7 @@ class Article { $wgOut->addWikiText( wfMsg( 'sessionfailure' ) ); return; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); # Enhanced rollback, marks edits rc_bot=1 $bot = $wgRequest->getBool( 'bot' ); @@ -2103,7 +2183,7 @@ class Article { if( $current->getComment() != '') { $wgOut->addHTML( wfMsg( 'editcomment', - htmlspecialchars( $current->getComment() ) ) ); + $wgUser->getSkin()->formatComment( $current->getComment() ) ) ); } return; } @@ -2189,7 +2269,7 @@ class Article { * Do standard deferred updates after page edit. * Update links tables, site stats, search index and message cache. * Every 1000th edit, prune the recent changes table. - * + * * @private * @param $text New text of the article * @param $summary Edit summary @@ -2222,7 +2302,7 @@ class Article { # Periodically flush old entries from the recentchanges table. global $wgRCMaxAge; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $cutoff = $dbw->timestamp( time() - $wgRCMaxAge ); $recentchanges = $dbw->tableName( 'recentchanges' ); $sql = "DELETE FROM $recentchanges WHERE rc_timestamp < '{$cutoff}'"; @@ -2269,13 +2349,13 @@ class Article { wfProfileOut( __METHOD__ ); } - + /** * Perform article updates on a special page creation. * * @param Revision $rev * - * @fixme This is a shitty interface function. Kill it and replace the + * @todo This is a shitty interface function. Kill it and replace the * other shitty functions like editUpdates and such so it's not needed * anymore. */ @@ -2299,8 +2379,8 @@ class Article { global $wgLang, $wgOut, $wgUser; if ( !wfRunHooks( 'DisplayOldSubtitle', array(&$this, &$oldid) ) ) { - return; - } + return; + } $revision = Revision::newFromId( $oldid ); @@ -2326,10 +2406,10 @@ class Article { $nextdiff = $current ? wfMsg( 'diff' ) : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid ); - + $userlinks = $sk->userLink( $revision->getUser(), $revision->getUserText() ) . $sk->userToolLinks( $revision->getUser(), $revision->getUserText() ); - + $r = "\n\t\t\t\t
    " . wfMsg( 'revision-info', $td, $userlinks ) . "
    \n" . "\n\t\t\t\t
    " . wfMsg( 'revision-nav', $prevdiff, $prevlink, $lnk, $curdiff, $nextlink, $nextdiff ) . "
    \n\t\t\t"; $wgOut->setSubtitle( $r ); @@ -2381,25 +2461,40 @@ class Article { * @return bool */ function isFileCacheable() { - global $wgUser, $wgUseFileCache, $wgShowIPinHeader, $wgRequest; + global $wgUser, $wgUseFileCache, $wgShowIPinHeader, $wgRequest, $wgLang, $wgContLang; $action = $wgRequest->getVal( 'action' ); $oldid = $wgRequest->getVal( 'oldid' ); $diff = $wgRequest->getVal( 'diff' ); $redirect = $wgRequest->getVal( 'redirect' ); $printable = $wgRequest->getVal( 'printable' ); + $page = $wgRequest->getVal( 'page' ); + + //check for non-standard user language; this covers uselang, + //and extensions for auto-detecting user language. + $ulang = $wgLang->getCode(); + $clang = $wgContLang->getCode(); - return $wgUseFileCache - and (!$wgShowIPinHeader) - and ($this->getID() != 0) - and ($wgUser->isAnon()) - and (!$wgUser->getNewtalk()) - and ($this->mTitle->getNamespace() != NS_SPECIAL ) - and (empty( $action ) || $action == 'view') - and (!isset($oldid)) - and (!isset($diff)) - and (!isset($redirect)) - and (!isset($printable)) - and (!$this->mRedirectedFrom); + $cacheable = $wgUseFileCache + && (!$wgShowIPinHeader) + && ($this->getID() != 0) + && ($wgUser->isAnon()) + && (!$wgUser->getNewtalk()) + && ($this->mTitle->getNamespace() != NS_SPECIAL ) + && (empty( $action ) || $action == 'view') + && (!isset($oldid)) + && (!isset($diff)) + && (!isset($redirect)) + && (!isset($printable)) + && !isset($page) + && (!$this->mRedirectedFrom) + && ($ulang === $clang); + + if ( $cacheable ) { + //extension may have reason to disable file caching on some pages. + $cacheable = wfRunHooks( 'IsFileCacheable', array( $this ) ); + } + + return $cacheable; } /** @@ -2446,7 +2541,7 @@ class Article { function quickEdit( $text, $comment = '', $minor = 0 ) { wfProfileIn( __METHOD__ ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $revision = new Revision( array( 'page' => $this->getId(), @@ -2471,7 +2566,7 @@ class Article { $id = intval( $id ); global $wgHitcounterUpdateFreq, $wgDBtype; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $pageTable = $dbw->tableName( 'page' ); $hitcounterTable = $dbw->tableName( 'hitcounter' ); $acchitsTable = $dbw->tableName( 'acchits' ); @@ -2555,7 +2650,7 @@ class Article { $title->touchLinks(); $title->purgeSquid(); - + # File cache if ( $wgUseFileCache ) { $cm = new HTMLFileCache( $title ); @@ -2617,7 +2712,7 @@ class Article { $wgOut->addHTML(wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) ); } } else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $wl_clause = array( 'wl_title' => $page->getDBkey(), 'wl_namespace' => $page->getNamespace() ); @@ -2659,7 +2754,7 @@ class Article { return false; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $rev_clause = array( 'rev_page' => $id ); @@ -2693,7 +2788,7 @@ class Article { return array(); } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( array( 'templatelinks' ), array( 'tl_namespace', 'tl_title' ), array( 'tl_from' => $id ), @@ -2708,7 +2803,7 @@ class Article { $dbr->freeResult( $res ); return $result; } - + /** * Return an auto-generated summary if the text provided is a redirect. * @@ -2785,6 +2880,84 @@ class Article { return $summary; } + + /** + * Add the primary page-view wikitext to the output buffer + * Saves the text into the parser cache if possible. + * Updates templatelinks if it is out of date. + * + * @param string $text + * @param bool $cache + */ + public function outputWikiText( $text, $cache = true ) { + global $wgParser, $wgUser, $wgOut; + + $popts = $wgOut->parserOptions(); + $popts->setTidy(true); + $parserOutput = $wgParser->parse( $text, $this->mTitle, + $popts, true, true, $this->getRevIdFetched() ); + $popts->setTidy(false); + if ( $cache && $this && $parserOutput->getCacheTime() != -1 ) { + $parserCache =& ParserCache::singleton(); + $parserCache->save( $parserOutput, $this, $wgUser ); + } + + if ( !wfReadOnly() && $this->mTitle->areRestrictionsCascading() ) { + // templatelinks table may have become out of sync, + // especially if using variable-based transclusions. + // For paranoia, check if things have changed and if + // so apply updates to the database. This will ensure + // that cascaded protections apply as soon as the changes + // are visible. + + # Get templates from templatelinks + $id = $this->mTitle->getArticleID(); + + $tlTemplates = array(); + + $dbr = wfGetDB( DB_SLAVE ); + $res = $dbr->select( array( 'templatelinks' ), + array( 'tl_namespace', 'tl_title' ), + array( 'tl_from' => $id ), + 'Article:getUsedTemplates' ); + + global $wgContLang; + + if ( false !== $res ) { + if ( $dbr->numRows( $res ) ) { + while ( $row = $dbr->fetchObject( $res ) ) { + $tlTemplates[] = $wgContLang->getNsText( $row->tl_namespace ) . ':' . $row->tl_title ; + } + } + } + + # Get templates from parser output. + $poTemplates_allns = $parserOutput->getTemplates(); + + $poTemplates = array (); + foreach ( $poTemplates_allns as $ns_templates ) { + $poTemplates = array_merge( $poTemplates, $ns_templates ); + } + + # Get the diff + $templates_diff = array_diff( $poTemplates, $tlTemplates ); + + if ( count( $templates_diff ) > 0 ) { + # Whee, link updates time. + $u = new LinksUpdate( $this->mTitle, $parserOutput ); + + $dbw = wfGetDb( DB_MASTER ); + $dbw->begin(); + + $u->doUpdate(); + + $dbw->commit(); + } + } + + $wgOut->addParserOutput( $parserOutput ); + } + } ?> diff --git a/includes/AuthPlugin.php b/includes/AuthPlugin.php index e33ef1bf..9395032f 100644 --- a/includes/AuthPlugin.php +++ b/includes/AuthPlugin.php @@ -1,6 +1,5 @@ # http://www.mediawiki.org/ @@ -33,7 +32,6 @@ * This interface is new, and might change a bit before 1.4.0 final is * done... * - * @package MediaWiki */ class AuthPlugin { /** @@ -187,12 +185,14 @@ class AuthPlugin { * Add a user to the external authentication database. * Return true if successful. * - * @param User $user + * @param User $user - only the name should be assumed valid at this point * @param string $password + * @param string $email + * @param string $realname * @return bool * @public */ - function addUser( $user, $password ) { + function addUser( $user, $password, $email='', $realname='' ) { return true; } diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 8de5608f..72a71c71 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -8,9 +8,11 @@ function __autoload($className) { global $wgAutoloadClasses; static $localClasses = array( + # Includes 'AjaxDispatcher' => 'includes/AjaxDispatcher.php', 'AjaxCachePolicy' => 'includes/AjaxFunctions.php', 'AjaxResponse' => 'includes/AjaxResponse.php', + 'AlphabeticPager' => 'includes/Pager.php', 'Article' => 'includes/Article.php', 'AuthPlugin' => 'includes/AuthPlugin.php', 'BagOStuff' => 'includes/BagOStuff.php', @@ -39,9 +41,8 @@ function __autoload($className) { 'Database' => 'includes/Database.php', 'DatabaseMysql' => 'includes/Database.php', 'ResultWrapper' => 'includes/Database.php', - 'OracleBlob' => 'includes/DatabaseOracle.php', - 'DatabaseOracle' => 'includes/DatabaseOracle.php', 'DatabasePostgres' => 'includes/DatabasePostgres.php', + 'DatabaseOracle' => 'includes/DatabaseOracle.php', 'DateFormatter' => 'includes/DateFormatter.php', 'DifferenceEngine' => 'includes/DifferenceEngine.php', '_DiffOp' => 'includes/DifferenceEngine.php', @@ -95,6 +96,7 @@ function __autoload($className) { 'HTMLCacheUpdateJob' => 'includes/HTMLCacheUpdate.php', 'Http' => 'includes/HttpFunctions.php', 'Image' => 'includes/Image.php', + 'ArchivedFile' => 'includes/Image.php', 'IP' => 'includes/IP.php', 'ThumbnailImage' => 'includes/Image.php', 'ImageGallery' => 'includes/ImageGallery.php', @@ -114,6 +116,10 @@ function __autoload($className) { 'MacBinary' => 'includes/MacBinary.php', 'MagicWord' => 'includes/MagicWord.php', 'MathRenderer' => 'includes/Math.php', + 'MediaTransformOutput' => 'includes/MediaTransformOutput.php', + 'ThumbnailImage' => 'includes/MediaTransformOutput.php', + 'MediaTransformError' => 'includes/MediaTransformOutput.php', + 'TransformParameterError' => 'includes/MediaTransformOutput.php', 'MessageCache' => 'includes/MessageCache.php', 'MimeMagic' => 'includes/MimeMagic.php', 'Namespace' => 'includes/Namespace.php', @@ -124,16 +130,18 @@ function __autoload($className) { 'ReverseChronologicalPager' => 'includes/Pager.php', 'TablePager' => 'includes/Pager.php', 'Parser' => 'includes/Parser.php', - 'ParserOutput' => 'includes/Parser.php', - 'ParserOptions' => 'includes/Parser.php', + 'ParserOutput' => 'includes/ParserOutput.php', + 'ParserOptions' => 'includes/ParserOptions.php', 'ParserCache' => 'includes/ParserCache.php', + 'PatrolLog' => 'includes/PatrolLog.php', 'ProfilerSimple' => 'includes/ProfilerSimple.php', 'ProfilerSimpleUDP' => 'includes/ProfilerSimpleUDP.php', 'Profiler' => 'includes/Profiler.php', 'ProxyTools' => 'includes/ProxyTools.php', 'ProtectionForm' => 'includes/ProtectionForm.php', 'QueryPage' => 'includes/QueryPage.php', - 'PageQueryPage' => 'includes/QueryPage.php', + 'PageQueryPage' => 'includes/PageQueryPage.php', + 'ImageQueryPage' => 'includes/ImageQueryPage.php', 'RawPage' => 'includes/RawPage.php', 'RecentChange' => 'includes/RecentChange.php', 'Revision' => 'includes/Revision.php', @@ -148,6 +156,7 @@ function __autoload($className) { 'SearchPostgres' => 'includes/SearchPostgres.php', 'SearchUpdate' => 'includes/SearchUpdate.php', 'SearchUpdateMyISAM' => 'includes/SearchUpdate.php', + 'SearchOracle' => 'includes/SearchOracle.php', 'SiteConfiguration' => 'includes/SiteConfiguration.php', 'SiteStats' => 'includes/SiteStats.php', 'SiteStatsUpdate' => 'includes/SiteStats.php', @@ -160,7 +169,6 @@ function __autoload($className) { 'IPBlockForm' => 'includes/SpecialBlockip.php', 'SpecialBookSources' => 'includes/SpecialBooksources.php', 'BrokenRedirectsPage' => 'includes/SpecialBrokenRedirects.php', - 'CategoriesPage' => 'includes/SpecialCategories.php', 'EmailConfirmation' => 'includes/SpecialConfirmemail.php', 'ContributionsPage' => 'includes/SpecialContributions.php', 'DeadendPagesPage' => 'includes/SpecialDeadendpages.php', @@ -173,7 +181,6 @@ function __autoload($className) { 'ImportStreamSource' => 'includes/SpecialImport.php', 'IPUnblockForm' => 'includes/SpecialIpblocklist.php', 'ListredirectsPage' => 'includes/SpecialListredirects.php', - 'ListUsersPage' => 'includes/SpecialListusers.php', 'DBLockForm' => 'includes/SpecialLockdb.php', 'LogReader' => 'includes/SpecialLog.php', 'LogViewer' => 'includes/SpecialLog.php', @@ -185,6 +192,7 @@ function __autoload($className) { 'MostlinkedPage' => 'includes/SpecialMostlinked.php', 'MostlinkedCategoriesPage' => 'includes/SpecialMostlinkedcategories.php', 'MostrevisionsPage' => 'includes/SpecialMostrevisions.php', + 'FewestrevisionsPage' => 'includes/SpecialFewestrevisions.php', 'MovePageForm' => 'includes/SpecialMovepage.php', 'NewbieContributionsPage' => 'includes/SpecialNewbieContributions.php', 'NewPagesPage' => 'includes/SpecialNewpages.php', @@ -194,6 +202,7 @@ function __autoload($className) { 'PopularPagesPage' => 'includes/SpecialPopularpages.php', 'PreferencesForm' => 'includes/SpecialPreferences.php', 'SpecialPrefixindex' => 'includes/SpecialPrefixindex.php', + 'PasswordResetForm' => 'includes/SpecialResetpass.php', 'RevisionDeleteForm' => 'includes/SpecialRevisiondelete.php', 'RevisionDeleter' => 'includes/SpecialRevisiondelete.php', 'SpecialSearch' => 'includes/SpecialSearch.php', @@ -215,6 +224,7 @@ function __autoload($className) { 'WantedCategoriesPage' => 'includes/SpecialWantedcategories.php', 'WantedPagesPage' => 'includes/SpecialWantedpages.php', 'WhatLinksHerePage' => 'includes/SpecialWhatlinkshere.php', + 'WithoutInterwikiPage' => 'includes/SpecialWithoutinterwiki.php', 'SquidUpdate' => 'includes/SquidUpdate.php', 'ReplacementArray' => 'includes/StringUtils.php', 'Replacer' => 'includes/StringUtils.php', @@ -237,13 +247,27 @@ function __autoload($className) { 'Xml' => 'includes/Xml.php', 'ZhClient' => 'includes/ZhClient.php', 'memcached' => 'includes/memcached-client.php', + + # Media + 'BitmapHandler' => 'includes/media/Bitmap.php', + 'BmpHandler' => 'includes/media/BMP.php', + 'DjVuHandler' => 'includes/media/DjVu.php', + 'MediaHandler' => 'includes/media/Generic.php', + 'ImageHandler' => 'includes/media/Generic.php', + 'SvgHandler' => 'includes/media/SVG.php', + + # Normal 'UtfNormal' => 'includes/normal/UtfNormal.php', + + # Templates 'UsercreateTemplate' => 'includes/templates/Userlogin.php', 'UserloginTemplate' => 'includes/templates/Userlogin.php', + + # Languages 'Language' => 'languages/Language.php', - 'PasswordResetForm' => 'includes/SpecialResetpass.php', + 'RandomPage' => 'includes/SpecialRandompage.php', - // API classes + # API 'ApiBase' => 'includes/api/ApiBase.php', 'ApiFormatFeedWrapper' => 'includes/api/ApiFormatBase.php', 'ApiFeedWatchlist' => 'includes/api/ApiFeedWatchlist.php', @@ -274,6 +298,7 @@ function __autoload($className) { 'ApiResult' => 'includes/api/ApiResult.php', ); + wfProfileIn( __METHOD__ ); if ( isset( $localClasses[$className] ) ) { $filename = $localClasses[$className]; } elseif ( isset( $wgAutoloadClasses[$className] ) ) { @@ -290,6 +315,7 @@ function __autoload($className) { } if ( !$filename ) { # Give up + wfProfileOut( __METHOD__ ); return; } } @@ -300,6 +326,7 @@ function __autoload($className) { $filename = "$IP/$filename"; } require( $filename ); + wfProfileOut( __METHOD__ ); } function wfLoadAllExtensions() { @@ -311,10 +338,10 @@ function wfLoadAllExtensions() { # guaranteed by entering special pages via SpecialPage members such as # executePath(), but here we have to take a more explicit measure. - require_once( 'SpecialPage.php' ); + require_once( dirname(__FILE__) . '/SpecialPage.php' ); foreach( $wgAutoloadClasses as $class => $file ) { - if ( ! class_exists( $class ) ) { + if( !( class_exists( $class ) || interface_exists( $class ) ) ) { require( $file ); } } diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index c720807d..2a04b9dd 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -19,7 +19,6 @@ # http://www.gnu.org/copyleft/gpl.html /** * - * @package MediaWiki */ /** @@ -29,15 +28,16 @@ * the PHP memcached client. * * backends for local hash array and SQL table included: - * $bag = new HashBagOStuff(); - * $bag = new MysqlBagOStuff($tablename); # connect to db first + * + * $bag = new HashBagOStuff(); + * $bag = new MysqlBagOStuff($tablename); # connect to db first + * * - * @package MediaWiki */ class BagOStuff { var $debugmode; - function BagOStuff() { + function __construct() { $this->set_debug( false ); } @@ -163,7 +163,6 @@ class BagOStuff { /** * Functional versions! * @todo document - * @package MediaWiki */ class HashBagOStuff extends BagOStuff { /* @@ -218,7 +217,6 @@ CREATE TABLE objectcache ( /** * @todo document * @abstract - * @package MediaWiki */ abstract class SqlBagOStuff extends BagOStuff { var $table; @@ -386,34 +384,32 @@ abstract class SqlBagOStuff extends BagOStuff { /** * @todo document - * @package MediaWiki */ class MediaWikiBagOStuff extends SqlBagOStuff { var $tableInitialised = false; function _doquery($sql) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->query($sql, 'MediaWikiBagOStuff::_doquery'); } function _doinsert($t, $v) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->insert($t, $v, 'MediaWikiBagOStuff::_doinsert', array( 'IGNORE' ) ); } function _fetchobject($result) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->fetchObject($result); } function _freeresult($result) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->freeResult($result); } function _dberror($result) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->lastError(); } function _maxdatetime() { - $dbw =& wfGetDB(DB_MASTER); if ( time() > 0x7fffffff ) { return $this->_fromunixtime( 1<<62 ); } else { @@ -421,24 +417,24 @@ class MediaWikiBagOStuff extends SqlBagOStuff { } } function _fromunixtime($ts) { - $dbw =& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); return $dbw->timestamp($ts); } function _strencode($s) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->strencode($s); } function _blobencode($s) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->encodeBlob($s); } function _blobdecode($s) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->decodeBlob($s); } function getTableName() { if ( !$this->tableInitialised ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); /* This is actually a hack, we should be able to use Language classes here... or not */ if (!$dbw) @@ -463,7 +459,6 @@ class MediaWikiBagOStuff extends SqlBagOStuff { * that Turck's serializer is faster, so a possible future extension would be * to use it for arrays but not for objects. * - * @package MediaWiki */ class TurckBagOStuff extends BagOStuff { function get($key) { @@ -498,9 +493,7 @@ class TurckBagOStuff extends BagOStuff { /** * This is a wrapper for APC's shared memory functions * - * @package MediaWiki */ - class APCBagOStuff extends BagOStuff { function get($key) { $val = apc_fetch($key); @@ -528,7 +521,6 @@ class APCBagOStuff extends BagOStuff { * This is basically identical to the Turck MMCache version, * mostly because eAccelerator is based on Turck MMCache. * - * @package MediaWiki */ class eAccelBagOStuff extends BagOStuff { function get($key) { @@ -560,6 +552,9 @@ class eAccelBagOStuff extends BagOStuff { } } +/** + * @todo document + */ class DBABagOStuff extends BagOStuff { var $mHandler, $mFile, $mReader, $mWriter, $mDisabled; diff --git a/includes/Block.php b/includes/Block.php index ff813ba3..94bfa5b4 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -1,7 +1,6 @@ mId = 0; + # Expand valid IPv6 addresses + $address = IP::sanitizeIP( $address ); $this->mAddress = $address; $this->mUser = $user; $this->mBy = $by; @@ -38,6 +39,7 @@ class Block $this->mCreateAccount = $createAccount; $this->mExpiry = self::decodeExpiry( $expiry ); $this->mEnableAutoblock = $enableAutoblock; + $this->mHideName = $hideName; $this->mForUpdate = false; $this->mFromMaster = false; @@ -58,7 +60,7 @@ class Block static function newFromID( $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->resultObject( $dbr->select( 'ipblocks', '*', array( 'ipb_id' => $id ), __METHOD__ ) ); $block = new Block; @@ -74,7 +76,7 @@ class Block $this->mAddress = $this->mReason = $this->mTimestamp = ''; $this->mId = $this->mAnonOnly = $this->mCreateAccount = $this->mEnableAutoblock = $this->mAuto = $this->mUser = - $this->mBy = 0; + $this->mBy = $this->mHideName = 0; $this->mByName = false; } @@ -85,14 +87,14 @@ class Block { global $wgAntiLockFlags; if ( $this->mForUpdate || $this->mFromMaster ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); if ( !$this->mForUpdate || ($wgAntiLockFlags & ALF_NO_BLOCK_LOCK) ) { $options = array(); } else { $options = array( 'FOR UPDATE' ); } } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $options = array(); } return $db; @@ -147,7 +149,7 @@ class Block } # Try range block - if ( $this->loadRange( $address, $killExpired, $user == 0 ) ) { + if ( $this->loadRange( $address, $killExpired, $user ) ) { if ( $user && $this->mAnonOnly ) { $this->clear(); return false; @@ -176,7 +178,8 @@ class Block /** * Fill in member variables from a result wrapper */ - function loadFromResult( ResultWrapper $res, $killExpired = true ) { + function loadFromResult( ResultWrapper $res, $killExpired = true ) + { $ret = false; if ( 0 != $res->numRows() ) { # Get first block @@ -211,7 +214,7 @@ class Block * Search the database for any range blocks matching the given address, and * load the row if one is found. */ - function loadRange( $address, $killExpired = true ) + function loadRange( $address, $killExpired = true, $user = 0 ) { $iaddr = IP::toHex( $address ); if ( $iaddr === false ) { @@ -230,6 +233,10 @@ class Block "ipb_range_start <= '$iaddr'", "ipb_range_end >= '$iaddr'" ); + + if ( $user ) { + $conds['ipb_anon_only'] = 0; + } $res = $db->resultObject( $db->select( 'ipblocks', '*', $conds, __METHOD__, $options ) ); $success = $this->loadFromResult( $res, $killExpired ); @@ -255,6 +262,7 @@ class Block $this->mAnonOnly = $row->ipb_anon_only; $this->mCreateAccount = $row->ipb_create_account; $this->mEnableAutoblock = $row->ipb_enable_autoblock; + $this->mHideName = $row->ipb_deleted; $this->mId = $row->ipb_id; $this->mExpiry = self::decodeExpiry( $row->ipb_expiry ); if ( isset( $row->user_name ) ) { @@ -286,7 +294,7 @@ class Block $block = new Block(); if ( $flags & Block::EB_FOR_UPDATE ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) { $options = ''; } else { @@ -294,7 +302,7 @@ class Block } $block->forUpdate( true ); } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $options = ''; } if ( $flags & Block::EB_RANGE_ONLY ) { @@ -341,7 +349,7 @@ class Block throw new MWException( "Block::delete() now requires that the mId member be filled\n" ); } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'ipblocks', array( 'ipb_id' => $this->mId ), __METHOD__ ); return $dbw->affectedRows() > 0; } @@ -353,8 +361,7 @@ class Block function insert() { wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" ); - $dbw =& wfGetDB( DB_MASTER ); - $dbw->begin(); + $dbw = wfGetDB( DB_MASTER ); # Unset ipb_anon_only for user blocks, makes no sense if ( $this->mUser ) { @@ -385,6 +392,7 @@ class Block 'ipb_expiry' => self::encodeExpiry( $this->mExpiry, $dbw ), 'ipb_range_start' => $this->mRangeStart, 'ipb_range_end' => $this->mRangeEnd, + 'ipb_deleted' => $this->mHideName ), 'Block::insert', array( 'IGNORE' ) ); $affected = $dbw->affectedRows(); @@ -418,20 +426,20 @@ class Block } else { #Limit is 1, so no loop needed. $retroblockip = $row->rc_ip; - return $this->doAutoblock($retroblockip); + return $this->doAutoblock( $retroblockip, true ); } } } /** * Autoblocks the given IP, referring to this Block. - * @param $autoblockip The IP to autoblock. + * @param string $autoblockip The IP to autoblock. + * @param bool $justInserted The main block was just inserted * @return bool Whether or not an autoblock was inserted. */ - function doAutoblock( $autoblockip ) { + function doAutoblock( $autoblockip, $justInserted = false ) { # Check if this IP address is already blocked - $dbw =& wfGetDB( DB_MASTER ); - $dbw->begin(); + $dbw = wfGetDB( DB_MASTER ); # If autoblocks are disabled, go away. if ( !$this->mEnableAutoblock ) { @@ -480,7 +488,9 @@ class Block return; } # Just update the timestamp - $ipblock->updateTimestamp(); + if ( !$justInserted ) { + $ipblock->updateTimestamp(); + } return; } else { $ipblock = new Block; @@ -495,6 +505,8 @@ class Block $ipblock->mTimestamp = wfTimestampNow(); $ipblock->mAuto = 1; $ipblock->mCreateAccount = $this->mCreateAccount; + # Continue suppressing the name if needed + $ipblock->mHideName = $this->mHideName; # If the user is already blocked with an expiry date, we don't # want to pile on top of that! @@ -544,7 +556,7 @@ class Block $this->mTimestamp = wfTimestamp(); $this->mExpiry = Block::getAutoblockExpiry( $this->mTimestamp ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'ipblocks', array( /* SET */ 'ipb_timestamp' => $dbw->timestamp($this->mTimestamp), @@ -628,16 +640,36 @@ class Block global $wgAutoblockExpiry; return wfTimestamp( TS_MW, wfTimestamp( TS_UNIX, $timestamp ) + $wgAutoblockExpiry ); } - - static function normaliseRange( $range ) - { + + /** + * Gets rid of uneeded numbers in quad-dotted/octet IP strings + * For example, 127.111.113.151/24 -> 127.111.113.0/24 + */ + static function normaliseRange( $range ) { $parts = explode( '/', $range ); if ( count( $parts ) == 2 ) { - $shift = 32 - $parts[1]; - $ipint = IP::toUnsigned( $parts[0] ); - $ipint = $ipint >> $shift << $shift; - $newip = long2ip( $ipint ); - $range = "$newip/{$parts[1]}"; + // IPv6 + if ( IP::isIPv6($range) && $parts[1] >= 64 && $parts[1] <= 128 ) { + $bits = $parts[1]; + $ipint = IP::toUnsigned6( $parts[0] ); + # Native 32 bit functions WONT work here!!! + # Convert to a padded binary number + $network = wfBaseConvert( $ipint, 10, 2, 128 ); + # Truncate the last (128-$bits) bits and replace them with zeros + $network = str_pad( substr( $network, 0, $bits ), 128, 0, STR_PAD_RIGHT ); + # Convert back to an integer + $network = wfBaseConvert( $network, 2, 10 ); + # Reform octet address + $newip = IP::toOctet( $network ); + $range = "$newip/{$parts[1]}"; + } // IPv4 + else if ( IP::isIPv4($range) && $parts[1] >= 16 && $parts[1] <= 32 ) { + $shift = 32 - $parts[1]; + $ipint = IP::toUnsigned( $parts[0] ); + $ipint = $ipint >> $shift << $shift; + $newip = long2ip( $ipint ); + $range = "$newip/{$parts[1]}"; + } } return $range; } @@ -646,7 +678,7 @@ class Block * Purge expired blocks from the ipblocks table */ static function purgeExpired() { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'ipblocks', array( 'ipb_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), __METHOD__ ); } @@ -658,7 +690,7 @@ class Block /* static $infinity; if ( !isset( $infinity ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $infinity = $dbr->bigTimestamp(); } return $infinity; diff --git a/includes/CacheDependency.php b/includes/CacheDependency.php index 4bb3d328..bb5c5437 100644 --- a/includes/CacheDependency.php +++ b/includes/CacheDependency.php @@ -4,6 +4,7 @@ * This class stores an arbitrary value along with its dependencies. * Users should typically only use DependencyWrapper::getFromCache(), rather * than instantiating one of these objects directly. + * @addtogroup Cache */ class DependencyWrapper { var $value; @@ -95,6 +96,9 @@ class DependencyWrapper { } } +/** + * @addtogroup Cache + */ abstract class CacheDependency { /** * Returns true if the dependency is expired, false otherwise @@ -107,6 +111,9 @@ abstract class CacheDependency { function loadDependencyValues() {} } +/** + * @addtogroup Cache + */ class FileDependency extends CacheDependency { var $filename, $timestamp; @@ -163,6 +170,9 @@ class FileDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class TitleDependency extends CacheDependency { var $titleObj; var $ns, $dbk; @@ -219,6 +229,9 @@ class TitleDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class TitleListDependency extends CacheDependency { var $linkBatch; var $timestamps; @@ -244,7 +257,7 @@ class TitleListDependency extends CacheDependency { # Do the query if ( count( $timestamps ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $where = $this->getLinkBatch()->constructSet( 'page', $dbr ); $res = $dbr->select( 'page', array( 'page_namespace', 'page_title', 'page_touched' ), @@ -299,6 +312,9 @@ class TitleListDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class GlobalDependency extends CacheDependency { var $name, $value; @@ -312,6 +328,9 @@ class GlobalDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class ConstantDependency extends CacheDependency { var $name, $value; diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 0086a2f9..356f9ea2 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -3,17 +3,23 @@ * Special handling for category description pages * Modelled after ImagePage.php * - * @package MediaWiki */ if( !defined( 'MEDIAWIKI' ) ) die( 1 ); /** - * @package MediaWiki */ class CategoryPage extends Article { function view() { + global $wgRequest, $wgUser; + + $diff = $wgRequest->getVal( 'diff' ); + $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) ); + + if ( isset( $diff ) && $diffOnly ) + return Article::view(); + if(!wfRunHooks('CategoryPageView', array(&$this))) return; if ( NS_CATEGORY == $this->mTitle->getNamespace() ) { @@ -175,7 +181,7 @@ class CategoryViewer { } function doCategoryQuery() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); if( $this->from != '' ) { $pageCondition = 'cl_sortkey >= ' . $dbr->addQuotes( $this->from ); $this->flip = false; @@ -196,6 +202,7 @@ class CategoryViewer { #+ $pageCondition, __METHOD__, array( 'ORDER BY' => $this->flip ? 'cl_sortkey DESC' : 'cl_sortkey', + 'USE INDEX' => 'cl_sortkey', 'LIMIT' => $this->limit + 1 ) ); $count = 0; @@ -234,11 +241,12 @@ class CategoryViewer { function getSubcategorySection() { # Don't show subcategories section if there are none. $r = ''; - if( count( $this->children ) > 0 ) { + $c = count( $this->children ); + if( $c > 0 ) { # Showing subcategories $r .= "
    \n"; $r .= '

    ' . wfMsg( 'subcategories' ) . "

    \n"; - $r .= wfMsgExt( 'subcategorycount', array( 'parse' ), count( $this->children) ); + $r .= wfMsgExt( 'subcategorycount', array( 'parse' ), $c ); $r .= $this->formatList( $this->children, $this->children_start_char ); $r .= "\n
    "; } @@ -247,11 +255,16 @@ class CategoryViewer { function getPagesSection() { $ti = htmlspecialchars( $this->title->getText() ); - $r = "
    \n"; - $r .= '

    ' . wfMsg( 'category_header', $ti ) . "

    \n"; - $r .= wfMsgExt( 'categoryarticlecount', array( 'parse' ), count( $this->articles) ); - $r .= $this->formatList( $this->articles, $this->articles_start_char ); - $r .= "\n
    "; + # Don't show articles section if there are none. + $r = ''; + $c = count( $this->articles ); + if( $c > 0 ) { + $r = "
    \n"; + $r .= '

    ' . wfMsg( 'category_header', $ti ) . "

    \n"; + $r .= wfMsgExt( 'categoryarticlecount', array( 'parse' ), $c ); + $r .= $this->formatList( $this->articles, $this->articles_start_char ); + $r .= "\n
    "; + } return $r; } @@ -391,7 +404,7 @@ class CategoryViewer { */ function pagingLinks( $title, $first, $last, $limit, $query = array() ) { global $wgUser, $wgLang; - $sk =& $this->getSkin(); + $sk = $this->getSkin(); $limitText = $wgLang->formatNum( $limit ); $prevLink = htmlspecialchars( wfMsg( 'prevn', $limitText ) ); diff --git a/includes/Categoryfinder.php b/includes/Categoryfinder.php index a8cdf3ce..7faae935 100644 --- a/includes/Categoryfinder.php +++ b/includes/Categoryfinder.php @@ -1,26 +1,27 @@ seed ( - array ( 12345 ) , - array ( "Category 1","Category 2" ) , - "AND" - ) ; - $a = $cf->run() ; - print implode ( "," , $a ) ; - -*/ - +/** + * The "Categoryfinder" class takes a list of articles, creates an internal + * representation of all their parent categories (as well as parents of + * parents etc.). From this representation, it determines which of these + * articles are in one or all of a given subset of categories. + * + * Example use : + * + * # Determines whether the article with the page_id 12345 is in both + * # "Category 1" and "Category 2" or their subcategories, respectively + * + * $cf = new Categoryfinder ; + * $cf->seed ( + * array ( 12345 ) , + * array ( "Category 1","Category 2" ) , + * "AND" + * ) ; + * $a = $cf->run() ; + * print implode ( "," , $a ) ; + * + * + */ class Categoryfinder { var $articles = array () ; # The original article IDs passed to the seed function @@ -34,8 +35,8 @@ class Categoryfinder { /** * Constructor (currently empty). - */ - function Categoryfinder () { + */ + function __construct() { } /** @@ -61,10 +62,10 @@ class Categoryfinder { /** * Iterates through the parent tree starting with the seed values, * then checks the articles if they match the conditions - @return array of page_ids (those given to seed() that match the conditions) - */ + * @return array of page_ids (those given to seed() that match the conditions) + */ function run () { - $this->dbr =& wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_SLAVE ); while ( count ( $this->next ) > 0 ) { $this->scan_next_layer () ; } @@ -83,20 +84,20 @@ class Categoryfinder { /** * This functions recurses through the parent representation, trying to match the conditions - @param $id The article/category to check - @param $conds The array of categories to match - @return bool Does this match the conditions? - */ + * @param $id The article/category to check + * @param $conds The array of categories to match + * @return bool Does this match the conditions? + */ function check ( $id , &$conds ) { # Shortcut (runtime paranoia): No contitions=all matched if ( count ( $conds ) == 0 ) return true ; - + if ( !isset ( $this->parents[$id] ) ) return false ; # iterate through the parents foreach ( $this->parents[$id] AS $p ) { $pname = $p->cl_to ; - + # Is this a condition? if ( isset ( $conds[$pname] ) ) { # This key is in the category list! @@ -113,7 +114,7 @@ class Categoryfinder { } } } - + # Not done yet, try sub-parents if ( !isset ( $this->name2id[$pname] ) ) { # No sub-parent @@ -130,10 +131,10 @@ class Categoryfinder { /** * Scans a "parent layer" of the articles/categories in $this->next - */ + */ function scan_next_layer () { $fname = "Categoryfinder::scan_next_layer" ; - + # Find all parents of the article currently in $this->next $layer = array () ; $res = $this->dbr->select( @@ -161,7 +162,7 @@ class Categoryfinder { $this->dbr->freeResult( $res ) ; $this->next = array() ; - + # Find the IDs of all category pages in $layer, if they exist if ( count ( $layer ) > 0 ) { $res = $this->dbr->select( diff --git a/includes/ChangesList.php b/includes/ChangesList.php index a2c1a265..bc141579 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -1,15 +1,7 @@ mAttribs = $rc->mAttribs; $rc2->mExtra = $rc->mExtra; @@ -27,14 +18,17 @@ class RCCacheEntry extends RecentChange } ; /** - * @package MediaWiki + * Class to show various lists of changes: + * - what links here + * - related changes + * - recent changes */ class ChangesList { # Called by history lists and recent changes # /** @todo document */ - function ChangesList( &$skin ) { + function __construct( &$skin ) { $this->skin =& $skin; $this->preCacheMessages(); } @@ -47,7 +41,7 @@ class ChangesList { * @return ChangesList derivative */ public static function newFromUser( &$user ) { - $sk =& $user->getSkin(); + $sk = $user->getSkin(); $list = NULL; if( wfRunHooks( 'FetchChangesList', array( &$user, &$sk, &$list ) ) ) { return $user->getOption( 'usenewrc' ) ? new EnhancedChangesList( $sk ) : new OldChangesList( $sk ); @@ -64,7 +58,7 @@ class ChangesList { // Precache various messages if( !isset( $this->message ) ) { foreach( explode(' ', 'cur diff hist minoreditletter newpageletter last '. - 'blocklink changes history boteditletter' ) as $msg ) { + 'blocklink history boteditletter' ) as $msg ) { $this->message[$msg] = wfMsgExt( $msg, array( 'escape') ); } } @@ -212,6 +206,23 @@ class ChangesList { global $wgUseRCPatrol, $wgUser; return( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ); } + + /** + * Returns the string which indicates the number of watching users + */ + function numberofWatchingusers( $count ) { + global $wgLang; + static $cache = array(); + if ( $count > 0 ) { + if ( !isset( $cache[$count] ) ) { + $cache[$count] = wfMsgExt('number_of_watching_users_RCview', + array('parsemag', 'escape'), $wgLang->formatNum($count)); + } + return $cache[$count]; + } else { + return ''; + } + } } @@ -229,6 +240,7 @@ class OldChangesList extends ChangesList { wfProfileIn( $fname ); # Extract DB fields into local scope + // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables. extract( $rc->mAttribs ); # Should patrol-related stuff be shown? @@ -273,9 +285,7 @@ class OldChangesList extends ChangesList { $this->insertUserRelatedLinks($s,$rc); $this->insertComment($s, $rc); - if($rc->numberofWatchingusers > 0) { - $s .= ' ' . wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rc->numberofWatchingusers)); - } + $s .= rtrim(' ' . $this->numberofWatchingusers($rc->numberofWatchingusers)); $s .= "
  • \n"; @@ -301,6 +311,7 @@ class EnhancedChangesList extends ChangesList { $rc = RCCacheEntry::newFromParent( $baseRC ); # Extract fields from DB into the function scope (rc_xxxx variables) + // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables. extract( $rc->mAttribs ); $curIdEq = 'curid=' . $rc_cur_id; @@ -405,7 +416,7 @@ class EnhancedChangesList extends ChangesList { * Enhanced RC group */ function recentChangesBlockGroup( $block ) { - global $wgContLang, $wgRCShowChangedSize; + global $wgLang, $wgContLang, $wgRCShowChangedSize; $r = ''; # Collate list of users @@ -467,22 +478,32 @@ class EnhancedChangesList extends ChangesList { $currentRevision = $block[0]->mAttribs['rc_this_oldid']; if( $block[0]->mAttribs['rc_type'] != RC_LOG ) { # Changes - $r .= ' ('.count($block).' '; + + $n = count($block); + static $nchanges = array(); + if ( !isset( $nchanges[$n] ) ) { + $nchanges[$n] = wfMsgExt( 'nchanges', array( 'parsemag', 'escape'), + $wgLang->formatNum( $n ) ); + } + + $r .= ' ('; if( $isnew ) { - $r .= $this->message['changes']; + $r .= $nchanges[$n]; } else { $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(), - $this->message['changes'], $curIdEq."&diff=$currentRevision&oldid=$oldid" ); + $nchanges[$n], $curIdEq."&diff=$currentRevision&oldid=$oldid" ); } + $r .= ') . . '; + # Character difference $chardiff = $rcObj->getCharacterDifference( $block[ count( $block ) - 1 ]->mAttribs['rc_old_len'], $block[0]->mAttribs['rc_new_len'] ); if( $chardiff == '' ) { - $r .= '; '; + $r .= ' ('; } else { - $r .= '; ' . $chardiff . ' '; + $r .= ' ' . $chardiff. ' . . ('; } @@ -494,16 +515,14 @@ class EnhancedChangesList extends ChangesList { $r .= $users; - if($block[0]->numberofWatchingusers > 0) { - global $wgContLang; - $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($block[0]->numberofWatchingusers)); - } + $r .= $this->numberofWatchingusers($block[0]->numberofWatchingusers); $r .= "
    \n"; # Sub-entries $r .= '