Commit graph

183 commits

Author SHA1 Message Date
Novem Linguae
3391b91af2 Sanitizer: delete method removeHTMLtags()
Git blame on wfDeprecated() is 7 years old.

Unique name, no sign of it in CodeSearch for MediaWiki & services
at WMF. Couple of CodeSearch hits using the "Everything" filter.

Bug: T362636
Change-Id: I8961ebb3a72b328e839659aeeee3e73512a88dee
2024-06-27 14:09:00 +00:00
jenkins-bot
65533a55b6 Merge "ParserOptions: delete 3 hard deprecated methods" 2024-06-27 14:02:24 +00:00
Arlo Breault
6b05fa3a21 Remove image and gallery image caption trimming
Post I5039c7ef9e07199c256fd568b4f94714e5831d17, gallery image captions
are no longer placed on new lines, so the presence of leading whitespace
shouldn't be significant.

This fixes an inconsistency in gallery image caption trimming, where
only the first and last option had start and end trimming, respectively.

It also matches Parsoid output, where no trimming takes places, as seen
in the updated tests.

Change-Id: I2a80198c43598dc8c7fa61cb4b0340a97d2ee895
2024-06-26 21:51:40 -04:00
Novem Linguae
bf8e83fe44 ParserOptions: delete 3 hard deprecated methods
Git blame on wfDeprecated() is 4 years old.

Unique names, no sign of them in CodeSearch.

Bug: T362636
Change-Id: I90f11dc78be0938aea53a304b5824f034dd70107
2024-06-26 18:56:59 +00:00
Volker E.
c2fab12870 mediawiki.less: Remove deprecated @width-breakpoint-* Less variables
`@width-breakpoint-*` Less variables have been removed. Use
`@min-width-breakpoint-*`/`@max-width-breakpoint-*` instead.
Follow-up to Ie06bf3e15e552.

Bug: T349793
Change-Id: Ie397cf6839fa03ef84d3906f6d9f56c9b090884a
2024-06-26 16:28:07 +02:00
jenkins-bot
f6f28cb083 Merge "PermissionManager: Add getPermissionStatus(), deprecate getPermissionErrors()" 2024-06-26 09:46:14 +00:00
Bartosz Dziewoński
1fbe8b7619 PermissionManager: Add getPermissionStatus(), deprecate getPermissionErrors()
getPermissionErrors() uses a weird format for its return value that
is slightly different from the usual "legacy error array", and legacy
errors arrays are already icky. Deprecate it without changing this
format, and introduce getPermissionStatus() to replace it. Document
the return format more precisely.

Refactor PermissionManager to use PermissionStatus objects internally,
and only convert to the weird format in the deprecated method.

However, fix a scenario where the error array could directly contain
MessageSpecifier objects or strings instead of nested arrays,
as the documentation said that was not possible. Fix a test case
demonstrating this incorrect behavior.

Change-Id: I6670a58fe1fcb4e1ae87351277e5ddf29c548183
2024-06-26 01:19:37 +02:00
Eric Gardner
af7df71542 Update Codex from 1.7.0 to 1.8.0
Also adds @size-tooltip and @background-color-inverted to
mediawiki.skin.defaults.less.

