| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Bug: T341434
Change-Id: I51e8fc6d44dddecfba8f7c47fcff9fffdf15e2b0
(cherry picked from commit c397e4ff70bbc604b54602dc315d5918f688622b)
|
|
|
|
|
|
|
|
|
|
|
| |
Use a static call to XMLReader::open() in PHP 8.0.0+.
Remove the check for LIBXML_PARSEHUGE since it is always available in
PHP 7.4+. The #ifdef was removed.
Bug: T330464
Change-Id: I39f050c5d4e461923a84ebb8b3b1d92c021d2e7a
(cherry picked from commit 7aeadbf81bba17051d8d9b52969d4ff398c6b0dd)
|
|
|
|
|
|
|
|
|
| |
If the text key does not exist (which is expected for uploads), the
makeContent function throws an exception.
Bug: T292348
Change-Id: Ib4946e98fc9c53f28cb7d26953985006508dd90a
(cherry picked from commit f862ea57f09a4267a4e989aa4985a2301c29a5e6)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Creation of dynamic property UploadSourceAdapter::$context is deprecated
in php8.2
Prototyp says this property must exists
https://www.php.net/manual/en/class.streamwrapper.php
Bug: T314099
Change-Id: I8f8b42c2ea3351a3becdfac36248f6d371c32fe3
(cherry picked from commit 85ec890e7f3c651687509e99040075027063a1c8)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the new latest
Elsewhere in MediaWiki, ties between revisions with identical
timestamps are resolved by comparing their revision IDs
(see RevisionStore::getRelativeRevision), and the revision being
imported will necessarily have a higher ID than any existing one.
Also, elsewhere in this file we already assume that "multiple
revisions of the same page are imported in order from oldest to
newest" (see code comment on line 142).
Change-Id: I56f0e161e5438d5f77b7d53d4db7411f90f97d05
(cherry picked from commit 92474073a5d23b681007d78940b183d431978f0e)
|
|
|
|
|
|
|
| |
HttpRequestFactory::request returns null on failure, not false
Bug: T315309
Change-Id: Ifeee184abe9faa3e9b45f9cf8db84d35a104fdbb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. The code that processes $logInfo first calls setUserIP(), and then
uncontitionally calls setUsername() with "Unknown user". Because
both setters write to the same field (see I6687305) the IP was never
stored.
2. Flip conditionals to prefer user name over IP. Usually this
shouldn't make a difference. Only one of the two fields should be
set. But if both are set the better logic is to store the name of the
logged in user, instead of silently turning them into an anonymous
one.
I am not sure if this is actually related to the linked tasks,
but might be. The bug was introduced in 2015 via Idf95263 (T121338).
The setUserIP/setUsername problem exists since 2004, see
https://phabricator.wikimedia.org/rMW436a0280.
Bug: T11041
Bug: T236644
Change-Id: I1b8ed89a4190b55d3a9e4ecd9a83b0a042e493be
|
|
|
|
|
|
|
|
| |
The "${var}" and "${expr}" style string interpolations are deprecated in
PHP 8.2. Migrate usages in core to "{$var}" as appropriate.
Bug: T314096
Change-Id: I269bad3d4a68c2b251b3e71a066289d4ad9fd496
|
|
|
|
|
| |
Bug: T312678
Change-Id: I4e523352120ede4cc216ae5035b52f4e83913103
|
|
|
|
|
|
| |
It has been deprecated since 1.31 and it is unused.
Change-Id: Ieb2273939fa5d4244ccf1fd4a653ec784167dfe1
|
|
|
|
|
|
| |
The property has been deprecated since 1.29.
Change-Id: I04ab2fc7aac85f448ebef3bb5bc24aa5c617f233
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I20878f8958329d09b1d4ce88403063a62b70f89f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reasoning:
* Not all code needs an actual User object. And even if, most code
doesn't need it to be validated. That's expensive.
Let the users decide.
* setUserObj() is almost never called anyway. And the few places that
call it go the extra mile and create a User object just to please this
setter. We can avoid or at least postpone this.
* All callers already fall back to getUser() when there is no
getUserObj().
* For a while we try to replace the User class with much smaller
interfaces, whenever possible. This is a chance to remove of one more.
* A "user IP" is a concept that doesn't even exist in this code. The
setter writes to the same property as setUsername(). This makes it
very easy to use these methods wrong, and this indeed already happened
in some places.
Change-Id: I6687305a5be68e8a068f11482625a0a6bd9626f2
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
This is almost always null. All callers expect this already and fall
back to getUser().
It looks like setUserObj() is sometimes called with false. Luckily the
users I can find use the ?: operator and behave the same, no matter
if they get null or false. Let's fix it anyway to make the code less
surprising.
Depends-On: Id019f633a19f925faa1e5890a9b7818bb9e81a84
Change-Id: I128c21c60f6bb017521218933c22e6f1754e9133
|
|
|
|
|
|
|
|
| |
Part 1, proof of concept. Hundreds of files left to go. These changes
brought to you in large part by vim macros.
Bug: T305805
Change-Id: I44789091e9f6394c800a11b29f22528c8dcacf71
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about conditional variable declaration
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T259172
Change-Id: I1f200ac37df7448453688bf464a8250c97313e5d
|
|
|
|
|
|
| |
Found by phan (T304887)
Change-Id: I3105a5fd4826f8667b5232834defc5ec93be32a1
|
|
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
|
|
|
|
|
|
| |
Found by phan strict checks
Change-Id: I83187b5fd25b015d2c75e22d4b5202803653d743
|
|
|
|
| |
Change-Id: I301786f35cd6eb9c63fb72e0b64cffa9efd7b86b
|
|
|
|
| |
Change-Id: I2eb133a9e32116cd155f59086245bc4d15ecbfcc
|
|
|
|
| |
Change-Id: I60b1b4cbc4d17ba068d8d3dfb81d38fea30fb9b3
|
|
|
|
|
|
|
|
|
| |
When the value is a constant, the initialization can be done
way up together with the property declaration. I believe
this makes the code easier to read because it's not spread
out so much.
Change-Id: I5af482feccb746c144c0f318e119165cf5a56cbe
|
|
|
|
|
|
|
|
|
|
| |
As discussed in the task, there is no simple replacement for this
function.
Reduces core PHPUnit error count from 121 to 2.
Bug: T268847
Change-Id: Ia8697e1c3ba369346b39ef50d94ea8b132eb9c80
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI.
Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228
* This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it.
A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki
Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
|
|
|
|
| |
Change-Id: Icaea2b6665cfc3b811d94f70c93452237f5e72bf
|
|
|
|
|
|
|
|
|
|
|
|
| |
PreparedUpdate represents an in-progress edit. It can be used to access
information about the edit from hooks that do to have access to the
PageUpdater. Ideally, the PreparedUpdate or PageUpdater would be passed
to the hook as a parameter. Handlers of legacy hooks may use
WikiPage::prepareUpdate() to access it.
Bug: T242249
Needed-By: I23324a31e06e7e6f28077085c0ade05db63e9a35
Change-Id: Id5ba40a21cc4547205adf2f3a1f725c3a69c24d8
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Id8e4553a054a36011433d5705c699d1c2730456e
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This is an attempt at getting a more useful error message than
"Import failed Expected <mediawiki> tag, got"
(ie. XMLReader thinking that the root tag name is the empty string).
E.g. with the dump file I'm debugging at the moment, after applying
this patch I get "XML error at line 1: Extra content at the end of
the document" instead.
Change-Id: I365eebf78c30b644808eb5ac42d0946c8cf60778
|
|
|
|
|
|
|
|
| |
WikiPage::doEditUpdates() has been deprecated. Using the PageUpdaterFactory's
newDerivedPageDataUpdater() is the new way forward. Also, I made sure to have
the `$options` array with the `causeAction` and `causeAgent` key/value pairs.
Change-Id: I9f2c212d7c83a46799f9f947dc372dc364289680
|
|
|
|
|
|
| |
Constants are harder to misspell
Change-Id: Ie1afcc8580cccf815df1cc97f05a5be81676d9f7
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Queries that query a value "1" are expected to return either
that "1" (possibly as a string), or false. It's safe to simply
cast this to bool and use it as it is.
Queries for COUNT(*) are expected to return that number,
possibly as a string. It's not possible for such a query to
return false. And even if, casting to 0 is fine.
I found an existing code style where the table name and the
"1" are on the same line as the selectField() method name, and
applied it to all similar queries.
Change-Id: I9453196281871c03ef03f653f43762eb9284342f
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
It's documented as string only, but some code (possibly test code) is
passing null, causing failures for I0e7e4a48b56c3e5fde56f50693fd0cdc19c30dd0.
Change-Id: I07e2fc0c6249e8bcda3af99213fcf26f17e6df94
|
|/
|
|
| |
Change-Id: Iaa9360939a7151851c69667b411ae12daa381dbb
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I32d921aaa3a5799777ff62b35608cbedcfff907d
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
The fallback to global state for the services injected into
WikiImporter has been removed with Ide7693a411d, thus these
services need to be injected and are not allowed to be null.
Bug: T283530
Change-Id: Iff6e673f56c48bafad4f7dc5732e136b9359f149
|
|
|
|
|
| |
Bug: T283530
Change-Id: Ide7693a411d76e11bd1611b2ffd269cb1f23799c
|
|\
| |
| |
| | |
check). Remove key to i18n message, no longer being used."
|
| |
| |
| |
| |
| |
| |
| | |
Remove key to i18n message, no longer being used.
Bug: T272079
Change-Id: Id6566e5241b06ba377c2eca083221ee02556365f
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
This change doesn't change any UI messages.
Bug: T54687
Change-Id: Ia62899a2a6fe8910618c35cd667291e397ddb055
|
|/
|
|
|
|
|
|
|
|
| |
Need to rely on RequestContext::getMain() since no user is
available nor is injecting one simple to do (the calling method,
::finishImportPage, is used as a callback and extensions can
replace it with their own callbacks instead)
Bug: T285447
Change-Id: I02e01e52909da51e7001b4acee43567ae645d9a7
|
|
|
|
| |
Change-Id: Iadcb20f76dc0d7623a60d9b8a63b097e6d5d7732
|
|
|
|
|
|
|
|
| |
This patch injects services into WikiImporter. It also adds
a WikiImporterFactory service for creating WikiImporter
instances.
Change-Id: I2966297e5728fca1ae8280361f1008cef6c6041b
|