Commit graph

59 commits

Author SHA1 Message Date
Umherirrender df17930718 Add explicit parentheses around mixed boolean operator
Mixing different binary boolean operators within an expression
without using parentheses to clarify precedence is not allowed (T358966)

Change-Id: I4348e05d74bdfd1e076c8b0425fe65616143e8f7
2024-03-23 01:08:23 +01:00
Umherirrender e627f6b99d build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: I1438abb264edc6c64bbe0a1bef98be1397c712bd
2024-03-12 20:42:45 +01:00
libraryupgrader cdd7bd3503 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.1 → 0.14.0

npm:
* eslint-config-wikimedia: 0.25.0 → 0.26.0
* grunt-banana-checker: 0.11.0 → 0.11.1
* grunt-eslint: 24.0.1 → 24.3.0

Change-Id: I28f3c498c8403fa270d56d3a3bad538410e4d6b2
2024-02-12 18:34:20 +00:00
Gergő Tisza 2b7633219b
Declare grant risk levels
createaccount is a core grant which by default isn't really
sensitive, but TitleBlacklist adds tboverride-account which
can be used for social engineering.

Using MediaWikiServices to change configuration is not great,
but it's the least bad option available today - other hooks run
too late, and the extension registry doesn't support extensions
overriding core values.

Bug: T290790
Depends-On: Ib7a195c167f82e686c4ede45388957f9988bf75d
Change-Id: I2d20190266e4094449b5857b88f962a444c2f9b5
2024-01-18 22:29:07 -08:00
Umherirrender dfef274db6 Use namespaced classes
Done automatically via script

Change-Id: If7d9fb3dda6b4c71ac6cf4963da86d49021544a5
2024-01-04 22:31:38 +01:00
Umherirrender 711eebd869 Escape raw title blacklist entry for wikitext when used in messages
A line in the title blacklist can contains pipe as part of a regex,
the pipe is also used in wikitext, so it needs escaping to allow use of
templates in system message.

Bug: T350296
Change-Id: I7f18bb7111b989cc66808f17476bacdf45120e09
2023-11-02 21:09:37 +01:00
gerritbot d4395ce88d Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I87b70d83127a4068bc5b9f9a8ba347283977423e
2023-08-19 14:15:44 +00:00
Umherirrender 319b33cb46 Use HookHandlers for Scribunto hook
Bug: T271033
Change-Id: I486bf703a73d6196c7bb840ac37b290615c548e7
2023-08-15 15:29:02 +02:00
Umherirrender ffc9986a95 api: Rename php class behind action=titleblacklist
titleblacklist is not part of action=query (since a2f5ccd2 back in 2011)
and should not follow that naming schema.

No class alias as nobody needs to call the class directly

Change-Id: If57e5bd9291a894edf42835fed07d37cd8e8abed
2023-07-04 22:42:50 +02:00
Umherirrender 8584bb40bd api: Parse error message with the title to check
When the custom error message contains {{PAGENAME}} or other title based
variables, there are currently parsed as
"Badtitle/dummy_title_for_API_calls_set_in_api.php"
The same custom message is shown correctly on index.php

Bug: T340923
Change-Id: I4c1dc6660976de54ff6ba8f8f7a5768371e61e80
2023-07-02 10:36:33 +02:00
Daimona Eaytoy 6b45e11915 Replace deprecated MWException
Bug: T328220
Change-Id: Ie3533ce07a1e372dd5ec05f4437bfc9e35149b96
2023-06-07 17:12:37 +02:00
gerritbot 5109fe66b9 Update moved class EditPage
See T321882. Moved in Ibefc44eb64aed

Bug: T321681
Change-Id: I46fc958aa4b9b8406866e16f5f39624d62744465
2023-05-06 21:20:41 +00:00
Umherirrender 890c1ed9b8 Replace use of deprecated Parser::$mTitle
Parser::getTitle is also deprecated,
using getPage + TitleFormatter instead

Bug: T275160
Change-Id: I90b0bba6c2a8283f2257dbf2e140e893e3f62442
2022-12-27 13:00:16 +01:00
Thiemo Kreuz 4d2df71552 Various code style cleanups
E.g. reducing deep indention and code duplication. Removing comments
that literally repeat what the code says.

The goal is to make the code easier to read and to maintain in the
future. I hope this is the case.

