| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
wfDeprecatedMsg was replaced with trigger_error for better alignment
with non-MediaWiki environments.
Change-Id: Icc5a58cb2eccf26def393a9715ab5089cf4b7951
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Bug: T378797
Change-Id: I3f0177e85d71dd5c1526cdd42fbee69d8d1f6eca
|
|\ \ \ \ \ \ |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
I find the code quite surprising and hard to read because it assumes
that a variable will continue to live outside of the scope of the
"catch". This might work in PHP but not necessarily in other
languages and can be confusing because of this.
PHPUnit does have standard utilities to work with exceptions:
* In the first example we don't need to catch the exception just to
make the test fail. PHPUnit already does this.
* In the other two examples the PHPUnit way to do this is with
expectException.
The extra assertions in the end don't do much but are needed to not
have the tests marked as risky.
Change-Id: I62220a93ac176c42d4a44724484d05db89fb601c
|
|\ \ \ \ \ \ \
| |_|_|/ / / /
|/| | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Change-Id: I0f8a8cac36015bba52aea3ee2affd92f83d3574a
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Why:
* Code in the CheckUser extension needs to know when the
expectations of a request are defined as POST-nonwrite.
** This is because CheckUser may need to make writes to the DB
as a result of an auto-creation of an account made during a
POST-nonwrite API request.
* This code cannot currently query the TransactionProfiler to
see the expectations for a request, and cannot also easily
see if the API request is non-writing.
** Allowing the CheckUser code to see the expectations for the
number of writes in the request will allow it to instead
insert the data using a job when writes are not expected but
still insert in the usual way when in a POST request that
allows writes.
What:
* Add TransactionProfiler::getExpectation which returns the
TransactionProfiler::FLD_LIMIT value for a given event name
** The method throws an InvalidArgumentException if the event
name provided is not recognised.
* Add tests for the new method.
Bug: T384915
Change-Id: I54dc388557c3b0cb4fd73625132fb64b14f4ddd0
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Extend translation functionality to translate nested parameter properties.
Bug: T383790
Change-Id: I22e95764971a4d886136d227016ce36192b41b7f
|
|\ \ \ \ \ \ |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
* Plumb this value into Parsoid's SiteConfig so that the Parsoid
library code can access this.
Bug: T373253
Bug: T385129
Change-Id: If119ff94e65325fc446ca068e0b2d2434c070a2e
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Bug: T240685
Bug: T364240
Change-Id: Id1fe4ac6127894c9861b0d904c7a55f21deb7455
|
| |/ / / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Why:
- Ief4258ef6d46fb237837907c6ecb96bb3afe6d81 has implemented tracing
support for ObjectCacheFactory via an injected TracerInterface instance.
- This new parameter is typehinted as TelemetryHeadersInterface, which
TracerInterface extends, but in practice always receives a
TracerInterface implementation.
What:
- Make it require TracerInterface.
- Add a test.
Bug: T340552
Change-Id: I653a48ab9d904816ae062896454e7c3193e94fa4
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | | |
Bug: T340552
Change-Id: Ief4258ef6d46fb237837907c6ecb96bb3afe6d81
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This seems the cleaner fix, since we do want to emit output headers
in lowercase, as that's what the rest of mediawiki/core emits nowadays,
as well as basically the rest of the world.
Bug: T384629
Change-Id: I8ea568e316c6e06b8c3d6f370b04be57dcbddc0a
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Using Title::exists does not account for special or interwiki pages which are
also valid redirect targets. Using Title::isKnown instead does no longer cause
the warning to appear when redirecting to a special page or an interwiki link.
Bug: T384393
Change-Id: I35e4c72b0e21aaa36c1f8b1ac85fa819d353945e
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issues spotted while working on I03a9a6945ab27e9888ea21b03985ed713f0a9b50.
Some code style improvements too.
Change-Id: I409d0a1805aa7430cc86e53633f4f85ef8a76dcf
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In ExpiryDef::normalizeExpiry(), throw an InvalidArgumentException if
the expiry string indicates a date outside of the years 0 - 9999. Such
timestamps fail in various exotic ways, so it's best to reject them
early.
Bug: T384241
Change-Id: Ic2110421e8ff1a8892d02b600a0dce965b36c82d
|
|\ \ \ \ |
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Shows a warning when trying to create a redirect that points to another
redirect.
Bug: T326056
Change-Id: Ieb51dde88ce6c23753f74191a85cd40f0bfbd864
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Why:
- It's useful to be able to listen to sets of compatible event types.
What:
- Make DomainEvents aware of a list of types they are compatible with.
- Make EventDispatchEngine dispatch to all compatible listeners,
registered for any of the supported types.
- Move all page events to their own namespace
Bug: T384330
Change-Id: I96bde2cfaf198e409a6ef3a24101ee7d02d57959
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add a REST API hook that allows disabling specific endpoints
or rejecting specific requests, similar to ApiCheckCanExecuteHook.
Bug: T383011
Change-Id: I8518cb1ad7f00594c9f31d7bf934b1ce74f18da9
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Why:
- ScrambleMapping requires either the gmp or bcmath PHP extensions, and
throws an error if neither is loaded.
- One of the test cases in ScrambleMappingTest skips itself if neither
PHP extension is available, but the other doesn't.
What:
- Move the check to a PHPUnit setup function so that it is performed
before every test case in the class.
Change-Id: I2141b06e85d11ba78a713b9ff35af6e9313b9ffc
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Same as Ia294bf4 did for 1-line comments. This patch removes slightly
more complex 2-line PHPDoc comments that don't add any new information
to the code, but literally repeat what the code already says.
They say "don't document the code, code the documentation", and we
are doing this more and more. We just tend to forget to remove the
obsolete comments.
Note I'm also removing a line of text in a few cases when it's very
short and literally says the same as the method name. Again, such
comments add zero new information.
Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I assume these are all either auto-generated by an IDE or the
language-level type declarations have been added later. In any case
the comments don't add any new information to what the code already
says. This is just extra clutter that makes the code harder to read,
I would argue.
There are many, many more comments like this. In this patch I
intentionally focus on the most trivial 1-line comments.
Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As part of T383701, I am planning to add a new hook to the service,
to allow extensions to modify ConditionalUserOptions. That hook
would be cubersome to call from ServiceWiring.
In order to maintain a single pattern, this patch refactors
the service to contain the call.
Bug: T383701
Change-Id: Idf5e84543f996a500a66c72b6bac97d188995de9
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Why:
- Some of the newly implemented propagator functionality is missing unit
tests.
What:
- Add relevant test cases.
Bug: T340552
Change-Id: I63333310f7ca49321768958c6be7a0da1fb73916
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Having these huge objects attached to every Message makes it difficult
to compare them in serialization tests, because they indirectly hold
references to a bajillion services, which are different in the test
providers and the tests, so all comparisons fail unless you reset
each of the bajillion of services or delay constructing the objects.
Bug: T373719
Bug: T376565
Change-Id: I373cc9ec6d44ff2c82ccf143ede12969d7ff8203
|
|\ \ \ \ \ |
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* Add a limit to the HideUserUtils subqueries to avoid error "Subquery
returns more than 1 row". We really want to know if at least one row
exists.
* Fix outdated doc comment
* Add tests.
Bug: T382399
Change-Id: Ib3bc22e0b3080b3ae6e1d2591ac7f2a1ef57c6b3
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This introduces support for invoking listeners before commit,
in addition to after commit.
This also removes the dependency on HookContainer
and adds automatic discovery of the correct invocation mode to
EventSubscriberBase.
Bug: T379775
Change-Id: I16510738477b37129872a887163ec0b84647c94e
|
|\ \ \ \ \ \ |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This patch does two things:
1. Be forgiving about associative arrays with numeric keys. This
is because lists can unintentially become associative arrays (as
a result of side effect) and discarding the keys is not a problem.
2. Correct the spurious error message for truly associative arrays
with non-numeric string keys.
Bug: T322131
Change-Id: I870218023093305a8f414d4de1a73282b5f53b9a
|
| |_|/ / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Also condition using incoming span context upon
$wgAllowExternalReqID
Bug: T340552
Change-Id: Ib1cf361dd800c81a7943231441d58c790191ef5a
|
|\ \ \ \ \ \ |
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* The LightweightObjectStore namespace was experimentally adopted for
two classes in 2020 with change Ia862c5111a3daf10a34fc78163301629,
however in 2024 when we namespaced the BagOStuff component as a
whole, we went with ObjectCache namespace in change Ie01962517e.
* The StorageAwareness class is internal since I836735b1fec8dfd, so
it can be freely renamed.
* Similar to I836735b1fec8dfd, further reduce direct use of it,
keeping it only as effectively an internal trait for adding a
consistent set of constants to 3 classes (Bag, Wan, MemcClient).
Bug: T353529
Bug: T364652
Change-Id: Ib10db39a91274e84a51a2eead94560b8d9137019
|
|\ \ \ \ \ \ |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Avoids weird-looking queries when the same field(+alias) is provided
twice, and throws an exception for potentially incorrect queries when
the provided fields(+aliases) conflict.
Change-Id: I03ba16fc3fce3f1468e518fb08dd65e705ca461f
|
|\| | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
When you add the same field to the query builder more than once,
weird things happen.
Change-Id: I5cb51b262ec954624f531943ff011091102295ae
|
|\ \ \ \ \ \ \ |
|