Commit graph

82 commits

Author SHA1 Message Date
Umherirrender 00f58b2d52 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I6fd8bf5240359bf7e2ab23f9581471714f0a01d3
2024-06-10 20:42:18 +02:00
Wandji69 b93b997de5 Use ObjectCacheFactory instead of deprecated ObjectCache methods
Bug: T363770
Change-Id: I235642d059855a8c5f7296095965687ae73c6efb
2024-05-29 18:07:48 +00:00
Amir Sarabadani 055daa65ef Switch away from wfGetDB()
Bug: T357657
Change-Id: I54f95397958c99b87083894cdf867d5ef6612fe7
2024-03-18 21:34:56 +01:00
libraryupgrader fb751efbc5 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.1 → 0.14.0

npm:
* grunt-banana-checker: 0.11.0 → 0.11.1

Change-Id: I7ad279ce54fd99dcdef439718b32baad112de9e9
2024-02-12 19:01:28 +00:00
Umherirrender fc369e9457 Use namespaced classes
This requires 1.42 for some new names

Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I9a7df2df9407ef10d855bc19db247983682a5fc8
2024-01-05 19:28:12 +01:00
gerritbot effea0bde6 Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I36f07ad64f90049b412969654cff0d3da31777e6
2023-08-19 04:19:23 +00:00
Tim Starling 51941a42ec Disable remote loading during PHPUnit tests
Bug: T65015
Change-Id: I205c5e247f314f734178f6c745eaa507f736083a
2023-07-04 09:37:12 +10:00
Amir Sarabadani a4484d08e8 Avoid checking for email denylist if user has sboverride right
Similar to the ones above

Change-Id: I3b7e0596eed2c8abe02762a13dde9adc64e17a9f
2023-05-30 09:09:00 +02:00
Amir Sarabadani 0981faaf86 Improve support for read-new wikis with externallinks
Bug: T337149
Change-Id: Ie5947fac2e1e908305f0cab6c2151adcc40094d5
2023-05-26 16:00:18 +02:00
gerritbot a76f8baf06 Update moved class EditPage
See T321882. Moved in Ibefc44eb64aed

Bug: T321681
Change-Id: I8f98cecb9177edb9de973cda7b2e10bb10743483
2023-05-06 21:20:28 +00:00
Amir Sarabadani 1d8b60b7b9 Use core's externallinks lookup
Depends-On: I8ae9ef388957b0c04efa281f3bc3b5796bec17fe
Bug: T326251
Change-Id: Ic326c6ba4476093cb62a8d1ce82da44c32b7d1e1
2023-04-24 19:54:45 +02:00
Reedy 53e7ef575d Drop 'BaseBlacklist' class alias
Depends-On: I724f5f2352bee20a82697fe090e99832405d82af
Change-Id: Idfc003d5f34799398d3bfd28aa532893461b30c9
2022-11-29 14:35:54 +00:00
Umherirrender 06a90e4df8 Inject services into hook handler
Change-Id: Iba11bb4f4ca937abbc2b8e8864b008966890ae52
2022-10-08 22:00:11 +00:00
Thiemo Kreuz f7ab8d10be Make various generic "array" type hints more specific
Includes fixing a misplaced count(). Looks like this issue was
introduced in 9bb2bc11 in 2006.

Change-Id: I27cb11419aa828330f4e06f06295f459b430fdbf
2022-10-04 12:37:47 +02:00
DannyS712 2a66c6b06f Add sboverride right to override the spam blacklist
Bug: T36928
Change-Id: I516dc68ec7a2dfaa82647feb67ec9bd264b8c380
2022-07-08 04:01:27 +00:00
Reedy 7a67ab0a5d Fix and enable 1 PHPCS exclusion
Change-Id: Iee1fb7c926b301a9980e8f1d2b447fb6ef169c6e
2022-04-08 13:57:05 +00:00
Reedy 6829b5410c EditFilterMergedContent: Remove handling for old MW
Change-Id: Id1ca273b13f762d3a4d06e63019e74c9f4e89877
Follows-Up: I456a40ce676c486b4ae12f00a7024a4c070448cd
2022-04-08 13:57:00 +00:00
Reedy 52bb0939d9 Namespace extension
Change-Id: Ie53302078d5f405eaa6caef3b7ef4daebf47d877
2022-04-08 13:41:20 +00:00
gerritbot 1f10a3f7fc Fix usage of ApiBase::PARAM_* deprecated constants
The ones that are replaced with ParamValidator