Bug: T308520
Bug: T340456
Bug: T349793
Bug: T364306
Bug: T366129
Bug: T366541
Bug: T366861
Bug: T367098
Bug: T367100
Bug: T367101
Change-Id: Ie06bf3e15e55272f0ebecfebe4baa9564fa804df
2024-06-25 14:27:50 -07:00
Máté Szabó
cec4460d5a QueryPage: Don't try to swallow DBErrors
updateSpecialPages.php runs QueryCache::recache() for each special page being
updated, with the $ignoreErrors parameter set to true (the default). While this
successfully swallows the original error, the script will immediately fail
anyways with DBTransactionStateError ("Cannot execute query from
Wikimedia\Rdbms\Database::ping while transaction status is ERROR") .

Since the guidelines[1] consider catching DBError without proper cleanup a
transaction misuse error, and explicitly discourage it, let's allow the original
erorr to bubble up instead. This has the additional benefit of providing helpful
context for whoever will inevitably have to debug why the script failed.

---
[1] https://www.mediawiki.org/wiki/Database_transactions

Bug: T278543
Change-Id: Ic81e7c5e13b2461c8eafc3ae5a57cdec5462cc4f
2024-06-20 00:15:19 +02:00
jenkins-bot
3078fe7eb9 Merge "Add protection indicators to mediawiki/core" 2024-06-19 18:54:26 +00:00
Bartosz Dziewoński
c5ee9dc5d0 DatabaseUpdater: Don't require script path in 'runMaintenance'
Bug: T367918
Change-Id: If9453e0be0cca8cd5c90f0294f0978f672aa76b9
2024-06-18 22:12:26 +02:00
James D. Forrester
e7a47e1548 Change 'powered by MediaWiki' icon to new version, wrapped in Codex buttons
Bug: T256190
Change-Id: I4eca56b28682e5ca2b880bc01c123dc4f977f485
2024-06-17 14:35:48 -04:00
jenkins-bot
aef2cedb38 Merge "rdbms: Move IReadableDatabase::primaryPosWait() to IDatabaseForOwner" 2024-06-14 20:22:15 +00:00
Derk-Jan Hartman
f1a8470c65 Add release note for this feature
Bug: T365636
Change-Id: I934f2cd8dded372314585038ef3e9255ffc3dd72
2024-06-12 21:34:14 +00:00
Amir Sarabadani
00fc1b3d8f rdbms: Move IReadableDatabase::primaryPosWait() to IDatabaseForOwner
Only used in LB

Bug: T363839
Change-Id: I0b66dc85b1dd282b567c0a1847cdf07d2bcfe600
2024-06-12 22:42:24 +02:00
James D. Forrester
19f4e6945a Rename JsonUnserial… to JsonDeserial…
This is to make it clearer that they're related to converting serialized
content back into JSON, rather than stating that things are not
representable in JSON.

Change-Id: Ic440ac2d05b5ac238a1c0e4821d3f2d858bc3d76
2024-06-12 14:50:58 -04:00
Roan Kattouw
5a8b4dad05 Update OOUI to v0.50.0
Release notes: https://gerrit.wikimedia.org/g/oojs/ui/+/v0.50.0/History.md

Bug: T367061
Bug: T364777
Bug: T365759
Depends-On: Ib183cd7c28ea3fb68a6614b38362325560b426f8
Change-Id: I8427c2ebe487e914764c1b42991545edbe112ae0
2024-06-12 02:13:25 +00:00
Tim Starling
98cba784bf user: Remove "options" parameter to User::createNew()
I can't find anything in codesearch that uses this parameter. The
behaviour is odd and won't work for anything except a test. The other
parameters to User::createNew(), such as "email", will be written to the
database as initial values for the new user, which seems sensible. But
this "options" parameter just sets up fake options "prefetched" from
the DB, but doesn't actually insert them.

Bug: T323076
Change-Id: Icef65cb9f354197bc6dbcc92a3cf4d4e2918f2e8
2024-06-12 00:56:26 +00:00
Tim Starling
94151fcde9 user: Move "reset kinds" concept to PreferencesFactory
Fix the dependency loop between PreferencesFactory and
UserOptionsManager by moving the concept of "reset kinds" or "option
kinds" to PreferencesFactory.

Note that this is a half-baked feature from 2013 (I5f9ba5b0dfe7c2ea)
that is not really used for anything. Apparently only the "all" and
"unused" kinds are used.

The strong dependencies on PreferencesFactory internal details show that
this feature belongs in PreferencesFactory. But UserOptionsManager can
reset "all" preferences without help from PreferencesFactory, so add a
helper for that.

The rationale for putting it in UserOptionsManager was that eventually
all preference definition information should move to UserOptionsManager
(T250822). I don't agree with that. UserOptionsManager is the key/value
store which backs PreferencesFactory. I need to refactor it further for
T323076 and it will help to have these concepts be separate.

Hard-deprecate UserOptionsManager methods resetOptions, listOptionKinds
and getOptionKinds. Add convenience methods to replace calls to
resetOptions().

I couldn't understand the logic in resetOptions(). Why was it copying
old values instead of just omitting them? Why was it assigning null but
only for "all"? setOption() had a documented method for resetting an
option to the default, so I just used that.

Bug: T323076
Depends-On: I1ed0a1a9f6492fb50254104fa4bc9f2130218323
Change-Id: I900fd4a48c96d91491eae54824e7bf02a004843d
2024-06-11 23:50:21 +00:00
Roan Kattouw
034540bae9 Update Codex from v1.6.1 to v1.7.0
Bug: T361717
Bug: T363741
Bug: T364748
Bug: T365207
Bug: T365748
Bug: T366206
Bug: T366538
Bug: T367062
Change-Id: I792e89a8253a426b8c723486b96cb87bf9e1d85d
2024-06-11 21:14:25 +00:00
jenkins-bot
936f4d7808 Merge "Migrate MediaWiki.rest_api to statslib" 2024-06-11 18:49:08 +00:00
Wendy Quarshie
e7fd78aed1 Migrate MediaWiki.rest_api to statslib
Bug: T359364
Change-Id: I3646140ee8e16800c43f37958fc4b6ff00edcad6
2024-06-11 18:13:21 +00:00
jenkins-bot
bbadf63fa8 Merge "Move Linker::makeExternalLink() to the LinkRenderer service" 2024-06-10 19:58:45 +00:00
C. Scott Ananian
b855c62f66 Move Linker::makeExternalLink() to the LinkRenderer service
Move Linker::makeExternalLink to the LinkRenderer service, as has been
done with the other static methods of Linker.

In order to allow phan's SecurityCheckPlugin to perform a more accurate
analysis of taintedness, tweak the API of Linker::makeExternalLink to
clearly indicate via the type system whether the link text has already
been escaped or not: a `string` argument will always be escaped, and
if the argument is already escaped it should be passed as an HtmlArmor
object.  In refactoring, `Message` arguments were also common, and accept
them as-is to avoid the caller having to think about whether to call
Message::text() or Message::escaped().

This allows us to provide a more precise taint type to the $text argument,
avoids an opaque boolean argument, and avoids spurious errors from
SecurityCheck.

We also require the caller to explicitly pass a Title context, instead
of implicitly relying on the global $wgTitle.  This works cleanly
everywhere except for CommentParser, which has a $selfLinkTarget which
generally works as the title context for the external link, but which
is nullable.  The original Linker::makeExternalLink() used $wgTitle as
a fallback, but $wgTitle can also be null in some circumstances.  The
title context only determines how $wgNoFollowNsExceptions is handled,
so existing code basically just ignored $wgNoFollowNsExceptions when
$wgTitle was null, which isn't terrible.  A future refactor could/should
clean up CommentParser to ensure that there is always a non-null title
context that can be used.

Change-Id: I9bcf4780f388ba639a9cc882dd9dd42eda5736ae
2024-06-10 18:47:32 +00:00
jenkins-bot
933c9e1071 Merge "rdbms: Move several more methods to IDatabaseForOwner" 2024-06-06 18:38:13 +00:00
Amir Sarabadani
e522618837 rdbms: Drop IReadableDatabase::wasReadOnlyError()
Bug: T363839
Change-Id: I234338f87ee8419b81e3c9fdcc3f9edc00818220
2024-06-04 15:55:44 +02:00
Amir Sarabadani
f33b5515b5 rdbms: Remove ILoadBalancer::getWriterIndex()
It doesn't need to have its own method, We can just use the constant
instead.

Bug: T363839
Change-Id: Iaec5a8e88dc3e5ae4eaf1f24aebf4c5d73f4b350
2024-06-03 14:17:57 -07:00
Aaron Schulz
b823c3dad1 rdbms: remove deprecated IDatabase::nextSequenceValue() method
Change-Id: Ic01a6d5b7951f53898f4cb4c19de1210beb5af85
2024-06-03 12:50:54 -07:00
Volker E.
ccf804bfa5 mediawiki.mixins: Deprecate .column-break-after-avoid()
Use just the CSS rule `break-after: avoid-column;` instead now.
Also replacing one occurrence in Wikimedia deployed software of the
mixin and align other mixin call to coding guidelines.

Change-Id: Ie77f39136ae7320dc37f74930297e0721fcf0c19
2024-06-01 13:10:15 +01:00
Volker E.
68e4583170 mediawiki.mixins: Remove deprecated .background-image() mixin
Deprecated since v1.38.

Bug: T299982
Depends-On: I0d75b1517fe306dcacc17daa233a1df60b5ca9fc
Depends-On: I7d4b04dbcec439fa1b9e5f7efad0dd1639d658b5
Depends-On: I3aecc142b9c98c1b2f314129898f55c0178fb00f
Change-Id: Id8bd7ac18cd52b415353a49f347f6842cfe5436f
2024-05-31 23:40:34 -07:00
Volker E.
fc894832df mediawiki.mixins: Remove deprecated .list-style-image() mixin
Deprecated since v1.38.

Bug: T299982
Depends-On: I3da120f421520d2a66b37fd6a0ba277d64f9897a
Change-Id: Ib03c82749085a124fb23dbd18efe16ee16cbfd90
2024-05-31 23:38:19 -07:00
jenkins-bot
943f4578b6 Merge "rdbms: Drop IReadableDatabase::wasDeadlock()" 2024-05-31 22:38:29 +00:00
jenkins-bot
98e6c4cebe Merge "Deprecate Message::objectParams() and related code" 2024-05-31 21:42:23 +00:00
C. Scott Ananian
27d5ac2679 Hard deprecate OutputPage::setPageTitle() with Message argument
Bug: T343994
Depends-On: I2c0a5ff8055eea5e23f402c25174b8ebcd7d25af
Depends-On: I75508e494dd47bfe38be65d9cca8595edd662937
Depends-On: I91eaadd56aca7896c1329d13bc78c260fc4f6d8d
Depends-On: If92935766461edc1375d277066c2768415a45744
Change-Id: Ie125f229cd356c5a056c983389f92b4d5f8da98f
2024-05-31 19:23:26 +00:00
Amir Sarabadani
dc58171528 rdbms: Move several more methods to IDatabaseForOwner
Hide more internal methods

Bug: T363839
Change-Id: If1ce624485399e7e79a445e172449b51da0b3f9b
2024-05-31 17:08:15 +02:00
Amir Sarabadani
87cce5f510 rdbms: Drop IReadableDatabase::wasDeadlock()
Unused.

Bug: T363839
Change-Id: I83f377a74e15a30fdc0ee2e5dfde91c91a22377d
2024-05-31 16:06:01 +02:00
Aaron Schulz
2e8c7daca5 rdbms: remove unused IMaintainableDatabase::textFieldSize() method
Change-Id: I841de7699ec31bac2e98b633ed265979f0d9fae2
2024-05-30 15:52:59 -07:00
Eric Gardner
48065759cd Update Vue.js to 3.4.27
Bug: T364789
Change-Id: Ib21a5dfdf8fcdd6c090ea74fb052181f0fb90d9e
2024-05-29 18:08:16 +00:00
Anne Tomasevich
38993eb5b5 Update Codex from v1.6.0 to v1.6.1
Note that CSS module filenames in this release have an extra 'Cdx'
prefix - this is a known bug that will be resolved with the next
release. For now, these files are not used directly, and are
properly tracked by the manifest, so there should be no discernible
changes. See T366206.

Bug: T363432
Bug: T363858
Bug: T364611
Bug: T364636
Bug: T364762
Bug: T364789
Bug: T364894
Bug: T364927
Bug: T364929
Bug: T364934
Bug: T365003
Bug: T365363
Bug: T366097
Depends-On: I04c1250aef3afbff43c11a012194263ec6b0f533
Change-Id: I4988a93e8cb0f33c198303403dde8d92223d63c4
2024-05-29 17:54:43 +00:00
jenkins-bot
ea4ee02f2a Merge "rdbms: remove IMaintainableDatabase::truncate() method" 2024-05-29 00:40:29 +00:00
jenkins-bot
68593e5c5a Merge "rdbms: Drop IDatabase::getTopologyRole()" 2024-05-29 00:23:16 +00:00
Aaron Schulz
80b71dd7aa rdbms: remove IMaintainableDatabase::truncate() method
Bug: T363839
Change-Id: I79b7a2d1c65a38c200e84b479222052ff0ba5092
2024-05-29 00:16:14 +00:00
Bartosz Dziewoński
f18362ccce Deprecate Message::objectParams() and related code
This functionality was introduced in 2021 (commit 349819dc5a)
to support the addition of UserGroupMembershipParam, which was
never used, and no other use case appeared.

Its existence is now preventing us from allowing serializing
of MessageValue objects as JSON (since the parameters can't be
guaranteed to be serializable).

Deprecate:
* method: MessageValue::objectParams()
* method: Message::objectParams()
* method: Message::objectParam()
* class: UserGroupMembershipParam
* constant: ParamType::OBJECT
* Passing Stringable objects to ScalarParam

Change-Id: I492edabb7ea1d75774b45eb9fd18261b39963f9f
2024-05-28 22:03:46 +00:00
Sohom
bfb2d1d920 Add protection indicators to mediawiki/core
- Add a disabled by default feature flag 'EnableProtectionIndicators'
- When the config flag is enabled, show a lock indicator at the top
of the page.
- The lock icon should be overridable by the content of the page
- The indicator has a predictable ID which could be potentially used
 to style the icon using the onwiki Common.css file.
- The lock icon by default links to https://www.mediawiki.org/wiki/Help:Protection. However
this link can be customized per wiki per protection level using a
empty message (for example: `protection-sysop-helppage`)

Bug: T12347
Change-Id: I3e36d98edfe54a9c138b1fe8e5057e107ded281b
2024-05-28 16:09:27 -04:00
jenkins-bot
674eb6ad87 Merge "PermissionManagerTest: Add test for NSProtection excluded actions" 2024-05-28 18:10:17 +00:00
anterdc99
1025afdfbe PermissionManagerTest: Add test for NSProtection excluded actions
Bug: T362536
Follow-Up: I61ec3f8e1fe84927a6c987f387cbba349ec4a357
Change-Id: I2c65f5452b09fcc32ef93af6f090b285113427c8
2024-05-28 16:33:11 +00:00
jenkins-bot
ed10e9dbfb Merge "Remove TemplateLinksSchemaMigrationStage config" 2024-05-28 11:45:51 +00:00
Hannah Okwelum
b6ef248634 ResourceLoader: Update wikimedia/less.php from 4.2.1 to 4.4.1
Bug: T365481
Depends-On: I62585e4d243c4c2ba37cff400d62ea11bbcd80a5
Change-Id: I9e76ab95437730b2f68833552bdf7cea19f9e700
2024-05-27 21:35:22 +00:00
jenkins-bot
07ece77e44 Merge "Add MediaWiki\Watchlist namespace to the related classes" 2024-05-23 23:12:10 +00:00
jenkins-bot
a0de371081 Merge "REST: Document new redirect feature." 2024-05-23 16:58:55 +00:00