aboutsummaryrefslogtreecommitdiffstats
path: root/includes/specials
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "block: Fix incorrect bl_id sql conditional value"jenkins-bot2025-02-241-1/+1
|\ \
| * | block: Fix incorrect bl_id sql conditional valueDayllan Maza2025-02-241-1/+1
| | | | | | | | | | | | | | | | | | Follow-Up: I2ce1a82f3fbb3cf18aa2d17986d46dbdcc70c761 Bug: T387121 Change-Id: I1011934ae539077ac9f8551ee0a0df061927219c
* | | Merge "PageUpdater: allow dummy revisions to be minor"jenkins-bot2025-02-241-1/+1
|\ \ \ | |/ / |/| |
| * | PageUpdater: allow dummy revisions to be minordaniel2025-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - When introducing saveDummyRevision() in I1f8c0ac68b, we didn't account for the fact that most (but not all) dummy revisions should be marked as minor edits. What: - Add a $flag parameter to saveDummyRevision() Bug: T198297 Bug: T387067 Change-Id: I1db3ccc816cdb0e2a93593625306a9080b7204eb
* | | Merge "Fix formatting of blocking admin value"jenkins-bot2025-02-241-2/+2
|\ \ \ | |/ / |/| |
| * | Fix formatting of blocking admin valueWargo2025-02-221-2/+2
| | | | | | | | | | | | | | | | | | The id of blocker was not properly given to formatter. It resulted in treating registered admin userlink as anonymous user. Change-Id: I9dddb59f430385ad4b24ff009e8cbea2768db0ea
* | | Merge "BlockListPager: change unblock link for autoblocks"jenkins-bot2025-02-241-5/+2
|\ \ \
| * | | BlockListPager: change unblock link for autoblocksDayllan Maza2025-02-221-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autoblocks `unblock` or `remove block` links should always point to Special:Unblock Bug: T386876 Change-Id: Iad2f66b8829735ed4e99e663b5554664d4da875f
* | | | Merge "specials: Inject TempUserConfig into UsersPager"jenkins-bot2025-02-224-4/+17
|\ \ \ \ | |_|/ / |/| | |
| * | | specials: Inject TempUserConfig into UsersPagerUmherirrender2025-02-214-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use dependency injection for services, instead of global state via MediaWikiServices::getInstance() Follow-Up: I802ad15e1ef5d90e12686f1cf636db27973986f5 Change-Id: If52c17418efa269f364a33451d30945352a59df8
* | | | Merge "specials: Inject ChangeTagsStore into MergeHistoryPager"jenkins-bot2025-02-222-3/+11
|\ \ \ \
| * | | | specials: Inject ChangeTagsStore into MergeHistoryPagerUmherirrender2025-02-212-3/+11
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use dependency injection for services, instead of global state via MediaWikiServices::getInstance() Follow-Up: Icb9265644bdbc0b30e2a419ae0103f0e78fe90bd Change-Id: If2d2303e63e5496cab4a57e431e524fdf7052857
* | | | Merge "specials: Add support for file read new in ImageListPager"jenkins-bot2025-02-211-9/+94
|\ \ \ \ | |/ / / |/| | |
| * | | specials: Add support for file read new in ImageListPagerAmir Sarabadani2025-02-201-9/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The queries in this pager can be cleaned up massively on the read new mode. The same goes for the code which currently does two queries and then combines the results (and reorders them). Once we can get rid of the old code, this will allow for removal of hundreds of lines of code. Bug: T383496 Change-Id: I2427c845b427658788765646df5ad7d4fd7b91ed
* | | | Split MessageParser out of MessageCacheTim Starling2025-02-213-9/+8
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MessageCache has enough to do without also being a parser. Split a MessageParser class out of MessageCache and make it a service. * MessageCache::parseWithPostprocessing() becomes MessageParser::parse() because every caller wants postprocessing so it makes sense to use the shorter name for this. * MessageCache::parse() becomes MessageParser ::parseWithoutPostprocessing(). I changed the return type from ParserOutput|string to ParserOutput, which is a followup to I8a1fa84e650d920d07d74722d8059d5afeedec6b. Narrowing the return type does not break b/c so it is possible to make this change for both variants. * In the new methods, a null title is always a convenience alias for a placeholder title (Special:Badtitle). This reflects the convention in Parser::setPage(). The old MessageCache::parse() retains its b/c fallback to $wgTitle. MessageCache::transform() had the potential to fall back to the title used in the previous call, a fragile mechanism which I removed without deprecation. * For consistency, allow a string language in all new methods. * In EmailNotification, clean up an early attempt at global state avoidance. Change-Id: I05ab21508d5f8394189fd41ac6a2254ac0e0d785
* | | Merge "specials: Remove constructor PHPdoc block"jenkins-bot2025-02-2184-639/+0
|\ \ \
| * | | specials: Remove constructor PHPdoc blockUmherirrender2025-02-2084-639/+0
| | | | | | | | | | | | | | | | | | | | | | | | The doc block is identical to the type declaration for each argument. Change-Id: I8281b94351fe2be30344f1425a60f31fbf205100
* | | | Merge "specials\pagers: Use type declaration on constructor and properties"jenkins-bot2025-02-2111-128/+74
|\| | |
| * | | specials\pagers: Use type declaration on constructor and propertiesUmherirrender2025-02-2011-128/+74
| | | | | | | | | | | | | | | | Change-Id: Iff96024f9b261fff2af4205ee7ac568ce53f84a1
* | | | SpecialBlock [Codex]: guard against race conditions on initial loadMusikAnimal2025-02-201-8/+31
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In UserLookup, check against the existing list=allusers query to validate the target instead of firing a separate API request to list=users. For targets supplied by URL param, pass in blockTargetExists and set that on the store's targetExists prop. Validation within UserLookup is now confined to the single validate() method. Remove the blur listener which conflicts with the above strategy (i.e. validate() could get called before the list=allusers query runs). The blur listener shouldn't be needed, anyway. This patch also moves the 'nosuchusershort' error to be on the UserLookup field itself, instead of atop the whole form – something Design and Product had requested from the beginning. Finally, update module styles to reflect recent styling changes (such as T383921) to reduce flashes of unstyled content. Bug: T380970 Bug: T384712 Change-Id: I8172a13ffb26080b872bbf4b1a5a4f823acf9380
* | | Merge "PageUpdatedEvent: improve modeling of flags"jenkins-bot2025-02-201-1/+0
|\ \ \ | |/ / |/| |
| * | PageUpdatedEvent: improve modeling of flagsdaniel2025-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - Improve consistency, naming, documentation and definition of flags. What: - remove direct access to flags, provide a separate getter for each flag instead. - Deprecate EDIT_SUPPRESS_RC in favor of EDIT_SILENT - Introduce EDIT_IMPLICIT to replace "automated" mode - Introduce FLAG_RECONCILIATION_REQUEST into PageEvent. - Introduce isReconciliationRequest into DomainEvent. Bug: T383552 Change-Id: I2bffbb5810376829f871e1840ca799a8d8232dda
* | | Merge "special: Add support for file read new in NewFilesPager"jenkins-bot2025-02-191-7/+32
|\ \ \
| * | | special: Add support for file read new in NewFilesPagerAmir Sarabadani2025-02-191-7/+32
| | | | | | | | | | | | | | | | | | | | Bug: T383496 Change-Id: I44daa1293a76659b151df77541291a627ccde955
* | | | Merge "specials: Add support for file read new in more query pages"jenkins-bot2025-02-194-42/+149
|\| | |
| * | | specials: Add support for file read new in more query pagesAmir Sarabadani2025-02-184-42/+149
| |/ / | | | | | | | | | | | | Bug: T383496 Change-Id: I0e1e30cc7281666b9036c2f2f96792d6a8a01820
* | | block: Add a BlockTarget class hierarchyTim Starling2025-02-195-207/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main change: * Add a class hierarchy representing block targets, representing a target and type. * Add BlockTargetFactory, replacing BlockUtils. * Add CrossWikiBlockTargetFactory, replacing BlockUtilsFactory. * Construct a BlockTarget object early in the request flow and pass it down through the layers, instead of having every layer interpret UserIdentity|string target specifications. Also: * Remove Block::TYPE_ID. Nothing uses it in code search, so there's no point in porting it to the new system. * Stop using the type constants as specificity scores. Add BlockTarget::getSpecificity(). * Add DatabaseBlockStore::newUnsaved() to replace direct construction of DatabaseBlock in insertBlock() callers. There are many such callers in tests. This is part of the effort to remove the service container usage in DatabaseBlock::__construct(). * Make DatabaseBlock::getRangeStart() and getRangeEnd() return null if the block is not a range, since that is convenient for their only caller following the resolution of T51504. * Add DatabaseBlock::getIpHex() which similarly maps to a DB field in the new schema. * In ApiBlock and ApiUnblock, have ParamValidator provide UserIdentity objects instead of converting to a string and back to a UserIdentity again. Bug: T382106 Change-Id: I2ce1a82f3fbb3cf18aa2d17986d46dbdcc70c761
* | | Merge "block: Fix vague target requirements in BlockPermissionChecker"jenkins-bot2025-02-181-8/+10
|\ \ \ | |/ / |/| |
| * | block: Fix vague target requirements in BlockPermissionCheckerTim Starling2025-02-131-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The doc comment of newBlockPermissionChecker() describes the $target parameter as being optional. The returned object does not need or use a target when checkBasePermissions() or checkEmailPermissions() are called. But failing to pass a target when calling checkBlockPermissions() is incorrect. This was the subject of the linked bug. If an admin is performing a block, self-unblock permissions need to be checked, this is not optional. This could be enforced at runtime, but it seems safer and simpler to enforce it statically. So, move $target from being a constructor parameter to being a formal parameter of checkBlockPermissions(). This formal parameter will be statically required after a deprecation period. Deprecate newBlockPermissionChecker() and introduce newChecker(), using a name with a slightly less than conventional verbosity to allow us to change the parameter order. There is no $target parameter to newChecker(). Backwards compatibility is supported by adding an internal mutator method setTarget(). This can easily be removed after the deprecation period is over. In Special:Block, checkBlockPermissions() was called with $target=null on form entry, meaning that the user could unblock themselves if the target was specified in the URL, but could not unblock themselves by searching with the form. This seems inconsistent. So allow blocked admins to see the search form, but show an error when they try to block or unblock someone other than themselves. Bug: T384716 Change-Id: I8c26cdcc9b87b74bc458fe731cf7f170a2607150
* | | PageUpdater: make it easy to create dummy revisionsdaniel2025-02-141-29/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Creating dummy revisions was a fiddly multi-stage process. PageUpdater should just offer a method for doing it. Change how we create dummy revisions in: * LocalFile * MovePage * ImportReporter Bug: T198297 Bug: T384691 Change-Id: I4c7595ce24337ab637a4e0fdbb313fc77d452a15
* | Merge "import: Don't swallow exceptions that are not safe to catch"jenkins-bot2025-02-131-1/+7
|\ \
| * | import: Don't swallow exceptions that are not safe to catchMáté Szabó2025-01-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - Special:Import currently catches every subclass of Exception thrown by the import process and tries to render an error box for them. - DBError subclasses, aren't meant to be caught by most code however. If they left the main transaction round in an inconsistent state, further errors will occur if the default exception handler hasn't had a chance to perform cleanup. - Likewise, exceptions from wikimedia/request-timeout should also be allowed to bubble up as they indicate that a request-level timeout (enforced by Excimer in WMF prod) has expired and the request is to terminate as soon as possible. What: - Let DBErrors and TimeoutExceptions bubble up on Special:Import. Bug: T383933 Change-Id: Iae29d13534bd198823b4d8de0e8db20f43a97038
* | | Merge "Replace call_user_func with dynamic function call"jenkins-bot2025-02-131-1/+2
|\ \ \
| * | | Replace call_user_func with dynamic function callUmherirrender2025-02-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use modern php syntax to call a callable. Reduce the stack trace to improve performance and better IDE and static analyzer support Change-Id: I9ef131032a662a3b8db69aa7079dbd51f88f575a
* | | | specials: Use batch to format comments on Special:ListFilesUmherirrender2025-02-132-15/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a batch for formatting can reduce lookups for generating links Bug: T379688 Change-Id: Ia02de55254d0b222ecec8df1bff82ad58a18fedd
* | | | Merge "Replace call_user_func_array with dynamic function call"jenkins-bot2025-02-121-2/+2
|\ \ \ \ | |/ / / |/| | |
| * | | Replace call_user_func_array with dynamic function callUmherirrender2025-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use modern php syntax to call a callable. Reduce the stack trace to improve performance and better IDE and static analyzer Also replace func_get_args with variables Change-Id: Ie193c4e996ab136e08f1e16c988448d054520aa7
* | | | Add support for read new of categorylinks in SpecialExport and ↵Amir Sarabadani2025-02-112-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SpecialRandomInCategory Bug: T385890 Change-Id: Id787980d56b71ce15d6e4f7ce7e919e8adbc47fe
* | | | RenameUser: Introduce RenameUserJob to run rename jobxtex2025-02-111-147/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RenameUserJob is moved to Job/RenameUserTableJob because there are two kinds of jobs now. The newly added RenameUserDerivedJob is used for performing user-renames across a wiki family using virtual domains or shared tables. Most code are moved from SpecialRenameUser and maintenance/renameUser. The new service, RenameUserFactory is added for constructing RenameUser easier. When a global rename happen, the central wiki will enqueue RenameUserDerivedJobs for other wikis in the same family. The derived jobs will check if the central wiki has the same user table as local, and perform updates to local tables. A new user-right 'renameuser-global' is also added because wiki families may want global users to be renamed only by a limit set of users or on a certain global wiki. Bug: T104830 Change-Id: Ic4120cbd9a4850dfe22d009daa171199fe7c5e39
* | | | Merge "File: Add support for read new in more places"jenkins-bot2025-02-101-11/+34
|\ \ \ \
| * | | | File: Add support for read new in more placesAmir Sarabadani2025-02-071-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: T383496 Change-Id: Ifddfc42e28529d9a349ac7f4b24bf637aff3b51f
* | | | | Merge "Update searchdisabled message with docs and better link target"jenkins-bot2025-02-101-1/+1
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Update searchdisabled message with docs and better link targetSam Wilson2025-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: T384678 Change-Id: Ifb048489d24cda51ff62b64c0ff21b87eaec2580 Follows-up: I20a3fe8484424427de5dcc55098a09114fedaf66
* | | | | block: Remove change link from Special:BlockList autoblock rowsTim Starling2025-02-061-30/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Special:BlockList autoblock rows: * Remove the change link, since it is not possible to change autoblocks * Use wpTarget instead of a subpage to transmit the hash-prefixed ID to Special:Block, since "#" is not a valid title character. Special:Block is broken in multiple ways when it receives such a target, but that can be dealt with separately. Add test. Fix static cache which leaked data between tests. Bug: T385765 Change-Id: I638d6d6d23f9624ba1dff0f4fcc31e7261b70527
* | | | | Merge "Use $string === '' instead of strlen( $string ) === 0"jenkins-bot2025-02-054-8/+8
|\ \ \ \ \
| * | | | | Use $string === '' instead of strlen( $string ) === 0Fomafix2025-01-304-8/+8
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add $string === false or $string === null where $string can have other types than a string. Also document null as possible return value in FileRepo. Change-Id: Iaa29ba01c3fd6bea506debdc6f929edfe881c808
* | | | | SpecialWhatLinksHere: Use &redirect=no for transclusions tooTaavi Väänänen2025-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When linking to transclusions on redirect pages, mark those links as &redirect=no as well. Bug: T379863 Change-Id: I526065609ce225aded1f92dbf68935552912fd6e
* | | | | Merge "SpecialSearch: Add dedicated message for external (interwiki) search"jenkins-bot2025-02-031-0/+2
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | SpecialSearch: Add dedicated message for external (interwiki) searchAgnieszka2025-01-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a user enters an interwiki link (e.g. :pl:Jakub Ćwiek) in Special:Search, the existing code showed a confusing “page does not exist” message. This change introduces a new message key ("searchmenu-new-external") and checks $title->isExternal() to display a clearer prompt, suggesting users visit the external page. Bug: T196392 Change-Id: I84bc35dcab7e947cac1bd34b342bf969fd6cadd2
* | | | | build: Updating mediawiki/mediawiki-codesniffer to 46.0.0libraryupgrader2025-01-311-1/+1
| |/ / / |/| | | | | | | | | | | Change-Id: I0f8a8cac36015bba52aea3ee2affd92f83d3574a