Bug: T275455
Change-Id: I5337394f4d556c170b95c8baa21bf4738d195bc3
2022-04-04 01:29:42 +02:00
Samwalton9 5d6168805b Fix use of errorbox
Replace use of errorbox class with Html::errorBox.

Bug: T304270
Change-Id: I5d18b32e26dea1ca8f37a27f14a5d8486cbb69df
2022-03-24 21:34:37 +00:00
Umherirrender a5c4f5bb4d Use new namespace for MediaWiki\Revision\SlotRecord
MediaWiki\Storage is alias since 1.35

Change-Id: I24ed7c7893d6b949ab847bb5dfe703ca5d49c39d
2022-02-26 22:17:53 +01:00
Reedy 2219888555 Replace usages of Wikimedia\(suppress|restore)Warnings()
Change-Id: I17ff2a8c9ff6aa0be4990fb45aa966b3610f7d06
2022-02-24 21:15:28 +00:00
Amir Sarabadani d353677bdf Take LogicException into consideration
It can be caused by undo

Bug: T299111
Change-Id: I94054648ddfe95b59668ad3f53ac864e0c5f6e30
2022-01-13 08:08:41 +01:00
Amir Sarabadani 3cb265f12e Give priority to PreparedUpdate
StashedEdit is slower than the PreparedUpdate

Bug: T288639
Change-Id: Ibeb934050c6b24720da4b69dba6273c8b3e15acc
2022-01-10 09:10:18 +01:00
Amir Sarabadani 3758ed5510 Use PreparedUpdate to avoid double parse
It is now possible to do after Id5ba40a21cc45

Bug: T288639
Change-Id: Icaf5d15928c500dacde3f5574c71b3702702bb88
2022-01-01 11:21:38 +01:00
Umherirrender 3dc7350f89 Use ParserOptions::newFromAnon instead of ParserOptions::newCanonical
ParserOptions::newCanonical is deprecated.

Change-Id: If689727640c3f9a353a0ecc32c3a2973136737dc
2021-12-18 20:07:40 +01:00
Roman Stolar 3451e9261a Replace deprecated Content::getParserOutput call to new one ContentRenderer::getParserOutput
Bug: T287158
Change-Id: I07f043deea33391302692f56604d9f641bc77916
2021-10-20 16:17:36 +03:00
libraryupgrader 5cf47545c7 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: Ib6db3984f5892a13461defbbe9f191ceb75853c8
2021-09-09 11:41:40 +00:00
Amir Sarabadani 530c13120b Try to use EditStash before re-rendering
Bug: T288639
Change-Id: Ia2b41f1b5da0ed4f938b92d04f661d8b869fce01
2021-08-16 15:26:45 +02:00
Amir Sarabadani e7a37be1c8 Don't generate HTML when asking for ParserOutput
It doesn't need it and it's really expensive to produce.

Bug: T288639
Change-Id: I5f3ec6c38aec2cf4b5c648e00691272a3941d9ce
2021-08-12 11:29:55 +02:00
Amir Sarabadani 5d90e38616 Avoid using deprecated WikiPage::prepareContentForEdit
Which would prevent every edit attempt rendering the content twice.

Bug: T288639
Change-Id: I802ed3685b7f2bea3616399fd92a9720f204f134
2021-08-11 19:51:58 +00:00
Roman Stolar bbb4bec7e4 Replace depricating method IContextSource::getWikiPage to WikiPageFactory usage
Bug: T275710
Change-Id: I3a762c4c097e4b3e89e82e5d0e62e9eecc2486d3
2021-06-28 17:04:10 +03:00
jenkins-bot eb38eb13dc Merge "Handle EditFilterMergedContent hook properly to break hook chains and display error message" 2021-06-26 12:57:19 +00:00
DannyS712 55399c4938 Pass a user to WikiPage::prepareContentForEdit()
Bug: T285447
Change-Id: I745a7c185e35295e578fdb1d36a6841bb4a1e126
2021-06-24 03:29:13 +00:00
libraryupgrader bca1a61958 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: If7fce8d1738a011f37a9fcbfacbb52cf214d9bea
2021-05-13 21:44:31 +00:00
Func d4dd5a9408 Handle EditFilterMergedContent hook properly to break hook chains and display error message
Extensions are supposed to return false to break hook chains when failed, which can avoid unnecessary call of later handlers in other extensions and work around with problems caused by difference betwen multiple triggers.

On mediawiki version 1.36 and before, just returning false in this hook can't display error message by default.
Set $status->value manually still to provide backward compatibility.

