Merge "Add config for serving main Page from the domain root"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 23 Sep 2019 15:28:03 +0000 (15:28 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 23 Sep 2019 15:28:03 +0000 (15:28 +0000)
586 files changed:
.phan/config.php
.travis.yml
INSTALL
RELEASE-NOTES-1.34
autoload.php
composer.json
includes/AjaxResponse.php
includes/Autopromote.php
includes/DefaultSettings.php
includes/DevelopmentSettings.php
includes/EditPage.php
includes/FauxRequest.php
includes/GlobalFunctions.php
includes/Linker.php
includes/MergeHistory.php
includes/MovePage.php
includes/OutputPage.php
includes/PHPVersionCheck.php
includes/Permissions/PermissionManager.php
includes/ProtectionForm.php
includes/Rest/BasicAccess/MWBasicAuthorizer.php
includes/Rest/BasicAccess/MWBasicRequestAuthorizer.php
includes/Rest/EntryPoint.php
includes/Rest/LocalizedHttpException.php
includes/Rest/ResponseFactory.php
includes/Rest/Router.php
includes/Rest/Validator/ParamValidatorCallbacks.php
includes/Rest/Validator/Validator.php
includes/Revision/RevisionRecord.php
includes/Revision/RevisionStore.php
includes/Revision/RevisionStoreRecord.php
includes/Revision/SlotRoleHandler.php
includes/ServiceWiring.php
includes/Setup.php
includes/Storage/PageEditStash.php
includes/Title.php
includes/WebRequest.php
includes/Xml.php
includes/actions/McrUndoAction.php
includes/actions/SpecialPageAction.php
includes/api/ApiBase.php
includes/api/ApiErrorFormatter.php
includes/api/ApiQueryAllUsers.php
includes/api/ApiQueryBase.php
includes/api/ApiQueryBlockInfoTrait.php [new file with mode: 0644]
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryImageInfo.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryQueryPage.php
includes/api/ApiQuerySiteinfo.php
includes/api/ApiQueryUsers.php
includes/api/ApiTag.php
includes/api/ApiUpload.php
includes/api/i18n/fr.json
includes/api/i18n/gl.json
includes/api/i18n/he.json
includes/api/i18n/ko.json
includes/api/i18n/lt.json
includes/api/i18n/mk.json
includes/api/i18n/pt.json
includes/api/i18n/qqq.json
includes/api/i18n/ru.json
includes/api/i18n/zh-hant.json
includes/block/BlockManager.php
includes/cache/localisation/LocalisationCache.php
includes/changes/ChangesList.php
includes/changes/OldChangesList.php
includes/exception/MWExceptionHandler.php
includes/export/Dump7ZipOutput.php
includes/export/DumpFileOutput.php
includes/export/DumpFilter.php
includes/export/DumpOutput.php
includes/export/DumpPipeOutput.php
includes/filerepo/file/ArchivedFile.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
includes/htmlform/HTMLForm.php
includes/htmlform/fields/HTMLTitleTextField.php
includes/htmlform/fields/HTMLUserTextField.php
includes/http/HttpRequestFactory.php
includes/import/WikiImporter.php
includes/import/WikiRevision.php
includes/installer/i18n/be-tarask.json
includes/installer/i18n/de.json
includes/installer/i18n/diq.json
includes/installer/i18n/io.json
includes/installer/i18n/nap.json
includes/installer/i18n/pt.json
includes/installer/i18n/ru.json
includes/libs/StringUtils.php
includes/libs/filebackend/SwiftFileBackend.php
includes/libs/mime/MimeAnalyzer.php
includes/libs/objectcache/wancache/WANObjectCache.php
includes/logging/LogPager.php
includes/mail/UserMailer.php
includes/objectcache/ObjectCache.php
includes/objectcache/SqlBagOStuff.php
includes/page/Article.php
includes/page/MovePageFactory.php
includes/parser/CoreParserFunctions.php
includes/parser/PPDPart_Hash.php
includes/parser/Parser.php
includes/password/PasswordPolicyChecks.php
includes/preferences/DefaultPreferencesFactory.php
includes/profiler/SectionProfiler.php
includes/resourceloader/DerivativeResourceLoaderContext.php
includes/resourceloader/MessageBlobStore.php
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderCircularDependencyError.php
includes/resourceloader/ResourceLoaderClientHtml.php
includes/resourceloader/ResourceLoaderContext.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderFilePath.php
includes/resourceloader/ResourceLoaderForeignApiModule.php
includes/resourceloader/ResourceLoaderImage.php
includes/resourceloader/ResourceLoaderImageModule.php
includes/resourceloader/ResourceLoaderLanguageDataModule.php
includes/resourceloader/ResourceLoaderLessVarFileModule.php
includes/resourceloader/ResourceLoaderModule.php
includes/resourceloader/ResourceLoaderOOUIFileModule.php
includes/resourceloader/ResourceLoaderOOUIIconPackModule.php
includes/resourceloader/ResourceLoaderOOUIModule.php
includes/resourceloader/ResourceLoaderSiteModule.php
includes/resourceloader/ResourceLoaderSiteStylesModule.php
includes/resourceloader/ResourceLoaderSkinModule.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/resourceloader/ResourceLoaderUserDefaultsModule.php
includes/resourceloader/ResourceLoaderUserModule.php
includes/resourceloader/ResourceLoaderUserOptionsModule.php
includes/resourceloader/ResourceLoaderUserStylesModule.php
includes/resourceloader/ResourceLoaderUserTokensModule.php
includes/resourceloader/ResourceLoaderWikiModule.php
includes/site/MediaWikiSite.php
includes/site/Site.php
includes/site/SiteImporter.php
includes/skins/BaseTemplate.php
includes/specialpage/LoginSignupSpecialPage.php
includes/specials/SpecialBlock.php
includes/specials/SpecialConfirmEmail.php
includes/specials/SpecialEditTags.php
includes/specials/SpecialImport.php
includes/specials/SpecialListFiles.php
includes/specials/SpecialMyLanguage.php
includes/specials/SpecialPagesWithProp.php
includes/specials/SpecialRevisionDelete.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserrights.php
includes/specials/forms/PreferencesFormOOUI.php
includes/upload/UploadBase.php
includes/watcheditem/WatchedItemQueryService.php
languages/data/ZhConversion.php
languages/i18n/ace.json
languages/i18n/ady-cyrl.json
languages/i18n/aeb-arab.json
languages/i18n/af.json
languages/i18n/ais.json
languages/i18n/aln.json
languages/i18n/am.json
languages/i18n/ami.json
languages/i18n/an.json
languages/i18n/ang.json
languages/i18n/anp.json
languages/i18n/ar.json
languages/i18n/arc.json
languages/i18n/arn.json
languages/i18n/arq.json
languages/i18n/ary.json
languages/i18n/arz.json
languages/i18n/as.json
languages/i18n/ase.json
languages/i18n/ast.json
languages/i18n/atj.json
languages/i18n/avk.json
languages/i18n/awa.json
languages/i18n/az.json
languages/i18n/azb.json
languages/i18n/ba.json
languages/i18n/ban.json
languages/i18n/bar.json
languages/i18n/bcc.json
languages/i18n/bcl.json
languages/i18n/be-tarask.json
languages/i18n/be.json
languages/i18n/bg.json
languages/i18n/bgn.json
languages/i18n/bho.json
languages/i18n/bjn.json
languages/i18n/bn.json
languages/i18n/bo.json
languages/i18n/bpy.json
languages/i18n/bqi.json
languages/i18n/br.json
languages/i18n/bs.json
languages/i18n/btm.json
languages/i18n/bto.json
languages/i18n/ca.json
languages/i18n/cdo.json
languages/i18n/ce.json
languages/i18n/ceb.json
languages/i18n/ch.json
languages/i18n/ckb.json
languages/i18n/co.json
languages/i18n/cps.json
languages/i18n/crh-cyrl.json
languages/i18n/crh-latn.json
languages/i18n/cs.json
languages/i18n/csb.json
languages/i18n/cu.json
languages/i18n/cv.json
languages/i18n/cy.json
languages/i18n/da.json
languages/i18n/de-formal.json
languages/i18n/de.json
languages/i18n/diq.json
languages/i18n/dsb.json
languages/i18n/dtp.json
languages/i18n/dty.json
languages/i18n/ee.json
languages/i18n/egl.json
languages/i18n/el.json
languages/i18n/en-gb.json
languages/i18n/en.json
languages/i18n/eo.json
languages/i18n/es.json
languages/i18n/et.json
languages/i18n/eu.json
languages/i18n/exif/cs.json
languages/i18n/exif/nds-nl.json
languages/i18n/exif/sr-ec.json
languages/i18n/exif/tt-cyrl.json
languages/i18n/exif/zh-hans.json
languages/i18n/ext.json
languages/i18n/fa.json
languages/i18n/fi.json
languages/i18n/fit.json
languages/i18n/fo.json
languages/i18n/fr.json
languages/i18n/frc.json
languages/i18n/frp.json
languages/i18n/frr.json
languages/i18n/fur.json
languages/i18n/fy.json
languages/i18n/ga.json
languages/i18n/gag.json
languages/i18n/gan-hans.json
languages/i18n/gan-hant.json
languages/i18n/gcr.json
languages/i18n/gd.json
languages/i18n/gl.json
languages/i18n/glk.json
languages/i18n/gom-deva.json
languages/i18n/gom-latn.json
languages/i18n/gor.json
languages/i18n/got.json
languages/i18n/grc.json
languages/i18n/gsw.json
languages/i18n/gu.json
languages/i18n/gv.json
languages/i18n/ha.json
languages/i18n/hak.json
languages/i18n/haw.json
languages/i18n/he.json
languages/i18n/hi.json
languages/i18n/hif-latn.json
languages/i18n/hil.json
languages/i18n/hr.json
languages/i18n/hrx.json
languages/i18n/hsb.json
languages/i18n/ht.json
languages/i18n/hu.json
languages/i18n/hy.json
languages/i18n/hyw.json
languages/i18n/ia.json
languages/i18n/id.json
languages/i18n/ie.json
languages/i18n/ig.json
languages/i18n/ilo.json
languages/i18n/inh.json
languages/i18n/io.json
languages/i18n/is.json
languages/i18n/it.json
languages/i18n/ja.json
languages/i18n/jam.json
languages/i18n/jut.json
languages/i18n/jv.json
languages/i18n/ka.json
languages/i18n/kaa.json
languages/i18n/kab.json
languages/i18n/kbd-cyrl.json
languages/i18n/khw.json
languages/i18n/kiu.json
languages/i18n/kjp.json
languages/i18n/kk-arab.json
languages/i18n/kk-cyrl.json
languages/i18n/kk-latn.json
languages/i18n/km.json
languages/i18n/kn.json
languages/i18n/ko.json
languages/i18n/krc.json
languages/i18n/krl.json
languages/i18n/ksh.json
languages/i18n/ku-latn.json
languages/i18n/kum.json
languages/i18n/kw.json
languages/i18n/ky.json
languages/i18n/la.json
languages/i18n/lad.json
languages/i18n/lb.json
languages/i18n/lez.json
languages/i18n/lfn.json
languages/i18n/lg.json
languages/i18n/li.json
languages/i18n/lij.json
languages/i18n/lki.json
languages/i18n/lmo.json
languages/i18n/lo.json
languages/i18n/loz.json
languages/i18n/lrc.json
languages/i18n/lt.json
languages/i18n/ltg.json
languages/i18n/lus.json
languages/i18n/luz.json
languages/i18n/lv.json
languages/i18n/lzh.json
languages/i18n/lzz.json
languages/i18n/mai.json
languages/i18n/map-bms.json
languages/i18n/mdf.json
languages/i18n/mg.json
languages/i18n/mhr.json
languages/i18n/min.json
languages/i18n/mk.json
languages/i18n/ml.json
languages/i18n/mn.json
languages/i18n/mni.json
languages/i18n/mnw.json
languages/i18n/mr.json
languages/i18n/ms.json
languages/i18n/mt.json
languages/i18n/mwl.json
languages/i18n/my.json
languages/i18n/myv.json
languages/i18n/mzn.json
languages/i18n/nah.json
languages/i18n/nan.json
languages/i18n/nap.json
languages/i18n/nb.json
languages/i18n/nds-nl.json
languages/i18n/nds.json
languages/i18n/ne.json
languages/i18n/nl-informal.json
languages/i18n/nl.json
languages/i18n/nn.json
languages/i18n/nqo.json
languages/i18n/nso.json
languages/i18n/nys.json
languages/i18n/oc.json
languages/i18n/olo.json
languages/i18n/or.json
languages/i18n/os.json
languages/i18n/pa.json
languages/i18n/pag.json
languages/i18n/pam.json
languages/i18n/pcd.json
languages/i18n/pdc.json
languages/i18n/pfl.json
languages/i18n/pl.json
languages/i18n/pms.json
languages/i18n/pnb.json
languages/i18n/pnt.json
languages/i18n/prg.json
languages/i18n/ps.json
languages/i18n/pt-br.json
languages/i18n/pt.json
languages/i18n/qqq.json
languages/i18n/qu.json
languages/i18n/qug.json
languages/i18n/rif.json
languages/i18n/rm.json
languages/i18n/ro.json
languages/i18n/roa-tara.json
languages/i18n/ru.json
languages/i18n/rue.json
languages/i18n/sa.json
languages/i18n/sah.json
languages/i18n/sat.json
languages/i18n/sc.json
languages/i18n/scn.json
languages/i18n/sco.json
languages/i18n/sd.json
languages/i18n/sdc.json
languages/i18n/sdh.json
languages/i18n/se.json
languages/i18n/sei.json
languages/i18n/ses.json
languages/i18n/sgs.json
languages/i18n/sh.json
languages/i18n/shi.json
languages/i18n/shn.json
languages/i18n/shy-latn.json
languages/i18n/si.json
languages/i18n/sk.json
languages/i18n/skr-arab.json
languages/i18n/sl.json
languages/i18n/sli.json
languages/i18n/so.json
languages/i18n/sq.json
languages/i18n/sr-ec.json
languages/i18n/sr-el.json
languages/i18n/srn.json
languages/i18n/stq.json
languages/i18n/sty.json
languages/i18n/su.json
languages/i18n/sv.json
languages/i18n/sw.json
languages/i18n/szl.json
languages/i18n/ta.json
languages/i18n/tay.json
languages/i18n/tcy.json
languages/i18n/te.json
languages/i18n/tet.json
languages/i18n/tg-cyrl.json
languages/i18n/tg-latn.json
languages/i18n/th.json
languages/i18n/tk.json
languages/i18n/tl.json
languages/i18n/tly.json
languages/i18n/to.json
languages/i18n/tpi.json
languages/i18n/tr.json
languages/i18n/tru.json
languages/i18n/trv.json
languages/i18n/ts.json
languages/i18n/tt-cyrl.json
languages/i18n/tt-latn.json
languages/i18n/tyv.json
languages/i18n/tzm.json
languages/i18n/udm.json
languages/i18n/ug-arab.json
languages/i18n/uk.json
languages/i18n/ur.json
languages/i18n/uz.json
languages/i18n/vec.json
languages/i18n/vep.json
languages/i18n/vi.json
languages/i18n/vmf.json
languages/i18n/vo.json
languages/i18n/vot.json
languages/i18n/vro.json
languages/i18n/wa.json
languages/i18n/war.json
languages/i18n/wo.json
languages/i18n/wuu.json
languages/i18n/xal.json
languages/i18n/xmf.json
languages/i18n/xsy.json
languages/i18n/yi.json
languages/i18n/yo.json
languages/i18n/yue.json
languages/i18n/zea.json
languages/i18n/zgh.json
languages/i18n/zh-hans.json
languages/i18n/zh-hant.json
languages/i18n/zh-hk.json
maintenance/Doxyfile
maintenance/addChangeTag.php
maintenance/changePassword.php
maintenance/cleanupCaps.php
maintenance/cleanupRevActorPage.php [new file with mode: 0644]
maintenance/copyFileBackend.php
maintenance/createAndPromote.php
maintenance/edit.php
maintenance/importDump.php
maintenance/importImages.php
maintenance/install.php
maintenance/language/zhtable/simp2trad.manual
maintenance/language/zhtable/simp2trad_noconvert.manual
maintenance/language/zhtable/toCN.manual
maintenance/language/zhtable/toHK.manual
maintenance/language/zhtable/toSimp.manual
maintenance/language/zhtable/toTW.manual
maintenance/language/zhtable/toTrad.manual
maintenance/language/zhtable/trad2simp.manual
maintenance/language/zhtable/tradphrases.manual
maintenance/language/zhtable/tradphrases_exclude.manual
maintenance/mediawiki.Title/generatePhpCharToUpperMappings.php
maintenance/moveBatch.php
maintenance/mwdocgen.php
maintenance/purgeList.php
maintenance/refreshFileHeaders.php
mw-config/config.css
resources/Resources.php
resources/src/jquery/jquery.makeCollapsible.js
resources/src/mediawiki.Title/Title.js
resources/src/mediawiki.Title/phpCharToUpper.json
resources/src/mediawiki.legacy/shared.css
resources/src/mediawiki.page.gallery.slideshow.js
resources/src/mediawiki.page.image.pagination.js
resources/src/mediawiki.page.ready/.eslintrc.json [new file with mode: 0644]
resources/src/mediawiki.page.ready/checkboxShift.js
resources/src/mediawiki.page.ready/ready.js
resources/src/mediawiki.special/listFiles.less [new file with mode: 0644]
resources/src/mediawiki.ui/components/forms.less
tests/parser/parserTests.txt
tests/phpunit/MediaWikiCoversValidator.php
tests/phpunit/MediaWikiIntegrationTestCase.php
tests/phpunit/MediaWikiTestCaseTrait.php
tests/phpunit/includes/EditPageTest.php
tests/phpunit/includes/FauxRequestTest.php
tests/phpunit/includes/HtmlTest.php
tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/MediaWikiServicesTest.php
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/Rest/BasicAccess/MWBasicRequestAuthorizerTest.php
tests/phpunit/includes/Rest/EntryPointTest.php
tests/phpunit/includes/Revision/McrRevisionStoreDbTest.php
tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php
tests/phpunit/includes/SiteStatsTest.php
tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php
tests/phpunit/includes/TitleMethodsTest.php
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/XmlTest.php
tests/phpunit/includes/api/ApiBlockTest.php
tests/phpunit/includes/api/ApiPageSetTest.php
tests/phpunit/includes/api/ApiQueryBlockInfoTraitTest.php [new file with mode: 0644]
tests/phpunit/includes/api/ApiQuerySiteinfoTest.php
tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php
tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
tests/phpunit/includes/api/ApiWatchTest.php
tests/phpunit/includes/auth/AuthManagerTest.php
tests/phpunit/includes/block/BlockRestrictionStoreTest.php
tests/phpunit/includes/block/DatabaseBlockTest.php
tests/phpunit/includes/cache/MessageCacheTest.php
tests/phpunit/includes/changes/CategoryMembershipChangeTest.php
tests/phpunit/includes/changes/EnhancedChangesListTest.php
tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
tests/phpunit/includes/content/ContentHandlerTest.php
tests/phpunit/includes/content/UnknownContentHandlerTest.php
tests/phpunit/includes/content/UnknownContentTest.php
tests/phpunit/includes/content/WikitextContentHandlerTest.php
tests/phpunit/includes/context/RequestContextTest.php
tests/phpunit/includes/db/LBFactoryTest.php
tests/phpunit/includes/deferred/SiteStatsUpdateTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/filerepo/file/LocalFileTest.php
tests/phpunit/includes/http/GuzzleHttpRequestTest.php
tests/phpunit/includes/http/HttpTest.php
tests/phpunit/includes/jobqueue/JobQueueTest.php
tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php
tests/phpunit/includes/libs/ProcessCacheLRUTest.php
tests/phpunit/includes/libs/StringUtilsTest.php
tests/phpunit/includes/libs/TimingTest.php
tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php
tests/phpunit/includes/linker/LinkRendererTest.php
tests/phpunit/includes/media/JpegPixelFormatTest.php
tests/phpunit/includes/media/PNGMetadataExtractorTest.php
tests/phpunit/includes/page/WikiPageDbTestBase.php
tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
tests/phpunit/includes/search/SearchNearMatchResultSetTest.php
tests/phpunit/includes/shell/ShellTest.php
tests/phpunit/includes/site/CachingSiteStoreTest.php
tests/phpunit/includes/site/DBSiteStoreTest.php
tests/phpunit/includes/site/SiteTest.php
tests/phpunit/includes/specials/SpecialPageDataTest.php
tests/phpunit/includes/user/UserTest.php
tests/phpunit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php
tests/phpunit/includes/watcheditem/WatchedItemStoreUnitTest.php
tests/phpunit/integration/includes/db/DatabaseSqliteTest.php
tests/phpunit/languages/LanguageTest.php
tests/phpunit/maintenance/DumpTestCase.php
tests/phpunit/unit/includes/Rest/Handler/HelloHandlerTest.php
tests/phpunit/unit/includes/Rest/ResponseFactoryTest.php
tests/phpunit/unit/includes/Rest/RouterTest.php
tests/phpunit/unit/includes/diff/DiffOpTest.php
tests/phpunit/unit/includes/password/PasswordFactoryTest.php
tests/phpunit/unit/includes/search/SearchSuggestionSetTest.php
tests/selenium/wdio-mediawiki/Api.js
tests/selenium/wdio-mediawiki/CHANGELOG.md
tests/selenium/wdio-mediawiki/README.md
tests/selenium/wdio-mediawiki/package.json
tests/selenium/wdio.conf.js

index 56a8ccb..0fdefe0 100644 (file)
@@ -101,9 +101,6 @@ $cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [
        //after dropping HHVM
        // approximate error count: 110
        "PhanParamTooMany", // False positives with variargs. Unsuppress after dropping HHVM
-
-       // approximate error count: 45
-       "PhanTypeMismatchArgument",
 ] );
 
 // This helps a lot in discovering bad code, but unfortunately it will always fail for
