Update language fallback chain to zh-hans <=> zh-hant bidirectional to prevent adding translation
duplicates in zh and zh-hans.
Add en magic words in zh message file to prevent fallback to translations of language variants.
Bug: T286291
Bug: T296188
Bug: T252367
Bug: T278639
Related: I484d4cba1e16fce0f7c433a865f3acf676b818c1
Related: Idf39310b4b66f9c5f210d1717e0e47b9e598c13c
Change-Id: I3b30303118ae8cd87dc5f2016372f0de89a7b075
Add action links for deletion and protection on Changeslist.php.
This will make links more consistent with the log page entries.
Bug: T49466
Change-Id: Ic1fdb2b4280bdeac521323aafe4548819778c870
When deleting a page/file:
* Show warning when a file talk page has subpages
* Fix link to Special:PrefixIndex so that only the subpages
are listed
Follow-Up: I5660540f11b9ec74d573684f5d70266ca0df95b5
Bug: T305268
Change-Id: Ia500c79ad09bda4d03f9a172c7ae35ce1665e073
This reverts commit 123f785cdf.
Reason for revert: This breaks parserTests.php script since the ParserTestRunner script has references to both TestFileReader classes and this patch ends up using the same reader everywhere.
Change-Id: I22bdd05f9a86674e88335cc9055f1ce6cfa128d1
Fix and simplify the flags to executeQuery(). The QUERY_CHANGE_ROWS flag
caused the DB_REPLICA role check to be violated.
Remove the UNLOCK TABLES query since lockTables()/unlockTables() have
since been removed.
Bug: T306632
Change-Id: I8fcf940028abd70c0d66bec1780308d3c2367b61
The order in the result row is build using a message,
which needs the new parameter in the english message text.
The stylesheet mediawiki.interface.helpers.style is needed to show
parenthesis around the tags. It also adds parenthesis to the "bytes",
makes the comment in italic and format revision deleted information in
strike-grey.
Bug: T309647
Change-Id: I1fb481e6e62372874e3c65ec5e4cebf17291217f
These methods are not uncommon in a REST framework, so it'd be useful to
have a shorthand for them.
Add QUnit tests, copying the one for post().
Note that the REST framework actually ignores the request body for
DELETE requests, but we may want to change that (T309388), and so it is
supported here.
Change-Id: I9a4372314be1785c2124be354bd4151d595b6260
Group all comments things and all revdel things together
Follow-Up: I7dedebd3bce3b4aec127738edc81b180325f0836
Change-Id: I98cb2342059c54b8ad97e1efc1d90e0e563b408e
This reverts commit ec3da4589bebeb46d7f1544dc46f24baec334966.
Caused frequent session loss in the Wikimedia cluster.
Bug: T299193
Bug: T309616
Change-Id: I3a410df88071d72078672cf1b670e81c11b28117
(cherry picked from commit d1a1fcedc9eace8a5f4a8454eff44a7ed898848a)
In a default installation of Mediawiki, the article URLs use the URL GET
parameter "title" to construct the page title (index.php?title=Foo).
When a form is submitted, that parameter is added to the form as a
hidden field. Before this patch, it's added as last element of the form,
which makes the URL confusing. For example, when running a search on the
Lint errors, the URL becomes
index.php?pagename=Test&title=Special%3ALintErrors instead of starting
with title=Special:LintErrors as one would expect.
Note that this is not an issue on wikis that set their article path to
look like /wiki/Foo: in that case, the title of the page is not set as
a hidden field.
Change-Id: Id7c0617166754010cec987158e14ac54ddc94444
We cannot access MW services in a data provider, as MW will not have
bootstrapped by this point in plain PHPUnit. And we do not want to
bootstrap MW by the time a dataProvider is executing, because unit tests
should not need (nor be able to access) MW services.
Change-Id: I21a5993f91b8fbe3fa476a8244b8911cf81e1d5f
This would be useful in cases that lots of edits happen at the same time
and this would reduce the time waiting to get the row lock.
Bug: T306589
Change-Id: I3b869e3b85dfd66575390ef4247f2f81f19c878e
Currently, MediaWiki avoids CDN caching if the URL is not among the list
of canonical URLs that we purge, which can cause all sorts of issues
including caching being extremely narrow.
ViewAction is cache invariant and better to be cached unconditionally.
This effectively undoes part of Ie38ae198b1735339371 (2012). Similar
to the existing setCdnMaxage() calls, this is not expected to risk
caching of private information given that a separate layer is
responsible for deciding whether caching is "safe" from an application
point of view. Callint setCdnMaxage() does not affect whether CDN
caching is allowed, its just that the default maxage is 0 for cases
where it is safe, and this change effectively raises it to 1h for
arbitrary URLs that effectively route to action=view, including e.g.
diff URLs and oldid URLs, but e.g. not any other action parameters.
Bug: T309063
Change-Id: I468caa8fd4baf650b419572b77b3df64ae72780d
SessionBackend::save() results in the session provider unpersisting
when the session backend metadata is dirty (which is always true
for a new session). This breaks the tombstone mechanism introduced
in I3a76b67aa51159ebf0195db15cf7c34e00a64a2e: after the manager
refuses to load the tombstoned session, it will create an empty
session, and that will unpersist the session ID and log the user
out if the session ID was the only thing that kept them logged in.
Saving the session has two effects: the unpersisting (invalid
cookies are cleaned up) and saving the session data in in-process
cache (but not the real storage). The latter might cause an extra
session storage read per unauthenticated request, though in theory
it shouldn't as the SessionBackend itself gets cached so a new
session lookup only happens for a different WebRequest object.
Still, if it becomes a problem, we can just add some sort of
explicit cache warming step to empty session creation.
Skipping the unpersisting could mean that invalid (e.g. expired)
session cookies stick around and prevent the user from being
served from edge cache. But for non-tombstoned requests, as long
as there is a syntactically valid session ID and either no user
ID or a user ID pointing to a valid user, CookieSessionProvider
will return a non-null session info, and SessionManager will
reject it and unpersist; and CentralAuthSessionProvider behaves
similarly except for the case when there is no local session
cookie but there is a global session cookie on the second-level
domain. That seems a narrow enough edge case to ignore.
Bug: T299193
Change-Id: Ib34a84d1d3abbce4dcf7433b51abf6e694984c59
As a means of understanding the usage of the stash FEAT for
/page/html & /revision/html endpoints used by VE extension,
this patch introduces the collection of stats using the
StatsDataFactory.
Bug: T309017
Change-Id: I4e17d50e79da263637bdd55ab62e993df441fe38
Follows-up I56a0ee74595404e1, I38a0761ae4633 and I6c3d186de1877f73d4.
Remove most "Usage" examples as these are internal and
mostly-normalized class fields. This is not where end-users should
look for documentation. Besides, many of the examples were wrong or
outdated, and almost all were incomplete. It also had an inherent
dilimma between describing all possible valid input and describing
what we actually store in that instance variable after normalization
in the class constructor. The usage docs have long been moved
to the MW config file, so we can omit that.
In its stead, place more complete and accurate type hints for Phan
to understand the possible code paths, in particular to reflect
the use of FilePath objects.
Change-Id: I1cc002f350785d3f46f79be5defb7b3cadbebf34
All revision related classes are namespaced MediaWiki\Revision
instead of MediaWiki\Storage since 1.32. The old namespaced
class names are deprecated and only kept for backwards-compatibility.
Bug: T305784
Change-Id: I48cdc65301a8cd20d2bedd031dbdae33b8c2a34d