Commit graph

80325 commits

Author SHA1 Message Date
Translation updater bot
369b31f5ea
Localisation updates from https://translatewiki.net.
Change-Id: I8efdea63dce69f70911877f8c402daa05247f012
2025-03-04 06:34:04 +01:00
jenkins-bot
10aee37b9e Merge "ExternalLinks: fix mailto: links reversal" into REL1_43 2025-03-03 08:30:03 +00:00
daniel
d0bbe78b23 RateLimiter: Fix peek mode
Why:
- Setting the increment to 0 should check the limit without bumping it.
- This was apparently broken by If3e66491306f22650.

What:
- Use LimitBatch::peek if the increment amount is 0

Bug: T381033
Change-Id: Ife76a1976a2063f051f00302e5adaebd701e6367
(cherry picked from commit e09606b3dc44711571cc6cf2d0d11bd7784d0cdd)
2025-03-01 15:51:16 +00:00
Ammarpad
c373e0ba40 ExternalLinks: fix mailto: links reversal
If $mailparts does not contain two elements (which would be the case when the separator `@` is not present in the string), then we cannot
access $mailparts[1].

In this case, the entire path as is, is treated as the host.

Bug: T380880
Change-Id: I10187c93e67ce9294ff0b3866939d2c7d7292a9a
(cherry picked from commit c2db58c55bef207dd37ac5fe0b07aa28ee4bd2d5)
2025-02-28 16:33:54 +00:00
Translation updater bot
3f040e33bd
Localisation updates from https://translatewiki.net.
Change-Id: If360ec9295a3fd250b27dec146e81f205e0c6e54
2025-02-25 06:32:49 +01:00
Nemoralis
4d4359f8ef Add explanation text for "Allow emails from brand-new users"
It is not clear who the "brand-new users" are in this case so help-message is required here.

Bug: T381205
Change-Id: Idfc1b7e4b5b1686f0edf69b32e0d4152b30e54ae
(cherry picked from commit 141be6c7f7a3be92d702db1e26ba7d0493aa8a0f)
2025-02-21 22:34:44 +00:00
Reedy
1364192bb9 FeedItem: Update @since on xmlEncodeNullable for backports
Bug: T385332
Change-Id: I88f82fb5a703126f0ce586030d7ba7666fbb5a18
Follows-Up: Iafd89c0d61baecd7c68f62b2a0764cc78cf25069
(cherry picked from commit 30f076a54660304590c266b7edee949ccc35c237)
2025-02-21 03:53:56 +00:00
Tacsipacsi
1f73b5d5e4 feeds: Fix str_replace() deprecation warnings on PHP 8
Why:

Both AtomFeed::formatTime() and RSSFeed::formatTime() short-circuit with
null if the input is falsy. This caused deprecation warnings down the
line, as the return value was later fed into str_replace(), which raises
a deprecation warning on PHP 8 if it gets null.

It also caused unexpected output on all PHP versions: the Mustache
templates for both Atom and RSS conditionally emit the date elements
(<updated> in Atom, <pubDate> in RSS), but this conditional output is
skipped only if the variable is null, not when it’s an empty string –
which is exactly what the XML encoding returned on all PHP versions.

What:

Introduce a new method, xmlEncodeNullable(), which properly handles null
values, and returns them as-is, without trying to encode them. This:

- Avoids the deprecation warnings on PHP 8, since str_replace() is no
  longer called.
- Makes the conditional output work: the <updated>/<pubDate> elements
  are no longer output if no date is available.
  - This makes the RSS output spec-compliant, as no garbage is output
    anymore. The RSS <pubDate> is optional [1].
  - It doesn’t make the Atom output entirely spec-compliant, as Atom
    requires <updated> to be present [2], but the removal of garbage
    (it was a single letter Z) should still increase compatibility.

[1] https://www.rssboard.org/rss-specification#hrelementsOfLtitemgt
[2] https://validator.w3.org/feed/docs/atom.html#requiredEntryElements

