aboutsummaryrefslogtreecommitdiffstats
path: root/includes/specials/SpecialWhatLinksHere.php
Commit message (Collapse)AuthorAgeFilesLines
* specials: Use type declaration on undocumented private functionsUmherirrender2025-04-041-2/+2
| | | | Change-Id: Ib394792b10afabf5e0440cd3be34c1f2fd9cfe1d
* specials: Remove constructor PHPdoc blockUmherirrender2025-02-201-9/+0
| | | | | | The doc block is identical to the type declaration for each argument. Change-Id: I8281b94351fe2be30344f1425a60f31fbf205100
* 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
* build: Updating mediawiki/mediawiki-codesniffer to 46.0.0libraryupgrader2025-01-311-1/+1
| | | | Change-Id: I0f8a8cac36015bba52aea3ee2affd92f83d3574a
* specials: cast possible string to int before numeric operationAmmarpad2024-11-041-1/+1
| | | | | Bug: T378992 Change-Id: Ic48202435f76430dbe2d8a6408a711a0ea40fe75
* SpecialWhatLinksHere: Ensure namespace variable is definedAbijeet2024-10-241-1/+2
| | | | | | | Broken in I313b595ccbcf0650fceffc5bfd31bc245aca0237 Bug: T378048 Change-Id: I09b753fb642d877b3d49fe13c204a16298b9725d
* WhatLinksHere: Allow extensible filtersHuei Tan2024-10-211-10/+15
| | | | | | | | | Add SpecialWhatLinksHereQueryHook hook that allow extensions to modify the query builder to add more conditions based on the filters added in the SpecialPageBeforeFormDisplay hook. Bug: T216368 Change-Id: I221d4e0ad671feab6937719d4a2f894ad6154bb1
* SpecialWhatLinksHere: Replace FormOptions with request data in an arrayAbijeet2024-10-211-45/+53
| | | | | | | | | | | | | | | | Replace FormOptions with array based form data instead of FormOptions and specify defaults when defining HTML form fields. We prefer using form data since values for HTML fields added via SpecialPageBeforeFormDisplay hook are available in this array but not in FormOptions. When extensions add fields to this page via SpecialPageBeforeFormDisplay or ActionModifyFormFields hook, they can access the value of the added field via the form data using new hook to perform custom filtering. Bug: T216368 Change-Id: I313b595ccbcf0650fceffc5bfd31bc245aca0237
* Use HTML markup instead of bidi control chars in Special:WhatLinksHereEbrahim Byagowi2024-10-031-5/+5
| | | | | Bug: T375975 Change-Id: I54b58dd8dd29e6a58db911e2e4ec093e2e6aea29
* Use const keyword for constant list of strings or intsUmherirrender2024-09-111-2/+2
| | | | | | Also changed visiblity of some to private Change-Id: I113b040321d27c84fe9b807c162736909e96fb20
* Make use of the ??= and ?? operators where it makes sensethiemowmde2024-08-261-3/+1
| | | | | | | | This touches various production classes and maintenance scripts. The code should do the exact same as before. The main benefit is that the syntax avoids any repetition. Change-Id: I5c552125469f4d7fb5b0fe494d198951b05eb35f
* Remove Title and User from signaturesDaimona Eaytoy2024-07-101-5/+10
| | | | | | | Replace them with PageIdentity/LinkTarget and UserIdentity. These changes should all be backwards-compatible. Change-Id: I94c38f584ea6b75c5fcfb0f8f2f6c34bca29ff3d
* Merge "Add namespace and deprecation alias to Xml and XmlSelect"jenkins-bot2024-05-161-1/+1
|\
| * Add namespace and deprecation alias to Xml and XmlSelectEbrahim Byagowi2024-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | This patch introduces a new namespace declaration, MediaWiki\Xml and adds Xml and XmlSelect to it and establishes class aliases marked as deprecated since version 1.43. Bug: T353458 Change-Id: I45cccd540b6e15f267d3ab588a064fbeb719d921
* | specials: Improve docs and `@ingroup` tags, fix file headersTimo Tijhof2024-05-151-2/+0
|/ | | | | | | | | | | | | | | | | | | | * Add relevant `@ingroup` to special pages that belong to a specific component and for which a doc group is already defined (defgroup), e.g. "Upload" for SpecialUpload, "JobQueue" for SpecialRunJobs. * Remove duplicate descriptions from file blocks in favour of class doc blocks. This reduces needless duplication and was often incorrect or outdated, and helps make file headers more consistently (visually) ignorable. Add missing `ingroup` to class blocks (and remove any from file blocks) as otherwise the file is indexed twice (e.g. in Doxygen) which makes navigation on doc.wikimedia.org rather messy. Ref https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged Bug: T364652 Change-Id: I795c43b6d72782d457c963e352d7e1b022c2b641
* Namespace Message, move to appropriate directoryJames D. Forrester2024-02-141-1/+1
| | | | | Bug: T353458 Change-Id: I088cbc53fbcdb974e5b05b45a62e91709dacc024
* Namespace HTMLForm and friendsJames D. Forrester2024-02-141-1/+1
| | | | | Bug: T353458 Change-Id: I09e66c3223018ec47e0549ee7f6a590b676f4eef
* Deprecate Xml::wrapClass, used in only one other repoJames D. Forrester2024-02-061-3/+5
| | | | Change-Id: I2b49625a8519371dd392d0ba6786e2831cc5f83b
* Remove allowances for nullable `rd_interwiki` and `rd_fragment`Bartosz Dziewoński2023-10-031-2/+2
| | | | | | | | | After the other changes in T346290 these fields can never be null. The only place that needs to handle null values is the migration script fixInconsistentRedirects.php. Bug: T346290 Change-Id: I0235c4be93b203f369b29522b54c0110ee8d61e9
* Merge "specials: Avoid selecting interwiki redirects"jenkins-bot2023-09-231-0/+1
|\
| * specials: Avoid selecting interwiki redirectsUmherirrender2023-07-011-0/+1
| | | | | | | | | | | | | | | | Selects on redirect table must check for rd_interwiki when joining with page table to avoid that a interwiki redirect gets selected which links a same-named local page. Change-Id: Ib3118b99fb39e264d2246d916fb311c2735e5f07
* | Merge "Use OutputPage::setPageTitleMsg() instead of ::setPageTitle()"jenkins-bot2023-09-191-1/+3
|\ \
| * | Use OutputPage::setPageTitleMsg() instead of ::setPageTitle()C. Scott Ananian2023-09-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing a Message argument to OutputPage::setPageTitle() is deprecated, because the message is not properly HTML-escaped by default. Use ::setPageTitleMsg() instead wherever the message doesn't include HTML metacharacters. Also protect arguments with Message::plaintextParams() where appropriate. Bug: T343994 Bug: T343849 Change-Id: Iba67d008545249772c136c5d6d302110516d3b94
* | | Namespace NamespaceInfo under \MediaWiki\TitleJames D. Forrester2023-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | One of the big ones, so doing this alone. Bug: T166010 Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
* | | Merge "Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage"jenkins-bot2023-09-181-1/+1
|\ \ \
| * | | Namespace remaining 'specialpage' files under \MediaWiki\SpecialPageJames D. Forrester2023-09-181-1/+1
| |/ / | | | | | | | | | | | | | | | | | | SpecialPageFactory is already here, but none of the others were yet. Bug: T166010 Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
* / / SpecialWhatLinksHere: Add support for read new of pagelinksAmir Sarabadani2023-09-151-4/+1
|/ / | | | | | | | | | | | | This one was easy Bug: T346457 Change-Id: Ic2524b89aa95246553bcc6a7944e77773f701247
* | Namespace SpecialW* under \MediaWiki\SpecialsJames D. Forrester2023-09-151-0/+14
| | | | | | | | | | | | This completes the namespacing of core special pages. Change-Id: I195e7fc34a9413bfea0a33c941f2362cd4a7ff10
* | Use real type hints for services etc. in specials/ (N-Z)Bartosz Dziewoński2023-08-291-20/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly used find-and-replace: Find: /\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|) Replace with: \3 \1 \4 Followed by some manual review to make sure I'm not changing too much, omitting some changes that looked too complicated and anything that caused test failures, and some whitespace fixes. Change-Id: I27149404eedc19e68bf62836d79ae0f2b85cc4d0
* | Simplify WHERE conditions with field = '' OR IS NULLUmherirrender2023-07-011-1/+1
|/ | | | | | Syntax supported since 26235c73 Change-Id: I397c76d4aba753a1629383559b95df86514f19ff
* Fix Special:WhatLinksHere behavior on limit= vs. limit=0Thiemo Kreuz2023-05-221-4/+8
| | | | | | | | | | | | | This makes the limit=… parameter behave more predictable, in my opinion: - …?limit=0 is still respected. I don't get why anybody would do this intentionally. But even if it's an error, ignoring the number would hide that error. - …?limit= without a value as well as …?limit fall back to the default value instead of 0. Bug: T289351 Change-Id: I9ffa642d6aef235f56253fbf102a4e3943847d31
* Use more narrow IReadableDatabase in BatchRowIteratorthiemowmde2023-05-191-2/+2
| | | | | | | | | | It's an iterator. It reads. This causes a nice chain-reaction where a lot more code (a lot in extensions) can be updated the same way. Note this doesn't affect the stability of this code because all old callers will continue to work with the more narrow type. Change-Id: Ib7e0287a480af641ce2c19e856c1fb90498f3eb8
* Specials: Mass switch everything to IConnectionProvider from LBAmir Sarabadani2023-04-191-7/+7
| | | | | Bug: T330641 Change-Id: Ie1772da59f92213fea598f02385c3e0ac6d200a7
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+1
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* Reorg: Move HTML-related classes out of includes/ to Html/Amir Sarabadani2023-02-161-0/+1
| | | | | Bug: T321882 Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
* Refactor SpecialWhatLinksHere to use FormSpecialPageFunc2023-01-111-51/+67
| | | | | | | | Use cases of HTMLForm should not supply user inputs as the default value, espacially values that can't pass validations. Bug: T41126 Change-Id: Ia50b06e12fbe5d47165a73245e695ba75fa4faec
* Merge "Clarify "No pages link to ..." message with filters in ↵jenkins-bot2023-01-111-1/+7
|\ | | | | | | Special:WhatLinksHere"
| * Clarify "No pages link to ..." message with filters in Special:WhatLinksHereSimon Legner2022-08-101-1/+7
| | | | | | | | | | | | | | Clarify message "No pages link to ..." when "Hide transclusions", "Hide links", or "Hide redirects" is selected. Bug: T284332 Change-Id: I009155d63f5c4c9edda94867d1e61a8f381d3170
* | specials: Special:Whatlinkshere should not act on special pagesUmherirrender2023-01-041-1/+2
| | | | | | | | | | | | | | | | | | Avoid useless queries with WHERE *_namespace = -1 Do not show "No pages link to Special:" and provide a message to the user, because special page links/transclusion are not stored (T16787) Bug: T41126 Change-Id: I656caa1f5afa722bd91dcdfa71497ce03e17f732
* | SpecialWhatLinksHere: Use trySubmit() for input validationFunc2022-12-251-3/+8
| | | | | | | | | | Bug: T325885 Change-Id: I24039fb91cc1016e1377c2989b9dd8cd22809520
* | Reorg: Move Title-related classes to title/Amir Sarabadani2022-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These three classes: - TitleArray - TitleArrayFromResult - TitleFactory We need to move these and the rest of files under title/ to Title/ (and namespace them) but the patch will become way too big given that Title class is also one of them. Bug: T321882 Change-Id: Iac1688172ee457348a08a470c86e047571feb8e0
* | Use buildComparison() instead of raw SQL in SpecialWhatLinksHereBartosz Dziewoński2022-11-031-8/+16
| | | | | | | | | | Bug: T321422 Change-Id: Ib7eb96b20301bec477aff6bc7628819702aec3ab
* | Introduce PagerNavigationBuilder for making pagination linksBartosz Dziewoński2022-09-051-35/+15
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several implementations of almost identical paging links: * PrevNextNavigationRenderer: The nicest one, somewhat recently added (4ca72763ec). Unfortunately it was also the least featureful: only supporting paging by numeric offset and not by index, and not able to generate "first"/"last" links. Also, I didn't realize that it exists when working on 94553a1bcb and b95d208340, so it was missing those changes too. * IndexPager/ReverseChronologicalPager/AlphabeticPager: These have been here forever. The most featureful, but not configurable, so a large part of the implementation was copy-pasted in two classes. * SpecialWhatLinksHere: Through some accident of history, this one special page ended up with its own implementation??? They are all replaced to use the new PagerNavigationBuilder. It may be slightly too much, but I had fun writing it. Notable changes compared to PrevNextNavigationRenderer: * Adds <div class="mw-pager-navigation-bar"> wrapper around the navigation and <span class="…"> wrappers on inactive links * The current limit link is made inactive (like the "prev" link when on first page, etc.) Notable changes compared to ...Pager/...Pager/...Pager: * Does not generate useless tooltips that contain only the title of the page, can use custom tooltips * The current limit link is made inactive (like the "prev" link when on first page, etc.) * All links have query parameters in a consistent order: ?title= &... &dir= &offset= &limit= (some of them are optional) These changes affect many special pages and actions. I tested on: * Special:Contributions (ReverseChronologicalPager) * action=history (ReverseChronologicalPager) * Special:Categories (AlphabeticPager) * Special:WantedPages (PrevNextNavigationRenderer) * Special:Search (PrevNextNavigationRenderer) * Special:WhatLinksHere Bug: T308364 Change-Id: Ic75bd597b210e14612ca3aebb531b659897e8294
* SpecialWhatLinksHere: Uncollapse the OOUI formSaint Johann2022-06-271-4/+0
| | | | | | | Since it is a small form and it makes it inconvenient that it’s hidden on most page views of the special page, I propose that it shouldn’t be collapsed. Bug: T117754 Change-Id: Ibaf949664faf4e3151902a016a23d5cfb5a524e5
* SpecialWhatLinksHere: Fix patchwork in filter localisation messagesBartosz Dziewoński2022-06-101-2/+3
| | | | | | Follow-up to 7496cc59dd1c3d04e3ff83e8562ceca8168a2028. Change-Id: I1823f7bedb3e490587ad5a0cb8b141a210b389bc
* SpecialWhatLinksHere: Convert form to OOUIlziad2022-05-221-48/+31
| | | | | | | | | | | | The current form is changed to OOUI with some CSS rules introduced. The namespace select and invert checkbox are grouped in a section with a flexbox to keep them in the same line if possible. Filter checkboxes are set to be inline-block for compact spacing. The whole form is also collapsible and will be collapsed when user is browsing results (i.e. 'target' parameter is set). Bug: T117754 Change-Id: Iebdec0dd3618fe4ee91514c082c6e63640cd8b01
* SpecialWhatLinksHere: Convert form to use HTMLFormBartosz Dziewoński2022-05-131-54/+37
| | | | | | | | | | By replacing the custom form and a custom script with HTMLForm and hide-if, this fixes an issue identical to T307530. The form could be changed to OOUI, but that will require some thought to handle the "Filters" section nicely, so I'm not doing that for now. Change-Id: I0307634ca88847998980e3f7b618b97fa6809a0e
* Use injection for LinksMigration on LinkBatch, action, api, special pageUmherirrender2022-05-101-4/+9
| | | | | | | | Even the service does not long stay in that classes, it should be injected to avoid global state Bug: T304780 Change-Id: Ib488037f5a6966ab61042ed3cd889ddc50f1ba8e
* SpecialWhatLinksHere: Add support for read new in templatelinksAmir Sarabadani2022-04-141-4/+3
| | | | | Bug: T304780 Change-Id: Ie047f8fd53eb643305077c0f0511bcce4d138b50
* Use MainConfigNames instead of string literals, #2Aryeh Gregor2022-04-131-2/+3
| | | | | | | This covers all occurrences of /onfig->.*get( '/ in includes/. Undoubtedly there are still plenty more to go. Change-Id: I33196c4153437778496f40436bcde399638ac361