index d5607f1..8dbc5f2 100644 (file)
@@ -26,8 +26,6 @@ matrix:
   include:
     - php: 7.3
     - php: 7.2
-    - php: 7.1
-    - php: 7
 
 services:
   - mysql
diff --git a/INSTALL b/INSTALL
index 07dd9c3..0359166 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -7,7 +7,7 @@ Starting with MediaWiki 1.2.0, it's possible to install and configure the wiki
 
 Required software as of MediaWiki 1.34.0:
 
-* Web server with PHP 7.0.13 or higher, plus the following extesnsions:
+* Web server with PHP 7.2.0 or higher, plus the following extesnsions:
 ** ctype
 ** dom
 ** fileinfo
index 2da3b55..508ba08 100644 (file)
@@ -141,7 +141,7 @@ $wgPasswordPolicy['policies']['default']['PasswordNotInLargeBlacklist'] = false;
 * Updated mediawiki/codesniffer from 25.0.0 to 26.0.0 (dev-only).
 * Updated cssjanus/cssjanus from 1.2.1 to 1.3.0.
 * Updated wikimedia/at-ease from 1.2.0 to 2.0.0.
-* Updated wikimedia/remex-html from 2.0.1 to 2.0.3.
+* Updated wikimedia/remex-html from 2.0.1 to 2.1.0.
 * Updated monolog/monolog from 1.22.1 to 1.24.0 (dev-only).
 * Updated wikimedia/object-factory from 1.0.0 to 2.1.0.
 * Updated wikimedia/timestamp from 2.2.0 to 3.0.0.
@@ -164,6 +164,21 @@ $wgPasswordPolicy['policies']['default']['PasswordNotInLargeBlacklist'] = false;
   deprecated in 1.25, has been removed.
 * (T60993) action=query list=filearchive, list=alldeletedrevisions and
   prop=deletedrevisions no longer require the 'deletedhistory' user right.
+* In the response to queries that use 'prop=imageinfo', entries for
+  non-existing files (indicated by the 'filemissing' field) now omit the
+  following fields, since they are meaningless in this context:
+  'timestamp', 'userhidden', 'user', 'userid', 'anon', 'size', 'width',
+  'height', 'pagecount', 'duration', 'commenthidden', 'parsedcomment',
+  'comment', 'thumburl', 'thumbwidth', 'thumbheight', 'thumbmime',
+  'thumberror', 'url', 'sha1', 'metadata', 'extmetadata', 'commonmetadata',
+  'mime', 'mediadtype', 'bitdepth'.
+  Clients that process these fields should first check if 'filemissing' is
+  set. Fields that are supported even if the file is missing include:
+  'canonicaltitle', ''archivename' (deleted files only), 'descriptionurl',
+  'descriptionshorturl'.
+* The 'blockexpiry' result property in list=users and list=allusers will now be
+  returned in the same format used by the rest of the API: ISO 8601 for
+  expiring blocks, and "infinite" for non-expiring blocks.
 
 === Action API internal changes in 1.34 ===
 * The exception thrown in ApiModuleManager::getModule has been changed
@@ -171,7 +186,7 @@ $wgPasswordPolicy['policies']['default']['PasswordNotInLargeBlacklist'] = false;
   ApiModuleManager::getModule now also throws InvalidArgumentExceptions when
   ObjectFactory is presented with an invalid spec or incorrectly constructed
   objects.
-* 
+* Added ApiQueryBlockInfoTrait.
 
 === Languages updated in 1.34 ===
 MediaWiki supports over 350 languages. Many localisations are updated regularly.
@@ -303,6 +318,10 @@ because of Phabricator reports.
 * mw.language.specialCharacters, deprecated in 1.33, has been removed.
   Use require( 'mediawiki.language.specialCharacters' ) instead.
 * The jquery.colorUtil module was removed. Use jquery.color instead.
+* The jquery.checkboxShiftClick module was removed. The functionality
+  is provided by mediawiki.page.ready instead (T232688).
+* The 'jquery.accessKeyLabel' module has been removed. This jQuery
+  plugin now ships as part of the 'mediawiki.util' module bundle.
 * EditPage::submit(), deprecated in 1.29, has been removed. Use $this->edit()
   directly.
 * HTMLForm::getErrors(), deprecated in 1.28, has been removed. Use
@@ -430,6 +449,8 @@ because of Phabricator reports.
   * Revision::selectPageFields()
   * Revision::selectUserFields()
 * User::setNewpassword(), deprecated in 1.27 has been removed.
+* The ObjectCache::getMainWANInstance and ObjectCache::getMainStashInstance
+  functions, deprecated since 1.28, have been removed.
 
 === Deprecations in 1.34 ===
 * The MWNamespace class is deprecated. Use NamespaceInfo.
@@ -485,8 +506,6 @@ because of Phabricator reports.
 * ResourceLoaderContext::getConfig and ResourceLoaderContext::getLogger have
   been deprecated. Inside ResourceLoaderModule subclasses, use the local methods
   instead. Elsewhere, use the methods from the ResourceLoader class.
-* The 'jquery.accessKeyLabel' module has been deprecated. This jQuery
-  plugin is now ships as part of the 'mediawiki.util' module bundle.
 * The Profiler::setTemplated and Profiler::getTemplated methods have been
   deprecated. Use Profiler::setAllowOutput and Profiler::getAllowOutput
   instead.
@@ -568,13 +587,18 @@ because of Phabricator reports.
 * StreamFile::send404Message() and StreamFile::parseRange() are now deprecated.
   Use HTTPFileStreamer::send404Message() and HTTPFileStreamer::parseRange()
   respectively instead.
+* Global variable $wgSysopEmailBans is deprecated; to allow sysops to ban
+  users from sending emails, use
+  $wgGroupPermissions['sysop']['blockemail'] = true;
+* ApiQueryBase::showHiddenUsersAddBlockInfo() is deprecated. Use
+  ApiQueryBlockInfoTrait instead.
 
 === Other changes in 1.34 ===
 * …
 
 == Compatibility ==
-MediaWiki 1.34 requires PHP 7.0.13 or later. Although HHVM 3.18.5 or later is
-supported, it is generally advised to use PHP 7.0.13 or later for long term
+MediaWiki 1.34 requires PHP 7.2.0 or later. Although HHVM 3.18.5 or later is
+supported, it is generally advised to use PHP 7.2.0 or later for long term
 support. It also requires the following PHP extensions:
 
 * ctype