Bug: T385332
Change-Id: Iafd89c0d61baecd7c68f62b2a0764cc78cf25069
(cherry picked from commit 60c57b0fd5303e9627b7684ebac4cd369c1fe7a6)
2025-02-18 21:44:56 +00:00
Translation updater bot
086f0b5236
Localisation updates from https://translatewiki.net.
Change-Id: Ie6671ad9a673374b4d70a6fdfe0447e310d1db56
2025-02-18 06:32:08 +01:00
Timo Tijhof
d1ebddf51b installer: Restore "complete" success message
Bug: T384524
Change-Id: I433e381eb1f388584e36bbfd2b40665b61ec22eb
(cherry picked from commit ec17519993e4475588e70c0b9a3b9b7bfcda3268)
2025-02-18 02:01:37 +00:00
Timo Tijhof
6ea3f2f4f5 installer: Restore success messages
Bug: T384524
Change-Id: I688e310ab08d4fb83d5dc47bd1fa79617cead9d3
(cherry picked from commit 379d3842bd4fcc2bd0587ea85a81bb68ed5a285a)
2025-02-18 02:01:00 +00:00
Umherirrender
398fdb85b8 language: Use fallback chain to create NumberFormatter
php8.4 validates the locale and rejects invalid one.
Just use the fallback chain to find an usable language, mostly en.
Cache the created NumberFormatter instance, to avoid performance impact
for some languages due to more attempts to create a NumberFormatter.

Also C is rejected, so resolve it directly with Locale::getDefault()

Bug: T376711
Change-Id: I686f77baea33ea2852c546e30e9cc08618d44321
(cherry picked from commit 8b2cc12bd3724cd213ac581d220b50f91e282630)
2025-02-17 21:24:24 +00:00
Timo Tijhof
dff35eaa42 installer: Fix conflation between warning and info messages
* Fix getInfoBox to not be a warning box, but an information notice
  like it is intended to be.

* Update getInfoBox() to use codex class names, same as showMessage().

* Update getInfoBox() to bold the "Information" title, as per Codex
  examples and guidelines, e.g.
  https://doc.wikimedia.org/codex/latest/components/demos/message.html#multiline

* Remove infoBox() utility, it was used only once, in getInfoBox().
  The `mw-installer-box-*`, `mw-installer-infobox-*` CSS classes
  are also unusd now, however there is nothing to remove because
  these were already removed in a previous refactor.

* Introduce showWarning(), and apply it to showMessage() calls that
  convey non-fatal issues.

Bug: T384524
Change-Id: I6722346ef81a0a9cf8983153271be579905c7898
2025-02-17 03:57:42 +00:00
Amir Sarabadani
f680c0edc1 installer: Simplify the information box
The image passed to ::getInfobox is never passed to ::infoBox() it is
only called twice with an image which also doesn't work, it is never
called with 'class' option so remove both.

Bug: T383646
Change-Id: I4abe9f608e9b5dd657e3948988f28ad991495f25
(cherry picked from commit 412e602cd6586b9ce25b9c3cc9fcde14748fa146)
2025-02-17 01:21:10 +00:00
Translation updater bot
921fcc4d4c
Localisation updates from https://translatewiki.net.
Change-Id: If800b2998c86a9d9333057ccbcfe4e638dfbaca4
2025-02-11 06:32:37 +01:00
Máté Szabó
c4e9f987f1 rest: Return a 400 for invalid render IDs
Why:

- The REST API takes an optional renderid param when converting HTML
  back to source wikitext, which is user-provided and may be invalid.
- Invalid render IDs cause an InvalidArgumentException to be thrown that
  causes a 500 response.

What:

- Introduce a new error message for invalid render IDs in the REST API.
- Return a 400 with this new error message for HTML reverse-parses with
  an invalid render ID.

Bug: T385568
Change-Id: I062419fe8952329a39781a49cdca2e94c3996447
(cherry picked from commit cd1d42a5066e4bcb9b9d4ed9b4f7714fd428fea3)
2025-02-04 14:54:50 +00:00
Máté Szabó
b99dcc23bc parser: Gracefully handle invalid ParsoidRenderID keys
Why:

