Commit graph

6573 commits

Author SHA1 Message Date
C. Scott Ananian
8c18f2b41c Add a wfDeprecated to an overlooked code path where parser output is not tidy
We formally deprecated running the parser with tidy disabled in 1.33, but
I missed a hard-deprecation on this code path.

Be careful not to spam the logs with deprecation warnings triggered by
(deprecated) API requests, though.

Change-Id: I10f64e76ec0c5aee8b26fc00bc11ebb0e39f961b
2020-04-02 11:53:53 -04:00
Translation updater bot
d7f4f7c2a5 Localisation updates from https://translatewiki.net.
Change-Id: Iffce1621d37b02710d51ac98bfcbc62423321547
2020-03-30 09:11:38 +02:00
Translation updater bot
c6ac92433e Localisation updates from https://translatewiki.net.
Change-Id: I781f73e3d3c5f75aff1d8b0e07fb17bab19102d5
2020-03-27 08:39:40 +01:00
Translation updater bot
5d9e300534 Localisation updates from https://translatewiki.net.
Change-Id: I0d014483c6749b5c52ec24bc147dfd69f58194fc
2020-03-26 08:29:42 +01:00
DannyS712
7ae0b3dc56 ApiBase::checkUserRightsAny - remove an extra tab
Change-Id: Id81e257c24f8eadb1fedcc47c71adfbfb939273a
2020-03-26 04:13:35 +00:00
jenkins-bot
bdd722e310 Merge "Remove compat code for pre-MCR schema." 2020-03-25 18:19:33 +00:00
Translation updater bot
2419efb863 Localisation updates from https://translatewiki.net.
Change-Id: I193f1b778d7a76ba8f4fd38a46aace2fdcd16d59
2020-03-25 08:31:12 +01:00
daniel
495323c063 Remove compat code for pre-MCR schema.
NOTE: This was manually tested to ensure it does not
break updates, see T242764.

Bug: T198557
Change-Id: I1d9f5465018bae10124514bc38169e23e0e613e6
2020-03-24 19:45:47 +01:00
MusikAnimal
e0414f962e ApiWatch: Add support for expiries
With this commit, the action=watch API accepts an 'expiry' parameter,
analagous to the expiry accepted by action=userrights, action=block,
etc.

Bug: T245078
Change-Id: If37a772253082529cb290027da87098c1e6bf98c
2020-03-24 11:51:01 -04:00
Translation updater bot
5e1e15e2e5 Localisation updates from https://translatewiki.net.
Change-Id: I750bce53dba139aa90fe37c87a2eb3ccb190ebce
2020-03-24 08:47:10 +01:00
Thiemo Kreuz
854d5bcd7f Replace isset() in if() conditions with ?? if possible
The basic idea is: The sequence `$var ?? 'default'` either uses the
value from the variable (or array element) if available, or falls back
to the default value. The resulting value is then used in the if()
condition.

if ( $var ?? true ) means the variable should default to true, if not
set.

This is mostly a style change.

In ApiEditPage the $params are impossible to not be set.

Change-Id: Id67b81744fa21fe22a2d2377259e426aab67c479
2020-03-23 09:28:07 +01:00
Translation updater bot
27b7160802 Localisation updates from https://translatewiki.net.
Change-Id: I924333a95c6bb0f9c604502dd720c6342687eb46
2020-03-23 09:00:41 +01:00
jenkins-bot
795ca9f730 Merge "ApiDelete: Make ::delete(File)? only accept a wikipage, make private" 2020-03-20 20:15:51 +00:00
DannyS712
96ec1dbf8d ApiDelete: Make ::delete(File)? only accept a wikipage, make private
No classes extend ApiDelete, and this is essentially a breaking change
(previously accepted WikiPage or Article)

Update calls to WikiPage::doDeleteArticleReal to use the new signature

Bug: T247869
Bug: T247870
Change-Id: I48d9d8a2e1df92b81d8e477434c15e8ab3e90f3c
2020-03-20 19:58:14 +00:00
jenkins-bot
9f20b0ef03 Merge "api: InterwikiMap shouldn't report any interwikis as language ones when InterwikiMagic=false" 2020-03-20 18:17:30 +00:00
Martin Urbanec
0e0eb01e12 api: InterwikiMap shouldn't report any interwikis as language ones when InterwikiMagic=false
Wiki admins set wgInterwikiMagic=false when they do not want any
interwikis displayed in the sidebar as interlanguage links.

It is reasonable to expect they might add some interwikis
that looks like a language interwiki, linking to another wiki.

If that's done, MediaWiki incorrectly reports them as language interwiki,
which isn't correct.

