Commit graph

57 commits

Author SHA1 Message Date
thiemowmde ea573ea99e Replace trivial Xml::… methods with Html::…
This code isn't even generating XML. I'm intentionally leaving a few
Xml::… usages behind that are more complicated. This is for later
patches.

Bug: T341775
Change-Id: Icc693968f0cf726b8ed616c38b7cfd422f481da5
2024-04-19 14:54:09 +02:00
Umherirrender 373042d9d0 Fix casing of dropdown-related methods
Methods gets renamed to lowercase variant in core (f1d7e68c)

Follow-Up: Ifda13ba9dee316709c424636ec3b285de8d0e9b1
Change-Id: I9a1e6d191bc5217e555d23746793ddee472faf47
2024-03-09 15:45:40 +01:00
Bartosz Dziewoński 80bdcd3004 Restore support for matching 'LIKE' patterns/wildcards
Follow-up to 910ce4c870.

Add a test so that we don't break this again.

Bug: T355478
Change-Id: I98620dd66a3c3a6913f999d6f96eef0ef69271d1
2024-01-22 11:30:50 +00:00
Novem Linguae 2f16b24b08 Links to redirects should have ?redirect=no
Bug: T351575
Change-Id: I8bced40d8f86010ec74ebc5ea81211bd7aaf3803
2023-12-22 02:15:33 -08:00
Amir Sarabadani 910ce4c870 Migrate to query builder and expression builders
As an Iranian, I'm a big fan of this extension so I decided to update
some parts of it to use new rdbms APIs.

Bug: T350984
Bug: T312361
Change-Id: Id374fc9143d40ac0c65ae99ffab945cde51f77d5
2023-12-19 17:03:57 +01:00
Func b5b1b11608 SpecialNuke: Escape the page title for messages
The page title should be substituted into the link syntax before the
wikitext is parsed, so we should use wfEscapeWikiText() instead of
plaintextParams.

Bug: T310015
Change-Id: Iad216ded7e25c7f84b6b9ae619ddd51b9140bd24
2023-12-06 03:31:20 +00:00
Fomafix 4ce660a73c Use namespaced classes
Change-Id: I7ed3d04a7c4922d6ccfd21dc275751155da9e643
2023-10-02 21:09:38 +00:00
gerritbot 376dd4b74b Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: Ib8ea0118fa7946d8070b8894fa9d67a29191945a
2023-08-19 04:17:58 +00:00
gerritbot 2418468b84 Migrate ILB::getConnectionRef() calls to ILB::getConnection()
Deprecated since 1.39 (I6e7544763bd)

Bug: T343277
Change-Id: I575b724b8d098165abbf6043aa5e531e0f1d6f73
2023-08-01 20:59:12 +00:00
Alexander Vorwerk 0b5bb5ccd7 Fix case in use statement
Bug: T336083
Change-Id: Icda9d979d9fb97cbd832d53fa8c5bb6847aaa63b
2023-05-05 22:23:03 +02:00
jenkins-bot 139c485cea Merge "SpecialNuke: inject services" 2023-04-28 17:46:31 +00:00
Alexander Vorwerk b88f9e2279 SpecialNuke: inject services
Change-Id: Ib57944f0fb7e512456318519acf27c5874160b1b
2023-04-28 17:24:41 +00:00
gerritbot f191f1bd34 Update moved class FileDeleteForm
See T321882. Moved in Ibeb488ba322c6

Bug: T321681
Change-Id: Ifcc26c56fd5d9d1708ea219dd25a90a6048aaf6c
2023-04-25 09:48:10 +00:00
jenkins-bot 87d106f51d Merge "Inject services" 2022-11-05 12:47:53 +00:00
jenkins-bot 160e3d8e48 Merge "Remove phpcs exclude rules and update PHP code" 2022-11-05 12:44:15 +00:00
jenkins-bot ef0a197e58 Merge "Use WebRequest::getIntOrNull and avoid ctype_digit" 2022-11-04 18:08:44 +00:00
Fomafix 698188afd4 Use WebRequest::getIntOrNull and avoid ctype_digit
This avoids the deprecation warning:
ctype_digit(): Argument of type null will be interpreted as string in the future

