| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These .htaccess files are intended to prohibit all web access. But if
the user sets "Satisfy Any" on a parent directory, in conjunction with
any permissive require directive like "Require all granted", access will
be allowed despite "Require all denied" in .htaccess.
So, override Satisfy so that the "Require all denied" will reliably take
effect.
Note that "Satisfy All" is the default. This only affects non-default
installations.
Change-Id: Ia5862fb69e439b7ea2ed7af011e1ebf8f1b1f6d6
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I9a74c316b87ae35597ce846a830a55542d9aa14c
|
|/
|
|
|
|
|
|
|
| |
```
PHP Deprecated: strrpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /srv/mediawiki/1.42/includes/libs/filebackend/FileBackend.php on line 1588
```
Bug: T384851
Change-Id: I36c401587d94e7c1ab444d355b03ea88da8fb6e8
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use modern php syntax to call a callable.
Reduce the stack trace to improve performance
and better IDE and static analyzer
Also replace func_get_args with variables
Change-Id: Ie193c4e996ab136e08f1e16c988448d054520aa7
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Use modern php syntax to call a callable.
Reduce the stack trace to improve performance
and better IDE and static analyzer support
Change-Id: I8e563140ac3465ce3b3f8ec5e01bfd493c7269fe
|
|\ \ |
|
| |/
| |
| |
| |
| | |
Bug: T382910
Change-Id: I717e0b45b840ddedb67f402e7b62b46a9b628d85
|
|/
|
|
|
|
|
|
|
| |
Add $string === false or $string === null where $string can have other
types than a string.
Also document null as possible return value in FileRepo.
Change-Id: Iaa29ba01c3fd6bea506debdc6f929edfe881c808
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- code under include/libs must not depend on MediaWiki code
What:
- replaced DeferredUpdates with a callback
- replaced MWTimestamp with ConvertibleTimestamp
Bug: T382910
Change-Id: I85bc06364af65bdd5a4e16474ad8a6f644d4f940
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By passing arrays as native PSR3 context, the values end up as part
of the structured debug logs in Logstash where they can be shown
on-screen, selected, and copied into bug reports as their original
values instead of with JSON-escaping for various characters.
This is not a big deal today since FormatJson defaults to
JSON_UNESCAPED_SLASHES (which is important because most of these
values contain file paths that definitely include slashes). But,
this will change as part of T382910 by removing use FormatJson, and
inlining these gets tedious so instead pass it as native data where
the data is non-trivial, and for others embed the paths within the
string unchanged comma-separated.
Bug: T382910
Change-Id: I79fba128a8129b9ac4da17b513b5da0b03d90bf9
|
|
|
|
|
|
|
|
|
| |
isset() should only be used to suppress errors, not for null check.
When the property is always defined, there is no need to use isset.
Found by a new phan plugin (2efea9f989)
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset
Change-Id: Ib84b7d71e8308a36409f30ecfd16e9de149e97b3
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add more precise type hints to every method I could find that takes
message params as arguments, so that Phan will warn if bool or null
is passed, which is deprecated (T378876).
Errors found in this repository thanks to these checks
are fixed in I286a4a51e879bdf61f65c87dc078621c51045bee.
Bug: T378876
Change-Id: I3e0df790ff9db2fa630f82408a7254a359fe61ca
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Bug: T353458
Change-Id: I49c843c9d8f6459c0fbf774afeea7a82fa564b59
|
|
|
|
|
| |
Bug: T353458
Change-Id: I3b736346550953e3b2977c14dc3eb10edc07cf97
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Callers should not catch an unchecked exception, so it doesn't belong
in a function signature. Unchecked exceptions indicate a coding error,
which by definition the code will not be able to handle correctly.
If any of these exceptions were supposed to be in response to an edge
case, user input, or initial conditions, then they should be changed
to a runtime error. If the exception class cannot be changed, then
the annotation should include a comment explaining its purpose and
prognosis.
Bug: T240672
Change-Id: I2e640b9737cb68090a8e1cb70067d1b74037d647
|
|
|
|
|
|
|
|
|
|
| |
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: I46f46f1855ca32c89a276b06f4e2051ff541886e
|
|
|
|
|
| |
Bug: T366422
Change-Id: Ib3ba7dccc10f8308fc706500c74a2beca357efdf
|
|
|
|
|
|
|
|
|
| |
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
|
|
|
|
|
|
|
|
|
| |
This patch introduces a namespace declaration for the
Wikimedia\Http to MultiHttpClient and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I4ebc1a3b496de08b2b430301da376578d13fcfe6
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This also improves ThumbnailEntryPointTest by allowing it
to assert which headers got sent.
Change-Id: I33911775bce1b3cc7a53a03c2be50d53a28fabd1
|
|\ \ |
|
| |/
| |
| |
| |
| |
| | |
Needed for if you use large objects and you access the url anonymously.
Change-Id: I9aa384f525b0747793bba0c0691cc36b6369ed9b
|
|/
|
|
| |
Change-Id: I8f82724197d20f9289d80e138d80310f1eab29f2
|
|
|
|
|
|
|
|
|
|
|
|
| |
In FileBackend::streamFile(), do not send "headers" in "headless" mode.
In HTTPFileStreamer::stream(), do not treat $headers as an exception.
Just use $headerFunc like with all the other headers.
Nothing relies on the old behavior, and the only things using "headless" are
integration tests anyway. The same holds true for STREAM_HEADLESS.
Change-Id: I75faf9195a713d6a8a8f1273cb9e747980f4d57f
|
|
|
|
|
|
|
|
|
|
| |
"Deny from all" is deprecated; the replacement syntax has been
available since Apache 2.4 (originally released in 2012).
See <https://httpd.apache.org/docs/2.4/howto/access.html>.
Bug: T360850
Change-Id: I825053ccefe34f6ca4e04af5ad2601f79e4d51a7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every Wednesday, we get hundreds of user-visible storage failures,
because there is only one global storage token and it has a lifetime of
one week. The code assumes that requesting a token regularly will avoid
expiry, but that is not the case.
So, when a request fails with a 401, refresh the auth token, then retry
the request. Factor out HTTP request handling to allow this.
Swift gives us the remaining lifetime of the token in seconds, so use
that as the server and process cache expiry time. There will be a
stampede when it expires, but my laptop can do 700 req/s single-
threaded, so it should be OK.
Add tests to cover the cases previously handled by checking the return
value of getAuthentication().
Bug: T358830
Change-Id: If9fe4dde4127592adae1b81e8eb925c4f59443d9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MemoryFileBackend, a class which is only used for testing, does not
correctly respect the ignoreMissingSource option to its move operation.
The copy succeeds due to the forwarded ignoreMissingSource option, so it
proceeds with the source deletion, which fails.
This was implemented in the base class method FileBackendStore
::doMoveInternal, but every other subclass was overriding it.
So, make it abstract, by analogy with doCopyInternal and
doDeleteInternal. Add an implementation specific to MemoryFileBackend
which handles ignoreMissingSource correctly.
Change-Id: Ib5733046d741b962c65db42b5364705b073c4b06
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's possible to run FileBackendIntegrationTest against an actual Swift
server, but there were a few failures when I tried it:
* In SwiftFileBackend::getDirListPageInternal(), fix a PHP warning due
to strpos(null).
* In setUp(), fix exception "Backend domain ID not provided" due to
missing domainId parameter.
* In doTestGetLocalCopyAndReference404(), getLocalCopy() on a sharded
backend for a file that cannot exist, due to having no shard, returns
null not false, which I think is fine. Use a path that can exist so
that the assertion passes.
* In doTestGetFileList(), there is an assertion to confirm that
getFileList() on a non-existent container will return null, but in
Swift this is not known until iteration begins, so it returns an
iterator. Fix the assertion.
Change-Id: If3fc47eb285b51366e7cfd8b6cf6e64bd0f8cd41
|
|/
|
|
|
|
|
|
|
|
|
| |
Remove $fileOpHandles since it was effectively no longer used. Rename
$curFileOpHandles to $batch and note its type. Remove unnecessary
comments and improve the comment about T230245 by explaining what was
going on with that bug.
Followup to I67f9f25b3bc68a389c49c39b7b6def2343bda34e.
Change-Id: I809afc7ce4f2f32018c975ec0073cd8a4af21763
|
|
|
|
|
|
|
|
|
| |
Too many queued FileOps may end up causing 'Too many open files'
failures, and mysterious error messages claiming that existing
files were not found.
Bug: T230245
Change-Id: I67f9f25b3bc68a389c49c39b7b6def2343bda34e
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Add comments to the STATE_* constants and rename cancelled -> noOp.
Change-Id: I17fd8bd296e8845fcddd4e9676d100fbb82b5e6d
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the old pass-by-reference $predicates array and makes the
intent clearer. It also supports lazy-loading of predicated properties,
which useful for avoiding expensive computations like SHA-1 hashes when
they end up not being needed.
Pass FileOp::doPrecheck() a mutable "batch level" FileStatePredicates
instance along with an immutable "operation level" FileStatePredicates
instance. The later can be used in callbacks that need to recall the
predicated file states just before the start of the operation.
Make FileOp::precheckDestExistence() support lazy size/sha1 closures.
Bug: T348294
Change-Id: I709c1920d2bee4b76f69e38c1643a44a73d63265
|
|
|
|
|
|
|
|
|
|
|
| |
* Switch out raw Exceptions, mostly for InvalidArgumentExceptions.
* Fake exceptions triggered to give Monolog a backtrace are for
some reason "traditionally" RuntimeExceptions, instead, so we
continue to use that pattern in remaining locations.
* Just entirely give up on PostgresResultWrapper's resource vs. object mess.
* Drop now-unneeded false positive hits.
Change-Id: Id183ab60994cd9c6dc80401d4ce4de0ddf2b3da0
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For readability. Allowed since PHP 7.4.
I searched for integer literals of 6 or more digits, and also changed
some nearby smaller numbers for consistency.
Bug: T353205
Change-Id: I8518e04889ba8fd52e0f9476a74f8e3e1454b678
|
|/
|
|
|
|
| |
#1 ($string) of type string is deprecated"
Change-Id: Ie4023ba59653c749f717356a2b6d9d52537d8e35
|
|
|
|
|
| |
Bug: T166010
Change-Id: Ibd40734b96fd2900e3ce12239d09becfb4150059
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SwiftBackend theoretical max file size was increased to 5 GB
Sysadmins of MediaWiki are in a better position to judge what
is acceptable performance-wise for uploaded files than we are. The
answer presumably depends significantly on the hardware mediawiki
is running under. This increases the max limit to 32 GB (previously 4GB).
With files this big, operations such as copying and calculating SHA1
do become expensive. However everything still works, albeit with
some delay (I tested on a laptop with HDD, I imagine things are
significantly faster with an NVMe drive).
This changes the overall FileBackendStore limit which affects all
subclasses that haven't overriden the limit, including those from
extensions. Swift was set to 5GB as that backend has to change the
way it uses the Swift API for objects larger than 5GB.
This should not affect ordinary users as $wgMaxUploadSize is by
default only 100 MB in MediaWiki (4GB in Wikimedia).
Bug: T191805
Change-Id: Id091d51b620edbeea2d9df8c75422807bfc7aea0
|