Bug: T130381
Change-Id: Ie7c0ce43838c43392f144ab3a5ec9f847ec13182
2020-03-20 16:38:31 +01:00
Translation updater bot
9bddfc7a8d Localisation updates from https://translatewiki.net.
Change-Id: I0f2b77cdc00875e85c599d06ff93b9ffddcdeabf
2020-03-20 08:22:41 +01:00
jenkins-bot
73f8aadb70 Merge "Make use of PageArchive::undeleteAsUser" 2020-03-19 14:49:00 +00:00
Bartosz Dziewoński
94bed1a020 Rephrase the "assert..." API error messages for end-users
These were clearly written with API users in mind. However, we
recently started using the 'assert' parameter in editing tools and
surfacing them to end-users (e.g. commit 7d6682195f encourages it),
and they don't make much sense in that context.

It's difficult to come up with a generic phrasing that works for any
tool making any action and also doesn't confuse API users too much…
but I tried.

Bug: T245327
Change-Id: I026e0e0b9ab77487385f0847d496b5e49517c73a
2020-03-19 01:32:38 +01:00
jenkins-bot
a9c6ee89b6 Merge "Hard deprecate Revision::getParentLengths" 2020-03-18 22:24:56 +00:00
jenkins-bot
9d50ef6e4e Merge "Remove use of deprecated Revision from ApiStashEdit" 2020-03-18 22:24:49 +00:00
jenkins-bot
c5fff7f0ec Merge "Remove use of deprecated Revision from ApiParse" 2020-03-18 22:24:42 +00:00
Petr Pchelko
ebd35bdc85 Hard deprecate Revision::getParentLengths
As well hard-deprecate RevisionStore::listRevisionSizes.
It was marked as @deprecated, but the release for the
deprecation was not specified. Let's say it's 1.35.

Additionally, in order to avoid temporary code duplication,
listRevisionSizes now uses getRevisionSizes and ignores the
database object injected into it. This is ok since we're
hard-deprecating the method and all the usages have been
removed.

Bug: T246284
Change-Id: Ifad1c25a0af892b88fce492b2d34c8cf71279b70
2020-03-18 12:26:26 -07:00
DannyS712
c6db277af4 Make use of PageArchive::undeleteAsUser
Bug: T247188
Change-Id: I1dc38d039aa375fc607463360ed4d007b4cf16d5
2020-03-18 18:21:35 +00:00
jenkins-bot
b53ac504c5 Merge "Stop accepting ApiMain instances in ApiResult::__construct" 2020-03-18 16:30:36 +00:00
jenkins-bot
c44e087c7e Merge "Hard-deprecate api hooks for getting tokens" 2020-03-18 16:30:26 +00:00
Daimona Eaytoy
c1200325fc Stop accepting ApiMain instances in ApiResult::__construct
This was deprecated in 1.25, no code doing that:
https://codesearch.wmflabs.org/search/?q=new%20%5C%5C%3FApiResult%5C(%5Cs*(new%7C%5C%24)&i=nope&files=&repos=

Change-Id: I21fff4fa66478d2eada13e2ff801bcd6a58b865a
2020-03-18 15:57:05 +00:00
Translation updater bot
c58a7bae24 Localisation updates from https://translatewiki.net.
Change-Id: I43f7c4c686e521077f0625fc4eb36c29d3c76a44
2020-03-18 08:55:58 +01:00
jenkins-bot
68bc9300dc Merge "Remove auto-generated and empty lines in comments" 2020-03-17 09:32:26 +00:00
Translation updater bot
526d17b8ca Localisation updates from https://translatewiki.net.
Change-Id: Iba2fa35c4cfc7accfa1be2d24b6c8a5706863b25
2020-03-17 10:22:25 +01:00
Thiemo Kreuz
7a4df9b019 Remove auto-generated and empty lines in comments
… and add the missing newline after the initial <?php.

Change-Id: I83bbbb1504e4b2bd97eec63c7626d34c655c3197
2020-03-17 09:55:24 +01:00
Translation updater bot
7531497628 Localisation updates from https://translatewiki.net.
Change-Id: I0c8cc50124f7e12f96d005240196bc84ea7fa1f3
2020-03-16 14:28:37 +01:00
jenkins-bot
18017b1af3 Merge "languages: Move default $wgNamespaceAliases to MessagesEn.php" 2020-03-15 00:14:08 +00:00
DannyS712
e9b012f3b1 Hard-deprecate api hooks for getting tokens
Soft deprecated in 1.24
The following hooks were hard deprecated:
* APIQueryInfoTokens
* APIQueryRecentChangesTokens
* APIQueryRevisionsTokens
* APIQueryUsersTokens
* ApiTokensGetTokenTypes

