This was spotted when running tests on Travis (PHP 7.3 nighly, trusty).
Two expressions inside preg_replace() contained non-escaped "-" inside [],
where this "-" meant an actual "-" character.
The warning is because "-" has special meaning inside [] ("a-z" for range),
and things like [\w-.] are considered "invalid range".
Solution is to escape "-" like this: [\w\-.]
Change-Id: I41cc217081f00f54d957b6d8052ee209412f5ff6
* Remove some creation dates, they are not protected by GPL
* Remove duplicate @defgroup API
* Remove @ingroup from some @file doc comments on class files. It is not
useful to list class files alongside classes in the doxygen module menu.
Add @ingroup to some more class files that had @ingroup on their file,
that was probably the author's intent.
* In PackedOverlayImageGallery, use the file comment as a class comment
* Don't put @defgroup and @file in the same comment. @defgroup makes the
whole doc comment describe the group.
* Instead of putting AnsiTermColorer in two groups, use hierarchical
groups.
Change-Id: If54f6e0b2bc1ea6de42045885cf836ee67b8e961
In some cases, the error messages have changed slightly, mostly because
of capitalisation & punctuation.
In a few other cases (mainly UploadStashNotLoggedInException), the content
has also slightly changed (removed mention of the __METHOD__ it occurred in)
Bug: T178291
Change-Id: I184067f2d7fe0a0a2df1114d2525fd9ab95b6c86
With the introduction of CommentStore, selects from various table
require certain joins or column aliases for proper operation. The
upcoming actor table change, and the suggested title table change, will
add more such requirements.
Change-Id: Ic8213bff74b8350b15cd271d0ef252e63e7e79bd
* FSFile should not be responsible for handling this much logic.
* Make more MediaHandler classes aware of the fact that an object
other than File might be passed in. Use the FSFile instead of a
useless empty stdClass object.
* Also added more fields to FSFile::placeholderProps to make it
more complete.
Change-Id: I9fe764b2a7261af507c6555e6a57273cf7d00d36
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.
The old constant is an alias now.
Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
- User parameter is now *required*, remove $wgUser fallback
- We don't actually need the object after construction, don't store it
Change-Id: Id0cc859b70e5d0608ffbfa591bce6a1feb7cc3be
If us_props is too big for the database (> 64kb), don't store the
file handler metadata. This is usually by far the biggest portion
(For pdf/djvu it contains OCR data), and it's non-critical to the
upload process as it's only needed for display, and the file handler
will probably regenerate it anyway if it is missing.
At some point in the future, having data too big for a db field
is probably going to cause errors instead of silent truncation,
so we really don't want to be doing silent truncation.
An alternative way to solve T94562 might be to make it use us_sha1
instead of the one encoded in us_props, but seems like it's important
to fix us_props for other data in it too.
Bug: T94562
Change-Id: I8aed6a1a5c9a136090b36d4ad23d8429791f58c4
Remove empty line comments as found by the
MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.EmptyComment sniff
Change-Id: I5d694f7a7d3bc97e16300ba03c60ad17f3c912a5
Also move creation of UploadStash to main entry point of the special
page to avoid use of context before it is set (by called getUser).
Change-Id: Ibcb17b6ee1b853d807f91104ba428b307e9a5208
There are seven (used) error types in the stash class, and we umbrella'd
them all into one error message, which is mighty silly. This should give
us more information.
Also added to the mw.Api.errors list so UploadWizard can handle them.
Change-Id: I79bf0c29a4cef19363d111cc1128e35256ae572a
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: Ie419638e909a47aa72a274043604247830ee1a81
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I8804ebe0922d3a414863b162a2110e0b9e49b80f
Also swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: Ic36c8c7820a6c2d603f1138130670c6bf6a1ca59
UploadStash::getFile has a "noAuth" parameter, which should be set true
when this is called from UploadStash::removeFileNoAuth.
Callers should already be doing their own auth checking, or calling
UploadStash::removeFile.
Bug: 56298
Change-Id: Ic70c4e2bc6df5cb9b139a3631766f8ff0ec4ef02
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments
Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
If nothing has called getFile() for a key before that key is passed to
removeFileNoAuth(), UploadStash will throw a fatal error when it tries to
remove the file from the filesystem because the UploadStashFile was
never created.
Change-Id: Idf0d2c53ce759b59836f34ff5aaad393b8c371c6
* Clients can send the last chunk with 'async' to get an immediate
response and then check the status of the upload by polling the API
using the 'checkstatus' parameter.
* Pass the User object along to stash functions within UploadFromChunks.
Change-Id: Ie2ad4c7e94862a728e8a687c3195306e16a5059e
* We already compute the props when stashing, so including that in a column
lets us reuse it later when the stashed file is to be published.
Change-Id: I3d6adb6528f1e992d8986058806e745c4e1c0300
* This adds an UnregisteredLocalFile::setLocalReference()
function, which is used to avoid an extra GET request.
* This removes the useless rename() in stashFile(). We just
need to make sure the stashed file has the right extension.
Getting rid of the rename makes setLocalReference() usable.
* Also adds some debug logging with ellapsed time.
Change-Id: I087701ad0c27a4eba74591e6b49f5667b011424c
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
code.
* various undocumented function parameters
* typos in parameters declarations
Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
Currently it shows the error message without any parameters since
$error is an array with the message name and its parameters, and
the Message class thinks that this is a message with its fallbacks
(see wfMessageFallback())
Change-Id: I5d825144795ad108f0a71f90cc530629c5c98a41
stashFile renames files to add an extension, this way it is no longer
cleaned up by php. So we have to unlink it after storing it in the FileRepo.
Change-Id: Iab697fc4535546dd25231dddf220e18f3b0b73be