Commit graph

1724 commits

Author SHA1 Message Date
jenkins-bot b53b3c652c Merge "Special:AbuseFilter page title should mention filter name" 2023-12-22 15:07:26 +00:00
Novem Linguae 88e9d8d0b6 Special:AbuseFilter page title should mention filter name
- Mentions filter number and name in the title
- Distinguishes between viewing and editing

Bug: T353106
Change-Id: Idda9854a78937033b168603810154b48288c3f4c
2023-12-22 04:55:37 -08:00
Reedy c0a374eab8 Drop some ancient schema changes
MW <= 1.34

Bug: T353923
Change-Id: Id5fd76857019c4882e31b185c8ba48ef5c1025a8
2023-12-22 02:07:48 +00:00
Reedy f7339cdc82 SchemaChangesHandler: Document when some changes were added
Bug: T353921
Change-Id: Ibe7c0780a3d1eebe35d6a6bce451a48fd57b545f
2023-12-22 02:07:13 +00:00
Paladox f1feb6c456 Fix "PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated"
Change-Id: Ic5eff58389a66f56bd2a9585c476dcde5a93f4d1
2023-12-15 23:01:09 +00:00
Umherirrender bd84a6514c Use namespaced classes
This requires 1.42 for some new names

Changes to the use statements done automatically via script
Addition of missing use statements and changes to docs done manually

Change-Id: Ic1e2c9a0c891382744e4792bba1effece48e53f3
2023-12-10 23:03:12 +01:00
jenkins-bot 22435fe600 Merge "Replace BadMethodCallException with LogicException" 2023-11-19 13:03:56 +00:00
jenkins-bot 5af833f0a8 Merge "Improve PHPDocs in SpecialAbuseFilter" 2023-11-19 13:03:54 +00:00
jenkins-bot 3906112737 Merge "Document more generated messages" 2023-11-16 21:02:16 +00:00
thiemowmde 2def63118e Replace BadMethodCallException with LogicException
The BadMethodCallException is documented as "thrown if a callback
refers to an undefined method or if some arguments are missing".
This is not what happens in these places.

Change-Id: Ic95b67acc2e17eea1dd0fa1d72f9ac94a86bcf17
2023-11-16 19:10:50 +00:00
thiemowmde 71170d6db1 Fix typo "Builer" → "Builder"
This luckily doesn't appear anywhere else:
https://codesearch.wmcloud.org/search/?q=EditBoxBuiler

Change-Id: I8238015b10cc729a2df7b56be7e3eb5140f8a070
2023-11-16 20:00:41 +01:00
thiemowmde 5f0f61de5d Improve PHPDocs in SpecialAbuseFilter
Change-Id: I5364650dc31b69ab406fe1c12b6fb2ca66f02da1
2023-11-16 19:55:40 +01:00
Ed Sanders 34bb759cd8 Document more generated messages
Change-Id: I255235b03a060199e9577aa669227742efa7ff07
2023-11-08 16:34:08 +00:00
MusikAnimal 7db0e05aeb Show notification when editor links to a blocked domain
This leverages the new BlockedExternalDomains system that is now part of
AbuseFilter. It notifies editors in realtime if a link they add is
blocked. See https://w.wiki/7ZsF for more information.

BlockedExternalDomains is slated to have its own API tantamount to the
action=spamblacklist endpoint, after which case this code will need to be
updated. In the meantime, it's meant to serve as a minimal viable product
for the CWS 2023 wish <https://w.wiki/7ZsE> for wikitext users.

The new $wgAbuseFilterBlockedExternalDomainsNotification configuration
setting controls the availability of this feature.

A similar feature for VisaulEditor is tracked at T276857

Bug: T347435
Change-Id: I7eae55f12da9ee58be5786bfc153e549b09598e7
2023-10-31 15:32:02 +00:00
Umherirrender 97a8f0ae6c Replace empty() with a null compare
empty() should only be used to suppress errors
Found by a new phan plugin (T234237)

Change-Id: I5428b4bfe17b5d3a3aca6f07795a1b84af2eaf37
2023-10-21 20:27:31 +02:00
Umherirrender a7f0b7971a Use the expression assignment operator to simplify code
Suggested by phan, available since php7.4

Change-Id: Ibcc1742bd16a16e6518b4851046ad62d85de559e
2023-10-14 00:42:34 +02:00
Bartosz Dziewoński 0f63d6011c Parse wikitext in page titles with filter number as parameter
Follow-up to 0ff282dcc3.