- ParsoidRenderID::newFromKey() validates incoming keys and throws an
  InvalidArgumentException if a required key component was missing.
- It does so by eagerly destructuring the return value of explode(),
  which causes a PHP Notice for invalid inputs as the expected offsets
  won't exist then.

What:

- Check the count of key parts before destructuring.
- Add unit tests.

Bug: T385567
Change-Id: I1d936ae038f85ffa2e5d1d3d8a75fdc75e4c8ef8
(cherry picked from commit eec130925c081c2da1c475f9a9ce719e6838ca51)
2025-02-04 14:54:31 +00:00
Translation updater bot
e00a967d45
Localisation updates from https://translatewiki.net.
Change-Id: If24feed544ade08f7f94ff61566392de84bb6a19
2025-02-04 06:32:24 +01:00
Reedy
c8ad182926 MultiUsernameFilter: Don't try to split ids if they're not a string
Bug: T385169
Change-Id: I97e22139846a28b91021c463de2dbb1db3b73909
(cherry picked from commit 75a2dc996d9ee665c2dcf0e503215fc3bbfc39f8)
2025-01-30 15:26:00 +00:00
Roan Kattouw
e402fc7d91 resourceloader: Fix hash computation for virtual files with versionFilePath
A regression in 69ad795df7 caused virtual
files with a versionFilePath to be silently dropped from the version
hash computation. This caused changes in these files to not be reflected
in the version hash of the file.

Bug: T385055
Change-Id: Ibde41f07bb6fa7610660cb5b7a3f7aafbe9d6bd3
(cherry picked from commit bce48b6358cd2176d9fbc9a7c22f008bfbcf73d2)
2025-01-29 21:26:20 +00:00
Ammarpad
8713498046 specialpage: Improve handling of invalid lang codes on login/signup
Special pages for login and signup contain language selector links
to change the interface language, the available languages are defined
via the `loginlanguagelinks` message. Invalid codes will make the
pages completely inaccessible, preventing account creation and login.

This patch improves the link generation logic to only create links
for codes considered valid by LanguageNameUtils.

Bug: T384995
Change-Id: I4f470dc417a773225ba335f95da1151525a2f620
(cherry picked from commit da179c65056d65dc5d610af1e29fed57df4f1082)
2025-01-29 16:04:57 +00:00
Reedy
73ae8ac576 FormatMetadata: Prevent running preg_match() on null
Bug: T384879
Change-Id: I439d000515198e43f65a13f8676cadb21ee65d28
(cherry picked from commit 55ad2b22e9b1339f5c0405b5bf4fc1afc0f11952)
2025-01-28 12:05:59 +00:00
Translation updater bot
0677163554
Localisation updates from https://translatewiki.net.
Change-Id: If3a2f012b033ae6c05d001bb1531cb928044e9c6
2025-01-28 06:31:37 +01:00
Reedy
fc1759bfe6 MWExceptionHandler: Add error suppression to constant( 'E_STRICT' )
Bug: T375707
Change-Id: I075edf064cefa012d3d7a2c734a2e9051a826074
Follows-Up: I5937cacdf5b01614042a06d4deb5112ffff51727
(cherry picked from commit 96a12a2dd6b98a25e4a9048a25b2b5010036e32c)
2025-01-21 22:31:11 +00:00
Translation updater bot
922ba6c190
Localisation updates from https://translatewiki.net.
Change-Id: Iadbd52cbddf89c6f862d60d9f778c9a891d4010c
2025-01-21 06:32:19 +01:00
Translation updater bot
9530b23ee3
Localisation updates from https://translatewiki.net.
Change-Id: I7c5c2921596e509850cfa828ff4da00e9fbb6ea0
2025-01-14 06:31:37 +01:00
Derk-Jan Hartman
82c9c2d88c MimeAnalyzer: detect magic number for gltf binary
Bug: T383037
Change-Id: I8aea7f120c670ac17e286a8280eae96af975fe4a
(cherry picked from commit 8765932c5f0bdb51a46eb38dbaf44da17fb2b284)
2025-01-09 14:57:11 +00:00
Derk-Jan Hartman
442f09d479 MimeMap: add gltf and glb mime types
Bug: T383037
Change-Id: Ic2e5fb5e6267dfc07ef66d74afbce8b96523055d
(cherry picked from commit aee7af136bfc653826342806c797073e07958c27)
2025-01-09 14:56:56 +00:00
Translation updater bot
cacd3b793b
Localisation updates from https://translatewiki.net.
Change-Id: Ie051918d63ba73144f9a47c262cff016a9da4b88
2025-01-07 06:33:31 +01:00
jenkins-bot
bee4e2659a Merge "session: Do not set session.use_trans_sid" into REL1_43 2025-01-06 23:26:57 +00:00
Reedy
30c8f812ac DnsBlacklistUrls: Remove sorbs.net
Service is no longer running, so it's a default that doesn't do anything

