These requests are usually sent to a wiki operated by a different
organization so UA etiquette is important.
* Add the site's URL (the URL of the main page, more specifically)
as a contact address.
* Add the site's URL as a referer as well.
Considered but not done:
* Use $wgEmergencyContact as the contact part of the UA. It's not
guaranteed to be set correctly, while the main page URL always
exists and will usually be enough to pinpoint the wiki (except
maybe in some intranet scenarios).
* Include information about the user making the request. Would
be a privacy risk + probably useless due to caching.
* Include information about the page the request is for. Would
require lots of refactoring (making the patch harder to
backport) or relying on the context title (which might be
fragile), and in any case probably unreliable due to caching,
and doesn't seem very relevant to the operator of the foreign
site.
Bug: T400881
Change-Id: I968fac6ee0ebbc5a2bd3244f57851eb64125c93d
Catch the exception and return Http Code 400 as already done in the
class for the non-redirect code path.
To get the exception, visit /thumb.php?f=Redirect.jpg
Bug: T387684
Change-Id: I45202572dfce8b60a8aed9343f7d99e2eee12415
(cherry picked from commit b43c89b297e895cb77fbf0f9efd987c6dbf7f50e)
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)
The messages in the output are in user interface language:
curl -i -H 'Accept-Language: nl' http://localhost/mediawiki/img_auth.php
Change-Id: Ie42af75b1adb1c77968d0f9b8be24c47cdbf05df
(cherry picked from commit 180763bdfa3906539c752686fb4a5101593bdac8)
* Add FileBackend::addShellboxInputFile(), allowing Shellbox to read
directly from a FileBackend. Add generic, FS and Swift
implementations.
* Add FileRepo wrapper, which takes a FileRepo virtual URL.
* Add File::addToShellboxCommand(), which allows a File to be used as
input in a Shellbox command.
* Add configuration.
* Extend FileBackend::getFileHttpUrl(), adding method and ipRange
parameters. Unindent existing code.
I was going to add support for PUT requests, but I reverted it due to
the impossibility of supporting FileBackendMultiWrite. I left the method
parameter in getFileHttpUrl().
Bug: T292322
Change-Id: If9487a0c9586065bf044b69ac04cc7a06b6e8856
(cherry picked from commit 8cdde9dcb03e33332e49aed06aa71b60ae2c9b33)
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
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: Ifbc2ce0c68865c5d32689e56c6215a5099f7478b
get_debug_type() does the same thing but better (spelling type names
in the same way as in type declarations, and including names of
object classes and resource types). It was added in PHP 8, but the
symfony/polyfill-php80 package provides it while we still support 7.4.
Also remove uses of get_class() and get_resource_type() where the new
method already provides the same information.
For reference:
https://www.php.net/manual/en/function.get-debug-type.phphttps://www.php.net/manual/en/function.gettype.php
In this commit I'm only changing code where it looks like the result
is used only for some king of debug, log, or test output. This
probably won't break anything important, but I'm not sure whether
anything might depend on the exact values.
Change-Id: I7c1f0a8f669228643e86f8e511c0e26a2edb2948
In change I625a48a6ecd3fad5c2ed76b23343a0fef91e1b83 I am planning to
make Wikimedia\Message\MessageValue use it, and we try to pretend that
it is a library separate from MediaWiki, so it makes sense to move
MessageSpecifier to the same namespace under Wikimedia\.
Bug: T353458
Change-Id: I9ff4ff7beb098b60c92f564591937c7d789c6684
Avoid the call to internal constructor of AndExpressionGroup and
OrExpressionGroup by creating a factory function similiar as the
IReadableDatabase::expr function for Expression objects.
This is also a replacement for calls to ISQLPlatform::makeList with
LIST_AND or LIST_OR argument to reduce passing sql as string to the
query builders.
Created two functions to allow the return type to be set for both
expression group to allow further calls of ->and() or ->or() on the
returned object.
Depending on the length of the array argument to makeList() it is
sometimes hard to see if the list gets converted to AND or OR, having
the operator in the function name makes it easier to read, so two
functions are helpful in this case as well.
Bug: T358961
Change-Id: Ica29689cbd0b111b099bb09b20845f85ae4c3376
This is currently guaranteed, and a lot of code already relies on
it, e.g. in the FileImporter extension. It's de-facto part of the
stable interface already, just not well documented.
The original @stable was added in 2020 via I635f0fd.
Change-Id: Ia6096a1a0934bc4301fff6baf96c5952dac8809c
TimingMetric->start() and stop() cannot handle recursion due to statefulness.
To fix, we'll measure the metric manually so that the sample will be
captured in a single operation.
Bug: T367110
Bug: T367928
Change-Id: I663d32e0211df35d5295bf2a09175e6fdcb4c5ed
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
Nowadays files transferred to browser via text/* MIME are also getting
automatic dark mode by the browsers so this makes these simple pages
compatible with those features of the browsers.
Change-Id: Id8360ff3ca6dbe7b78e30194fde292763479cb21
Follow-up to commit 250b23aa, which removed the override in LocalFile
and the call to it, but left this stub.
Change-Id: Ie269e2f78010f016962f82b5bab3ed7d9b03b365
Updates:
* media.thumbnail.generate.bucket
* media.thumbnail.generate.fetchoriginal
* media.thumbnail.generate.store
* media.thumbnail.generate.transform
This doesn't attempt to label the multiple generate methods
becuase they appear to me to have very heterogeneous
functionality
Patches squashed into this commit:
* I652f31fd8a553b8f197fb51ffd2cca34199c7394
* I8edc96668b4e5968b8b44dc92fe4fdc3f29fcbab
* I8edc96668b4e5968b8b44dc92fe4fdc3f29fcbab
Bug: T359344
Change-Id: Icec6600b4751568ef93f9fbe9e2063770d405bcb
This patch introduces a namespace declaration for the
Wikimedia\FileBackend to FileBackend and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: Id897687b1d679fd7d179e3a32e617aae10ebff33
This patch introduces a namespace declaration for the
MediaWiki\Json to FormatJson and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I5e1311e4eb7a878a7db319b725ae262f40671c32
The idea is that all entry points should share the code in the
MediaWikiEntryPoint base class. This change just moves code from
the file scope into a class, without any structural changes.
Bug: T354216
Change-Id: Ie2e827d30a070bcc63bdce56891c3aa0a4dacddd
This cases cannot benefit from the SelectQueryBuilder as each argument
get processed by hooks with fix signature or coming from abstract
functions providing the arguments separate.
Bug: T344971
Change-Id: I6490caae3984efaae81bd2583220a7dd1c3b371d
Also removing a test from WatchedItemQueryServiceUnitTest. These tests
have been written extremely poorly and have caused issue many times over
the years not allowing us to do any refactors. There are still pretty
good integration tests in place.
Bug: T361023
Change-Id: I400294fbbe70ac98508f254a4ed72be14e018975
This code was previously removed from thumb.php
in 7acfa6a0a5,
accidentally reintroduced in ThumbnailEntryPoint
in 9638fa314a.
Change-Id: I1afaf98d87e0b8372f5a9b776883eb4d3d1da683