Bug: T232869
Bug: T232870
Bug: T232871
Bug: T232872
Bug: T232873
Bug: T245329
Change-Id: Ia14eae17b676ee0356eaf0679d8ac3af0b24b86a
2020-03-14 20:35:04 +00:00
Timo Tijhof
75ccdc6147 languages: Move default $wgNamespaceAliases to MessagesEn.php
These are not configuration but business logic, similar to the
canonical names that are in NamespaceInfo.php, these must always
exist and cannot be altered or unset.

They were previously unconditionally assigned during all requests
in Setup.php and passed down as "site configuration".

Changes:

* Move them to MessagesEn.php where they can be cached and
  processed the same way as other core-provided aliases.

  Document and confirm with tests that this is a mergeable
  attribute that follows the language chain.

* Remove the duplicated code in a few places that was reading
  this variable + Language::getNamespaceAliases(), to instead
  just call the latter and move the logic there, centralised,
  and tested.

  In doing so I noticed that these were applied in an
  inconsistent order. Sometimes the config won, sometimes not.
  There's no obvious right or wrong way here, but I've chosen
  to standardise on the way that Language::getNamespaceIds() did
  it, which is that config wins. This because that method seems
  to be most widely used of the three (it decides how URLs and
  titles are parsed), and thus the one I least want to change
  the behaviour of.

* Document that $wgNamespaceAliases may only be used to
  define (extra) aliases, it is and never was a way to access
  the complete list of aliases.

Bug: T189966
Change-Id: Ibb14181aba8c1b509264ed40523e9ab4000fd71a
2020-03-14 19:27:40 +00:00
Umherirrender
3161311c5a Use MediaWikiServices::getMessageCache
Change-Id: I07fcc9529991adc634c10e5ed8498ac138a1c2b7
2020-03-14 14:25:03 +01:00
jenkins-bot
852139c6e4 Merge "Reduce the length of 6 long lines of code" 2020-03-13 10:10:24 +00:00
jenkins-bot
c731a4501c Merge "API: Fix fetching login token from action=query&meta=tokens on private wikis" 2020-03-13 09:59:52 +00:00
Translation updater bot
d3ab01b13d Localisation updates from https://translatewiki.net.
Change-Id: I666c3c8204deb7295b63e016ae85432966aa1032
2020-03-13 08:06:55 +01:00
Petr Pchelko
e2443a7066 Remove use of deprecated Revision from ApiStashEdit
Bug: T246284
Change-Id: I734e6572c913f4f32295a14705f0fc19b8000b03
2020-03-13 08:04:39 +04:00
Petr Pchelko
61c7613540 Remove use of deprecated Revision from ApiParse
Bug: T246284
Change-Id: Iac013a35531a8984fc3cf0915bef464f79d38322
2020-03-13 08:04:32 +04:00
Sam Wilson
bada529138 Reduce the length of 6 long lines of code
This shortens some lines below 120 characters when a tab is
counted as 4 characters (not that line lengths are currently
counted like that).

Bug: T243598
Change-Id: I828cd540268810bd56589885e38ad03f8bafc6f9
2020-03-13 09:01:14 +08:00
Translation updater bot
558dfe8052 Localisation updates from https://translatewiki.net.
Change-Id: Ia62fef773f0d8e1eb20ea98ed5a3e2cda6ef6220
2020-03-12 08:06:53 +01:00
jenkins-bot
e005e08768 Merge "Add a ContentModelChange helper, and an api module that uses it" 2020-03-11 22:10:01 +00:00
jenkins-bot
7932a7cb52 Merge "Remove usage of deprecated Revision from ApiEditPage" 2020-03-11 22:08:20 +00:00
jenkins-bot
486fcdb86d Merge "ApiEditPage: add baserevid parameter" 2020-03-11 21:54:10 +00:00
daniel
3ebd55ed47 ApiEditPage: add baserevid parameter
This adds a baserevid parameter for detecting edit conflicts, as an
alternative to the less precise basetimestamp parameter. This is
introduced for parity with and use by the new REST api.

Bug: T230843
Bug: T34037
Change-Id: Id7565018f66860b5c2ba688777508db1b88700ae
2020-03-11 13:29:09 +01:00
DannyS712
78bc3ae255 Hard deprecate Revision::userCan
Replace remaining uses outside of tests, hide deprecated in tests

Bug: T247259
Change-Id: I91dfb46ed6864ee89d968aea8ec93b5ea2f8389e
2020-03-11 02:10:52 +00:00
Translation updater bot
68d5da3e20 Localisation updates from https://translatewiki.net.
Change-Id: I4bf32cac14bfa15bb228cc1ebcb2c725261f8021
2020-03-09 07:54:47 +01:00
Petr Pchelko
71ea5a36a2 Remove usage of deprecated Revision from ApiEditPage
Bug: T246284
Change-Id: Iee97229d2d5e2996077f86aa8b191a4ec0cd8e36
2020-03-06 21:03:57 -08:00