| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
|
|
| |
Bug: T231636
Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0
Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8
|
|
|
|
| |
Change-Id: Ie6cc415b8440951e3a04be4f28a30aeb47b0954e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These global functions were deprecated in 1.34 and services made
available to replace them. See services below;
* wfFindFile() - MediaWikiServices::getInstance()->getRepoGroup()->findFile()
* wfLocalFind() - MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()->newFile()
NOTES:
* wfFindFile() and wfLocalFind() usages in tests have been ignored
in this change per @Timo's comments about state of objects.
* includes/upload/UploadBase.php also maintained for now as it causes
some failures I don't fully understand, will investigate and handle
it in a follow up patch.
* Also, includes/MovePage.php
Change-Id: I9437494de003f40fbe591321da7b42d16bb732d6
|
|
|
|
|
|
|
|
|
| |
Wikimedia\quietCall() is deprecated and AtEase is here for use.
I would have loved to do restoreWarnings() and suppressWarnings()
in this same patch set but will continue the work for a later patch.
Bug: T182273
Change-Id: I43e3a5f378c99b5c40883b35ba133cbd126fc433
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method User::isBlocked() attempts to answer two questions:
(1) Does the user have a block?
(2) Is the user prevented from performing this action?
The method can answer #1, but it cannot answer #2. Since User::getBlock() can
also answer #1, this method is redundant. The method cannot answer #2 because
there is not enough context in order to answer that question.
If access is being checked against a Title object, all access checks can be
performed with PermissionManager:userCan() which will also check the user's
blocks.
If performing all access checks is not desirable, using
PermissionManager::isBlockedFrom() is also acceptable for only checking if the
user is blocked. This method does *not* determine if the action is allowed,
only that the user's block applies to that Title.
If access is being checked without an existing Title, User::getBlock() can be
used to get the user's block. Then Block::appliesToRight() can be used to
determine if the block applies explicitly to a right (or returns null if
it is unknown or false if explicitly allowed). If the user is creating a new
Title, but the text of the title is not yet known (as in the case of Wikibase),
access should be checked with Block::appliesToNamespace().
Bug: T209004
Change-Id: Ic0ad1b92e957797fee8dcd00bd1092fe69fa58f1
|
|
|
|
|
|
|
|
| |
Note the custom code was not working correctly for filenames that do
not contain a dot. I assume this is not relevant for the filenames this
code needs to process.
Change-Id: Id4578bc86203dcbd9f76928bbec71a2c46176e11
|
|
|
|
|
|
|
| |
These don't add any knowledge to what is already obvious from the
code, I find.
Change-Id: Ia613b6a059f78dbeefdfd020899bd1a6e239a731
|
|
|
|
|
| |
Bug: T182273
Change-Id: Id7d8e176fcd93040e30e46cb64fc6a3d36bc8230
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
|
|
|
|
|
|
|
|
|
| |
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).
Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
|
|
|
|
| |
Change-Id: Ieed41b5d6b0f568fe2872e7754f2feae7868fe7a
|
|
|
|
|
|
|
|
| |
Deprecate the second argument to Maintenance::error() in favor of a new
Maintenance::fatalError() method. This is intended to make it easier to
review flow control in maintenance scripts.
Change-Id: I75699008638f7e99b11210c7bb9e2e131fca7c9e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When uploading a file, there are a few ways of checking for and blocking
(or at least warning about) duplicate uploads already.
However, it occasionally seems to happen that files get uploaded twice.
The exact same file, usually - submitted at (almost) the exact same time
(possibly some error in whatever submits the file upload, but still)
Given 2 uploads at (almost) the exact same time, both of them are stored,
even if they are the exact same files.
The last upload also ends up with a `logging` entry with `log_page = 0`.
I don’t believe such upload should go through: if we do find that a file
is an exact duplicate of something that already exists, I don’t see any
reason it should go through.
Note that with this patch, it will become impossible to reupload a file
with the exact same hash (which was possible before.)
If we still want to allow same-file reuploads while also blocking these
kind of race-condition same-uploads, we could make the check more strict
(e.g. also check timestamps, or check if page already exists, or …)
Bug: T158480
Change-Id: I76cbd2c64c3b893997f1f85974d6f82cbfe121e1
|
|
|
|
|
|
| |
Organize phpcs.xml a bit
Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
|
|
|
|
|
|
|
|
| |
Reverts 84e4d7508893, and parts of cdfe08439c3b and 4511f6fa9fa0.
Bug: T150741
Bug: T167034
Change-Id: I39cfcf2cb231b6dfef569968fba6f473da258916
|
|
|
|
|
|
|
|
|
| |
This allows us to populate X-Content-Dimensions without touching the
existing metadata format. Which makes the migration of existing content a lot faster by
only having to run refreshFileHeaders.
Bug: T150741
Change-Id: I2c0f39b2b01f364c3fab997ccc2f874b7f101d8a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For storage repos that support headers (such as Swift), this will store the original
media dimensions as an extra custom header, X-Content-Dimensions.
The header is formatted to minimize its length when dealing with multipage
documents, by expressing the information as page ranges keyed by dimensions.
Example for a multipage documents with some pages of different sizes:
X-Content-Dimensions: 1903x899:1-9,11/1903x873:10
Example for a single page document:
X-Content-Dimensions: 800x600:1
Bug: T150741
Change-Id: Ic4c6a86557b3705cf75d074753e9ce2ee070a6df
|
|
|
|
|
|
|
|
|
|
| |
I was bored. What? Don't look at me that way.
I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.
Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the importImages maintenance script offers an option
to sleep an arbitrary amount of seconds after each upload.
The current logic implementation had a side effect to also sleep
after the last image upload. This is not a desired behavior, as
the tasks are done and a clean exit with a report are welcome.
Instead, sleep will now occur before the second upload and the
ones to follow.
Change-Id: Ia675f210582c3075e9b59b002a00cb1fc4b44cac
|
|
|
|
|
|
| |
I even tested it!
Change-Id: I999f5842625c752f01c1eb4b012431c4a24ce7ce
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Change-Id: Ibd3d617901130378a935402326cd4eefbb382c9e
|
|
|
|
|
|
|
|
| |
Status::getWikiText is used for internal logging, api error messages and
maintenance scripts. All this places are usually in english, so pass an
english language to getWikiText.
Change-Id: I3010fca8eb5740a3a851c55a8b12e171714c78f7
|
|
|
|
|
|
| |
options so they are usable
Change-Id: Ia3ba7ed221a4cf7fcf78a6c64f5a59109a1b886d
|
|
|
|
|
|
|
|
|
|
| |
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
|
|
|
|
|
| |
Bug: T78060
Change-Id: I545ea8f28ff3a1aac03c29d27355c0371632ef4d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AuthManager is coming, which will make it easier to add alternative
methods of authentication. But in order to do that, we need to finally
get around to ripping the password-related bits out of the User class.
The password expiration handling isn't used anywhere in core or
extensions in Gerrit beyond testing for expired passwords on login and
resetting the expiry date on password change. Those bits have been
inlined and the functions removed; AuthManager will allow each
"authentication provider" to handle its own password expiration.
The methods for fetching passwords, including the fact that mPassword
and other fields are public, has also been removed. This is already
broken in combination with basically any extension that messes with
authentication, and the major use outside of that was in creating
system users like MassMessage's "MediaWiki message delivery" user.
Password setting methods are silently deprecated, since most of the
replacements won't be available until AuthManager. But uses in unit
testing can be replaced with TestUser::setPasswordForUser() immediately.
User::randomPassword() and User::getPasswordFactory() don't really
belong in User either. For the former a new PasswordFactory method has
been created, while the latter should just be replaced by the two lines
to create a PasswordFactory via its constructor.
Bug: T47716
Change-Id: I2c736ad72d946fa9b859e6cd335fa58aececc0d5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.
Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.
Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.
Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
|
|
|
|
| |
Change-Id: I0a2485f1a9426183e1b1c5a5b6e95966f23da237
|
|
|
|
| |
Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
|
|
|
|
| |
Change-Id: Ib9ee255740681f0d32d76b75ef33b369bc87bcc1
|
|
|
|
|
|
|
|
| |
If the summary parameter is not set, then use the page text of the
given page, NOT that of the first image uploaded.
Bug: 55885
Change-Id: I00ced9d2ce62fc1a00f26ff513866359cf96d535
|
|
|
|
|
| |
Bug: 55883
Change-Id: I695e080000f6abec3ded966f12af3e25c585c3ba
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.
Also updated usage in text in documentation and the
installer LocalSettingsGenerator.
Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;
Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
|
|
|
|
| |
Change-Id: Id65de095d7d7b697092a369f429b9e3b171d3e38
|
|
|
|
|
|
| |
Removed parenthesis after echo
Change-Id: Ia533aedf63b11d15dcc6a5cf75a56134a4b11d86
|
|
|
|
|
|
|
|
|
| |
importImages maintenance script was not updating file metadata
when overwriting files. Bring code in importImages in line with
LocalFile::upload
Bug: 47483
Change-Id: I0e879604ce76ed78708a36df46b58fb3b8a7d6d2
|
|
|
|
|
|
|
| |
Added spaces before if, foreach
Added some braces for one line statements
Change-Id: I9657f72996358f8c1c154cea1ea97970d973723c
|
|
|
|
|
|
|
|
|
| |
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
|
|
|
|
| |
Change-Id: I73a0d42884c1006492cd3de912eb1dc6dab08c5e
|
|
|
|
|
|
| |
This tabs are strange and a space there is better
Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
|
|
|
|
|
|
|
| |
--timestamp overrides upload timestamp
--summary sets upload summary
Change-Id: I930c8b1ce55af0543a41f412ecf702715c82c6df
|
|
|
|
|
|
| |
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)
Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
|
|
|
|
| |
Change-Id: If0af9922ede902c2c6f18b627d5810f3e888c944
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/110168
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
into WikiPage::doUpdateRestrictions(); older methods still work for backward compatibility, but marked Title::updateTitleProtection() as deprecated and for removal in 1.20 since no extension calls it
* Removed permissions check from WikiPage::doUpdateRestrictions() and left it for callers, resolves the todo from documentation
* Inverted $expiry and $reason parameter between WikiPage::doUpdateRestrictions() and WikiPage::updateRestrictions() for more consistency; WikiPage::doUpdateRestrictions() also requires all parameters to be passed
* WikiPage::doUpdateRestrictions() returns a Status object instead of bool for the older one; only possible error at the moment is a read-only database
* Updated core calls to these functions
* Made maintenance scripts using it simply protect all actions returned by Title::getRestrictionTypes() instead of hardcoded 'edit' and 'move'
* This also means that protect.php can be used to protect a non-existing page for creation
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/106567
|
|
|
|
|
|
|
| |
Unindent most of the code
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/100267
|
|
|
|
|
|
|
|
|
| |
Trimming trailing whitespace also
Doing in 3 commits (3/3), so hopefully reviewable in CR...
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/90282
|
|
|
|
|
|
|
|
|
|
| |
maintenance/waitForSlave.php still calls the old prototype.
Most instances were replaced with
sed -i 's/wfWaitForSlaves( [0-9]* );/wfWaitForSlaves();/' ./maintenance/initEditCount.php ./maintenance/updateRestrictions.php ./maintenance/updateSpecialPages.php ./maintenance/importDump.php ./maintenance/moveBatch.php ./maintenance/storage/resolveStubs.php ./maintenance/storage/trackBlobs.php ./maintenance/storage/fixBug20757.php ./maintenance/storage/moveToExternal.php ./maintenance/storage/compressOld.inc ./maintenance/populateSha1.php ./maintenance/deleteDefaultMessages.php ./maintenance/migrateUserGroup.php ./maintenance/importImages.php ./maintenance/runJobs.php ./maintenance/archives/upgradeLogging.php ./maintenance/deleteBatch.php ./maintenance/populateLogSearch.php ./maintenance/populateLogUsertext.php ./maintenance/gearman/gearmanWorker.php ./maintenance/populateRevisionLength.php ./maintenance/refreshLinks.php ./maintenance/deleteSelfExternals.php ./maintenance/upgrade1_5.php ./maintenance/rebuildFileCache.php ./includes/job/RefreshLinksJob.php ./includes/installer/MysqlUpdater.php ./maintenance/convertUserOptions.php ./maintenance/populateParentId.php ./maintenance/runBatchedQuery.php ./maintenance/upgrade1_5.php ./maintenance/waitForSlave.php ./maintenance/populateCategory.php ./maintenance/importImages.php
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/86447
|
|
|
|
|
|
|
| |
messages on failure. (as in pass along the errors generated from publish() )
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/78662
|