Commit graph

68 commits

Author SHA1 Message Date
Chlod Alejandro b7a0be19c5
Explain capitalization process
Add comments into the code for converting page cases
from lowercase (first letter) to uppercase.

Change-Id: I3ae3602d826e232adc1ce6063ac6b50eac01d5bc
2024-05-12 17:50:12 +08:00
jenkins-bot 77f19d09dd Merge "Cleanup code comment on Special:Nuke" 2024-05-05 12:23:00 +00:00
jenkins-bot 9663707fba Merge "Replace rc_new for rc_source in DB query" 2024-05-05 11:43:53 +00:00
Samwalton9 8385ddbb74 Add talk page link to Nuke confirmation form
Added talk page links to aid in uncovering which talk pages may require further inspection. Also reorganised the information a little, made some terminology consistent, and added a .less file to store Nuke styles.

Bug: T364143
Change-Id: I76b9bbb939afde1d7d951925818fd15f40022ead
2024-05-05 10:55:52 +03:00
suecarmol 4873bf7040 Cleanup code comment on Special:Nuke
Removed a comment that no longer applied to Nuke

Bug: T234726
Change-Id: I560666e0ec47fb48acc51baaa46ebd4767e84fad
2024-05-04 20:07:53 +03:00
Samwalton9 e506e68969 Italicize redirects in Nuke page list
When pages are redirects, admins may not want to delete them, as they are less likely to contain bad content. This patch highlights them by using the allpagesredirect styling which provides the same italicizing behaviour for Special:AllPages.

Bug: T278625
Change-Id: I027cad868ed13190424612d1f9c2bdaf6456f49e
2024-05-04 18:21:26 +03:00
suecarmol 00894a4484 Replace rc_new for rc_source in DB query
Replaces the rc_new field for rc_source because rc_new has become obsolete.

Bug: T36320
Change-Id: I821332c2484850dd3ad293703faafbd29379a83e
2024-05-04 16:15:28 +03:00
Seb35 fb60b51cd8
Permit spaces in the SQL LIKE pattern
The search is against the MediaWiki-DB-encoded title (with '_' for space
and initial uppercase letter): these constraints are converted in this
patch to let the user use MediaWiki-displayed titles if they want.

It was taken care about of the configuration-specific case where some
namespaces are first-case-insensitive but other namespaces are first-case-
sensitive, by partitioning the namespace space into to distinct spaces.

Bug: T234726
Co-authored-by: Chlod Alejandro <chlod@chlod.net>
Change-Id: Id83832c256660b691a896113c98641700ed02707
2024-05-04 16:15:24 +03:00
xiplus 52352320c2
Query current page name for moved pages
Join "page" table to query current page name for moved pages.

Bug: T43351
Co-authored-by: Chlod Alejandro <chlod@chlod.net>
Change-Id: I127bc413c8ef25bbc24cb27b2cdc6d1ec08142ab
2024-05-03 13:39:07 +03:00
jenkins-bot 2982814a9b Merge "Modernize the code a little bit" 2024-04-21 10:32:58 +00:00
thiemowmde 9fb95da819 Modernize the code a little bit
For example:
* Remove redundant PHPDoc blocks that just duplicate existing
  information and aren't needed any more with our current PHPCS
  rule set.
* Add some very obvious type declarations.
* Use ??= where it makes sense.

Change-Id: I5c182cc961c6eeccead79ff49b0376eee2418acf
2024-04-19 15:10:15 +02:00
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 &#160;
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0)
instead of the HTML entity &#160;.

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