Change-Id: I6f23bc61ffb8b6d42ec697fec91bb6c92152561f
2022-12-07 14:37:10 +01:00
Reedy f95b5ce792 Drop class aliases
Change-Id: I9698f39ec3e301266390032a53cb9249372f216a
2022-10-31 23:02:13 +00:00
libraryupgrader 7edfc6ba48 build: Updating mediawiki/mediawiki-phan-config to 0.12.0
Change-Id: Ifff444f6a712bc640df174914674ea21836ffffd
2022-10-09 12:12:18 +00:00
Taavi Väänänen 8cb2f2f252
Add a class_alias for TitleBlacklistEntry too
TitleBlacklist compares cache version in app code, meaning that entries
with old versions will still be deserialized.

Bug: T307513
Change-Id: Icea6022fcf5530b2429ce660e2589dd5954577a7
2022-05-04 11:30:27 +03:00
Alexander Vorwerk a1c08ed427 Add class alias for TitleBlacklist and bump cache version
Bug: T307513
Change-Id: Ibcbec44fe0f1168594036cbc2e0b5199f9b88bff
2022-05-03 23:40:35 +02:00
Reedy 70754ecf37 Fix and enable 1 PHPCS exclusion
Change-Id: I15c2af8205f58f774b77bff52cad38e0cf541014
2022-04-08 13:42:43 +00:00
Reedy 3113e6bf5f Namespace extension
Change-Id: I7917483168a3534d74b62dd2077026c0baa4cbe0
2022-04-08 14:24:11 +01:00
gerritbot 7bceb39e18 Fix usage of ApiBase::PARAM_* deprecated constants
The ones that are replaced with ParamValidator

Bug: T275455
Change-Id: Ifdc8bafbab1b1fc04d1cf3e0045d95fef1fe0216
2022-04-04 00:39:22 +00:00
Samwalton9 44ad553f62 Fix use of errorbox
Replace use of errorbox class with Html::errorBox.

Bug: T304269
Change-Id: I78a7f31c23b9faf2820ffbf215866b385db1b1a2
2022-03-25 14:12:16 +00:00
Reedy b9b82c550f Replace usages of Wikimedia\(suppress|restore)Warnings()
Change-Id: I601cf8d513bd1bbd305c6ad2250ba18b376fe819
2022-02-24 21:14:12 +00:00
Reedy efca55077c Use namespaced AntiSpoof class
Change-Id: Idcda3765210f4b1f247fcb2c1572a465546cfe4e
2022-02-11 14:18:16 +00:00
jenkins-bot 9b150fc464 Merge "Avoid using WikiPage::factory()" 2021-12-18 15:52:32 +00:00
Alexander Vorwerk 49eaa3a463 Avoid using WikiPage::factory()
WikiPage::factory() is deprecated since 1.36 and should be replaced
with WikiPageFactory::newFromTitle().

Bug: T297688
Change-Id: Ic3f8745de45916baca68ab3620ca88148fbbc4ba
2021-12-14 12:32:13 +01:00
Siddharth VP ce64fbb8df Fix typos in comments
Bug: T201491
Change-Id: I5177bc2003f411f08638f066e0bd9e60b45e159c
2021-10-14 11:20:01 +05:30
jenkins-bot 2d3067e347 Merge "Avoid using ContentHandler::getContentText()" 2021-10-12 18:18:56 +00:00
libraryupgrader a1bdadb769 build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: Ib5cf97f989880bd68e9477b5926dd52c9d67178a
2021-09-09 11:47:01 +00:00
Alexander Vorwerk d54338f52b Avoid using ContentHandler::getContentText()
ContentHandler::getContentText() is deprecated and should be
replaced with Content::getText() for TextContent instances.

Change-Id: If38508a069c668e43686226262acbb8ecce92764
2021-05-18 09:02:41 +00:00
libraryupgrader 9d8d5c93c1 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

npm:
* grunt: 1.3.0 → 1.4.0
* lodash: 4.17.19 → 4.17.21
  * https://npmjs.com/advisories/1673 (CVE-2021-23337)

Change-Id: I513a37524fba7387d143b9bb560b569ef7d600ad
2021-05-14 06:39:49 +00:00
Umherirrender fedb84b9c5 Use HookHandlers for core hooks
Bug: T271033
Change-Id: I42f323261b9acb24b0cf8cb9202ef5c804cc1a6d
2021-04-15 19:30:17 +00:00
libraryupgrader 6218ba8396 build: Updating mediawiki/mediawiki-phan-config to 0.10.6
Change-Id: I19c53a7b3d3ea12bb098f754dc68ce23cc5c8529
2020-12-29 21:20:23 +00:00
Umherirrender 0f3699c40f Avoid wfMessage in special page
Use self::msg instead to avoid global state