Bug: T343994
Change-Id: I14cc0cebcf10fb552475ef6ffbab9dcfa55221cd
2023-10-05 20:54:58 +00:00
Bartosz Dziewoński 1e54192b1b Fix non-escaped messages used in page subtitles
Reported by Phan, and also discoverable with ?uselang=x-xss.

Change-Id: Ieb41d11acf543784f1cfbca5ea2272ac0bffc9a9
2023-10-05 22:51:21 +02:00
jenkins-bot df88b1b4b7 Merge "Revert "Remove unused SecurityCheck-ReDoS suppression"" 2023-09-25 20:19:36 +00:00
Daimona Eaytoy 7896e8f2c4 Revert "Remove unused SecurityCheck-ReDoS suppression"
This reverts commit 2107ee4f38.

Reason for revert: T347220

Change-Id: If76c4d0d7564d48bf231173d1d8f5177127fc5fa
2023-09-25 16:07:21 +00:00
C. Scott Ananian 0ff282dcc3 Use OutputPage::setPageTitleMsg() instead of ::setPageTitle()
The new method formats the message with Message::escaped() which
better protects from bad HTML in the message.

The ::setPageTitleMsg() method was added in 1.41 and this extension
already requires MW >= 1.41.

Bug: T343994
Change-Id: Ic07cde3bafeaa0325024fe89b4948680d04c4820
2023-09-22 21:18:03 +00:00
C. Scott Ananian 2107ee4f38 Remove unused SecurityCheck-ReDoS suppression
Change-Id: I7809c29e1150ea6770f3aa70a3fb790f3e4ce32f
2023-09-22 21:17:31 +00:00
jenkins-bot 1f1c5e477b Merge "When testing against a page creation in RC, set page_id to 0 as in the real filtering" 2023-09-11 09:28:33 +00:00
Matěj Suchánek 9beeca3752 Fix various typos and documentation issues
Change-Id: I1e9d297f665282d251343598e102e1d342488965
2023-09-04 12:55:17 +02:00
Amir Sarabadani ead29fc0fe Re-enable skipped test
Depends-On: I04c1dcf5129df437589149f0f3e284974d7c98fa
Change-Id: Ib071cd62d21090d28088729d2b2850363b750dae
2023-08-25 17:06:15 +02:00
Derick Alangi 623b9dbea3
Migrate DeferredUpdatesManager to use DeferredUpdates directly
Reverts part of Id9056528a433faf0, to switch to DeferredUpdates in
CirrusSearch back from DeferredUpdatesManager.

Bug: T265749
Change-Id: I8126cc76440724753c356c48ba4e0fcc9be5b41a
2023-08-21 12:59:28 +01:00
Umherirrender 62127964b7 Use namespaced MediaWiki\User\ActorMigrationBase
Bug: T321681
Change-Id: If3940c982d55643a685e2dedccab0540f86b9ae9
2023-08-20 01:08:09 +02:00
jenkins-bot e23b4bf8ef Merge "Use namespaced Title" 2023-08-19 18:33:50 +00:00
Umherirrender cd7e9d31a7 Use namespaced Title
Bug: T321681
Change-Id: I66fd9b70a5de06ac3c81bdf6a2a5bca64ed094c2
2023-08-19 19:49:36 +02:00
jenkins-bot 96f6e1961f Merge "Clean up AbuseFilterConsequencesTest a bit" 2023-08-19 17:29:27 +00:00
Daimona Eaytoy 85f8f90531 Clean up AbuseFilterConsequencesTest a bit
Most notably, make it not use additional DB tables to test global
filters. Instead, just pretend that the local database is not local (via
config) and "hide" local filters with a simple test-only flag in
FilterLookup.