Bug: T322079
Change-Id: Id1e7ec7d73028339b53047ebfd6a975d23c3d180
2022-11-04 13:17:05 +00:00
Fomafix 42ef4ee402 Remove phpcs exclude rules and update PHP code
Change-Id: Ifecf2f8a053b9304a8e9e6558cd7c1f570f15084
2022-11-04 13:09:25 +00:00
Fomafix 49df51e106 Inject services
Change-Id: I7f11825af2bb96ad61aa2cefcc47fcad706388af
2022-11-04 11:21:00 +00:00
Fomafix 35abb011cf Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice.

Change-Id: Ia857f37abdb17fe88e91ae17a5610c027c97376e
2022-11-04 10:47:02 +00:00
jenkins-bot d7f428d5e1 Merge "Use WebRequest::getRawVal instead of WebRequest::getText" 2022-09-01 21:58:53 +00:00
Fomafix 7cd544c4ca Use \u{00A0} instead of  
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0)
instead of the HTML entity  .

Bug: T154300
Change-Id: I2f50fd24772eacd0bddf90c982fd7112196e6ad2
2022-08-30 13:24:53 +00:00
Fomafix cfc33f1a2a Use WebRequest::getRawVal instead of WebRequest::getText
The UTF-8 normalization for the URL attributes `action` and `namespace`
are not needed.

Also use === instead of ==.

Change-Id: I03a844d58b11f45dc67f3dfb861d8f6e9ffcc18d
2022-08-30 08:47:34 +00:00
Reedy cbbf2cc376 SpecialNuke: Null coalescence in execute()
Bug: T313146
Change-Id: I40850e2f126728ab09ab89fc666241a7f041c7ee
2022-07-17 20:43:16 +01:00
DannyS712 6620e7e686 SpecialNuke: use Message::plaintextParams() for page titles
So that their contents do not get parsed

Bug: T304777
Change-Id: I6f031d1b857ee0955b8966f5f63c63e269306568
2022-03-27 00:34:46 +00:00
Func bfe4c13c0b SpecialNuke: Don't set edit token in HTMLForm twice
HTMLForm would set it for post form, use setTokenSalt() to amend.

Change-Id: Ia79dbd261e9f0a34bf9f10660a1043355ab72ede
2022-03-18 12:03:12 +00:00
DannyS712 022da28e19 Unsuppress MissingDocumentationProtected and add docs
Change-Id: I169df0d822232c74ad5069141e032dbb10af6ac1
2022-03-12 01:45:39 +00:00
Taavi Väänänen 42d4bdb9ef SpecialNuke: Add dropdown with predefined deletion reasons
This commit adds logic very similar to what DeleteAction does: there's a
dropdown with predefined reasons (from MediaWiki:Deletereason-dropdown)
and a text field where you can enter a custom reason that will be
appended to the one you chose to on the dropdown.

Bug: T25020
Change-Id: I9668244d165caae2d71467573f1204689f2600a8
2022-02-14 05:35:33 +00:00
jenkins-bot 09907e9ece Merge "Don't use GROUP BY in getNewPages" 2021-11-04 22:30:20 +00:00
Martin Urbanec 90e1590f70 SECURITY: Pass required parameters to DeletePageJob
Without the params, the job does not actually delete the page,
rendering Nuke useless.

Bug: T294686
Change-Id: I61f47961e1d4739a290ed53704e87887e3f59f23
2021-11-01 16:54:55 +01:00
Amir Sarabadani 92c459552c Queue deletion job instead of trying to delete the pages
This would make running Special:Nuke much faster and avoid production
errors due to timeout.

Bug: T188679
Bug: T212690
Change-Id: I59d99068dd4d663261a5a5d0180105889fca66a2
2021-10-17 19:22:13 +02:00
Matěj Suchánek aca86ef6b3 Don't use GROUP BY in getNewPages
Bug: T212690
Change-Id: Ieec6d940073f69290d25967720fd72d751f4dd3e
2021-10-17 15:45:48 +02:00
Alexander Vorwerk 5169b386ca Replace usage of deprecated global function wfLocalFile()
wfLocalFile is deprecated and emits deprecation warnings. It's usages
should be replaced with FileRepo::newFile()

Follow-Up: I0a9c414da4cb0cec686e1e91b5d0babe055925a6

Bug: T288641
Change-Id: Ie6046ac1e12b4f09a856045f40aa87485b32b39e
2021-08-11 18:40:17 +00:00
DannyS712 94a3043d0d Minor cleanup to SpecialNuke::doDelete
Don't re-fetch the context user each time
through a loop.