Bug: T382987
Change-Id: I3a21c12ba689928d38e410cbe2547ab7e616ac8a
(cherry picked from commit 4a6fac8b7dadfdffe6e0e239b8a551436e147d97)
2025-01-06 22:57:01 +00:00
Gergő Tisza
cfa48515a6 session: Do not set session.use_trans_sid
session.use_trans_sid is a PHP antifeature that tells PHP to add
session IDs to all local URLs by modifying the HTML it's told to
output. We have set it to false just in case, but now that's
triggering deprecation warnings.

Bug: T380755
Change-Id: Iace0dcdb23eedb432cc1c032bbb3ce31d34071be
(cherry picked from commit 3b948a3da4be2a20573db01d611d601f2f90f2e5)
2025-01-06 22:12:05 +00:00
xtex
7fec3fdec6 exception: Convert E_STRICT errors to E_USER_NOTICE
E_STRICT is deprecated in PHP 8.4.0.

MediaWiki (and almost all extensions) no longer produces errors at this
level.
To not break the compatibility, let's converts all E_STRICT level errors
to E_USER_NOTICE, which is also mapped to warning severity.

Using '@' operator to avoid generating the deprecation warning of
E_STRICT.

This should addresses the deprecation warning of E_STRICT when another
warning or error is raised.

Bug: T375707
Change-Id: I5937cacdf5b01614042a06d4deb5112ffff51727
2025-01-03 16:31:41 +00:00
Translation updater bot
91e434b9ba
Localisation updates from https://translatewiki.net.
Change-Id: I407e678d3272356af61f1aa4501da649e579c42f
2024-12-31 06:32:17 +01:00
Translation updater bot
0974f58a47
Localisation updates from https://translatewiki.net.
Change-Id: I990c03920d6eea71c57cd642fd257d959d328e79
2024-12-24 06:31:59 +01:00
Atieno
8216997ffc Prep 1.43.0
Bug: T372295
Change-Id: I47c8d47e8a098faba63b7d16e9ccd0362fb17d27
2024-12-20 17:36:14 +03:00
Translation updater bot
28a23b6c17
Localisation updates from https://translatewiki.net.
Change-Id: I3bc5b5e1cf102d5de24e18e207ded1a1eb386c7c
2024-12-17 06:32:12 +01:00
James D. Forrester
31509b74d9 ButtonAuthenticationRequest: Add AllowDynamicProperties directive
Bug: T381068
Change-Id: I779f2f995df1c330ce049daef2702f1af8569c33
(cherry picked from commit b691c3897a77cb0b2544f5b010bf08a8ea9b35f0)
2024-12-12 21:45:31 +00:00
Translation updater bot
243674529e
Localisation updates from https://translatewiki.net.
Change-Id: I63a0d567bfa65b73120645bc5820be2321b6d84f
2024-12-10 06:31:11 +01:00
Atieno
25990d4774 Prep 1.43.0-rc.0
Based on I32963c91ce8e73412769557ded867286149dc166

