This change renames the existing method `codePointAt` to `charAt` and
make it public. This method is similar to `String.prototype.charAt()`
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt
but supports Unicode characters outside of the BMP.
The name `codePointAt` would be irritating because the method
`String.prototype.codePointAt()`
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt
returns the code point number of the character instead of the character
as string.
Use this method to fix in the module 'mediawiki.jqueryMsg' the
functions `int`, `ucfirst` and `lcfirst` for strings with a character
outside of the Unicode BMP as first character.
Also add tests and use the usual Unicode syntax in the tests.
Bug: T285174
Change-Id: I4343e628e846de44cfdf0405261fa1a8d7ffbed3
There is a namespace filter and two more options on the page.
They weren't preserved when the user navigated to another batch
of results (e.g., using "50 next").
Change-Id: I702c08957daa204f151db0d85063da9818835866
Gated behind the flag $wgParserEnableLegacyMediaDOM. The scattershot
usage of it is a little unfortunate but isn't expected to live very long
so maybe that's acceptable.
Further details can be found at,
https://www.mediawiki.org/wiki/Parsing/Media_structure
Bug: T51097
Bug: T266148
Bug: T271129
Change-Id: I978187f9f6e9e0a105521ab3e26821e36a96b911
This matches Parsoid and shouldn't be an issue since nothing in core is
generating <figure>s yet, presumably.
Bug: T51097
Change-Id: I9f489b13d5d4db0415a3f0f0dbb936c8e89461fa
Large wiki farms may have to purge servers concurrently (instead of
one at a time) in order to keep up with new writes and delete expired
rows faster than new rows are written.
The parameter for this uses server tags for three reasons:
* Maintenance risk and complexity.
This requires the least information about MW configuration to be
hardcoded in the scheduled maintenance cronjob (compared to: server
indexes which are a runtime concept, or specific hostnames/IP/
tableprefixes which may change and should not require
coordinating changes elsewhere).
* Operational convenience.
By using server tags, the parameters don't have to vary between
data centers.
* Code complexity.
The current code for obtaining connections is based on server indexes,
which are easy to mapped at runtime from server tags. Other ways
of identifying shard like hostnames are either an awkward fit (as
they don't uniquely identify a shard per-se, with multiple instances
on the same hardware at WMF), or require SqlBagOStuff to store and
maintain more information about connections than it currently has
readily available.
Bug: T282761
Change-Id: I618bc1e8ca3008a4dd54778ac24aa5948f27c52e
This patch does several things to LinkCache to make its behavior more
consistent and predictable:
* Methods that set a "good" link now clear the "bad link" flag, and vice
versa.
* invalidateTitle() now also clears the local cache, not just the
persistent cache.
* Attempts to set data for LinkTargets that are not proper local pages
are ignored.
* All methods now accept LinkTarget|PageRecord as the key.
The ones that previously accepted a string still allow that as well.
* addLinkObject() now consistently uses the local cache if possible,
and consistently bypasses it if the forUpdate() flag is set.
This is all done in preparation for LinkCache being used inside PageStore.
Bug: T278940
Change-Id: I62107789fa185606a81be20ffa8f0be48297c08f
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.
Bug: T284950
Change-Id: I9a4806047f8d31d59a00e02145906672b85c004c
The SkinTemplateTabAction hook was marked as deprecated in MediaWiki
1.35.
Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].
[0] https://codesearch.wmcloud.org/search/?q=SkinTemplateTabAction
Bug: T284950
Change-Id: I998bf8ffe6be43ad3eb38b1a9388a35aa94d7685
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.
Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].
[0] https://codesearch.wmcloud.org/search/?q=SkinTemplatePreventOtherActiveTabs
Bug: T284950
Change-Id: I37c5bdcc8875a23798f641161e53be3e4d073d7d
No longer need to save more than one, which was previously
needed to be able to call User::setEditCountInternal(), but
that method has been removed.
It turns out we can't just rely on the user id alone, because
UserEditTracker requires a UserIdentity object and the name
of the user matters.
Follow-up: Ie3fb4887d9f2d96b32598865030351bf3bf20ce5
Change-Id: I4ba1300837cf2cf624c563d4445a2a7dc6b88d86
Dependency was added in T254053 so that we
could use a pimple ServiceLocator in
MediaWikiTestCaseTrait::createSimpleObjectFactory.
But, since the ServiceLocator being created is using
an empty container, its not actually used for anything,
and can easily be replaced with a mock that says
it has no services and throws if trying to retrieve any.
Per the PSR11 spec, the container interface should
throw an exception that implements
NotFoundExceptionInterface - use the
NoSuchServiceException from the Services library
that we use for MediaWikiServices
Change-Id: I721e7417036a8b0fa9084e9d13329262253ae0f6
Added to the release notes as a breaking change,
no deprecation period because there are no known
uses anywhere on codesearch
Bug: T248215
Change-Id: If7368ffdd09ab69f7a40501ef9d8a90660db7f58
It's logically part of LoggedUpdateMaintenance. There are two copies
already, and I was considering adding a third.
Change-Id: Ib3686cb3d408a017cd17cde624df71edb379f07e