Change-Id: I0a9c414da4cb0cec686e1e91b5d0babe055925a6
2021-08-02 06:55:02 +00:00
Tim Starling 94cd0132b8 Stop using legacy ActorMigration field "rc_user"
Migration was complete in MW 1.34

Bug: T278917
Change-Id: Ibe5768ece9126207470c2094237112b1011c8e46
2021-04-20 12:12:19 +10:00
Reedy 52d27a2714 Namespace extension
Change-Id: If386a072e64f7c4903be911f5f70db3ee52338c2
2021-02-11 06:20:26 +00:00
DannyS712 8d1f938dda Remove checks for whether ActorMigration class exists
Exists since 1.31, extension requires 1.35+
If it is ever removed, using the current handling from before it was
added will break things

Change-Id: Iee13649a4e3fb59195a60d178473d6e970680a45
2020-11-23 23:58:51 +00:00
jenkins-bot a1c014e67e Merge "Replace call to deprecated User::isBlocked with User::getBlock" 2020-07-31 08:51:52 +00:00
DannyS712 37c4b77c63 Replace call to deprecated User::isBlocked with User::getBlock
Check if the block applies to the `delete` right. Currently,
AbstractBlock::appliesToRight has no logic for delete, and returns
null, but to be forward-compatible it should be checked instead of
just assuming that blocks prohibit deletion.

Change-Id: I35820f07b5765f0870ab7f3c838955e6167533cd
2020-07-08 07:05:49 +00:00
DannyS712 7bd74621a7 Update hook calling to use new HookContainer system
Bug: T254558
Change-Id: Ibadbdb6f15fc407ef7b9b77b13811b68031e1439
2020-06-10 07:40:19 +00:00
DannyS712 fb26f45c03 Replace WikiPage::doDeleteArticle with ::doDeleteArticleReal
Don't need to worry about old signature since Nuke requires MW 1.35+

Bug: T248000
Change-Id: I32fd5dfa4a9edded90f4e52fd3c2acaaaf78e169
2020-03-19 15:32:13 +00:00
Umherirrender 51bf625b31 Use MediaWikiServices::getRepoGroup
This required MediaWiki 1.34 (already set to 1.35 in extension.json)

Change-Id: Ifede8f406c8017883cbc96a86d347d5f5cfecc21
2020-03-14 14:43:23 +01:00
BAGArt 1160b7e3f4 Replace usage of deprecated Page in favor of WikiPage/Article
Using actual Article contract with getPage method

Bug: T239975
Change-Id: I22ab8ce8ff2e2bc202d0ade6dec35b153f7fab8d
2020-03-03 02:24:00 +03:00
jenkins-bot 05afe8cd33 Merge "Use the help page dedicated to usage" 2020-02-23 10:23:21 +00:00
DannyS712 13d7bad063 Pass a user to FileDeleteForm::doDelete
Bug: T245682
Change-Id: I62a4e23e67d8fdf438767a17bec8b7f0572d9ac1
2020-02-19 22:34:13 +00:00
DannyS712 83ccb948b4 Remove use of Title::getUserPermissionsErrors
Bug: T244929
Change-Id: Ibeda8fdee104e8208c52c976550609f28fa991dc
2020-02-11 21:45:35 +00:00
libraryupgrader 2cd2837567 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
Additional changes:
* Also sorted "composer fix" command to run phpcbf last.

Change-Id: Ib4c6d57da6841418ce13fa7b4a6dc1e708774bf2
2020-01-14 08:25:55 +00:00
Jayprakash12345 08e3e84d7d Remove setMethod( 'post' ) from HTMLForm Object
Bug: T215123
Change-Id: I0579f4ad9f3c083691d1f6495cbefe0de5a4a585
2020-01-02 01:18:58 +05:30
Seb35 d791381831 Use the help page dedicated to usage
Bug: T228071
Change-Id: I0dbf2e9f04120db35ab76c13c325aaf20b2bef59
2019-10-08 15:46:17 +02:00
DannyS712 9529ceea80 Add help links to special pages
Bug: T228071
Change-Id: Ibf252ff64db6414fe12ae18ad7d3eef3b2c087e6
2019-07-17 19:45:04 +00:00