Bug: T372320
Change-Id: I87e9992789ceefdd1f3c01e948f22cac1bf39d96
2024-12-03 22:25:27 +03:00
Translation updater bot
6c023c219b
Localisation updates from https://translatewiki.net.
Change-Id: If6383924ed055260ce45fd363dd37c889f3d0cd2
2024-12-03 06:32:00 +01:00
Derk-Jan Hartman
c8d42840f7 Add migrateSearchindex functions
This runs migrations that were previously attempted.
Postgres never executed as the renameindex failed and it never ran the
patch either.

MySql did run, but was relying on renameIndex with PRIMARY, which is a
bad idea. The function now runs it as a patch, with upgrade row in the
log, but also checks for the lack of the old index in case the users
were already on 1.44 or if they used 1.43rc

Bug: T379591
Change-Id: I7e74ccbf8cf2b105e8e6dedf812af3487c18113b
(cherry picked from commit def5b99737a296c108310881debe6ecb8bac1b2f)
2024-11-26 17:59:30 +00:00
Translation updater bot
c149a70c0e
Localisation updates from https://translatewiki.net.
Change-Id: Iee6d9a093d36164b67739c76651500c6eff23414
2024-11-26 06:31:54 +01:00
Paladox
fe9818379d RefreshLinksJob: Don't retry job if "Revision x is not current" is returned
There's no point in retrying a job when you get "Revision x is not current".
It just causes log spam. Makes people think there's a problem when there isn't as it
logs in the error channel.

Bug: T379656
Change-Id: Iaa5bd006bf3f26277e81ad5bea1387ef4b925f68
2024-11-19 16:08:11 +00:00
Translation updater bot
d5a793d5a2
Localisation updates from https://translatewiki.net.
Change-Id: Ide69282dbb21c4f1bb12e5ad90444472711cbf19
2024-11-19 06:32:07 +01:00
Dreamy Jazz
2b19a410f0 Reject temporary account usernames on Special:PasswordReset
Why:
* Special:PasswordReset allows users to send an email containing
  a temporary password to the email address attached to an account.
* Temporary accounts do not have passwords and cannot have an email
  address set (as they cannot access Special:Preferences).
* Therefore, Special:PasswordReset does not provide holders of
  temporary accounts a way to get access back into the temporary
  account if they loose access.
* However, the form currently accepts temporary account usernames
  and we should update the functionality to reject such usernames.

What:
* Update SpecialPasswordReset to reject temporary account usernames.
* Expand tests for SpecialPasswordReset to check this fix has worked.

Bug: T380085
Change-Id: I004453d4d16cd2a0448ac3922e4d13c24a158c8d
(cherry picked from commit e27be818690820c0df227cb06206da499eb94d38)
2024-11-18 14:35:28 +00:00
Gergő Tisza
786e87c75c Fix img_auth message logic
Do not pass arbitrary parameters to the generic message whose
purpose is to hide details; parameters can be revealed with
uselang=qqx.

Change-Id: I6e239bc91db9089aea36e91908fe50b5a5a429d8
(cherry picked from commit c5a62853cc2ebc85cbcfcc932f78bc87657a5dc1)
2024-11-14 01:05:30 +00:00
Jdlrobson
276627160f Merge "Hard deprecate soft deprecated skin methods" into REL1_43 2024-11-13 00:27:38 +00:00
Ammarpad
8f6100dfa4 specials: Fix contributions page for user '0'
Follows Ia30bd09c19 (cbee5bdc29, T372444).

Also add regression test

Bug: T379515
Change-Id: Ic0d79d879587d6b5b4dc2f4998aba8df43e9ca81
(cherry picked from commit 18f6d477e8b0fe881fbf3519f27667c4943b1fc0)
2024-11-12 14:31:22 -05:00
Translation updater bot
21eaa87821
Localisation updates from https://translatewiki.net.
Change-Id: Ifd10ef063d76695c30c0bc703b955d5c96c2430b
2024-11-12 06:32:03 +01:00