Change-Id: Ib431dbf6c9d84978ee84e7f0671cfcbf8a54d7a2
2023-08-19 15:31:41 +00:00
gerritbot f5258d16bc Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I0402e835b5c05bac0a890b6fe0036516751c411b
2023-08-19 04:13:30 +00:00
Umherirrender 8e6d820154 Use HookHandlers for UserMerge hook
Bug: T254306
Depends-On: Ib78dae49854863af1a37a00636737c94694776ae
Change-Id: If2bc517fb612199f4d744efbfa261ee5c556b6a5
2023-08-16 09:44:30 +02:00
jenkins-bot e80a4337c0 Merge "Use HookHandlers for Echo hook" 2023-08-16 05:26:14 +00:00
gerritbot ae1262fb68 Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I505b97ffbb74f1b1a12bf141b73b1414c60c5020
2023-08-16 01:54:05 +00:00
Umherirrender a328477b8d Use HookHandlers for Echo hook
Bug: T254306
Depends-On: Iffa2b409502b4269c9746e0304feb4aaee37a86e
Change-Id: I0e27c535367b37b7038a54955e43ff96d9c81d32
2023-08-16 00:18:02 +02:00
jenkins-bot e566cb1327 Merge "Avoid TestUser in non-database tests" 2023-08-07 13:13:25 +00:00
Daimona Eaytoy 2a6b7edecb Avoid TestUser in non-database tests
TestUser requires a DB connection, so avoid using it in database-less
tests. Add to the Database group tests that are making DB writes (e.g.,
for log entries).

Change-Id: I211cb60296e5c2446128fcdf2caaadc728a8c272
2023-08-06 22:18:49 +00:00
Amir Sarabadani 049e602b07 BlockedDomains: Move filtering logic to a dedicated class
I'm planning to add support for bypass and regex-based blocking which
means it'll grow a bit. So let's give it a dedicated class.

Bug: T337431
Change-Id: I5a6fe2fd2f1efdebd8cada0ba6c481341f830e27
2023-08-06 16:27:23 +02:00
jenkins-bot a3ffaba341 Merge "Replace userNameUtils with UserIdentityUtils" 2023-08-06 10:00:04 +00:00
gerritbot 806ac5285d Migrate ILB::getConnectionRef() calls to ILB::getConnection()
Deprecated since 1.39 (I6e7544763bd)

Bug: T343277
Change-Id: I1d6d8d8bee8b39a5d364d8bb65f5f9a85194114d
2023-08-03 22:28:51 +00:00
Umherirrender c72b6a20f0 Pass ParserFactory to LazyVariableComputer
Make the init of Parser lazy

Bug: T343070
Change-Id: If0f0ca3c4aa2136c85903289f7f80b95dc5132c8
2023-07-29 14:20:07 +02:00
AnaïsGueyte 2efd6d9ac9 Replace userNameUtils with UserIdentityUtils
Where UserIdentity is available and where it's necessary to check ::isNamed

Bug: T342741
Change-Id: I5b52686f1c072282e76874f3863962345ca8097e
2023-07-27 10:29:31 -03:00
Matěj Suchánek 82ff324ae9 Remove faulty phan suppression
Change-Id: I5928d14f92d2bf7e8ceae9b40086533d7e0d0061
2023-07-21 21:47:34 +02:00
jenkins-bot ad37cd8725 Merge "Get parsed content from PreparedUpdate" 2023-07-18 14:15:40 +00:00
jenkins-bot 78c7334d6a Merge "Split VariableGenerator::addEditVars" 2023-07-17 23:26:53 +00:00
Matěj Suchánek 1e93f8b674 Get parsed content from PreparedUpdate
This finally makes new_html work for non-wikitext contents.

Bug: T264104
Change-Id: I1174b63a8e3a96e83ee7472dd086bfc91636316c
2023-07-16 14:48:30 +02:00
jenkins-bot 9aa87e9234 Merge "Clean up AbuseFilterViewTestBatch" 2023-07-12 13:12:47 +00:00
Matěj Suchánek 49edc86a78 Split VariableGenerator::addEditVars
This method actually consists of two: add derived vars, and initialize
content vars. The former part depends on no parameters of this method.
On the other hand, the latter part combines multiple implementations
for some of the content variables using branching.

The branching is a dirty workaround and inferior to the GRASP principle:
"When related alternatives or behaviors vary by type, assign
responsibility for the behavior to the types for which the behavior
varies."
In other words, the callers (extensions) should be responsible for
choosing the initialization strategy themselves, instead of letting
VariableGenerator figure it out.

As the first step, split the former part to a separate method.
For now, it will be implicitly called by ::addEditVars.

Change-Id: I5ff00dbdbf29ec54eabfd95c44a4fd7f713969f5
2023-07-05 14:58:32 +00:00
Tim Starling fe592746b7 Use the new Wikimedia\Diff namespace
Bug: T339184
Change-Id: I381686678524868c85466bdafde3856a73a8cb1c
2023-06-29 11:56:13 +10:00