| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Changes to the use statements and some additions
are done automatically via script
This also updates @covers tag for the namespaced classes
Change-Id: I859ba6d05018c99710b744e2becab432410d3bca
|
|
|
|
|
|
|
|
|
| |
A constant is not a variable. The type is hard-coded via the value
and can never change. While the extra @var probably doesn't hurt much,
it's redundant and error-prone and can't provide any additional
information.
Change-Id: Iee1f36a1905d9b9c6b26d0684b7848571f0c1733
|
|
|
|
|
| |
Bug: T353458
Change-Id: If0137003ab625017d322d57870448a02569668c3
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I07ce1f37d1bfb18d6e73dd008a712b3ca60a80e9
|
|
|
|
|
|
|
| |
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Iae45fa269363be8ee05c598ea6926514ce817762
|
|
|
|
|
|
|
| |
This will be useful in making the upload async and allow us
to retrieve the status of an upload remotely.
Change-Id: I7279185b3c5ece5f4177c0550ca0852810c8f052
|
|
|
|
| |
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Ic8c210e9223f93ecf66ad2e09de7838f0cd79f70
|
| |
| |
| |
| |
| |
| |
| | |
Ideally we'd use Authority, but that doesn't always work, so just call
the getTest* methods directly.
Change-Id: I7f8393bb754beeb319b5555b5dac05265e376a22
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This property shouldn't be needed in modern code, where most things can
use Authority. So much so because TestUser adds a dependency on the
database, but many tests that use TestUser don't even need the database.
ApiTestCase, in particular, sets this property in setUp, thus adding a
database dependency to all API tests, including those that don't need
users or the database at all.
Deprecate the property and replace existing usages in core. The one in
ApiTestCase is much harder to migrate, but this patch replaces the array
with an anonymous ArrayAccess class to allow lazy initialization and
remove DB dependencies.
Bug: T155147
Change-Id: I59c4ed1f6a7572d3a92387b15b8e56625bc376a2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Error messages are not guaranteed to be stable, and these tests
prevent us from improving them.
Error codes are supposed to be stable, so we should be asserting
that they do not change (especially since many of them are
dynamically generated by the dodgy code in ApiMessageTrait).
Introduce helpers assertApiErrorCode() and expectApiErrorCode()
to be used instead of the usual PHPUnit assertions/expectations
for this case.
Change-Id: I752f82f29bf5f9405ea117ebf9e5cf70335464ad
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.
Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.
Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
|
|
|
|
| |
Change-Id: I1587380f669d5434c7f32ed359ab48fc6f79ce6b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
These classes:
- MergeHistory
- MovePage
- ProtectionForm
- BadFileLookup (to MediaWiki\Page\File)
- FileDeleteForm (to MediaWiki\Page\File)
Bug: T321882
Change-Id: Ibeb488ba322c62a34042a0307bbb5562773bcad1
|
|
|
|
|
|
|
|
| |
Inkscape has an attribute only-selected in it's namespace which
is not interpreted by browsers and should be safe upload.
Bug: T288186
Change-Id: I044f225aef813efc708eb96f588fc55733d165f3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Redoing I5ea70120d74 but without moving WebRequest that caused issues
with phan-taint-plugin.
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequestUpload
Bug: T321882
Change-Id: I832b133aaf61ee9f6190b0227d2f3de99bd1717b
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2bdc0b2b7209441a42a784157633a8a01b321922.
Reason for revert: T166010#8349431
Bug: T166010
Change-Id: Idcd3025647aec99532f5d69b9c1718c531761283
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequest
- WebRequestUpload
Bug: T166010
Change-Id: I5ea70120d745f2876ae31d039f3f8a51e49e9ad8
|
|
|
|
|
|
|
|
| |
Introduced in PHP 7.1. Because it's shorter and looks nice.
I used regex replacement.
Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
|
|
|
|
| |
Change-Id: I1b0e8e2cf4d85ae5ce8ad090cfc47f5086350702
|
|
|
|
|
|
|
|
|
| |
UTF-8 is a strict superset of us-ascii, so any us-ascii file is a valid
UTF-8 file. So therefore it should be a safe encoding to use as it does
not allow you to hide JavaScript, unlike with UTF-7.
Bug: T278386
Change-Id: I0e52120812e3a0bd5112fe2c240ebb2d5d00ebc7
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces a new system message,
MediaWiki:copyupload-allowed-domains, which lets sysops to define which
domains can be used with the upload-by-url tool. This feature is behind
an off-by-default feature flag, which lets system administrators
disable this feature if it is not wanted.
Bug: T300407
Change-Id: Iae7dafbd71182695444210409d550e5b6d10928b
|
|
|
|
|
|
|
| |
This ensures that assertions work in a uniform way,
and provides meaningful messages in cause of failure.
Change-Id: Ic01715b9a55444d3df6b5d4097e78cb8ac082b3e
|
|
|
|
|
|
|
|
|
|
|
| |
There is a common and reasonable need for longer lines in tests.
The nudge for shorter lines doesn't seem valuable here. The natural
breaks will likely still fall in 80-100 given the enforced practice
for non-test code, e.g. whether through habit, or 80-100 column markers
in text editors, or the finite width of diff and code review
interfaces.
Change-Id: I879479e13551789a67624ce66f0946d2f185e6ee
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Icdb301d352d302f70fefba9b40df2368cb217fd2
|
|/
|
|
| |
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
|
|
|
|
|
|
|
|
|
| |
Add a new helper to MediaWikiIntegrationTestCase, since deleting pages
seems to be pretty common in tests.
Some calls to WikiPage::factory were also updated to use WikiPageFactory.
Change-Id: I5b5100273a00ac292a1900022ca79708fa254347
|
|
|
|
|
|
|
| |
This reverts commit 0d75fdb4f73ddbf4ad5f29e14258d58e507d55b4.
Bug: T287542
Change-Id: Iedd3461869f973f8d621a39e6ad4674cbb577551
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) The following methods were hard deprecated:
- User::addAutopromoteOnceGroups
- User::getEffectiveGroups
- User::getAutomaticGroups
- User::getFormerGroups
2) User ::getGroups, ::getGroupMemberships, ::addGroup,
::removeGroup were replaced in the production code,
but they were not hard deprecated because of conflict
with UserRightsProxy class.
Bug: T275148
Change-Id: Ia69598316f5dc5dd9511f6112b5b13e1aa07575a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
The following sniffs now pass and were enabled:
* Generic.ControlStructures.InlineControlStructure
* MediaWiki.PHPUnit.AssertCount.NotUsed
npm:
* svgo: 2.3.0 → 2.3.1
* https://npmjs.com/advisories/1754 (CVE-2021-33587)
Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
|
|
|
|
| |
Change-Id: I079d2c802d9b48d6abf7f37fa9ef7dafac631345
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.
Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
|
|
|
|
| |
Change-Id: Ic663e81cca0bf007804a70772250914a85f1fef4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The InterwikiLoadPrefix hook isn't compatible with Parsoid, as it is
unidirectional and doesn't support enumerating all valid prefixes
(T270444). Set/reset $wgInterwikiCache to mock the interwiki table
for parserTests and other unit tests instead.
This is a soft deprecation, as the used-in-production
Extension:Interwiki still uses InterwikiLoadPrefix, although not in a
way that would break Parsoid (since $wgInterwikiCache is set in
production).
Bug: T270444
Change-Id: If2507017c99c4ee42c104a0890bc45a84d7239d5
|
|
|
|
| |
Change-Id: I63476388655ae317453b9ebca793329a23519a4c
|
|
|
|
|
|
|
|
| |
This reverts commit b35ab283b223c64705ccffa56af9c3be129126fb.
Bug: T265024
Bug: T262443
Change-Id: I65ddf30805ba8a2932af57ee28fc2c4700c3490f
|
|
|
|
|
|
|
|
|
| |
Tests should not make real HTTP requests. Mock out the
HTTPRequestFactory service to prevent this.
Bug: T262443
Depends-On: I63bfd54c3de55d678e8b862b85c0adfb5fc94d91
Change-Id: I1702c11928f8760bb41b41f4c7c04d7af03f62e2
|
|
|
|
|
|
|
|
|
|
|
| |
MockHttpTrait can be used by tests that need to simulate HTTP requests.
Bug: T262443
Needed-By: I1832cb1858ef4cf42ec34cb7fda509ce5b951c27
Needed-By: I390856b4609635cee22253071f21ce63ff716791
Needed-By: Iff24b55dfaf7a4e02a4c80aaeaf0366de5660ef1
Needed-By: Ia8213725839e4b697c4985060bc35593fea622bc
Change-Id: I8ce17da7315b87b8dd0e502e601b9ac488089456
|
|
|
|
|
|
|
|
|
|
|
| |
The upload function saved the redirect page(s) content together with the upload file content which would produce an incorrect MIME type (text/html instead of actual upload MIME type). Disabled the automatic redirect and reset the file content until the final file location or the maximum number of redirect is reached.
This patch also touches WatchedItemQueryServiceIntegrationTest to make
it more robust. Without this change, UploadFromUrlTest interfered with
WatchedItemQueryServiceIntegrationTest in some way, causing it to fail.
Bug: T258122
Change-Id: I1de709576c02ce5b31b356751680cbd23689a3fa
|
|
|
|
|
|
|
|
| |
This test currently fails if it cannot download a file from
http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png
Bug: T262443
Change-Id: I3d0438f6f47e129b2a7b52833f7ab9fb0781bf48
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)
My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.
Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Update the two "processing_instruction_handler" and
"external_dtd_handler" callbacks to use a syntax for the callback
that doesn't stuff the class name in a string, but actually
references the class.
* We don't need call_user_func() in modern PHP7 any more.
* Add and update a few type hints in UploadBase to make the code
easier explorable.
Change-Id: I0ab3cfbe4f0bf15b1da4ab10fd9ffc1986d968d0
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The exception serves no purpose, and can only really be triggered via
a test. The API prevents no file extension at all, as does UW js.
This function (for whatever reason, probably a seperate bug) cannot
get the extension from a stashed stl file (seems to work fine for
other types).
With what/how it's actually used, it doens't really matter if
we can't get the extension, we get it by more robust methods later
on.
This partially reverts 0a82600a27. Before the changes in that commit,
the exception was unreachable.
Bug: T254078
Change-Id: I0a7bd13fe8e08c7d4a75b4a3709661dbbf53d6cb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problematic code:
$extensions = explode( ' ', $magic->getExtensionsForType( $mimeType ) );
if ( count( $extensions ) ) {
$extension = $extensions[0];
}
If $mimeType is not known to MediaWiki,
$magic->getExtensionsForType($mimeType) will return null.
explode( ' ', null ) is [""]. (Thank you so much, PHP!)
This means $extensions is nonempty (it contains the empty string), so
$extension is set to ''.
Change-Id: Icf387a9c93cb7351c2f48c69f413e7ad2224ba6b
|
|
|
|
|
|
|
| |
Not including WikiPageDbTestBase, which is testing the method
Bug: T248000
Change-Id: I1848a79be9e25759654053e88ef956269342f588
|
|
|
|
| |
Change-Id: Iceec961de4f0cc689f7d3b981afac923b46c98f6
|