Change-Id: I5677e9ceb6b11c69d50a74b0bd1330896ddfef55
2020-12-19 12:21:36 +01:00
DannyS712 e5a7ed6997 Update hooks to use PageSaveComplete
Extension requires MW 1.35+, always available

Bug: T250566
Change-Id: I35a288d38e944df4498d63f1d686ee7904909c74
2020-06-23 19:26:40 +00:00
Umherirrender c90c0e5d09 Pass function name to HttpRequestFactory::get
Useful for logging
Replace deprecated Http::get with service (since 1.34)
Have to check for falsy to avoid returning non-string

Change-Id: I6d06698cf1e34d0cb9ab7d808145b80b556cd243
2020-06-07 13:31:37 +02:00
Reedy 300118615f Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: I7f3189a5e5546edd7969935d2f7d12ebbaeaad6f
2020-05-20 01:03:00 +01:00
Timo Tijhof 9bf6f9480c Remove use of internal $messageMemc variable
The $messageMemc legacy global, is a BagOStuff intended for
MessageCache service, configured by wgMessageCacheType.

Use that directly as a short-term measure so that we can remove
$messageMemc initialization from Setup.php.

Bug: T189966
Bug: T243175
Change-Id: I04a0e578d76269fa02ee85cffee070dc3e1f4512
2020-03-18 17:14:49 +00:00
Lucas Werkmeister e35e542c08 Update cache key for Unicode normalization
Change I5d79426a32 (commit f03d6c617b) changed what kinds of values we
store in the cache – Status objects, rather than plain arrays. This
means we need to use a different cache key as well, or they’ll get all
mixed up.

Note that this will effectively replace the current “warm” cache with a
“cold” one on deployment.

Bug: T246643
Change-Id: I0dc5b796af4ab574cd31c8e01d24ddae3edc8a4c
2020-03-02 13:20:54 +01:00
Umherirrender 66f6418eaf Improve param docs
Change-Id: I6f6d781d1b9399520192df156664d39a88752860
2020-02-29 22:10:59 +01:00
Umherirrender f03d6c617b Use AntiSpoof::checkUnicodeStringStatus
Migrate from AntiSpoof::checkUnicodeString to the new function with
status object - was added in 1.32

Use ExtensionRegistry to check for extension
Add error message from the Status to the log

Change-Id: I5d79426a328c6ddc02789d795bc84599e8e5c06d
2020-02-29 10:59:56 +01:00
libraryupgrader 09d70a1f18 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingReturn

Additional changes:
* Also sorted "composer fix" command to run phpcbf last.

Change-Id: I668c40626bbb60ff8c1ddc130ffdf95c6eefbd2e
2020-01-15 09:20:50 +00:00
libraryupgrader fcd8ab2cb8 build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: Idc3c7294c8e7636f2f44beb7389566a7389d23de
2019-12-27 18:55:00 +00:00
Umherirrender 41c93cd4b6 Improve param docs
Change-Id: Id143b26039da91584f473063e7280e41ca241731
2019-12-12 20:15:59 +01:00
Max Semenik 6948b3c5cf Stop passing objects by reference
Bug: T193950
Change-Id: I17f9793ee27f9b8fa6fdd5f70b061d295aef08bd
2019-11-15 15:53:13 -08:00
James D. Forrester 762ef4c02b Drop use of wgParser, replaced in 1.32 and to be removed in 1.35
Bug: T160811
Change-Id: Iefb5557f6dd1c300515dc532485e906d57e2d37f
2019-10-28 20:03:37 +00:00
Derick Alangi 41e6b19e57 Avoid usage of deprecated ObjectCache::getMainWANInstance()
Replacement with services made available in 1.28 and this extension
requires 1.31. So, the replacement is good.

Change-Id: Ia1452ace85d13eb07f7d55b338e120f24d339069
2019-07-03 13:58:55 +01:00
jenkins-bot f233dd5264 Merge "Update unspecific "array" type documentation" 2019-06-06 01:17:45 +00:00
Derick Alangi 088bfe3028 TitleBlacklistHooks: Fix TitleBlacklist hooks to conform with MW
Also, cleanup various legacy behavior of hooks: as they return true. In
addition, objects are passed by reference by default.

I see more room for improvements, but will keep doing them in later change
sets.

Change-Id: I1ff3ec493a1d161cfbcfacf49b1af486a93b1052
2019-06-05 18:21:55 +00:00
Thiemo Kreuz 8b2dd9cae3 Update unspecific "array" type documentation
Change-Id: Ic1120e726be71f09fa6ebd166d4992ee2c3a3a6b
2019-06-05 18:31:39 +02:00