index f95e001..7ff29ce 100644 (file)
@@ -89,6 +89,7 @@ $wgAutoloadLocalClasses = [
        'ApiQueryBacklinks' => __DIR__ . '/includes/api/ApiQueryBacklinks.php',
        'ApiQueryBacklinksprop' => __DIR__ . '/includes/api/ApiQueryBacklinksprop.php',
        'ApiQueryBase' => __DIR__ . '/includes/api/ApiQueryBase.php',
+       'ApiQueryBlockInfoTrait' => __DIR__ . '/includes/api/ApiQueryBlockInfoTrait.php',
        'ApiQueryBlocks' => __DIR__ . '/includes/api/ApiQueryBlocks.php',
        'ApiQueryCategories' => __DIR__ . '/includes/api/ApiQueryCategories.php',
        'ApiQueryCategoryInfo' => __DIR__ . '/includes/api/ApiQueryCategoryInfo.php',
@@ -272,6 +273,7 @@ $wgAutoloadLocalClasses = [
        'CleanupInvalidDbKeys' => __DIR__ . '/maintenance/cleanupInvalidDbKeys.php',
        'CleanupPreferences' => __DIR__ . '/maintenance/cleanupPreferences.php',
        'CleanupRemovedModules' => __DIR__ . '/maintenance/cleanupRemovedModules.php',
+       'CleanupRevActorPage' => __DIR__ . '/maintenance/cleanupRevActorPage.php',
        'CleanupSpam' => __DIR__ . '/maintenance/cleanupSpam.php',
        'CleanupUploadStash' => __DIR__ . '/maintenance/cleanupUploadStash.php',
        'CleanupUsersWithNoId' => __DIR__ . '/maintenance/cleanupUsersWithNoId.php',
index 5785873..1f2776c 100644 (file)
@@ -49,7 +49,7 @@
                "wikimedia/php-session-serializer": "1.0.7",
                "wikimedia/purtle": "1.0.7",
                "wikimedia/relpath": "2.1.1",
-               "wikimedia/remex-html": "2.0.3",
+               "wikimedia/remex-html": "2.1.0",
                "wikimedia/running-stat": "1.2.1",
                "wikimedia/scoped-callback": "3.0.0",
                "wikimedia/utfnormal": "2.0.0",
index 0664652..faff021 100644 (file)
@@ -55,7 +55,7 @@ class AjaxResponse {
 
        /**
         * HTTP response code
-        * @var string $mResponseCode
+        * @var int|string $mResponseCode
         */
        private $mResponseCode;
 
@@ -114,7 +114,7 @@ class AjaxResponse {
 
        /**
         * Set the HTTP response code
-        * @param string $code
+        * @param int|string $code
         */
        function setResponseCode( $code ) {
                $this->mResponseCode = $code;
index 2156787..f8f3c24 100644 (file)
@@ -187,10 +187,10 @@ class Autopromote {
                                }
                                return $user->getEditCount() >= $reqEditCount;
                        case APCOND_AGE:
-                               $age = time() - wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
+                               $age = time() - (int)wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
                                return $age >= $cond[1];
                        case APCOND_AGE_FROM_EDIT:
-                               $age = time() - wfTimestampOrNull( TS_UNIX, $user->getFirstEditTimestamp() );
+                               $age = time() - (int)wfTimestampOrNull( TS_UNIX, $user->getFirstEditTimestamp() );
                                return $age >= $cond[1];
                        case APCOND_INGROUPS:
                                $groups = array_slice( $cond, 1 );
index 6e01efc..1068700 100644 (file)
@@ -2733,16 +2733,17 @@ $wgExtensionInfoMTime = false;
  * although they are sometimes still referred to as Squid settings for
  * historical reasons.
  *
- * Achieving a high hit ratio with an HTTP proxy requires special
- * configuration. See https://www.mediawiki.org/wiki/Manual:Squid_caching for
- * more details.
+ * Achieving a high hit ratio with an HTTP proxy requires special configuration.
+ * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
+ * for more details.
  *
  * @{
  */
 
 /**
  * Enable/disable CDN.
- * See https://www.mediawiki.org/wiki/Manual:Squid_caching
+ *
+ * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
  *
  * @since 1.34 Renamed from $wgUseSquid.
  */
@@ -4444,7 +4445,8 @@ $wgCentralIdLookupProvider = 'local';
  * The checks supported by core are:
  *     - MinimalPasswordLength - Minimum length a user can set.
  *     - MinimumPasswordLengthToLogin - Passwords shorter than this will
- *             not be allowed to login, regardless if it is correct.
+ *             not be allowed to login, or offered a chance to reset their password
+ *             as part of the login workflow, regardless if it is correct.
  *     - MaximalPasswordLength - maximum length password a user is allowed
  *             to attempt. Prevents DoS attacks with pbkdf2.
  *     - PasswordCannotMatchUsername - Password cannot match the username.
@@ -4990,6 +4992,8 @@ $wgBlockAllowsUTEdit = true;
 
 /**
  * Allow sysops to ban users from accessing Emailuser
+ * @deprecated since 1.34; `$wgGroupPermissions['sysop']['blockemail'] = true;`
+ * should be used instead
  */
 $wgSysopEmailBans = true;
 
index d93caa7..668de39 100644 (file)
@@ -27,7 +27,7 @@ ini_set( 'display_errors', 1 );
 
 global $wgDevelopmentWarnings, $wgShowExceptionDetails, $wgShowHostnames,
        $wgDebugRawPage, $wgCommandLineMode, $wgDebugLogFile,
-       $wgDBerrorLog, $wgDebugLogGroups;
+       $wgDBerrorLog, $wgDebugLogGroups, $wgLocalisationCacheConf;
 
 // Use of wfWarn() should cause tests to fail
 $wgDevelopmentWarnings = true;
@@ -74,3 +74,6 @@ $wgSQLMode = 'TRADITIONAL';
 
 // Disable legacy javascript globals in CI and for devs (T72470)
 $wgLegacyJavaScriptGlobals = false;
+
+// Localisation Cache to StaticArray (T218207)
+$wgLocalisationCacheConf['store'] = 'array';
index 23d6ef9..fe00149 100644 (file)
@@ -1156,7 +1156,7 @@ class EditPage {
                        $out->showErrorPage(
                                'modeleditnotsupported-title',
                                'modeleditnotsupported-text',
-                               $modelName
+                               [ $modelName ]
                        );
                        return false;
                }
@@ -1188,7 +1188,7 @@ class EditPage {
        /**
         * @param Content|null $def_content The default value to return
         *
-        * @return Content|null Content on success, $def_content for invalid sections
+        * @return Content|false|null Content on success, $def_content for invalid sections
         *
         * @since 1.21
         */
@@ -1683,7 +1683,9 @@ class EditPage {
                        case self::AS_CANNOT_USE_CUSTOM_MODEL:
                        case self::AS_PARSE_ERROR:
                        case self::AS_UNICODE_NOT_SUPPORTED:
-                               $out->wrapWikiTextAsInterface( 'error', $status->getWikiText() );
+                               $out->wrapWikiTextAsInterface( 'error',
+                                       $status->getWikiText( false, false, $this->context->getLanguage() )
+                               );
                                return true;
 
                        case self::AS_SUCCESS_NEW_ARTICLE:
@@ -1757,7 +1759,8 @@ class EditPage {
                                // is if an extension hook aborted from inside ArticleSave.
                                // Render the status object into $this->hookError
                                // FIXME this sucks, we should just use the Status object throughout
-                               $this->hookError = '<div class="error">' . "\n" . $status->getWikiText() .
+                               $this->hookError = '<div class="error">' . "\n" .
+                                       $status->getWikiText( false, false, $this->context->getLanguage() ) .
                                        '</div>';
                                return true;
                }
@@ -2742,7 +2745,7 @@ ERROR;
         * content.
         *
         * @param Content|null|bool|string $content
-        * @return string The editable text form of the content.
+        * @return string|false|null The editable text form of the content.
         *
         * @throws MWException If $content is not an instance of TextContent and
         *   $this->allowNonTextContent is not true.
@@ -4045,11 +4048,11 @@ ERROR;
 
                if ( $this->isConflict ) {
                        $conflict = Html::rawElement(
-                               'h2', [ 'id' => 'mw-previewconflict' ],
+                               'div', [ 'id' => 'mw-previewconflict', 'class' => 'warningbox' ],
                                $this->context->msg( 'previewconflict' )->escaped()
                        );
                } else {
-                       $conflict = '<hr />';
+                       $conflict = '';
                }
 
                $previewhead = Html::rawElement(
@@ -4058,7 +4061,9 @@ ERROR;
                                'h2', [ 'id' => 'mw-previewheader' ],
                                $this->context->msg( 'preview' )->escaped()
                        ) .
-                       $out->parseAsInterface( $note ) . $conflict
+                       Html::rawElement( 'div', [ 'class' => 'warningbox' ],
+                               $out->parseAsInterface( $note )
+                       ) . $conflict
                );
 
                $pageViewLang = $this->mTitle->getPageViewLanguage();
index 78f6ca9..9337270 100644 (file)
@@ -86,14 +86,6 @@ class FauxRequest extends WebRequest {
                return (string)$this->getVal( $name, $default );
        }
 
-       /**
-        * @return array
-        * @suppress PhanParamSignatureMismatch
-        */
-       public function getValues() {
-               return $this->data;
-       }
-
        /**
         * @return array
         */
index 38daab5..125b917 100644 (file)
@@ -518,7 +518,7 @@ function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
                }
        }
 
-       $defaultProtoWithoutSlashes = substr( $defaultProto, 0, -2 );
+       $defaultProtoWithoutSlashes = $defaultProto !== null ? substr( $defaultProto, 0, -2 ) : '';
 
        if ( substr( $url, 0, 2 ) == '//' ) {
                $url = $defaultProtoWithoutSlashes . $url;
@@ -1816,10 +1816,11 @@ function mimeTypeMatch( $type, $avail ) {
  *
  * @param array $cprefs Client's acceptable type list
  * @param array $sprefs Server's offered types
- * @return string
+ * @return string|null
  *
  * @todo FIXME: Doesn't handle params like 'text/plain; charset=UTF-8'
  * XXX: generalize to negotiate other stuff
+ * @todo The function appears unused. Is it worth to keep?
  */
 function wfNegotiateType( $cprefs, $sprefs ) {
        $combine = [];
@@ -2030,7 +2031,7 @@ function wfRecursiveRemoveDir( $dir ) {
  */
 function wfPercent( $nr, $acc = 2, $round = true ) {
        $ret = sprintf( "%.${acc}f", $nr );
-       return $round ? round( $ret, $acc ) . '%' : "$ret%";
+       return $round ? round( (float)$ret, $acc ) . '%' : "$ret%";
 }
 
 /**
@@ -2793,7 +2794,7 @@ function wfMemoryLimit( $newLimit ) {
 function wfTransactionalTimeLimit() {
        global $wgTransactionalTimeLimit;
 
-       $timeLimit = ini_get( 'max_execution_time' );
+       $timeLimit = (int)ini_get( 'max_execution_time' );
        // Note that CLI scripts use 0
        if ( $timeLimit > 0 && $wgTransactionalTimeLimit > $timeLimit ) {
                set_time_limit( $wgTransactionalTimeLimit );
index 324b1f5..864019d 100644 (file)
@@ -891,7 +891,7 @@ class Linker {
         * Make user link (or user contributions for unregistered users)
         * @param int $userId User id in database.
         * @param string $userName User name in database.
-        * @param string $altUserName Text to display instead of the user name (optional)
+        * @param string|false $altUserName Text to display instead of the user name (optional)
         * @return string HTML fragment
         * @since 1.16.3. $altUserName was added in 1.19.
         */
@@ -1912,7 +1912,7 @@ class Linker {
         * @since 1.16.3. $context added in 1.20. $editCount added in 1.21
         * @param Revision $rev
         * @param IContextSource|null $context Context to use or null for the main context.
-        * @param int $editCount Number of edits that would be reverted
+        * @param int|false $editCount Number of edits that would be reverted
         * @return string HTML fragment
         */
        public static function buildRollbackLink( $rev, IContextSource $context = null,
index 4045a54..1a950c5 100644 (file)
@@ -273,6 +273,18 @@ class MergeHistory {
                        return $status;
                }
 
+               // Update denormalized revactor_page too
+               $this->dbw->update(
+                       'revision_actor_temp',
+                       [ 'revactor_page' => $this->dest->getArticleID() ],
+                       [
+                               'revactor_page' => $this->source->getArticleID(),
+                               // Slightly hacky, but should work given the values assigned in this class
+                               str_replace( 'rev_timestamp', 'revactor_timestamp', $this->timeWhere )
+                       ],
+                       __METHOD__
+               );
+
                // Make the source page a redirect if no revisions are left
                $haveRevisions = $this->dbw->lockForUpdate(
                        'revision',
index 634e7af..59baae7 100644 (file)
@@ -83,7 +83,7 @@ class MovePage {
         * @param ServiceOptions|null $options
         * @param ILoadBalancer|null $loadBalancer
         * @param NamespaceInfo|null $nsInfo
-        * @param WatchedItemStore|null $watchedItems
+        * @param WatchedItemStoreInterface|null $watchedItems
         * @param PermissionManager|null $permMgr
         */
        public function __construct(
index 79b343e..acf2d25 100644 (file)
@@ -50,7 +50,7 @@ class OutputPage extends ContextSource {
        /** @var array */
        protected $mLinktags = [];
 
-       /** @var bool */
+       /** @var string|bool */
        protected $mCanonicalUrl = false;
 
        /**
@@ -332,7 +332,7 @@ class OutputPage extends ContextSource {
         * a OutputPage tied to that context.
         * @param IContextSource $context
         */
-       function __construct( IContextSource $context ) {
+       public function __construct( IContextSource $context ) {
                $this->setContext( $context );
        }
 
@@ -385,8 +385,8 @@ class OutputPage extends ContextSource {
         * @param string $name Name of the meta tag
         * @param string $val Value of the meta tag
         */
-       function addMeta( $name, $val ) {
-               array_push( $this->mMetatags, [ $name, $val ] );
+       public function addMeta( $name, $val ) {
+               $this->mMetatags[] = [ $name, $val ];
        }
 
        /**
@@ -406,8 +406,8 @@ class OutputPage extends ContextSource {
         *
         * @param array $linkarr Associative array of attributes.
         */
-       function addLink( array $linkarr ) {
-               array_push( $this->mLinktags, $linkarr );
+       public function addLink( array $linkarr ) {
+               $this->mLinktags[] = $linkarr;
        }
 
        /**
@@ -425,7 +425,7 @@ class OutputPage extends ContextSource {
         * in preference to addLink(), to avoid duplicate link tags.
         * @param string $url
         */
-       function setCanonicalUrl( $url ) {
+       public function setCanonicalUrl( $url ) {
                $this->mCanonicalUrl = $url;
        }
 
@@ -447,7 +447,7 @@ class OutputPage extends ContextSource {
         *
         * @param string $script Raw HTML
         */
-       function addScript( $script ) {
+       public function addScript( $script ) {
                $this->mScripts .= $script;
        }
 
@@ -621,7 +621,7 @@ class OutputPage extends ContextSource {
         *
         * @return array
         */
-       function getHeadItemsArray() {
+       public function getHeadItemsArray() {
                return $this->mHeadItems;
        }
 
@@ -1955,7 +1955,7 @@ class OutputPage extends ContextSource {
         * @param ParserOutput $parserOutput
         * @param array $poOptions Options to ParserOutput::getText()
         */
-       function addParserOutput( ParserOutput $parserOutput, $poOptions = [] ) {
+       public function addParserOutput( ParserOutput $parserOutput, $poOptions = [] ) {
                $this->addParserOutputMetadata( $parserOutput );
                $this->addParserOutputText( $parserOutput, $poOptions );
        }
@@ -2147,7 +2147,7 @@ class OutputPage extends ContextSource {
        }
 
        /**
-        * Get TTL in [$minTTL,$maxTTL] in pass it to lowerCdnMaxage()
+        * Get TTL in [$minTTL,$maxTTL] and pass it to lowerCdnMaxage()
         *
         * This sets and returns $minTTL if $mtime is false or null. Otherwise,
         * the TTL is higher the older the $mtime timestamp is. Essentially, the
@@ -2163,10 +2163,10 @@ class OutputPage extends ContextSource {
                $maxTTL = $maxTTL ?: $this->getConfig()->get( 'CdnMaxAge' );
 
                if ( $mtime === null || $mtime === false ) {
-                       return $minTTL; // entity does not exist
+                       return; // entity does not exist
                }
 
-               $age = MWTimestamp::time() - wfTimestamp( TS_UNIX, $mtime );
+               $age = MWTimestamp::time() - (int)wfTimestamp( TS_UNIX, $mtime );
                $adaptiveTTL = max( 0.9 * $age, $minTTL );
                $adaptiveTTL = min( $adaptiveTTL, $maxTTL );
 
@@ -2189,7 +2189,7 @@ class OutputPage extends ContextSource {
         *
         * @return array
         */
-       function getCacheVaryCookies() {
+       public function getCacheVaryCookies() {
                if ( self::$cacheVaryCookies === null ) {
                        $config = $this->getConfig();
                        self::$cacheVaryCookies = array_values( array_unique( array_merge(
@@ -2210,7 +2210,7 @@ class OutputPage extends ContextSource {
         *
         * @return bool
         */
-       function haveCacheVaryCookies() {
+       public function haveCacheVaryCookies() {
                $request = $this->getRequest();
                foreach ( $this->getCacheVaryCookies() as $cookieName ) {
                        if ( $request->getCookie( $cookieName, '', '' ) !== '' ) {
@@ -2270,7 +2270,7 @@ class OutputPage extends ContextSource {
        /**
         * Return a Link: header. Based on the values of $mLinkHeader.
         *
-        * @return string
+        * @return string|false
         */
        public function getLinkHeader() {
                if ( !$this->mLinkHeader ) {
@@ -2602,7 +2602,7 @@ class OutputPage extends ContextSource {
         * and optionally an custom HTML title (content of the "<title>" tag).
         *
         * @param string|Message $pageTitle Will be passed directly to setPageTitle()
-        * @param string|Message $htmlTitle Will be passed directly to setHTMLTitle();
+        * @param string|Message|false $htmlTitle Will be passed directly to setHTMLTitle();
         *                   optional, if not passed the "<title>" attribute will be
         *                   based on $pageTitle
         */
@@ -3283,7 +3283,7 @@ class OutputPage extends ContextSource {
                        $vars['wgUserId'] = $user->getId();
                        $vars['wgUserEditCount'] = $user->getEditCount();
                        $userReg = $user->getRegistration();
-                       $vars['wgUserRegistration'] = $userReg ? wfTimestamp( TS_UNIX, $userReg ) * 1000 : null;
+                       $vars['wgUserRegistration'] = $userReg ? (int)wfTimestamp( TS_UNIX, $userReg ) * 1000 : null;
                        // Get the revision ID of the oldest new message on the user's talk
                        // page. This can be used for constructing new message alerts on
                        // the client side.
index bf138c4..8d642e1 100644 (file)
@@ -77,8 +77,8 @@ class PHPVersionCheck {
        /**
         * Return the version of the installed PHP implementation.
         *
-        * @param string $impl By default, the function returns the info of the currently installed PHP
-        *  implementation. Using this parameter the caller can decide, what version info will be
+        * @param string|false $impl By default, the function returns the info of the currently installed
+        *  PHP implementation. Using this parameter the caller can decide, what version info will be
         *  returned. Valid values: HHVM, PHP
         * @return array An array of information about the PHP implementation, containing:
         *  - 'version': The version of the PHP implementation (specific to the implementation, not
@@ -108,8 +108,8 @@ class PHPVersionCheck {
                        'implementation' => 'PHP',
                        'version' => PHP_VERSION,
                        'vendor' => 'the PHP Group',
-                       'upstreamSupported' => '5.6.0',
-                       'minSupported' => '7.0.13',
+                       'upstreamSupported' => '7.1.0',
+                       'minSupported' => '7.2.0',
                        'upgradeURL' => 'https://www.php.net/downloads.php',
                );
        }
@@ -258,7 +258,7 @@ HTML;
        <head>
                <meta charset="UTF-8" />
                <title>MediaWiki {$this->mwVersion}</title>
-               <style media='screen'>
+               <style media="screen">
                        body {
                                color: #000;
                                background-color: #fff;
@@ -266,7 +266,7 @@ HTML;
                                padding: 2em;
                                text-align: center;
                        }
-                       p, img, h1, h2, ul  {
+                       p, img, h1, h2, ul {
                                text-align: left;
                                margin: 0.5em 0 1em;
                        }
@@ -279,9 +279,9 @@ HTML;
                </style>
        </head>
        <body>
-               <img src="{$encLogo}" alt='The MediaWiki logo' />
+               <img src="{$encLogo}" alt="The MediaWiki logo" />
                <h1>MediaWiki {$this->mwVersion} internal error</h1>
-               <div class='error'>
+               <div class="error">
                <p>
                        {$shortHtml}
                </p>
index 0a8e515..ef6b8ac 100644 (file)
@@ -97,7 +97,7 @@ class PermissionManager {
         */
        private $temporaryUserRights = [];
 
-       /** @var string[] Cached rights for isEveryoneAllowed */
+       /** @var bool[] Cached rights for isEveryoneAllowed, [ right => allowed ] */
        private $cachedRights = [];
 
        /**
index a1be271..3e639b9 100644 (file)
@@ -333,7 +333,9 @@ class ProtectionForm {
                );
 
                if ( !$status->isOK() ) {
-                       $this->show( $out->parseInlineAsInterface( $status->getWikiText() ) );
+                       $this->show( $out->parseInlineAsInterface(
+                               $status->getWikiText( false, false, $this->mContext->getLanguage() )
+                       ) );
                        return false;
                }
 
index 43014f1..92529b3 100644 (file)
@@ -2,24 +2,24 @@
 
 namespace MediaWiki\Rest\BasicAccess;
 
-use User;
 use MediaWiki\Permissions\PermissionManager;
 use MediaWiki\Rest\Handler;
 use MediaWiki\Rest\RequestInterface;
+use MediaWiki\User\UserIdentity;
 
 /**
- * A factory for MWBasicRequestAuthorizer which passes through a User object
+ * A factory for MWBasicRequestAuthorizer which passes through a UserIdentity.
  *
  * @internal
  */
 class MWBasicAuthorizer extends BasicAuthorizerBase {
-       /** @var User */
+       /** @var UserIdentity */
        private $user;
 
        /** @var PermissionManager */
        private $permissionManager;
 
-       public function __construct( User $user, PermissionManager $permissionManager ) {
+       public function __construct( UserIdentity $user, PermissionManager $permissionManager ) {
                $this->user = $user;
                $this->permissionManager = $permissionManager;
        }
index 8c459c6..671488a 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace MediaWiki\Rest\BasicAccess;
 
-use User;
+use MediaWiki\User\UserIdentity;
 use MediaWiki\Permissions\PermissionManager;
 use MediaWiki\Rest\Handler;
 use MediaWiki\Rest\RequestInterface;
@@ -13,14 +13,14 @@ use MediaWiki\Rest\RequestInterface;
  * @internal
  */
 class MWBasicRequestAuthorizer extends BasicRequestAuthorizer {
-       /** @var User */
+       /** @var UserIdentity */
        private $user;
 
        /** @var PermissionManager */
        private $permissionManager;
 
        public function __construct( RequestInterface $request, Handler $handler,
-               User $user, PermissionManager $permissionManager
+               UserIdentity $user, PermissionManager $permissionManager
        ) {
                parent::__construct( $request, $handler );
                $this->user = $user;
index ee3441e..070451d 100644 (file)
@@ -10,6 +10,7 @@ use MediaWiki\Rest\Validator\Validator;
 use RequestContext;
 use Title;
 use WebResponse;
+use Wikimedia\Message\ITextFormatter;
 
 class EntryPoint {
        /** @var RequestInterface */
@@ -49,12 +50,18 @@ class EntryPoint {
                        'cookiePrefix' => $conf->get( 'CookiePrefix' )
                ] );
 
+               $responseFactory = new ResponseFactory( self::getTextFormatters( $services ) );
+
                // @phan-suppress-next-line PhanAccessMethodInternal
                $authorizer = new MWBasicAuthorizer( $context->getUser(),
                        $services->getPermissionManager() );
 
                // @phan-suppress-next-line PhanAccessMethodInternal
-               $restValidator = new Validator( $objectFactory, $request, RequestContext::getMain()->getUser() );
+               $restValidator = new Validator( $objectFactory,
+                       $services->getPermissionManager(),
+                       $request,
+                       RequestContext::getMain()->getUser()
+               );
 
                global $IP;
                $router = new Router(
@@ -62,7 +69,7 @@ class EntryPoint {
                        ExtensionRegistry::getInstance()->getAttribute( 'RestRoutes' ),
                        $conf->get( 'RestPath' ),
                        $services->getLocalServerObjectCache(),
-                       new ResponseFactory,
+                       $responseFactory,
                        $authorizer,
                        $objectFactory,
                        $restValidator
@@ -76,6 +83,25 @@ class EntryPoint {
                $entryPoint->execute();
        }
 
+       /**
+        * Get a TextFormatter array from MediaWikiServices
+        *
+        * @param MediaWikiServices $services
+        * @return ITextFormatter[]
+        */
+       public static function getTextFormatters( MediaWikiServices $services ) {
+               $langs = array_unique( [
+                       $services->getMainConfig()->get( 'ContLang' )->getCode(),
+                       'en'
+               ] );
+               $textFormatters = [];
+               $factory = $services->getMessageFormatterFactory();
+               foreach ( $langs as $lang ) {
+                       $textFormatters[] = $factory->getTextFormatter( $lang );
+               }
+               return $textFormatters;
+       }
+
        public function __construct( RequestContext $context, RequestInterface $request,
                WebResponse $webResponse, Router $router
        ) {
index 10d3a40..184fe16 100644 (file)
@@ -5,7 +5,14 @@ namespace MediaWiki\Rest;
 use Wikimedia\Message\MessageValue;
 
 class LocalizedHttpException extends HttpException {
-       public function __construct( MessageValue $message, $code = 500 ) {
-               parent::__construct( 'Localized exception with key ' . $message->getKey(), $code );
+       private $messageValue;
+
+       public function __construct( MessageValue $messageValue, $code = 500 ) {
+               parent::__construct( 'Localized exception with key ' . $messageValue->getKey(), $code );
+               $this->messageValue = $messageValue;
+       }
+
+       public function getMessageValue() {
+               return $this->messageValue;
        }
 }
index 5e5a198..fd0f3c7 100644 (file)
@@ -5,19 +5,31 @@ namespace MediaWiki\Rest;
 use Exception;
 use HttpStatus;
 use InvalidArgumentException;
+use LanguageCode;
 use MWExceptionHandler;
 use stdClass;
 use Throwable;
+use Wikimedia\Message\ITextFormatter;
+use Wikimedia\Message\MessageValue;
 
 /**
  * Generates standardized response objects.
  */
 class ResponseFactory {
-
        const CT_PLAIN = 'text/plain; charset=utf-8';
        const CT_HTML = 'text/html; charset=utf-8';
        const CT_JSON = 'application/json';
 
+       /** @var ITextFormatter[] */
+       private $textFormatters;
+
+       /**
+        * @param ITextFormatter[] $textFormatters
+        */
+       public function __construct( $textFormatters ) {
+               $this->textFormatters = $textFormatters;
+       }
+
        /**
         * Encode a stdClass object or array to a JSON string
         *
@@ -167,13 +179,23 @@ class ResponseFactory {
                return $response;
        }
 
+       /**
+        * Create an HTTP 4xx or 5xx response with error message localisation
+        */
+       public function createLocalizedHttpError( $errorCode, MessageValue $messageValue ) {
+               return $this->createHttpError( $errorCode, $this->formatMessage( $messageValue ) );
+       }
+
        /**
         * Turn an exception into a JSON error response.
         * @param Exception|Throwable $exception
         * @return Response
         */
        public function createFromException( $exception ) {
-               if ( $exception instanceof HttpException ) {
+               if ( $exception instanceof LocalizedHttpException ) {
+                       $response = $this->createLocalizedHttpError( $exception->getCode(),
+                               $exception->getMessageValue() );
+               } elseif ( $exception instanceof HttpException ) {
                        // FIXME can HttpException represent 2xx or 3xx responses?
                        $response = $this->createHttpError(
                                $exception->getCode(),
@@ -240,4 +262,18 @@ class ResponseFactory {
                return "<!doctype html><title>Redirect</title><a href=\"$url\">$url</a>";
        }
 
+       public function formatMessage( MessageValue $messageValue ) {
+               if ( !$this->textFormatters ) {
+                       // For unit tests
+                       return [];
+               }
+               $translations = [];
+               foreach ( $this->textFormatters as $formatter ) {
+                       $lang = LanguageCode::bcp47( $formatter->getLangCode() );
+                       $messageText = $formatter->format( $messageValue );
+                       $translations[$lang] = $messageText;
+               }
+               return [ 'messageTranslations' => $translations ];
+       }
+
 }
index a520130..6821d89 100644 (file)
@@ -4,6 +4,7 @@ namespace MediaWiki\Rest;
 
 use AppendIterator;
 use BagOStuff;
+use Wikimedia\Message\MessageValue;
 use MediaWiki\Rest\BasicAccess\BasicAuthorizerInterface;
 use MediaWiki\Rest\PathTemplateMatcher\PathMatcher;
 use MediaWiki\Rest\Validator\Validator;
@@ -226,18 +227,28 @@ class Router {
                $path = $request->getUri()->getPath();
                $relPath = $this->getRelativePath( $path );
                if ( $relPath === false ) {
-                       return $this->responseFactory->createHttpError( 404 );
+                       return $this->responseFactory->createLocalizedHttpError( 404,
+                               ( new MessageValue( 'rest-prefix-mismatch' ) )
+                                       ->plaintextParams( $path, $this->rootPath )
+                       );
                }
 
+               $requestMethod = $request->getMethod();
                $matchers = $this->getMatchers();
-               $matcher = $matchers[$request->getMethod()] ?? null;
+               $matcher = $matchers[$requestMethod] ?? null;
                $match = $matcher ? $matcher->match( $relPath ) : null;
 
+               // For a HEAD request, execute the GET handler instead if one exists.
+               // The webserver will discard the body.
+               if ( !$match && $requestMethod === 'HEAD' && isset( $matchers['GET'] ) ) {
+                       $match = $matchers['GET']->match( $relPath );
+               }
+
                if ( !$match ) {
                        // Check for 405 wrong method
                        $allowed = [];
                        foreach ( $matchers as $allowedMethod => $allowedMatcher ) {
-                               if ( $allowedMethod === $request->getMethod() ) {
+                               if ( $allowedMethod === $requestMethod ) {
                                        continue;
                                }
                                if ( $allowedMatcher->match( $relPath ) ) {
@@ -245,12 +256,20 @@ class Router {
                                }
                        }
                        if ( $allowed ) {
-                               $response = $this->responseFactory->createHttpError( 405 );
+                               $response = $this->responseFactory->createLocalizedHttpError( 405,
+                                       ( new MessageValue( 'rest-wrong-method' ) )
+                                               ->textParams( $requestMethod )
+                                               ->commaListParams( $allowed )
+                                               ->numParams( count( $allowed ) )
+                               );
                                $response->setHeader( 'Allow', $allowed );
                                return $response;
                        } else {
                                // Did not match with any other method, must be 404
-                               return $this->responseFactory->createHttpError( 404 );
+                               return $this->responseFactory->createLocalizedHttpError( 404,
+                                       ( new MessageValue( 'rest-no-match' ) )
+                                               ->plaintextParams( $relPath )
+                               );
                        }
                }
 
@@ -272,6 +291,7 @@ class Router {
 
        /**
         * Execute a fully-constructed handler
+        *
         * @param Handler $handler
         * @return ResponseInterface
         */
index 6c54a50..93de911 100644 (file)
@@ -3,21 +3,30 @@
 namespace MediaWiki\Rest\Validator;
 
 use InvalidArgumentException;
+use MediaWiki\Permissions\PermissionManager;
 use MediaWiki\Rest\RequestInterface;
+use MediaWiki\User\UserIdentity;
 use Psr\Http\Message\UploadedFileInterface;
-use User;
 use Wikimedia\ParamValidator\Callbacks;
 use Wikimedia\ParamValidator\ValidationException;
 
 class ParamValidatorCallbacks implements Callbacks {
 
+       /** @var PermissionManager */
+       private $permissionManager;
+
        /** @var RequestInterface */
        private $request;
 
-       /** @var User */
+       /** @var UserIdentity */
        private $user;
 
-       public function __construct( RequestInterface $request, User $user ) {
+       public function __construct(
+               PermissionManager $permissionManager,
+               RequestInterface $request,
+               UserIdentity $user
+       ) {
+               $this->permissionManager = $permissionManager;
                $this->request = $request;
                $this->user = $user;
        }
@@ -76,7 +85,7 @@ class ParamValidatorCallbacks implements Callbacks {
        }
 
        public function useHighLimits( array $options ) {
-               return $this->user->isAllowed( 'apihighlimits' );
+               return $this->permissionManager->userHasRight( $this->user, 'apihighlimits' );
        }
 
 }
index cee1cdb..be8d7a4 100644 (file)
@@ -2,10 +2,11 @@
 
 namespace MediaWiki\Rest\Validator;
 
+use MediaWiki\Permissions\PermissionManager;
 use MediaWiki\Rest\Handler;
 use MediaWiki\Rest\HttpException;
 use MediaWiki\Rest\RequestInterface;
-use User;
+use MediaWiki\User\UserIdentity;
 use Wikimedia\ObjectFactory;
 use Wikimedia\ParamValidator\ParamValidator;
 use Wikimedia\ParamValidator\TypeDef\BooleanDef;
@@ -62,16 +63,20 @@ class Validator {
        private $paramValidator;
 
        /**
-        * @internal
         * @param ObjectFactory $objectFactory
+        * @param PermissionManager $permissionManager
         * @param RequestInterface $request
-        * @param User $user
+        * @param UserIdentity $user
+        * @internal
         */
        public function __construct(
-               ObjectFactory $objectFactory, RequestInterface $request, User $user
+               ObjectFactory $objectFactory,
+               PermissionManager $permissionManager,
+               RequestInterface $request,
+               UserIdentity $user
        ) {
                $this->paramValidator = new ParamValidator(
-                       new ParamValidatorCallbacks( $request, $user ),
+                       new ParamValidatorCallbacks( $permissionManager, $request, $user ),
                        $objectFactory,
                        [
                                'typeDefs' => self::$typeDefs,
index 759180a..cf35371 100644 (file)
@@ -59,7 +59,7 @@ abstract class RevisionRecord {
        const FOR_THIS_USER = 2;
        const RAW = 3;
 
-       /** @var string Wiki ID; false means the current wiki */
+       /** @var string|false Wiki ID; false means the current wiki */
        protected $mWiki = false;
        /** @var int|null */
        protected $mId;
index 735a212..3ecef76 100644 (file)
@@ -1623,10 +1623,18 @@ class RevisionStore
         * @param object[]|IResultWrapper $slotRows
         * @param int $queryFlags
         * @param Title $title
+        * @param array|null $slotContents a map from blobAddress to slot
+        *      content blob or Content object.
         *
         * @return SlotRecord[]
         */
-       private function constructSlotRecords( $revId, $slotRows, $queryFlags, Title $title ) {
+       private function constructSlotRecords(
+               $revId,
+               $slotRows,
+               $queryFlags,
+               Title $title,
+               $slotContents = null
+       ) {
                $slots = [];
 
                foreach ( $slotRows as $row ) {
@@ -1651,8 +1659,15 @@ class RevisionStore
                                        = $this->emulateContentId( intval( $row->rev_text_id ) );
                        }
 
-                       $contentCallback = function ( SlotRecord $slot ) use ( $queryFlags ) {
-                               return $this->loadSlotContent( $slot, null, null, null, $queryFlags );
+                       $contentCallback = function ( SlotRecord $slot ) use ( $slotContents, $queryFlags ) {
+                               $blob = null;
+                               if ( isset( $slotContents[$slot->getAddress()] ) ) {
+                                       $blob = $slotContents[$slot->getAddress()];
+                                       if ( $blob instanceof Content ) {
+                                               return $blob;
+                                       }
+                               }
+                               return $this->loadSlotContent( $slot, $blob, null, null, $queryFlags );
                        };
 
                        $slots[$row->role_name] = new SlotRecord( $row, $contentCallback );
@@ -1804,8 +1819,10 @@ class RevisionStore
 
        /**
         * @param object $row A database row generated from a query based on getQueryInfo()
-        * @param null|object[] $slotRows Database rows generated from a query based on
-        *        getSlotsQueryInfo with the 'content' flag set.
+        * @param null|object[]|RevisionSlots $slots
+        *      - Database rows generated from a query based on getSlotsQueryInfo
+        *        with the 'content' flag set. Or
+        *  - RevisionSlots instance
         * @param int $queryFlags
         * @param Title|null $title
         * @param bool $fromCache if true, the returned RevisionRecord will ensure that no stale
@@ -1816,11 +1833,10 @@ class RevisionStore
         * @see RevisionFactory::newRevisionFromRow
         *
         * MCR migration note: this replaces Revision::newFromRow
-        *
         */
        public function newRevisionFromRowAndSlots(
                $row,
-               $slotRows,
+               $slots,
                $queryFlags = 0,
                Title $title = null,
                $fromCache = false
@@ -1857,7 +1873,9 @@ class RevisionStore
                // Legacy because $row may have come from self::selectFields()
                $comment = $this->commentStore->getCommentLegacy( $db, 'rev_comment', $row, true );
 
-               $slots = $this->newRevisionSlots( $row->rev_id, $row, $slotRows, $queryFlags, $title );
+               if ( !( $slots instanceof RevisionSlots ) ) {
+                       $slots = $this->newRevisionSlots( $row->rev_id, $row, $slots, $queryFlags, $title );
+               }
 
                // If this is a cached row, instantiate a cache-aware revision class to avoid stale data.
                if ( $fromCache ) {
@@ -1887,7 +1905,7 @@ class RevisionStore
         *               loaded immediately. Supports falsy or truthy value as well
         *               as an explicit list of slot role names.
         *               'content'- whether the actual content of the slots should be
-        *               preloaded. TODO: no supported yet.
+        *               preloaded.
         * @param int $queryFlags
         * @param Title|null $title
         * @return StatusValue a status with a RevisionRecord[] of successfully fetched revisions
@@ -1957,24 +1975,40 @@ class RevisionStore
                        }, $options['slots'] );
                }
 
-               // TODO: Support optional fetching of the content
-               $queryInfo = self::getSlotsQueryInfo( [ 'content' ] );
+               // We need to set the `content` flag because newRevisionFromRowAndSlots requires content
+               // metadata to be loaded.
+               $slotQueryInfo = self::getSlotsQueryInfo( [ 'content' ] );
                $db = $this->getDBConnectionRefForQueryFlags( $queryFlags );
                $slotRows = $db->select(
-                       $queryInfo['tables'],
-                       $queryInfo['fields'],
+                       $slotQueryInfo['tables'],
+                       $slotQueryInfo['fields'],
                        $slotQueryConds,
                        __METHOD__,
                        [],
-                       $queryInfo['joins']
+                       $slotQueryInfo['joins']
                );
 
                $slotRowsByRevId = [];
                foreach ( $slotRows as $slotRow ) {
                        $slotRowsByRevId[$slotRow->slot_revision_id][] = $slotRow;
                }
+
+               $slotContents = null;
+               if ( $options['content'] ?? false ) {
+                       $blobAddresses = [];
+                       foreach ( $slotRows as $slotRow ) {
+                               $blobAddresses[] = $slotRow->content_address;
+                       }
+                       $slotContentFetchStatus = $this->blobStore
+                               ->getBlobBatch( $blobAddresses, $queryFlags );
+                       foreach ( $slotContentFetchStatus->getErrors() as $error ) {
+                               $result->warning( $error['message'], ...$error['params'] );
+                       }
+                       $slotContents = $slotContentFetchStatus->getValue();
+               }
+
                $result->setResult( true, array_map( function ( $row ) use
-                       ( $slotRowsByRevId, $queryFlags, $titlesByPageId, $result ) {
+                       ( $slotRowsByRevId, $queryFlags, $titlesByPageId, $slotContents, $result ) {
                                if ( !isset( $slotRowsByRevId[$row->rev_id] ) ) {
                                        $result->warning(
                                                'internalerror',
@@ -1985,7 +2019,15 @@ class RevisionStore
                                try {
                                        return $this->newRevisionFromRowAndSlots(
                                                $row,
-                                               $slotRowsByRevId[$row->rev_id],
+                                               new RevisionSlots(
+                                                       $this->constructSlotRecords(
+                                                               $row->rev_id,
+                                                               $slotRowsByRevId[$row->rev_id],
+                                                               $queryFlags,
+                                                               $titlesByPageId[$row->rev_page],
+                                                               $slotContents
+                                                       )
+                                               ),
                                                $queryFlags,
                                                $titlesByPageId[$row->rev_page]
                                        );
index 469e494..dabf62b 100644 (file)
@@ -151,7 +151,7 @@ class RevisionStoreRecord extends RevisionRecord {
 
        /**
         * @throws RevisionAccessException if the size was unknown and could not be calculated.
-        * @return string The nominal revision size, never null. May be computed on the fly.
+        * @return int The nominal revision size, never null. May be computed on the fly.
         */
        public function getSize() {
                // If length is null, calculate and remember it (potentially SLOW!).
index 85b4c5a..7c2623b 100644 (file)
@@ -150,7 +150,7 @@ class SlotRoleHandler {
         *
         * The default implementation always returns false.
         *
-        * @return string
+        * @return bool
         */
        public function supportsArticleCount() {
                return false;
index 4cd3d85..ab51eab 100644 (file)
  * For every service that MediaWiki core requires, an instantiator must be defined in
  * this file.
  *
+ * Note that, ideally, all information used to instantiate service objects should come
+ * from configuration. Information derived from the current request is acceptable, but
+ * only where there is no feasible alternative. It is preferred that such information
+ * (like the client IP, the acting user's identity, requested title, etc) be passed to
+ * the service object's methods as parameters. This makes the flow of information more
+ * obvious, and makes it easier to understand the behavior of services.
+ *
  * @note As of version 1.27, MediaWiki is only beginning to use dependency injection.
  * The services defined here do not yet fully represent all services used by core,
  * much of the code still relies on global state for this accessing services.
@@ -267,6 +274,8 @@ return [
                if ( defined( 'MW_NO_SESSION' ) ) {
                        return $services->getLinkRendererFactory()->create();
                } else {
+                       // Normally information from the current request would not be passed in here;
+                       // this is an exception. (See also the class documentation.)
                        return $services->getLinkRendererFactory()->createForUser(
                                RequestContext::getMain()->getUser()
                        );
@@ -784,7 +793,8 @@ return [
                        $services->getDBLoadBalancer(),
                        $services->getCommentStore(),
                        $services->getActorMigration(),
-                       $services->getWatchedItemStore()
+                       $services->getWatchedItemStore(),
+                       $services->getPermissionManager()
                );
        },
 
index 518531a..d450bdd 100644 (file)
@@ -440,6 +440,13 @@ if ( $wgEnableEmail ) {
        $wgUsersNotifiedOnAllChanges = [];
 }
 
+// $wgSysopEmailBans deprecated in 1.34
+if ( isset( $wgSysopEmailBans ) && $wgSysopEmailBans === false ) {
+       foreach ( $wgGroupPermissions as $group => $_ ) {
+               unset( $wgGroupPermissions[$group]['blockemail'] );
+       }
+}
+
 if ( $wgMetaNamespace === false ) {
        $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
 }
@@ -721,7 +728,7 @@ if ( is_null( $wgLocaltimezone ) ) {
 
 date_default_timezone_set( $wgLocaltimezone );
 if ( is_null( $wgLocalTZoffset ) ) {
-       $wgLocalTZoffset = date( 'Z' ) / 60;
+       $wgLocalTZoffset = (int)date( 'Z' ) / 60;
 }
 // The part after the System| is ignored, but rest of MW fills it
 // out as the local offset.
index a0ef07d..826d526 100644 (file)
@@ -231,7 +231,7 @@ class PageEditStash {
                        return false;
                }
 
-               $age = time() - wfTimestamp( TS_UNIX, $editInfo->output->getCacheTime() );
+               $age = time() - (int)wfTimestamp( TS_UNIX, $editInfo->output->getCacheTime() );
                $context['age'] = $age;
 
                $isCacheUsable = true;
@@ -450,7 +450,7 @@ class PageEditStash {
        ) {
                // If an item is renewed, mind the cache TTL determined by config and parser functions.
                // Put an upper limit on the TTL for sanity to avoid extreme template/file staleness.
-               $age = time() - wfTimestamp( TS_UNIX, $parserOutput->getCacheTime() );
+               $age = time() - (int)wfTimestamp( TS_UNIX, $parserOutput->getCacheTime() );
                $ttl = min( $parserOutput->getCacheExpiry() - $age, self::MAX_CACHE_TTL );
                // Avoid extremely stale user signature timestamps (T84843)
                if ( $parserOutput->getFlag( 'user-signature' ) ) {
index f9b5d0f..6c15a06 100644 (file)
@@ -1561,14 +1561,32 @@ class Title implements LinkTarget, IDBAccessObject {
         * Get a Title object associated with the talk page of this article
         *
         * @deprecated since 1.34, use getTalkPageIfDefined() or NamespaceInfo::getTalkPage()
-        *             with NamespaceInfo::canHaveTalkPage().
+        *             with NamespaceInfo::canHaveTalkPage(). Note that the new method will
+        *             throw if asked for the talk page of a section-only link, or of an interwiki
+        *             link.
         * @return Title The object for the talk page
         * @throws MWException if $target doesn't have talk pages, e.g. because it's in NS_SPECIAL
         *         or because it's a relative link, or an interwiki link.
         */
        public function getTalkPage() {
-               return self::castFromLinkTarget(
-                       MediaWikiServices::getInstance()->getNamespaceInfo()->getTalkPage( $this ) );
+               // NOTE: The equivalent code in NamespaceInfo is less lenient about producing invalid titles.
+               //       Instead of failing on invalid titles, let's just log the issue for now.
+               //       See the discussion on T227817.
+
+               // Is this the same title?
+               $talkNS = MediaWikiServices::getInstance()->getNamespaceInfo()->getTalk( $this->mNamespace );
+               if ( $this->mNamespace == $talkNS ) {
+                       return $this;
+               }
+
+               $title = self::makeTitle( $talkNS, $this->mDbkeyform );
+
+               $this->warnIfPageCannotExist( $title, __METHOD__ );
+
+               return $title;
+               // TODO: replace the above with the code below:
+               // return self::castFromLinkTarget(
+               // MediaWikiServices::getInstance()->getNamespaceInfo()->getTalkPage( $this ) );
        }
 
        /**
@@ -1596,8 +1614,51 @@ class Title implements LinkTarget, IDBAccessObject {
         * @return Title The object for the subject page
         */
        public function getSubjectPage() {
-               return self::castFromLinkTarget(
-                       MediaWikiServices::getInstance()->getNamespaceInfo()->getSubjectPage( $this ) );
+               // Is this the same title?
+               $subjectNS = MediaWikiServices::getInstance()->getNamespaceInfo()
+                       ->getSubject( $this->mNamespace );
+               if ( $this->mNamespace == $subjectNS ) {
+                       return $this;
+               }
+               // NOTE: The equivalent code in NamespaceInfo is less lenient about producing invalid titles.
+               //       Instead of failing on invalid titles, let's just log the issue for now.
+               //       See the discussion on T227817.
+               $title = self::makeTitle( $subjectNS, $this->mDbkeyform );
+
+               $this->warnIfPageCannotExist( $title, __METHOD__ );
+
+               return $title;
+               // TODO: replace the above with the code below:
+               // return self::castFromLinkTarget(
+               // MediaWikiServices::getInstance()->getNamespaceInfo()->getSubjectPage( $this ) );
+       }
+
+       /**
+        * @param Title $title
+        * @param string $method
+        *
+        * @return bool whether a warning was issued
+        */
+       private function warnIfPageCannotExist( Title $title, $method ) {
+               if ( $this->getText() == '' ) {
+                       wfLogWarning(
+                               $method . ': called on empty title ' . $this->getFullText() . ', returning '
+                               . $title->getFullText()
+                       );
+
+                       return true;
+               }
+
+               if ( $this->getInterwiki() !== '' ) {
+                       wfLogWarning(
+                               $method . ': called on interwiki title ' . $this->getFullText() . ', returning '
+                               . $title->getFullText()
+                       );
+
+                       return true;
+               }
+
+               return false;
        }
 
        /**
@@ -1610,8 +1671,23 @@ class Title implements LinkTarget, IDBAccessObject {
         * @return Title
         */
        public function getOtherPage() {
-               return self::castFromLinkTarget(
-                       MediaWikiServices::getInstance()->getNamespaceInfo()->getAssociatedPage( $this ) );
+               // NOTE: Depend on the methods in this class instead of their equivalent in NamespaceInfo,
+               //       until their semantics has become exactly the same.
+               //       See the discussion on T227817.
+               if ( $this->isSpecialPage() ) {
+                       throw new MWException( 'Special pages cannot have other pages' );
+               }
+               if ( $this->isTalkPage() ) {
+                       return $this->getSubjectPage();
+               } else {
+                       if ( !$this->canHaveTalkPage() ) {
+                               throw new MWException( "{$this->getPrefixedText()} does not have an other page" );
+                       }
+                       return $this->getTalkPage();
+               }
+               // TODO: replace the above with the code below:
+               // return self::castFromLinkTarget(
+               // MediaWikiServices::getInstance()->getNamespaceInfo()->getAssociatedPage( $this ) );
        }
 
        /**
@@ -1986,7 +2062,7 @@ class Title implements LinkTarget, IDBAccessObject {
         *
         * @see self::getLocalURL for the arguments.
         * @see wfExpandUrl
-        * @param string|string[] $query
+        * @param string|array $query
         * @param string|string[]|bool $query2
         * @param string|int|null $proto Protocol type to use in URL
         * @return string The URL
@@ -2047,7 +2123,7 @@ class Title implements LinkTarget, IDBAccessObject {
         *  valid to link, locally, to the current Title.
         * @see self::newFromText to produce a Title object.
         *
-        * @param string|string[] $query An optional query string,
+        * @param string|array $query An optional query string,
         *   not used for interwiki links. Can be specified as an associative array as well,
         *   e.g., [ 'action' => 'edit' ] (keys and values will be URL-escaped).
         *   Some query patterns will trigger various shorturl path replacements.
@@ -2187,7 +2263,7 @@ class Title implements LinkTarget, IDBAccessObject {
         * protocol-relative, the URL will be expanded to http://
         *
         * @see self::getLocalURL for the arguments.
-        * @param string|string[] $query
+        * @param string|array $query
         * @param string|bool $query2 Deprecated
         * @return string The URL
         */
@@ -2210,7 +2286,7 @@ class Title implements LinkTarget, IDBAccessObject {
         * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
         *
         * @see self::getLocalURL for the arguments.
-        * @param string|string[] $query
+        * @param string|array $query
         * @param string|bool $query2 Deprecated
         * @return string The URL
         * @since 1.18
index a48d032..c94e8d4 100644 (file)
@@ -547,7 +547,7 @@ class WebRequest {
         *
         * @param string $name
         * @param array|null $default Option default (or null)
-        * @return array Array of ints
+        * @return int[]|null
         */
        public function getIntArray( $name, $default = null ) {
                $val = $this->getArray( $name, $default );
index febf03e..b368a13 100644 (file)
@@ -266,7 +266,7 @@ class Xml {
        /**
         * Convenience function to build an HTML text input field
         * @param string $name Value of the name attribute
-        * @param int $size Value of the size attribute
+        * @param int|false $size Value of the size attribute
         * @param mixed $value Value of the value attribute
         * @param array $attribs Other attributes
         * @return string HTML
@@ -289,7 +289,7 @@ class Xml {
        /**
         * Convenience function to build an HTML password input field
         * @param string $name Value of the name attribute
-        * @param int $size Value of the size attribute
+        * @param int|false $size Value of the size attribute
         * @param mixed $value Value of the value attribute
         * @param array $attribs Other attributes
         * @return string HTML
@@ -600,7 +600,7 @@ class Xml {
         *
         * @param string|bool $legend Legend of the fieldset. If evaluates to false,
         *   legend is not added.
-        * @param string $content Pre-escaped content for the fieldset. If false,
+        * @param string|false $content Pre-escaped content for the fieldset. If false,
         *   only open fieldset is returned.
         * @param array $attribs Any attributes to fieldset-element.
         *
index 41cd24e..68c0ea1 100644 (file)
@@ -289,8 +289,9 @@ class McrUndoAction extends FormAction {
                                'h2', [ 'id' => 'mw-previewheader' ],
                                $this->context->msg( 'preview' )->text()
                        ) .
-                       $out->parseAsInterface( $note ) .
-                       "<hr />"
+                       Html::rawElement( 'div', [ 'class' => 'warningbox' ],
+                               $out->parseAsInterface( $note )
+                       )
                );
 
                $pageViewLang = $this->getTitle()->getPageViewLanguage();
index 8a231cb..56be456 100644 (file)
@@ -35,6 +35,9 @@ class SpecialPageAction extends FormlessAction {
                'editchangetags' => 'EditTags',
        ];
 
+       /**
+        * @inheritDoc
+        */
        public function getName() {
                $request = $this->getRequest();
                $actionName = $request->getVal( 'action', 'view' );
index 056d10c..7518008 100644 (file)
@@ -1585,6 +1585,7 @@ abstract class ApiBase extends ContextSource {
                                'integeroutofrange',
                                [ 'min' => $min, 'max' => $max, 'botMax' => $botMax ?: $max ]
                        );
+                       // @phan-suppress-next-line PhanTypeMismatchArgument
                        $this->warnOrDie( $msg, $enforceLimits );
                        $value = $min;
                }
@@ -1606,6 +1607,7 @@ abstract class ApiBase extends ContextSource {
                                                'integeroutofrange',
                                                [ 'min' => $min, 'max' => $max, 'botMax' => $botMax ?: $max ]
                                        );
+                                       // @phan-suppress-next-line PhanTypeMismatchArgument
                                        $this->warnOrDie( $msg, $enforceLimits );
                                        $value = $botMax;
                                }
@@ -1616,6 +1618,7 @@ abstract class ApiBase extends ContextSource {
                                        'integeroutofrange',
                                        [ 'min' => $min, 'max' => $max, 'botMax' => $botMax ?: $max ]
                                );
+                               // @phan-suppress-next-line PhanTypeMismatchArgument
                                $this->warnOrDie( $msg, $enforceLimits );
                                $value = $max;
                        }
@@ -2022,6 +2025,7 @@ abstract class ApiBase extends ContextSource {
         */
        public function dieWithException( $exception, array $options = [] ) {
                $this->dieWithError(
+                       // @phan-suppress-next-line PhanTypeMismatchArgument
                        $this->getErrorFormatter()->getMessageFromException( $exception, $options )
                );
        }
@@ -2464,6 +2468,7 @@ abstract class ApiBase extends ContextSource {
                                        if ( $m ) {
                                                $m = new ApiHelpParamValueMessage(
                                                        $value,
+                                                       // @phan-suppress-next-line PhanTypeMismatchArgument
                                                        [ $m->getKey(), 'api-help-param-no-description' ],
                                                        $m->getParams(),
                                                        isset( $deprecatedValues[$value] )
index 81ee9b9..9dfd370 100644 (file)
@@ -237,6 +237,7 @@ class ApiErrorFormatter {
         */
        public function formatException( $exception, array $options = [] ) {
                return $this->formatMessage(
+                       // @phan-suppress-next-line PhanTypeMismatchArgument
                        $this->getMessageFromException( $exception, $options ),
                        $options['format'] ?? null
                );
index a7d4fb9..0ea6af3 100644 (file)
  * @file
  */
 
+use MediaWiki\Block\DatabaseBlock;
+
 /**
  * Query module to enumerate all registered users.
  *
  * @ingroup API
  */
 class ApiQueryAllUsers extends ApiQueryBase {
+       use ApiQueryBlockInfoTrait;
+
        public function __construct( ApiQuery $query, $moduleName ) {
                parent::__construct( $query, $moduleName, 'au' );
        }
@@ -153,7 +157,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $this->addWhere( 'user_editcount > 0' );
                }
 
-               $this->showHiddenUsersAddBlockInfo( $fld_blockinfo );
+               $this->addBlockInfoToQuery( $fld_blockinfo );
 
                if ( $fld_groups || $fld_rights ) {
                        $this->addFields( [ 'groups' =>
@@ -263,13 +267,8 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                );
                        }
 
-                       if ( $fld_blockinfo && !is_null( $row->ipb_by_text ) ) {
-                               $data['blockid'] = (int)$row->ipb_id;
-                               $data['blockedby'] = $row->ipb_by_text;
-                               $data['blockedbyid'] = (int)$row->ipb_by;
-                               $data['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
-                               $data['blockreason'] = $commentStore->getComment( 'ipb_reason', $row )->text;
-                               $data['blockexpiry'] = $row->ipb_expiry;
+                       if ( $fld_blockinfo && !is_null( $row->ipb_id ) ) {
+                               $data += $this->getBlockDetails( DatabaseBlock::newFromRow( $row ) );
                        }
                        if ( $row->ipb_deleted ) {
                                $data['hidden'] = true;
index 10db848..8d9cb48 100644 (file)
@@ -31,6 +31,7 @@ use Wikimedia\Rdbms\IResultWrapper;
  * @ingroup API
  */
 abstract class ApiQueryBase extends ApiBase {
+       use ApiQueryBlockInfoTrait;
 
        private $mQueryModule, $mDb, $tables, $where, $fields, $options, $join_conds;
 
@@ -424,47 +425,6 @@ abstract class ApiQueryBase extends ApiBase {
                return Hooks::run( 'ApiQueryBaseProcessRow', [ $this, $row, &$data, &$hookData ] );
        }
 
-       /**
-        * Filters hidden users (where the user doesn't have the right to view them)
-        * Also adds relevant block information
-        *
-        * @param bool $showBlockInfo
-        * @return void
-        */
-       public function showHiddenUsersAddBlockInfo( $showBlockInfo ) {
-               $db = $this->getDB();
-
-               $tables = [ 'ipblocks' ];
-               $fields = [ 'ipb_deleted' ];
-               $joinConds = [
-                       'blk' => [ 'LEFT JOIN', [
-                               'ipb_user=user_id',
-                               'ipb_expiry > ' . $db->addQuotes( $db->timestamp() ),
-                       ] ],
-               ];
-
-               if ( $showBlockInfo ) {
-                       $actorQuery = ActorMigration::newMigration()->getJoin( 'ipb_by' );
-                       $commentQuery = CommentStore::getStore()->getJoin( 'ipb_reason' );
-                       $tables += $actorQuery['tables'] + $commentQuery['tables'];
-                       $joinConds += $actorQuery['joins'] + $commentQuery['joins'];
-                       $fields = array_merge( $fields, [
-                               'ipb_id',
-                               'ipb_expiry',
-                               'ipb_timestamp'
-                       ], $actorQuery['fields'], $commentQuery['fields'] );
-               }
-
-               $this->addTables( [ 'blk' => $tables ] );
-               $this->addFields( $fields );
-               $this->addJoinConds( $joinConds );
-
-               // Don't show hidden names
-               if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'hideuser' ) ) {
-                       $this->addWhere( 'ipb_deleted = 0 OR ipb_deleted IS NULL' );
-               }
-       }
-
        /** @} */
 
        /************************************************************************//**
@@ -610,4 +570,24 @@ abstract class ApiQueryBase extends ApiBase {
        }
 
        /** @} */
+
+       /************************************************************************//**
+        * @name   Deprecated methods
+        * @{
+        */
+
+       /**
+        * Filters hidden users (where the user doesn't have the right to view them)
+        * Also adds relevant block information
+        *
+        * @deprecated since 1.34, use ApiQueryBlockInfoTrait instead
+        * @param bool $showBlockInfo
+        * @return void
+        */
+       public function showHiddenUsersAddBlockInfo( $showBlockInfo ) {
+               wfDeprecated( __METHOD__, '1.34' );
+               return $this->addBlockInfoToQuery( $showBlockInfo );
+       }
+
+       /** @} */
 }
diff --git a/includes/api/ApiQueryBlockInfoTrait.php b/includes/api/ApiQueryBlockInfoTrait.php
new file mode 100644 (file)
index 0000000..a3be356
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+use MediaWiki\Block\DatabaseBlock;
+use MediaWiki\Permissions\PermissionManager;
+
+/**
+ * @ingroup API
+ */
+trait ApiQueryBlockInfoTrait {
+       use ApiBlockInfoTrait;
+
+       /**
+        * Filters hidden users (where the user doesn't have the right to view them)
+        * Also adds relevant block information
+        *
+        * @param bool $showBlockInfo
+        * @return void
+        */
+       private function addBlockInfoToQuery( $showBlockInfo ) {
+               $db = $this->getDB();
+
+               if ( $showBlockInfo ) {
+                       $queryInfo = DatabaseBlock::getQueryInfo();
+               } else {
+                       $queryInfo = [
+                               'tables' => [ 'ipblocks' ],
+                               'fields' => [ 'ipb_deleted' ],
+                               'joins' => [],
+                       ];
+               }
+
+               $this->addTables( [ 'blk' => $queryInfo['tables'] ] );
+               $this->addFields( $queryInfo['fields'] );
+               $this->addJoinConds( $queryInfo['joins'] );
+               $this->addJoinConds( [
+                       'blk' => [ 'LEFT JOIN', [
+                               'ipb_user=user_id',
+                               'ipb_expiry > ' . $db->addQuotes( $db->timestamp() ),
+                       ] ],
+               ] );
+
+               // Don't show hidden names
+               if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'hideuser' ) ) {
+                       $this->addWhere( 'ipb_deleted = 0 OR ipb_deleted IS NULL' );
+               }
+       }
+
+       /**
+        * @name Methods required from ApiQueryBase
+        * @{
+        */
+
+       /** @see ApiBase::getDB */
+       abstract protected function getDB();
+
+       /** @see ApiBase::getPermissionManager */
+       abstract protected function getPermissionManager(): PermissionManager;
+
+       /** @see IContextSource::getUser */
+       abstract public function getUser();
+
+       /** @see ApiQueryBase::addTables */
+       abstract protected function addTables( $tables, $alias = null );
+
+       /** @see ApiQueryBase::addFields */
+       abstract protected function addFields( $fields );
+
+       /** @see ApiQueryBase::addWhere */
+       abstract protected function addWhere( $conds );
+
+       /** @see ApiQueryBase::addJoinConds */
+       abstract protected function addJoinConds( $conds );
+
+       /**@}*/
+
+}
index b8caeb9..a47ca09 100644 (file)
@@ -23,6 +23,7 @@
 use MediaWiki\MediaWikiServices;
 use MediaWiki\Storage\NameTableAccessException;
 use MediaWiki\Revision\RevisionRecord;
+use MediaWiki\Revision\SlotRecord;
 
 /**
  * Query module to enumerate all deleted revisions.
@@ -347,7 +348,9 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                                        $anyHidden = true;
                                }
                                if ( Revision::userCanBitfield( $row->ar_deleted, RevisionRecord::DELETED_TEXT, $user ) ) {
-                                       ApiResult::setContentValue( $rev, 'text', Revision::getRevisionText( $row, 'ar_' ) );
+                                       ApiResult::setContentValue( $rev, 'text',
+                                               $revisionStore->newRevisionFromArchiveRow( $row )
+                                                       ->getContent( SlotRecord::MAIN )->serialize() );
                                }
                        }
 
index 97a9b0a..285c0bf 100644 (file)
@@ -387,9 +387,13 @@ class ApiQueryImageInfo extends ApiQueryBase {
                $vals = [
                        ApiResult::META_TYPE => 'assoc',
                ];
+
+               // Some information will be unavailable if the file does not exist. T221812
+               $exists = $file->exists();
+
                // Timestamp is shown even if the file is revdelete'd in interface
                // so do same here.
-               if ( isset( $prop['timestamp'] ) ) {
+               if ( isset( $prop['timestamp'] ) && $exists ) {
                        $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $file->getTimestamp() );
                }
 
@@ -408,7 +412,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                $user = isset( $prop['user'] );
                $userid = isset( $prop['userid'] );
 
-               if ( $user || $userid ) {
+               if ( ( $user || $userid ) && $exists ) {
                        if ( $file->isDeleted( File::DELETED_USER ) ) {
                                $vals['userhidden'] = true;
                                $anyHidden = true;
@@ -428,7 +432,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
 
                // This is shown even if the file is revdelete'd in interface
                // so do same here.
-               if ( isset( $prop['size'] ) || isset( $prop['dimensions'] ) ) {
+               if ( ( isset( $prop['size'] ) || isset( $prop['dimensions'] ) ) && $exists ) {
                        $vals['size'] = (int)$file->getSize();
                        $vals['width'] = (int)$file->getWidth();
                        $vals['height'] = (int)$file->getHeight();
@@ -449,7 +453,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                $pcomment = isset( $prop['parsedcomment'] );
                $comment = isset( $prop['comment'] );
 
-               if ( $pcomment || $comment ) {
+               if ( ( $pcomment || $comment ) && $exists ) {
                        if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
                                $vals['commenthidden'] = true;
                                $anyHidden = true;
@@ -500,7 +504,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                }
 
                if ( $url ) {
-                       if ( $file->exists() ) {
+                       if ( $exists ) {
                                if ( !is_null( $thumbParams ) ) {
                                        $mto = $file->transform( $thumbParams );
                                        self::$transformCount++;
@@ -529,8 +533,6 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                        }
                                }
                                $vals['url'] = wfExpandUrl( $file->getFullUrl(), PROTO_CURRENT );
-                       } else {
-                               $vals['filemissing'] = true;
                        }
                        $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl(), PROTO_CURRENT );
 
@@ -540,11 +542,15 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        }
                }
 
-               if ( $sha1 ) {
+               if ( !$exists ) {
+                       $vals['filemissing'] = true;
+               }
+
+               if ( $sha1 && $exists ) {
                        $vals['sha1'] = Wikimedia\base_convert( $file->getSha1(), 36, 16, 40 );
                }
 
-               if ( $meta ) {
+               if ( $meta && $exists ) {
                        Wikimedia\suppressWarnings();
                        $metadata = unserialize( $file->getMetadata() );
                        Wikimedia\restoreWarnings();
@@ -553,12 +559,12 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        }
                        $vals['metadata'] = $metadata ? static::processMetaData( $metadata, $result ) : null;
                }
-               if ( $commonmeta ) {
+               if ( $commonmeta && $exists ) {
                        $metaArray = $file->getCommonMetaArray();
                        $vals['commonmetadata'] = $metaArray ? static::processMetaData( $metaArray, $result ) : [];
                }
 
-               if ( $extmetadata ) {
+               if ( $extmetadata && $exists ) {
                        // Note, this should return an array where all the keys
                        // start with a letter, and all the values are strings.
                        // Thus there should be no issue with format=xml.
@@ -575,11 +581,11 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        $vals['extmetadata'] = $extmetaArray;
                }
 
-               if ( $mime ) {
+               if ( $mime && $exists ) {
                        $vals['mime'] = $file->getMimeType();
                }
 
-               if ( $mediatype ) {
+               if ( $mediatype && $exists ) {
                        $vals['mediatype'] = $file->getMediaType();
                }
 
@@ -589,7 +595,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        $vals['archivename'] = $file->getArchiveName();
                }
 
-               if ( $bitdepth ) {
+               if ( $bitdepth && $exists ) {
                        $vals['bitdepth'] = $file->getBitDepth();
                }
 
index 47a6f87..2c19c7d 100644 (file)
@@ -186,6 +186,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
 
                        // T71222: MariaDB's optimizer, at least 10.1.37 and .38, likes to choose a wildly bad plan for
                        // some reason for this code path. Tell it not to use the wrong index it wants to pick.
+                       // @phan-suppress-next-line PhanTypeMismatchArgument
                        $this->addOption( 'IGNORE INDEX', [ 'logging' => [ 'times' ] ] );
                }
 
index 26c17c5..12e908f 100644 (file)
@@ -61,7 +61,7 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase {
         * @param string $name
         * @return QueryPage
         */
-       private function getSpecialPage( $name ) {
+       private function getSpecialPage( $name ) : QueryPage {
                $qp = $this->specialPageFactory->getPage( $name );
                if ( !$qp ) {
                        self::dieDebug(
index 7e4a891..47212b3 100644 (file)
@@ -279,6 +279,8 @@ class ApiQuerySiteinfo extends ApiQueryBase {
        }
 
        protected function appendNamespaces( $property ) {
+               $nsProtection = $this->getConfig()->get( 'NamespaceProtection' );
+
                $data = [
                        ApiResult::META_TYPE => 'assoc',
                ];
@@ -303,6 +305,17 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                        $data[$ns]['content'] = $nsInfo->isContent( $ns );
                        $data[$ns]['nonincludable'] = $nsInfo->isNonincludable( $ns );
 
+                       if ( isset( $nsProtection[$ns] ) ) {
+                               if ( is_array( $nsProtection[$ns] ) ) {
+                                       $specificNs = implode( "|", array_filter( $nsProtection[$ns] ) );
+                               } elseif ( $nsProtection[$ns] !== '' ) {
+                                       $specificNs = $nsProtection[$ns];
+                               }
+                               if ( isset( $specificNs ) && $specificNs !== '' ) {
+                                       $data[$ns]['namespaceprotection'] = $specificNs;
+                               }
+                       }
+
                        $contentmodel = $nsInfo->getNamespaceContentModel( $ns );
                        if ( $contentmodel ) {
                                $data[$ns]['defaultcontentmodel'] = $contentmodel;
index ce51a67..0171a37 100644 (file)
  * @file
  */
 
+use MediaWiki\Block\DatabaseBlock;
+
 /**
  * Query module to get information about a list of users
  *
  * @ingroup API
  */
 class ApiQueryUsers extends ApiQueryBase {
+       use ApiQueryBlockInfoTrait;
 
        private $tokenFunctions, $prop;
 
@@ -150,7 +153,7 @@ class ApiQueryUsers extends ApiQueryBase {
                                $this->addWhereFld( 'user_id', $userids );
                        }
 
-                       $this->showHiddenUsersAddBlockInfo( isset( $this->prop['blockinfo'] ) );
+                       $this->addBlockInfoToQuery( isset( $this->prop['blockinfo'] ) );
 
                        $data = [];
                        $res = $this->select( __METHOD__ );
@@ -232,13 +235,7 @@ class ApiQueryUsers extends ApiQueryBase {
                                        $data[$key]['hidden'] = true;
                                }
                                if ( isset( $this->prop['blockinfo'] ) && !is_null( $row->ipb_by_text ) ) {
-                                       $data[$key]['blockid'] = (int)$row->ipb_id;
-                                       $data[$key]['blockedby'] = $row->ipb_by_text;
-                                       $data[$key]['blockedbyid'] = (int)$row->ipb_by;
-                                       $data[$key]['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
-                                       $data[$key]['blockreason'] = $commentStore->getComment( 'ipb_reason', $row )
-                                               ->text;
-                                       $data[$key]['blockexpiry'] = $row->ipb_expiry;
+                                       $data[$key] += $this->getBlockDetails( DatabaseBlock::newFromRow( $row ) );
                                }
 
                                if ( isset( $this->prop['emailable'] ) ) {
index bb6c580..f2b52cd 100644 (file)
@@ -96,6 +96,7 @@ class ApiTag extends ApiBase {
                                $valid = RecentChange::newFromId( $id );
                                if ( $valid && $this->getPermissionManager()->isBlockedFrom( $user, $valid->getTitle() ) ) {
                                        $idResult['status'] = 'error';
+                                       // @phan-suppress-next-line PhanTypeMismatchArgument
                                        $idResult += $this->getErrorFormatter()->formatMessage( ApiMessage::create(
                                                'apierror-blocked',
                                                'blocked',
@@ -111,6 +112,7 @@ class ApiTag extends ApiBase {
                                        $this->getPermissionManager()->isBlockedFrom( $user, $valid->getPageAsLinkTarget() )
                                ) {
                                        $idResult['status'] = 'error';
+                                       // @phan-suppress-next-line PhanTypeMismatchArgument
                                        $idResult += $this->getErrorFormatter()->formatMessage( ApiMessage::create(
                                                        'apierror-blocked',
                                                        'blocked',
index 373ec11..4678e1f 100644 (file)
@@ -636,6 +636,7 @@ class ApiUpload extends ApiBase {
                                }
                                ApiResult::setIndexedTagName( $details, 'detail' );
                                $msg->setApiData( $msg->getApiData() + [ 'details' => $details ] );
+                               // @phan-suppress-next-line PhanTypeMismatchArgument
                                $this->dieWithError( $msg );
                                break;
 
index 5ce00f5..12ece4c 100644 (file)
@@ -37,7 +37,7 @@
                        "Lucas Werkmeister (WMDE)"
                ]
        },
-       "apihelp-main-extended-description": "<div class=\"hlist plainlinks api-main-links\">\n* [[mw:Special:MyLanguage/API:Main_page|Documentation]]\n* [[mw:Special:MyLanguage/API:FAQ|FAQ]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api Liste de diffusion]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce Annonces de l’API]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R Bogues et demandes]\n</div>\n<strong>État :</strong> l’API de MediaWiki est une interface stable et mature qui est supportée et améliorée de façon active. Bien que nous essayions de l’éviter, nous pouvons avoir parfois besoin de faire des modifications impactantes ; inscrivez-vous à [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ la liste de diffusion ''mediawiki-api-announce''] pour être informé des mises à jour.\n\n<strong>Requêtes erronées :</strong> si des requêtes erronées sont envoyées à l’API, un entête HTTP sera renvoyé avec la clé « MediaWiki-API-Error ». La valeur de cet entête et le code d’erreur renvoyé prendront la même valeur. Pour plus d’information, voyez [[mw:Special:MyLanguage/API:Errors_and_warnings|API:Errors and warnings]].\n\n<p class=\"mw-apisandbox-link\"><strong>Test :</strong> Pour faciliter le test des requêtes à l’API, voyez [[Special:ApiSandbox]].</p>",
+       "apihelp-main-extended-description": "<div class=\"hlist plainlinks api-main-links\">\n* [[mw:Special:MyLanguage/API:Main_page|Documentation]]\n* [[mw:Special:MyLanguage/API:FAQ|FAQ]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api Liste de diffusion]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce Annonces de l’API]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R Bogues et demandes]\n</div>\n<strong>État :</strong> l’API de MediaWiki est une interface stable et mature qui est supportée et améliorée de façon active. Bien que nous essayions de l’éviter, nous pouvons avoir parfois besoin de faire des modifications impactantes ; inscrivez-vous à [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ la liste de diffusion ''mediawiki-api-announce''] pour être informé des mises à jour.\n\n<strong>Requêtes erronées :</strong> si des requêtes erronées sont envoyées à l’API, un entête HTTP sera renvoyé avec la clé « MediaWiki-API-Error ». La valeur de cet entête et le code d’erreur renvoyé prendront la même valeur. Pour plus d’information, voyez [[mw:Special:MyLanguage/API:Errors_and_warnings|API:Errors and warnings]].\n\n<p class=\"mw-apisandbox-link\"><strong>Test :</strong> Pour faciliter le test des requêtes à l’API, voyez [[Special:ApiSandbox]].</p>",
        "apihelp-main-param-action": "Quelle action effectuer.",
        "apihelp-main-param-format": "Le format de sortie.",
        "apihelp-main-param-maxlag": "La latence maximale peut être utilisée quand MediaWiki est installé sur une grappe de réplication de base de données. Pour éviter des actions provoquant un supplément de latence de réplication de site, ce paramètre peut faire attendre le client jusqu’à ce que la latence de réplication soit inférieure à une valeur spécifiée. En cas de latence excessive, le code d’erreur <samp>maxlag</samp> est renvoyé avec un message tel que <samp>Attente de $host : $lag secondes de délai</samp>.<br />Voyez [[mw:Special:MyLanguage/Manual:Maxlag_parameter|Manuel : paramètre Maxlag]] pour plus d’informations.",
index cb4cd81..f6076b4 100644 (file)
@@ -47,6 +47,9 @@
        "apihelp-block-param-reblock": "Se o usuario xa está bloqueado, sobreescribir o bloqueo existente.",
        "apihelp-block-param-watchuser": "Vixiar a páxina de usuario ou direccións IP e a de conversa deste usuario",
        "apihelp-block-param-tags": "Cambiar as etiquetas a aplicar á entrada no rexistro de bloqueos.",
+       "apihelp-block-param-partial": "Bloquear a un usuario en determinadas páxinas ou espazos de nomes no canto de todo o sitio.",
+       "apihelp-block-param-pagerestrictions": "Lista de títulos que o bloqueo impedirá editar ó usuario. Só se aplica cando <var>partial</var> (parcial) está definido como 'true' (verdadeiro).",
+       "apihelp-block-param-namespacerestrictions": "Lista de identificadores de espazos de nomes que o bloqueo impedirá que edite o usuario. Só se aplica cando <var>partial</var> (parcial) está definido como 'true' (verdadeiro).",
        "apihelp-block-example-ip-simple": "Bloquear dirección IP <kbd>192.0.2.5</kbd> durante tres días coa razón <kbd>Primeiro aviso</kbd>.",
        "apihelp-block-example-user-complex": "Bloquear indefinidamente ó usuario <kbd>Vandal</kbd> coa razón <kbd>Vandalism</kbd>, e impedir a creación de novas contas e envío de correos electrónicos.",
        "apihelp-changeauthenticationdata-summary": "Cambiar os datos de autenticación do usuario actual.",
index e2c5fe7..e7cf3d4 100644 (file)
        "apihelp-query-param-indexpageids": "לכלול פסקת pageids נוספת עם רשימת כל מזהי הדף שהוחזרו.",
        "apihelp-query-param-export": "יצוא הגרסאות הנוכחיות של כל הדפים הנתונים המחוללים.",
        "apihelp-query-param-exportnowrap": "להחזיר את ה־XML של היצוא בלי לעטוף אותו בתוצאת XML (אותו תסדיר כמו [[Special:Export]]). אפשר להשתמש בזה רק עם $1export.",
+       "apihelp-query-param-exportschema": "להשתמש בגרסה הנתונה של תסדיר היטל XML בעת היצוא. יכול לשמש רק עם <var>$1export</var>.",
        "apihelp-query-param-iwurl": "האם לקבל את ה־URL המלא אם הכותרת היא קישור בינוויקי.",
        "apihelp-query-param-rawcontinue": "להחזיר נתוני <samp>query-continue</samp> גולמיים להמשך.",
        "apihelp-query-example-revisions": "אחזור [[Special:ApiHelp/query+siteinfo|site info]] ו־[[Special:ApiHelp/query+revisions|revisions]] של <kbd>Main Page</kbd>.",
        "apihelp-query+langlinks-param-inlanguagecode": "קוד שפה בשביל שמות שפות מתורגמות.",
        "apihelp-query+langlinks-example-simple": "קבלת קישורים בין־לשוניים מהדף <kbd>Main Page</kbd>.",
        "apihelp-query+languageinfo-summary": "מחזירה מידע על שפות זמינות.",
+       "apihelp-query+languageinfo-extended-description": "אפשר להחיל [[mw:API:Query#Continuing queries|המשך]] אם אחזור המידע לוקח יותר מדי זמן בשביל בקשה אחת.",
        "apihelp-query+languageinfo-param-prop": "איזה מידע לקבל עבור כל שפה.",
+       "apihelp-query+languageinfo-paramvalue-prop-code": "קוד השפה. (הקוד הזה ייחודי למדיה־ויקי, אם כי יש חפיפה עם תקנים אחרים.)",
+       "apihelp-query+languageinfo-paramvalue-prop-bcp47": "קוד שפת לפי BCP-47.",
        "apihelp-query+languageinfo-paramvalue-prop-dir": "כיוון הכתיבה של השפה (<code>ltr</code> או <code>rtl</code>).",
+       "apihelp-query+languageinfo-paramvalue-prop-autonym": "השם העצמי של השפה, כלומר השם באותה השפה.",
+       "apihelp-query+languageinfo-paramvalue-prop-name": "השם בשפה בשפה שצוינה בפרמטר <var>uselang</var>, עם שפת גיבוי כשזה נחוץ.",
+       "apihelp-query+languageinfo-paramvalue-prop-fallbacks": "קודי השפה של שפות הגיבוי שמוגדרים עבור השפה הזאת. הגיבוי המשתמע הסופי ל־\"en\" אינו כלול (אבל שפות אחדות יכולות להיות מגובות ב־\"en\" במפורש).",
+       "apihelp-query+languageinfo-paramvalue-prop-variants": "קודי השפה של ההגוונים שהשפה הזאת תומכת בהם.",
+       "apihelp-query+languageinfo-param-code": "קודי השפה של השפות שאמורות להיות מוחזרות, או <code>*</code> כדי לקבל את כל השפות.",
        "apihelp-query+languageinfo-example-simple": "קבלת קודי שפה של כל השפות הנתמכות.",
+       "apihelp-query+languageinfo-example-autonym-name-de": "קבלת השמות העצמיים והשמות הגרמניים של כל השפות הנתמכות.",
+       "apihelp-query+languageinfo-example-fallbacks-variants-oc": "קבלת שפות הגיבוי וההגוונים של אוקסיטנית.",
+       "apihelp-query+languageinfo-example-bcp47-dir": "קבלת קודי שפה ב־BCP-47 וכיוון עבור כל השפות הנתמכות.",
        "apihelp-query+links-summary": "החזרת כל הקישורים מהדפים שצוינו.",
        "apihelp-query+links-param-namespace": "להציג קישורים רק במרחבי השם האלה.",
        "apihelp-query+links-param-limit": "כמה קישורים להחזיר.",
        "api-help-param-templated-var-first": "יש להחליף את הטקסט <var>&#x7B;$1&#x7D;</var> (בשם הפרמטר) עם הערכים של הפרמטר <var>$2</var>",
        "api-help-param-templated-var": "<var>&#x7B;$1&#x7D;</var> עם הערכים של הפרמטר <var>$2</var>",
        "api-help-datatypes-header": "סוגי נתונים",
-       "api-help-datatypes": "קלט למדיה־ויקי צריך להיות בקידוד UTF-8 מנורמל ב־NFC. מדיה־ויקי יכולה לנסות להמיר קלט אחר, אבל זה עלול לגרום לפעולות מסוימות (כגון [[Special:ApiHelp/edit|עריכות]] עם בדיקות MD5) להיכשל.\n\nחלק מסוגי הפרמטרים בבקשות API דורשים הסבר נוסף:\n;בוליאני (boolean)\n:פרמטרים בוליאניים עובדים כמו תיבות סימון של HTML: אם הפרמטר צוין, בלי קשר לערך שלו, הוא אמת (true). בשביל ערך שקר (false), יש להשמיט את הפרמטר לגמרי.\n;חותם־זמן (timestamp)\n:אפשר לכתוב חותמי־זמן במספר תסדירים. תאריך ושעה לפי ISO 8601 הוא הדבר המומלת. כל הזמנים מצוינים ב־ UTC, לא תהיה השפעה לשום אזור זמן שיצוין.\n:* תאריך ושעה לפי ISO 8601‏, <kbd><var>2001</var>-<var>01</var>-<var>15</var>T<var>14</var>:<var>56</var>:<var>00</var>Z</kbd> (לא חובה לכתוב פיסוק ו־<kbd>Z</kbd>)\n:* תאריך ושעה לפי ISO 8601 עם חלקי שנייה (שלא תהיה להם שום השפעה), <kbd><var>2001</var>-<var>01</var>-<var>15</var>T<var>14</var>:<var>56</var>:<var>00</var>.<var>00001</var>Z</kbd> (לא חובה לכתוב קווים מפרידים, נקודתיים ו־<kbd>Z</kbd>)\n:* תסדיר MediaWiki‏, <kbd><var>2001</var><var>01</var><var>15</var><var>14</var><var>56</var><var>00</var></kbd>\n:* תסדיר מספרי כללי, <kbd><var>2001</var>-<var>01</var>-<var>15</var> <var>14</var>:<var>56</var>:<var>00</var></kbd> (לאזור זמן אופציונלי של <kbd>GMT</kbd>‏, <kbd dir=\"ltr\">+<var>##</var></kbd>, או <kbd dir=\"ltr\">-<var>##</var></kbd> אין השפעה)\n:* תסדיר EXIF‏, <kbd><var>2001</var>:<var>01</var>:<var>15</var> <var>14</var>:<var>56</var>:<var>00</var></kbd>\n:* תסדיר RFC 2822 (אפשר להשמיט את אזור הזמן), <kbd><var>Mon</var>, <var>15</var> <var>Jan</var> <var>2001</var> <var>14</var>:<var>56</var>:<var>00</var></kbd>\n:* תסדיר RFC 850 (אפשר להשמיט את אזור הזמן), <kbd><var>Monday</var>, <var>15</var>-<var>Jan</var>-<var>2001</var> <var>14</var>:<var>56</var>:<var>00</var></kbd>\n:* תסדיר C ctime‏, <kbd><var>Mon</var> <var>Jan</var> <var>15</var> <var>14</var>:<var>56</var>:<var>00</var> <var>2001</var></kbd>\n:* שניות מאז 1970-01-01T00:00:00Z בתור מספר שלך בין 1 ל־13 (לא כולל <kbd>0</kbd>)\n:* המחרוזת <kbd>now</kbd>\n;מפריד ערכים מרובים חלופי\n:פרמטרים שלוקחים ערכים מרובים בדרך־כלל נשלחים עם הערכים מופרדים באמצעות תו מקל, למשל <kbd>param=value1|value2</kbd> או <kbd>param=value1%7Cvalue2</kbd>. אם הערך צריך להכיל את תו המקל, יש להשתמש ב־U+001F (מפריד יחידות) בתור המפריד ''וגם'' להוסיף לתחילת הערך U+001F, למשל <kbd>param=%1Fvalue1%1Fvalue2</kbd>.",
+       "api-help-datatypes": "קלט למדיה־ויקי צריך להיות בקידוד UTF-8 מנורמל ב־NFC. מדיה־ויקי יכולה לנסות להמיר קלט אחר, אבל זה עלול לגרום לפעולות מסוימות (כגון [[Special:ApiHelp/edit|עריכות]] עם בדיקות MD5) להיכשל.\n\nחלק מסוגי הפרמטרים בבקשות API דורשים הסבר נוסף:\n;בוליאני (boolean)\n:פרמטרים בוליאניים עובדים כמו תיבות סימון של HTML: אם הפרמטר צוין, בלי קשר לערך שלו, הוא אמת (true). בשביל ערך שקר (false), יש להשמיט את הפרמטר לגמרי.\n;חותם־זמן (timestamp)\n:אפשר לכתוב חותמי־זמן במספר תסדירים, ר' את [[mw:Special:MyLanguage/Timestamp|תיעוד תסדירי הקלט של ספריית Timestamp באתר mediawiki.org]] לפרטים. תאריך ושעה לפי ISO 8601 הוא הדבר המומלץ: <kbd><var>2001</var>-<var>01</var>-<var>15</var>T<var>14</var>:<var>56</var>:<var>00</var>Z</kbd>. בנוסף, המחרוזת <kbd>now</kbd> יכולה לשמש לציון חום־הזמן הנוכחי.\n;מפריד ערכים מרובים חלופי\n:פרמטרים שלוקחים ערכים מרובים בדרך־כלל נשלחים עם הערכים מופרדים באמצעות תו מקל, למשל <kbd>param=value1|value2</kbd> או <kbd>param=value1%7Cvalue2</kbd>. אם הערך צריך להכיל את תו המקל, יש להשתמש ב־U+001F (מפריד יחידות) בתור המפריד ''וגם'' להוסיף לתחילת הערך U+001F, למשל <kbd>param=%1Fvalue1%1Fvalue2</kbd>.",
        "api-help-templatedparams-header": "פרמטרים בתבניות",
        "api-help-templatedparams": "התכונה \"פרמטרים בתבניות\" תומכת במקרים שבהם מודול של API זקוק לערך כלשהו עבור ערכים של פרמטרים אחרים. למשל, אם היה מודול API לבקשת פרי, ייתכן שהוא היה זקוק לפרמטר בשם <var>פירות</var> על־מנת לציין מהם הפירות המבוקשים, ולפרמטר בתבנית בשם <var>{פרי}-כמות</var> על־מנת לציין את הכמות של כל פרי עבור הבקשה. לשם כך, לקוח API שמעוניין לקבל תפוח אחד, 5 בננות ו־20 תותים יכול היה ליצור בקשה בסגנון <kbd>פירות=תפוחים|בננות|תותים&תפוחים-כמות=1&בננות-כמות=5&תותים-כמות=20</kbd>.",
        "api-help-param-type-limit": "סוג: מספר שלם או <kbd>max</kbd>",
        "apierror-cantoverwrite-sharedfile": "קובץ היעד קיים במאגר משותף ואין לך הרשאה לעקוף אותו.",
        "apierror-cantsend": "לא נכנסת לחשבון, אין לך חשבון דואר אלקטרוני מאושר, או שאסור לך לשלוח דואר אלקטרוני למשתמשים אחרים, ולכן אין לך אפשרות לשלוח דואר אלקטרוני.",
        "apierror-cantundelete": "לא היה אפשר לשחזר ממחיקה: אולי הגרסאות המבוקשות אינן קיימות, ואולי הן כבר נמחקו.",
+       "apierror-cantview-deleted-comment": "אין לך הרשאה לצפות בהערות מחוקות.",
+       "apierror-cantview-deleted-description": "אין לך הרשאה לצפות בתיאורים של קבצים מחוקים.",
+       "apierror-cantview-deleted-metadata": "אין לך הרשאה לצפות במטא־נתונים של קבצים מחוקים.",
+       "apierror-cantview-deleted-revision-content": "אין לך הרשאה לצפות בתוכן של גרסאות מחוקות.",
        "apierror-changeauth-norequest": "יצירת בקשת השינוי נכשלה.",
        "apierror-chunk-too-small": "גודל הפלח המזערי הוא {{PLURAL:$1|בית אחד|$1 בתים}} בשביל פלחים לא סופיים.",
        "apierror-cidrtoobroad": "טווחי CIDR של $1 שרחבים יותר מ־/$2 אינם קבילים.",
        "apiwarn-deprecation-missingparam": "מכיוון שלא צוין <var>$1</var>, ישמש תסדיר ישן לפלט. התסדיר הזה מוכרז בתור מיושן, ובעתיד ישמש רק התסדיר החדש.",
        "apiwarn-deprecation-parameter": "הפרמטר <var>$1</var> מיושן.",
        "apiwarn-deprecation-parse-headitems": "<kbd>prop=headitems</kbd> מיושן מאז מדיה־ויקי 1.28. יש להשתמש ב־<kbd>prop=headhtml</kbd> בעת יצירת מסמכי HTML חדשים, או ב־<kbd>prop=modules|jsconfigvars</kbd> בעת עדכון מסמך בצד הלקוח.",
+       "apiwarn-deprecation-post-without-content-type": "בקשת POST נעשתה ללא כותר <code>Content-Type</code>. זה לא עובד באופן מהימן.",
        "apiwarn-deprecation-purge-get": "שימוש ב־<kbd>action=purge</kbd> דרך GET מיושן. יש להשתמש ב־POST במקום זה.",
        "apiwarn-deprecation-withreplacement": "<kbd>$1</kbd> מיושן. יש להשתמש ב־<kbd>$2</kbd> במקום זה.",
        "apiwarn-difftohidden": "לא היה אפשר לעשות השוואה עם גרסה $1: התוכן מוסתר.",
index 6124066..6f390f9 100644 (file)
@@ -16,7 +16,8 @@
                        "Jonghaya",
                        "Jerrykim306",
                        "코코아",
-                       "Macofe"
+                       "Macofe",
+                       "렌즈"
                ]
        },
        "apihelp-main-extended-description": "<div class=\"hlist plainlinks api-main-links\">\n* [[mw:Special:MyLanguage/API:Main_page|설명문서]]\n* [[mw:Special:MyLanguage/API:FAQ|FAQ]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api 메일링 리스트]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce API 알림 사항]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R 버그 및 요청]\n</div>\n<strong>상태:</strong> 이 페이지에 보이는 모든 기능은 정상적으로 작동하지만, API는 여전히 활발하게 개발되고 있으며, 언제든지 변경될 수 있습니다. 업데이트 공지를 받아보려면 [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ mediawiki-api-announce 메일링 리스트]를 구독하십시오.\n\n<strong>잘못된 요청:</strong> API에 잘못된 요청이 전송되면 \"MediaWiki-API-Error\" 키가 포함된 HTTP 헤더가 전송되며 반환되는 헤더와 오류 코드의 값은 모두 동일한 값으로 설정됩니다. 자세한 정보에 대해서는 [[mw:Special:MyLanguage/API:Errors and warnings/ko|API:오류와 경고]]를 참조하십시오.\n\n<strong>테스트하기:</strong> API 요청 테스트를 용이하게 하려면, [[Special:ApiSandbox]]를 보십시오.",
        "apihelp-compare-paramvalue-prop-title": "'from'과 'to' 판의 문서 제목입니다.",
        "apihelp-compare-paramvalue-prop-user": "'from'과 'to' 판의 사용자 이름과 ID입니다.",
        "apihelp-compare-paramvalue-prop-comment": "'from'과 'to' 판의 설명입니다.",
-       "apihelp-compare-paramvalue-prop-parsedcomment": "'from'과 to' 판의 구문 분석된 설명입니다.",
+       "apihelp-compare-paramvalue-prop-parsedcomment": "'from'과 to' 판의 변환된 설명입니다.",
        "apihelp-compare-paramvalue-prop-size": "'from'과 'to' 판의 크기입니다.",
        "apihelp-compare-example-1": "판 1과 2의 차이를 생성합니다.",
        "apihelp-createaccount-summary": "새 사용자 계정을 만듭니다.",
        "apihelp-options-example-complex": "모든 환경 설정을 초기화하고 <kbd>skin</kbd>과 <kbd>nickname</kbd>을 설정합니다.",
        "apihelp-paraminfo-summary": "API 모듈의 정보를 가져옵니다.",
        "apihelp-paraminfo-param-helpformat": "도움말 문자열 포맷.",
-       "apihelp-parse-summary": "ë\82´ì\9a©ì\9d\98 êµ¬ë¬¸ì\9d\84 ë¶\84ì\84\9dí\95\98ê³  í\8c\8cì\84\9c 출력을 반환합니다.",
-       "apihelp-parse-param-summary": "구문 분석할 요약입니다.",
-       "apihelp-parse-paramvalue-prop-text": "위키텍스트의 구문 분석된 텍스트를 제공합니다.",
-       "apihelp-parse-paramvalue-prop-langlinks": "구문 분석된 위키텍스트의 언어 링크를 제공합니다.",
-       "apihelp-parse-paramvalue-prop-categories": "구문 분석된 위키텍스트의 분류를 제공합니다.",
+       "apihelp-parse-summary": "ë\82´ì\9a©ì\9d\84 ë³\80í\99\98í\95\98ê³  출력을 반환합니다.",
+       "apihelp-parse-param-summary": "변환할 요약입니다.",
+       "apihelp-parse-paramvalue-prop-text": "위키텍스트로 변환된 텍스트를 제공합니다.",
+       "apihelp-parse-paramvalue-prop-langlinks": "언어 링크를 위키텍스트로 변환하여 제공합니다.",
+       "apihelp-parse-paramvalue-prop-categories": "분류를 변환된 위키텍스트로 제공합니다.",
        "apihelp-parse-paramvalue-prop-categorieshtml": "분류의 HTML 버전을 제공합니다.",
-       "apihelp-parse-paramvalue-prop-links": "구문 분석된 위키텍스트의 내부 링크를 제공합니다.",
-       "apihelp-parse-paramvalue-prop-templates": "구문 분석된 위키텍스트의 틀을 제공합니다.",
-       "apihelp-parse-paramvalue-prop-images": "구문 ë¶\84ì\84\9dë\90\9c ì\9c\84í\82¤í\85\8dì\8a¤í\8a¸ì\9d\98 ê·¸ë¦¼ì\9d\84 제공합니다.",
-       "apihelp-parse-paramvalue-prop-externallinks": "구문 분석된 위키텍스트의 외부 링크를 제공합니다.",
-       "apihelp-parse-paramvalue-prop-sections": "구문 분석된 위키텍스트의 문단을 제공합니다.",
-       "apihelp-parse-paramvalue-prop-revid": "구문 분석된 페이지의 판 ID를 추가합니다.",
-       "apihelp-parse-paramvalue-prop-displaytitle": "구문 분석된 위키텍스트의 제목을 추가합니다.",
+       "apihelp-parse-paramvalue-prop-links": "내부 링크를 위키텍스트로 변환하여 제공합니다.",
+       "apihelp-parse-paramvalue-prop-templates": "틀을 변환된 위키텍스트로 제공합니다.",
+       "apihelp-parse-paramvalue-prop-images": "그림ì\9d\84 ì\9c\84í\82¤í\85\8dì\8a¤í\8a¸ë¡\9c ë³\80í\99\98í\95\98ì\97¬ 제공합니다.",
+       "apihelp-parse-paramvalue-prop-externallinks": "외부 링크를 위키텍스트로 변환하여 제공합니다.",
+       "apihelp-parse-paramvalue-prop-sections": "문단을 변환된 위키텍스트로 제공합니다.",
+       "apihelp-parse-paramvalue-prop-revid": "변환할 페이지의 판 ID를 추가합니다.",
+       "apihelp-parse-paramvalue-prop-displaytitle": "제목을 변환된 위키텍스트로 추가합니다.",
        "apihelp-parse-paramvalue-prop-headitems": "문서의 <code>&lt;head&gt;</code> 안에 넣을 항목을 제공합니다.",
-       "apihelp-parse-paramvalue-prop-headhtml": "문서의 구문 분석된 <code>&lt;head&gt;</code>를 제공합니다.",
+       "apihelp-parse-paramvalue-prop-headhtml": "문서의 파싱된 doctype, 여는 <code>&lt;html&gt;</code>, <code>&lt;head&gt;</code>, <code>&lt;body&gt;</code>를 제공합니다.",
        "apihelp-parse-paramvalue-prop-modules": "문서에 사용되는 ResourceLoader 모듈을 제공합니다. 불러오려면, <code>mw.loader.using()</code>을 사용하세요. <kbd>jsconfigvars</kbd> 또는 <kbd>encodedjsconfigvars</kbd>는 <kbd>modules</kbd>와 함께 요청해야 합니다.",
        "apihelp-parse-paramvalue-prop-jsconfigvars": "문서에 특화된 자바스크립트 구성 변수를 제공합니다. 적용하려면 <code>mw.config.set()</code>을 사용하세요.",
-       "apihelp-parse-paramvalue-prop-iwlinks": "구문 분석된 위키텍스트의 인터위키 링크를 제공합니다.",
-       "apihelp-parse-paramvalue-prop-wikitext": "구문 분석된 위키텍스트 원문을 제공합니다.",
-       "apihelp-parse-paramvalue-prop-properties": "구문 분석된 위키텍스트에 정의된 다양한 속성을 제공합니다.",
-       "apihelp-parse-param-pst": "구문 분석 이전에 입력에 대한 사전 저장 변환을 수행합니다. 텍스트로 사용할 때에만 유효합니다.",
+       "apihelp-parse-paramvalue-prop-iwlinks": "인터위키 링크를 위키텍스트로 변환하여 제공합니다.",
+       "apihelp-parse-paramvalue-prop-wikitext": "변환한 원문 위키텍스트를 제공합니다.",
+       "apihelp-parse-paramvalue-prop-properties": "정의된 다양한 속성을 변환된 위키텍스트로 제공합니다.",
+       "apihelp-parse-param-pst": "파싱에 앞서 입력에 대한 저장 직전의 변환을 수행합니다. 텍스트로 사용할 때에만 유효합니다.",
        "apihelp-parse-param-disablelimitreport": "파서 출력에서 제한 보고서(\"NewPP limit report\")를 제외합니다.",
        "apihelp-parse-param-disablepp": "<var>$1disablelimitreport</var>를 대신 사용합니다.",
        "apihelp-parse-param-disableeditsection": "파서 출력에서 문단 편집 링크를 제외합니다.",
        "apihelp-parse-param-disabletidy": "파서 출력에서 HTML 정리(예: tidy)를 수행하지 않습니다.",
-       "apihelp-parse-param-preview": "미리 보기 모드에서 구문 분석을 합니다.",
-       "apihelp-parse-param-sectionpreview": "문단 미리 보기 모드에서 구문 분석을 합니다. (미리 보기 모드도 활성화함)",
+       "apihelp-parse-param-preview": "미리 보기 모드에서 파싱합니다.",
+       "apihelp-parse-param-sectionpreview": "문단 미리 보기 모드에서 파싱합니다. (미리 보기 모드도 활성화함)",
        "apihelp-parse-param-disabletoc": "출력에서 목차를 제외합니다.",
        "apihelp-parse-param-useskin": "선택한 스킨을 파서 출력에 적용합니다. 다음의 속성에 영향을 줄 수 있습니다: <kbd>langlinks</kbd>, <kbd>headitems</kbd>, <kbd>modules</kbd>, <kbd>jsconfigvars</kbd>, <kbd>indicators</kbd>.",
        "apihelp-parse-param-contentformat": "입력 텍스트에 사용할 내용 직렬화 포맷입니다. $1text와 함께 사용할 때에만 유효합니다.",
-       "apihelp-parse-example-page": "페이지의 구문을 분석합니다.",
+       "apihelp-parse-example-page": "페이지를 파싱합니다.",
        "apihelp-parse-example-text": "위키텍스트의 구문을 분석합니다.",
-       "apihelp-parse-example-summary": "요약을 구문 분석합니다.",
+       "apihelp-parse-example-summary": "요약을 변환합니다.",
        "apihelp-patrol-summary": "문서나 판을 점검하기.",
        "apihelp-patrol-param-rcid": "점검할 최근 바뀜 ID입니다.",
        "apihelp-patrol-param-revid": "점검할 판 ID입니다.",
        "apihelp-query+imageinfo-summary": "파일 정보와 업로드 역사를 반환합니다.",
        "apihelp-query+imageinfo-param-prop": "가져올 파일 정보입니다:",
        "apihelp-query+imageinfo-paramvalue-prop-timestamp": "업로드된 판에 대한 타임스탬프를 추가합니다.",
-       "apihelp-query+imageinfo-paramvalue-prop-parsedcomment": "판의 설명을 구문 분석합니다.",
+       "apihelp-query+imageinfo-paramvalue-prop-parsedcomment": "판의 설명을 변환합니다.",
        "apihelp-query+imageinfo-paramvalue-prop-sha1": "파일에 대한 SHA-1 해시를 추가합니다.",
        "apihelp-query+imageinfo-paramvalue-prop-mediatype": "파일의 미디어 유형을 추가합니다.",
        "apihelp-query+imageinfo-param-urlheight": "$1urlwidth와 유사합니다.",
        "apihelp-query+revisions+base-paramvalue-prop-contentmodel": "판의 콘텐츠 모델 ID.",
        "apihelp-query+revisions+base-paramvalue-prop-content": "판의 텍스트.",
        "apihelp-query+revisions+base-paramvalue-prop-tags": "판의 태그.",
-       "apihelp-query+revisions+base-param-parse": "<kbd>[[Special:ApiHelp/parse|action=parse]]</kbd>를 ë\8c\80ì\8b  ì\82¬ì\9a©í\95©ë\8b\88ë\8b¤. í\8c\90 ë\82´ì\9a©ì\9d\98 êµ¬ë¬¸ì\9d\84 ë¶\84ì\84\9d합니다. ($1prop=content 필요) 성능 상의 이유로 이 옵션을 사용할 경우 $1limit은 1로 강제됩니다.",
+       "apihelp-query+revisions+base-param-parse": "<kbd>[[Special:ApiHelp/parse|action=parse]]</kbd>를 ë\8c\80ì\8b  ì\82¬ì\9a©í\95\98ì\84¸ì\9a\94. í\8c\90 ë\82´ì\9a©ì\9d\84 í\8c\8cì\8b±합니다. ($1prop=content 필요) 성능 상의 이유로 이 옵션을 사용할 경우 $1limit은 1로 강제됩니다.",
        "apihelp-query+search-summary": "전문 검색을 수행합니다.",
        "apihelp-query+search-param-qiprofile": "쿼리 독립적인 프로파일 사용(순위 알고리즘에 영향있음)",
        "apihelp-query+search-paramvalue-prop-size": "바이트 단위로 문서의 크기를 추가합니다.",
        "apierror-cantsend": "로그인하지 않았거나 인증된 이메일 주소가 없거나 다른 사용자로 이메일을 보낼 권한이 없기 때문에 이메일을 보낼 수 없습니다.",
        "apierror-cantview-deleted-description": "삭제된 파일의 설명을 볼 권한이 없습니다.",
        "apierror-cantview-deleted-metadata": "삭제된 파일의 메타데이터를 볼 권한이 없습니다.",
+       "apierror-cantview-deleted-revision-content": "삭제된 판의 내용을 볼 권한이 없습니다.",
        "apierror-compare-maintextrequired": "<var>$1slots</var>에 <kbd>main</kbd>이 포함되어 있다면 <var>$1text-main</var> 변수는 필수입니다. (메인 슬롯을 삭제할 수 없습니다)",
        "apierror-compare-notext": "<var>$1</var> 변수는 <var>$2</var> 없이 사용할 수 없습니다.",
        "apierror-emptynewsection": "비어있는 새 문단을 만들 수 없습니다.",
index 907be26..51350a1 100644 (file)
@@ -3,7 +3,8 @@
                "authors": [
                        "Zygimantus",
                        "Eitvys200",
-                       "Hugo.arg"
+                       "Hugo.arg",
+                       "Homo"
                ]
        },
        "apihelp-main-param-action": "Kurį veiksmą atlikti.",
@@ -19,7 +20,7 @@
        "apihelp-createaccount-summary": "Kurti naują vartotojo paskyrą.",
        "apihelp-delete-summary": "Ištrinti puslapį.",
        "apihelp-delete-param-watch": "Pridėti puslapį prie dabartinio vartotojo stebimųjų sąrašo.",
-       "apihelp-delete-param-unwatch": "Pašalinti puslapį iš dabartinio vartotojo stebimųjų sąrašo.",
+       "apihelp-delete-param-unwatch": "Pašalinti puslapį iš dabartinio naudotojo stebimųjų sąrašo.",
        "apihelp-delete-example-simple": "Ištrinti <kbd>Main Page</kbd>.",
        "apihelp-delete-example-reason": "Ištrinti <kbd>Main Page</kbd> su priežastimi <kbd>Preparing for move</kbd>.",
        "apihelp-disabled-summary": "Šis modulis buvo išjungtas.",
@@ -36,7 +37,7 @@
        "apihelp-edit-param-createonly": "Neredaguoti puslapio jei jis jau egzistuoja.",
        "apihelp-edit-param-nocreate": "Parodyti klaidą, jei puslapis neegzistuoja.",
        "apihelp-edit-param-watch": "Pridėti puslapį į dabartinio vartotojo stebimųjų sąrašą.",
-       "apihelp-edit-param-unwatch": "Pašalinti puslapį iš dabartinio vartotojo stebimųjų sąrašo.",
+       "apihelp-edit-param-unwatch": "Pašalinti puslapį iš dabartinio naudotojo stebimųjų sąrašo.",
        "apihelp-edit-param-redirect": "Automatiškai išspręsti peradresavimus.",
        "apihelp-edit-param-contentmodel": "Naujam turiniui taikomas turinio modelis.",
        "apihelp-edit-example-edit": "Redaguoti puslapį.",
        "apihelp-move-param-movetalk": "Pervadinti aptarimo puslapį, jei jis egzistuoja.",
        "apihelp-move-param-noredirect": "Nekurti nukreipimo.",
        "apihelp-move-param-watch": "Pridėti puslapį ir nukreipimą į dabartinio vartotojo stebimųjų sąrašą.",
-       "apihelp-move-param-unwatch": "Pašalinti puslapį ir nukreipimą iš dabartinio vartotojo stebimųjų sąrašo.",
+       "apihelp-move-param-unwatch": "Pašalinti puslapį ir nukreipimą iš dabartinio naudotojo stebimųjų sąrašo.",
        "apihelp-move-param-ignorewarnings": "Ignuoruoti bet kokius įspėjimus.",
        "apihelp-move-example-move": "Perkelti <kbd>Badtitle</kbd> į <kbd>Goodtitle</kbd> nepaliekant nukreipimo.",
        "apihelp-opensearch-summary": "Ieškoti viki naudojant OpenSearch protokolą.",
        "apihelp-query+watchlist-paramvalue-type-new": "Puslapio sukūrimai.",
        "apihelp-query+watchlist-paramvalue-type-log": "Žurnalo įrašai.",
        "apihelp-resetpassword-param-user": "Iš naujo nustatomas vartotojas.",
-       "apihelp-resetpassword-param-email": "Iš naujo nustatomo vartotojo el. pašto adresas.",
+       "apihelp-resetpassword-param-email": "Iš naujo nustatomo naudotojo el. pašto adresas.",
        "apihelp-setpagelanguage-summary": "Keisti puslapio kalbą.",
        "apihelp-setpagelanguage-param-reason": "Keitimo priežastis.",
        "apihelp-stashedit-param-title": "Puslapio pavadinimas buvo redaguotas.",
index 59eb62c..f72c344 100644 (file)
@@ -73,7 +73,7 @@
        "apihelp-edit-param-summary": "Опис на уредувањето. Ова е и назив на поднасловот кога не се зададени $1section=new и $1sectiontitle.",
        "apihelp-edit-param-tags": "Ознаки за измена што се однесуваат на преработката.",
        "apihelp-edit-param-minor": "Означи го уредувањево како ситно.",
-       "apihelp-edit-param-notminor": "Ð\9dеÑ\81иÑ\82но Ñ\83Ñ\80едÑ\83ваÑ\9aе.",
+       "apihelp-edit-param-notminor": "Ð\94а Ð½Ðµ Ñ\81е Ð¾Ð´Ð±ÐµÐ»ÐµÐ¶Ñ\83ва Ð¾Ð²Ð° Ñ\83Ñ\80едÑ\83ваÑ\9aе ÐºÐ°ÐºÐ¾ Ñ\81иÑ\82но Ð´Ñ\83Ñ\80и Ð¸ Ð¿Ñ\80и Ð¿Ð¾Ñ\81Ñ\82авена ÐºÐ¾Ñ\80иÑ\81ниÑ\87каÑ\82а Ð¿Ð¾Ñ\81Ñ\82авка â\80\9e{{int:tog-minordefаult}}â\80\9c.",
        "apihelp-edit-param-bot": "Означи го уредувањето како ботовско.",
        "apihelp-edit-param-basetimestamp": "Датум и време на преработката на базата, кои се користат за утврдување на спротиставености во уредувањето. Може да се добие преку [[Special:ApiHelp/query+revisions|action=query&prop=revisions&rvprop=timestamp]].",
        "apihelp-edit-param-starttimestamp": "Датум и време кога сте почнало уредувањето, кои се користат за утврдување на спротиставености во уредувањата. Соодветната вредност се добива користејќи <var>[[Special:ApiHelp/main|curtimestamp]]</var> кога ќе почнете со уредување (на пр. кога ќе се вчита содржината што ќе ја уредувате).",
index 8e31b51..0986c31 100644 (file)
        "apierror-cantoverwrite-sharedfile": "O ficheiro alvo existe num repositório partilhado e você não tem permissão para o substituir.",
        "apierror-cantsend": "Não está autenticado, não tem um endereço de correio eletrónico confirmado, ou não lhe é permitido enviar correio a outros utilizadores, por isso não pode enviar correios eletrónicos.",
        "apierror-cantundelete": "Não foi possível restaurar: as revisões solicitadas podem não existir ou podem já ter sido restauradas.",
+       "apierror-cantview-deleted-comment": "Não tem permissão para ver comentários eliminados.",
+       "apierror-cantview-deleted-description": "Não tem permissão para ver descrições de ficheiros eliminados.",
+       "apierror-cantview-deleted-metadata": "Não tem permissão para ver metadados de ficheiros eliminados.",
+       "apierror-cantview-deleted-revision-content": "Não tem permissão para ver o conteúdo de revisões eliminadas.",
        "apierror-changeauth-norequest": "A criação do pedido de modificação falhou.",
        "apierror-chunk-too-small": "O tamanho de segmento mínimo é $1 {{PLURAL:$1|byte|bytes}} para segmentos que não sejam segmentos finais.",
        "apierror-cidrtoobroad": "Não são aceites intervalos CIDR $1 maiores do que /$2.",
index b648443..25e7522 100644 (file)
        "apihelp-block-param-userid": "{{doc-apihelp-param|block|userid}}",
        "apihelp-block-param-expiry": "{{doc-apihelp-param|block|expiry}}\n{{doc-important|Do not translate \"5 months\", \"2 weeks\", \"infinite\", \"indefinite\" or \"never\"!}}",
        "apihelp-block-param-reason": "{{doc-apihelp-param|block|reason}}",
-       "apihelp-block-param-anononly": "{{doc-apihelp-param|block|anononly}}\n* See also {{msg-mw|ipb-hardblock}}",
+       "apihelp-block-param-anononly": "{{doc-apihelp-param|block|anononly}}\n\n* See also {{msg-mw|ipb-hardblock}}",
        "apihelp-block-param-nocreate": "{{doc-apihelp-param|block|nocreate}}\n* See also {{msg-mw|ipbcreateaccount}}",
        "apihelp-block-param-autoblock": "{{doc-singularthey}}\n{{doc-apihelp-param|block|autoblock}}\n* See also {{msg-mw|ipbenableautoblock}}",
-       "apihelp-block-param-noemail": "{{doc-apihelp-param|block|noemail}}\n* See also {{msg-mw|ipbemailban}}",
+       "apihelp-block-param-noemail": "{{doc-apihelp-param|block|noemail}}\n\n* See also {{msg-mw|ipbemailban}}",
        "apihelp-block-param-hidename": "{{doc-apihelp-param|block|hidename}}",
        "apihelp-block-param-allowusertalk": "{{doc-apihelp-param|block|allowusertalk}}\n* See also {{msg-mw|ipb-disableusertalk}}",
        "apihelp-block-param-reblock": "{{doc-apihelp-param|block|reblock}}",
index 4d02204..3e5da0a 100644 (file)
@@ -38,7 +38,8 @@
                        "Vlad5250",
                        "Diralik",
                        "DmitTrix",
-                       "Марио"
+                       "Марио",
+                       "Katunchik"
                ]
        },
        "apihelp-main-extended-description": "<div class=\"hlist plainlinks api-main-links\">\n* [[mw:Special:MyLanguage/API:Main_page|Документация]]\n* [[mw:Special:MyLanguage/API:FAQ|ЧаВО]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api Почтовая рассылка]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce Новости API]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R Ошибки и запросы]\n</div>\n<strong>Статус:</strong> MediaWiki API — зрелый и стабильный интерфейс, активно поддерживаемый и улучшаемый. Мы стараемся избегать ломающих изменений, однако изредка они могут быть необходимы. Подпишитесь на [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ почтовую рассылку mediawiki-api-announce], чтобы быть в курсе обновлений.\n\n<strong>Ошибочные запросы:</strong> Если API получает запрос с ошибкой, вернётся заголовок HTTP с ключом «MediaWiki-API-Error», после чего значение заголовка и код ошибки будут отправлены обратно и установлены в то же значение. Более подробную информацию см. [[mw:Special:MyLanguage/API:Errors_and_warnings|API: Ошибки и предупреждения]].\n\n<p class=\"mw-apisandbox-link\"><strong>Тестирование:</strong> для удобства тестирования API-запросов, см. [[Special:ApiSandbox]].</p>",
        "apierror-cantoverwrite-sharedfile": "Целевой файл существует в общем репозитории и у вас нет прав перезаписать его.",
        "apierror-cantsend": "Вы не авторизованы, ваш электронный адрес не подтверждён или у вас нет прав на отправку электронной почты другим участникам, поэтому вы не можете отправить электронное письмо.",
        "apierror-cantundelete": "Невозможно восстановить: возможно, запрашиваемые версии не существуют или уже были восстановлены.",
+       "apierror-cantview-deleted-comment": "У вас нет разрешения на просмотр удаленных комментариев.",
+       "apierror-cantview-deleted-description": "У вас нет разрешения на просмотр описаний удаленных файлов.",
+       "apierror-cantview-deleted-metadata": "У вас нет разрешения на просмотр метаданных удаленных файлов.",
+       "apierror-cantview-deleted-revision-content": "У вас нет разрешения на просмотр содержимого удаленных редакций.",
        "apierror-changeauth-norequest": "Попытка создать запрос правки провалилась.",
        "apierror-chunk-too-small": "Минимальный размер кусочка — $1 {{PLURAL:$1|байт|байта|байт}}, если кусочек не является последним.",
        "apierror-cidrtoobroad": "Диапазоны $1 CIDR, шире /$2, не разрешены.",
index 7ee3751..cd5b4ce 100644 (file)
        "apierror-cantoverwrite-sharedfile": "目標檔案存在於分享儲存庫上,因此您沒有權限來覆蓋掉。",
        "apierror-cantsend": "您尚未登入,您沒有已確認的電子郵件地址,或是您未被允許發送電子郵件給其他人,因此您不能發送電子郵件。",
        "apierror-cantundelete": "無法取消刪除:請求的修訂可能不存在,或是可能已被取消刪除。",
+       "apierror-cantview-deleted-comment": "您沒有權限來檢視被刪除的註釋。",
        "apierror-cantview-deleted-description": "您沒有權限來檢視被刪除檔案的描述內容。",
        "apierror-cantview-deleted-metadata": "您沒有權限來檢視被刪除檔案的詮釋資料。",
+       "apierror-cantview-deleted-revision-content": "您沒有權限來檢視被刪除修訂的內容。",
        "apierror-changeauth-norequest": "建立更改請求失敗。",
        "apierror-chunk-too-small": "對於非最終塊,最小塊的大小為 $1 {{PLURAL:$1|位元組|位元組}}。",
        "apierror-cidrtoobroad": "不能接受超出 /$2 的 $1 CIDR 範圍。",
index 4c2f27e..077bdca 100644 (file)
@@ -455,12 +455,14 @@ class BlockManager {
                                                // TODO: Improve on simply tracking the first trackable block (T225654)
                                                foreach ( $block->getOriginalBlocks() as $originalBlock ) {
                                                        if ( $this->shouldTrackBlockWithCookie( $originalBlock, $isAnon ) ) {
+                                                               '@phan-var DatabaseBlock $originalBlock';
                                                                $this->setBlockCookie( $originalBlock, $response );
                                                                return;
                                                        }
                                                }
                                        } else {
                                                if ( $this->shouldTrackBlockWithCookie( $block, $isAnon ) ) {
+                                                       '@phan-var DatabaseBlock $block';
                                                        $this->setBlockCookie( $block, $response );
                                                }
                                        }
index 2646845..c6d6b8f 100644 (file)
@@ -519,17 +519,8 @@ class LocalisationCache {
         * @return array
         */
        protected function readPHPFile( $_fileName, $_fileType ) {
-               // Disable APC caching
-               Wikimedia\suppressWarnings();
-               $_apcEnabled = ini_set( 'apc.cache_by_default', '0' );
-               Wikimedia\restoreWarnings();
-
                include $_fileName;
 
-               Wikimedia\suppressWarnings();
-               ini_set( 'apc.cache_by_default', $_apcEnabled );
-               Wikimedia\restoreWarnings();
-
                $data = [];
                if ( $_fileType == 'core' || $_fileType == 'extension' ) {
                        foreach ( self::$allKeys as $key ) {
index fbcbc35..34d73d6 100644 (file)
@@ -455,13 +455,21 @@ class ChangesList extends ContextSource {
         * @param string &$s HTML to update
         * @param Title $title
         * @param string $logtype
+        * @param bool $useParentheses (optional) Wrap log entry in parentheses where needed
         */
-       public function insertLog( &$s, $title, $logtype ) {
+       public function insertLog( &$s, $title, $logtype, $useParentheses = true ) {
                $page = new LogPage( $logtype );
                $logname = $page->getName()->setContext( $this->getContext() )->text();
-               $s .= Html::rawElement( 'span', [
-                       'class' => 'mw-changeslist-links'
-               ], $this->linkRenderer->makeKnownLink( $title, $logname ) );
+               $link = $this->linkRenderer->makeKnownLink( $title, $logname, [
+                       'class' => $useParentheses ? '' : 'mw-changeslist-links'
+               ] );
+               if ( $useParentheses ) {
+                       $s .= $this->msg( 'parentheses' )->rawParams(
+                               $link
+                       )->escaped();
+               } else {
+                       $s .= $link;
+               }
        }
 
        /**
@@ -625,7 +633,7 @@ class ChangesList extends ContextSource {
         */
        public function insertComment( $rc ) {
                if ( $this->isDeleted( $rc, RevisionRecord::DELETED_COMMENT ) ) {
-                       return ' <span class="history-deleted">' .
+                       return ' <span class="history-deleted comment">' .
                                $this->msg( 'rev-deleted-comment' )->escaped() . '</span>';
                } else {
                        return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle(),
index c15701b..8228bae 100644 (file)
@@ -87,7 +87,7 @@ class OldChangesList extends ChangesList {
 
                if ( $rc->mAttribs['rc_log_type'] ) {
                        $logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] );
-                       $this->insertLog( $html, $logtitle, $rc->mAttribs['rc_log_type'] );
+                       $this->insertLog( $html, $logtitle, $rc->mAttribs['rc_log_type'], false );
                        $flags = $this->recentChangesFlags( [ 'unpatrolled' => $unpatrolled,
                                'bot' => $rc->mAttribs['rc_bot'] ], '' );
                        if ( $flags !== '' ) {
@@ -98,7 +98,7 @@ class OldChangesList extends ChangesList {
                        list( $name, $htmlubpage ) = MediaWikiServices::getInstance()->getSpecialPageFactory()->
                                resolveAlias( $rc->mAttribs['rc_title'] );
                        if ( $name == 'Log' ) {
-                               $this->insertLog( $html, $rc->getTitle(), $htmlubpage );
+                               $this->insertLog( $html, $rc->getTitle(), $htmlubpage, false );
                        }
                // Regular entries
                } else {
index b4e483b..4a72d72 100644 (file)
@@ -350,7 +350,7 @@ class MWExceptionHandler {
 
                // Look at message to see if this is a class not found failure
                // HHVM: Class undefined: foo
-               // PHP5: Class 'foo' not found
+               // PHP7: Class 'foo' not found
                if ( preg_match( "/Class (undefined: \w+|'\w+' not found)/", $message ) ) {
                        // phpcs:disable Generic.Files.LineLength
                        $msg = <<<TXT
@@ -683,16 +683,21 @@ TXT;
         * This method must not assume the exception is an MWException,
         * it is also used to handle PHP exceptions or exceptions from other libraries.
         *
-        * @since 1.22
         * @param Exception|Throwable $e
         * @param string $catcher CAUGHT_BY_* class constant indicating what caught the error
+        * @param array $extraData (since 1.34) Additional data to log
+        * @since 1.22
         */
-       public static function logException( $e, $catcher = self::CAUGHT_BY_OTHER ) {
+       public static function logException( $e, $catcher = self::CAUGHT_BY_OTHER, $extraData = [] ) {
                if ( !( $e instanceof MWException ) || $e->isLoggable() ) {
                        $logger = LoggerFactory::getInstance( 'exception' );
+                       $context = self::getLogContext( $e, $catcher );
+                       if ( $extraData ) {
+                               $context['extraData'] = $extraData;
+                       }
                        $logger->error(
                                self::getLogNormalMessage( $e ),
-                               self::getLogContext( $e, $catcher )
+                               $context
                        );
 
                        $json = self::jsonSerializeException( $e, false, FormatJson::ALL_OK, $catcher );
index a50150e..833d553 100644 (file)
@@ -60,8 +60,7 @@ class Dump7ZipOutput extends DumpPipeOutput {
        }
 
        /**
-        * @param string $newname
-        * @param bool $open
+        * @inheritDoc
         */
        function closeAndRename( $newname, $open = false ) {
                $newname = $this->checkRenameArgCount( $newname );
index d0256fd..ad68109 100644 (file)
@@ -59,7 +59,7 @@ class DumpFileOutput extends DumpOutput {
        }
 
        /**
-        * @param string $newname
+        * @inheritDoc
         */
        function closeRenameAndReopen( $newname ) {
                $this->closeAndRename( $newname, true );
@@ -92,8 +92,7 @@ class DumpFileOutput extends DumpOutput {
        }
 
        /**
-        * @param string $newname
-        * @param bool $open
+        * @inheritDoc
         */
        function closeAndRename( $newname, $open = false ) {
                $newname = $this->checkRenameArgCount( $newname );
index 75e149c..143fb8e 100644 (file)
@@ -102,14 +102,16 @@ class DumpFilter {
        }
 
        /**
-        * @param string $newname
+        * @see DumpOutput::closeRenameAndReopen()
+        * @param string|string[] $newname
         */
        function closeRenameAndReopen( $newname ) {
                $this->sink->closeRenameAndReopen( $newname );
        }
 
        /**
-        * @param string $newname
+        * @see DumpOutput::closeAndRename()
+        * @param string|string[] $newname
         * @param bool $open
         */
        function closeAndRename( $newname, $open = false ) {
index ab925b7..5c15c5f 100644 (file)
@@ -86,7 +86,7 @@ class DumpOutput {
         * and reopen new file with the old name. Use this
         * for writing out a file in multiple pieces
         * at specified checkpoints (e.g. every n hours).
-        * @param string|array $newname File name. May be a string or an array with one element
+        * @param string|string[] $newname File name. May be a string or an array with one element
         */
        function closeRenameAndReopen( $newname ) {
        }
@@ -95,7 +95,7 @@ class DumpOutput {
         * Close the old file, and move it to a specified name.
         * Use this for the last piece of a file written out
         * at specified checkpoints (e.g. every n hours).
-        * @param string|array $newname File name. May be a string or an array with one element
+        * @param string|string[] $newname File name. May be a string or an array with one element
         * @param bool $open If true, a new file with the old filename will be opened
         *   again for writing (default: false)
         */
index 0521c5a..4e61434 100644 (file)
@@ -73,15 +73,14 @@ class DumpPipeOutput extends DumpFileOutput {
        }
 
        /**
-        * @param string $newname
+        * @inheritDoc
         */
        function closeRenameAndReopen( $newname ) {
                $this->closeAndRename( $newname, true );
        }
 
        /**
-        * @param string $newname
-        * @param bool $open
+        * @inheritDoc
         */
        function closeAndRename( $newname, $open = false ) {
                $newname = $this->checkRenameArgCount( $newname );
index b4fd176..a968831 100644 (file)
@@ -438,7 +438,9 @@ class ArchivedFile {
        function pageCount() {
                if ( !isset( $this->pageCount ) ) {
                        // @FIXME: callers expect File objects
+                       // @phan-suppress-next-line PhanTypeMismatchArgument
                        if ( $this->getHandler() && $this->handler->isMultiPage( $this ) ) {
+                               // @phan-suppress-next-line PhanTypeMismatchArgument
                                $this->pageCount = $this->handler->pageCount( $this );
                        } else {
                                $this->pageCount = false;
index 60d4e29..73b08e6 100644 (file)
@@ -2042,7 +2042,7 @@ abstract class File implements IDBAccessObject {
         * Get the URL of the image description page. May return false if it is
         * unknown or not applicable.
         *
-        * @return string
+        * @return string|bool
         */
        function getDescriptionUrl() {
                if ( $this->repo ) {
diff --git