Bug: T280312
Change-Id: I456a40ce676c486b4ae12f00a7024a4c070448cd
2021-04-24 02:06:59 +00:00
Umherirrender 32ea1e7596 Use HookHandlers for core hooks
Bug: T271028
Depends-On: If7930a196272f782a6541fb0bc301e04e2d56f38
Change-Id: I7b5b6da058360bb60057f275234f972305ec0ea1
2021-04-15 21:02:35 +00:00
Reedy 4cbdb4fbc2 Add grepability comments
Collapse one nested if

Change-Id: I0d01239bc9ca3999688df2bb6d6360ccf563d956
2021-03-01 17:38:38 +00:00
Reedy c2e57657f4 Use updated CheckUser Hooks class
Depends-On: I3f66b660f9d59c0e88b182c9b06ee8cec994348e
Change-Id: I79e12fcd328bda203013a438b7f9a472b351dd48
2021-02-11 19:31:42 +00:00
Daimona Eaytoy 6ad12a26dc Make User parameter required in BaseBlacklist::filter
Depends-On: Idf346b7d5952c1af1547d178a3634d1116d4f85b
Depends-On: I7fe28c67e5a95de870ac98b4f2571733f4a7d302
Change-Id: I62478bec3a284b7aa56ea94f49be30199a6be3e4
2020-11-24 06:16:42 +00:00
Daimona Eaytoy da1af447e2 Always pass a User object to SpamBlacklist::filter
There are some usages outside of SpamBlacklist that must be fixed. After
doing that, the signature should be updated to make the user
non-optional.

Note: I've changed the signature because external callers only pass the
first two parameters. Hence, it's easier to change it now, add a
User parameter to the callers and then make it non-optional, than having
to pass $preserveLog and $mode in all callers and then swapping the
order (as that would break the world).

Change-Id: I0714eb9dbc6af3c775ab7a81cb4b59e687183f77
2020-11-10 19:13:01 +00:00
Ammar Abdulhamid 4c8c7bbb51 Remove manual passing of $this to closures
For a long time (since PHP 5.4.0) this indirection is unnecessary.

Change-Id: I1bf83f24e9b8762e929520bc94845b77ead511e6
2020-10-26 06:58:12 +00:00
daniel 5b0da2baf3 Ensure instance cache does not interfere with tests.
Tests need a way to rest BaseBlacklist::instances, so they can be sure
they operate on a clean slate. This is also needed to ensure they do not
operate on real settings, targetting a real remote host.

Bug: T262443
Change-Id: Ic320f7a72da7f26e0931ce3d393fc5a61d43d4fc
2020-09-29 17:20:44 +00:00
DannyS712 ad2f4fbc43 Update hooks to use PageSaveComplete
Update extension to require MW 1.35+, so the hook is available

Bug: T250566
Change-Id: I8dda65f1dcdeff68b884e83dafe9843d974bd3c4
2020-06-23 19:26:10 +00:00
Umherirrender 1f70c7ce00 Pass function name to HttpRequestFactory::get
Useful for logging
Replace deprecated Http::get with service (since 1.34)

Change-Id: I84382c37295e3b09a660983b206b526f19334568
2020-06-07 13:04:51 +02:00
Reedy e0b4d0bcc4 Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: Ibf6e74907477febe44bbaf8aac0f2bd59914675d
2020-05-20 01:05:42 +01:00
Timo Tijhof 423a6983bd Remove use of internal $messageMemc variable
Same as I04a0e578d7 in TitleBlacklist extension.

Bug: T189966
Bug: T243175
Change-Id: Ifc14f2ee1f176d025d6d1c6158405277f20a1ac1
2020-03-18 17:14:41 +00:00
libraryupgrader 4d1029117e build: Updating composer dependencies
* jakub-onderka/php-console-highlighter: 0.3.2 → 0.4.0
* mediawiki/minus-x: 0.3.2 → 1.0.0
* mediawiki/mediawiki-phan-config: 0.9.0 → 0.9.1

Change-Id: I2930f838e914f9b3f7917e773038c197af019851
2020-01-30 12:24:37 +00:00
DannyS712 0e17b75bc9 Remove use of global $wgUser and a use of global $wgRequest
Bug: T241704
Change-Id: I816b94558156bb9fea314047702d18cd3f1dd3e9
2020-01-04 09:27:22 +00:00
libraryupgrader 2d3b9f1d61 build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Change-Id: I56fbe7470e6dbc7ee2a2e381dc9e811db4b79224
2019-12-29 00:01:51 +00:00