These are not configuration but business logic, similar to the
canonical names that are in NamespaceInfo.php, these must always
exist and cannot be altered or unset.
They were previously unconditionally assigned during all requests
in Setup.php and passed down as "site configuration".
Changes:
* Move them to MessagesEn.php where they can be cached and
processed the same way as other core-provided aliases.
Document and confirm with tests that this is a mergeable
attribute that follows the language chain.
* Remove the duplicated code in a few places that was reading
this variable + Language::getNamespaceAliases(), to instead
just call the latter and move the logic there, centralised,
and tested.
In doing so I noticed that these were applied in an
inconsistent order. Sometimes the config won, sometimes not.
There's no obvious right or wrong way here, but I've chosen
to standardise on the way that Language::getNamespaceIds() did
it, which is that config wins. This because that method seems
to be most widely used of the three (it decides how URLs and
titles are parsed), and thus the one I least want to change
the behaviour of.
* Document that $wgNamespaceAliases may only be used to
define (extra) aliases, it is and never was a way to access
the complete list of aliases.
Bug: T189966
Change-Id: Ibb14181aba8c1b509264ed40523e9ab4000fd71a
This isn't a default setting or fallback, it's unconditional
business logic that can't be overidden. This doesn't need to
run on every web request in Setup.php.
Bug: T189966
Change-Id: I708131b111cd2ff0e34c3cc8a4b933eff260b3da
This internal variable was exported on all page views for all users
for use by jquery.tablesorter.
This feature has not used it since 2013 (commit 65f11938e8),
where it was migrated to use the mediawiki.language module instead.
Bug: T48496
Bug: T219340
Change-Id: I1c9b012d633ffd76a31be5822fd2f4f984e1fb5c
Also remove some comments that didn't help understand the line
below (e.g. "install header callback" above "HeaderCallback::install")
Bug: T189966
Change-Id: Ib0b413c557f83f8f58683515fcdbf1817fe1f661
This shortens some lines below 120 characters when a tab is
counted as 4 characters (not that line lengths are currently
counted like that).
Bug: T243598
Change-Id: I828cd540268810bd56589885e38ad03f8bafc6f9
This adds methods to ParserOutput ::addExtraCSPStyleSrc,
::addExtraCSPDefaultSrc, and ::addExtraCSPScriptSrc, to easily
allow parser tags/functions to add additional CSP sources if their
tag needs it. Previously such an extension would need to use
and OutputPage hook. This is modeled on how addModules() works.
The immediate use case is for Kartographer (T240960), although
its expected that lots of extensions might do something like this,
especially extensions used outside of Wikimedia.
Change-Id: I24e5f0b4edff58025a0c2a3e1a9aa3f62eb7db7b
Follows bb48ecbbc7.
This adds some documentation and renames the property that checks if a
non-string replacement has been used multiple times. The goal is to be
more mindful of other code that might inspect it.
A test is added to assert that the replacements are only cloned from the
second use onward, in case someone holds on to the inject object to
listen for clicks or something similar.
Change-Id: Icd1e06ed50f12483cf0884027e83dacf17eebb02
Allows .vue files to be used in package modules as if they were .js
files: they can be added to the 'packageFiles' array in module
definitions, and require()d from JS files.
In the load.php output, each .vue file is transformed to a function that
contains the JS from the <script> tag, then a line that sets
module.exports.template to the contents of the <template> tag (encoded
as a string). The contents of the <style> tag are added to the module's
styles.
Internally, the type of a .vue file is inferred as 'script-vue', and the
file is parsed with VueComponentParser, which extracts the three parts.
After the transformation, the file's type is set to 'script+style', and
files of this type contribute to both getScript() and getStyles().
This change also adds caching to getPackageFiles(), because it now needs
to be called twice (in getScript() and getStyles()).
Change-Id: Ic0a5c771901450a518eb7d24456053956507e1ed
Skins that are using ResourceLoaderSkinModule will need to update their
features to include `legacy`
Note that Ic7af947cfd5a5df4218f006232ede4ee7ed36c62 for Vector
and I6471bc169f3c2a1f51e17b8ee26ac245b0374c18 for Monobook should
be merged in the same release as this patch to ensure these styles
do not disappear from those skins. Minerva or Timeless will not be impacted.
Changes for other skins including Modern and CologneBlue to follow
where needed.
Bug: T242177
Change-Id: Icb910a563273bde92a09b1bb92857d5b6e348baa