Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
A constant is not a variable. The type is hard-coded via the value
and can never change. While the extra @var probably doesn't hurt much,
it's redundant and error-prone and can't provide any additional
information.
Change-Id: Iee1f36a1905d9b9c6b26d0684b7848571f0c1733
MessageCache::loadFromDB() already did that, but other code paths like
updateMessageOverride() didn't. To ensure every code path behaves the
same, add a check for redirects in getMessageTextFromContent().
Bug: T376398
Change-Id: I113e65f016401563009d1ccd60b4d1555ed0d283
This avoids addition of new code with the deprecated global,
or at least it gives extra attention on review when new code also uses
the inline ignore
Change-Id: I5c1bc5a1685c28f153d4fbe3525959930f54b557
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
Trigger a deprecation warning if MessageCache::get gets called without
a Language object. On omitted parameter still the content language is
used.
Also change from $langcode = true to $language = null. This allows to
introduce a PHP type check in I8d0de2c7c2e6d087228844874d8251933b4acea4.
Change-Id: Ib27cfc0af090790daca3995fb1c3d78712d53ae6
This cases cannot benefit from the SelectQueryBuilder as each argument
get processed by hooks with fix signature or coming from abstract
functions providing the arguments separate.
Bug: T344971
Change-Id: I6490caae3984efaae81bd2583220a7dd1c3b371d
When displaying messages, the requested message key can be overridden
by hooks such as 'MessageCacheFetchOverrides'. If this happened,
display the overridden key when using &uselang=qqx, to help users and
developers track down where a message is coming from.
Bug: T363729
Change-Id: I81d814278ca810035066ce4632f617f30536f1ab
If we are serious about getting rid of wfGetDB(), we should start
replcing callers with proper replacement.
These classes don't have any injection so it doesn't make sense to
introduce it for this specific usecase.
Bug: T330641
Change-Id: I645f67324d441288c63787c7e42390b59106c585
* Switch out raw Exceptions, mostly for InvalidArgumentExceptions.
* Fake exceptions triggered to give Monolog a backtrace are for
some reason "traditionally" RuntimeExceptions, instead, so we
continue to use that pattern in remaining locations.
* Just entirely give up on PostgresResultWrapper's resource vs. object mess.
* Drop now-unneeded false positive hits.
Change-Id: Id183ab60994cd9c6dc80401d4ce4de0ddf2b3da0
Found via (?<!IDBAccessObject)::READ_
We are planning to deprecate and remove implementing IDBAccessObject
interface just to use the constants.
Bug: T354194
Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
This creates a new language code, 'x-xss', which is enabled using the
setting $wgUseXssLanguage (similar to how $wgUsePigLatinVariant enables
the 'en-x-piglatin' language code, and likewise defaults to false; will
be enabled in development settings soon).
In this language code, all messages become “malicious”, trying to run
some alert() JavaScript; if any alert() actually fires in the browser,
the message was not escaped properly. ($wgRawHtmlMessages are exempt,
since they’re already known to be “unsafe” and require more rights to
edit on-wiki.) Messages that are not escaped properly are generally a
minor security issue; they effectively let a user with 'editinterface'
right (such as a sysop, on many wikis) run arbitrary JS, without needing
the 'editsitejs' right (normally restricted to interface admins).
Developers can use this language code to more easily check their code
for escaping issues / cross-site scripting vulnerabilities.
Bug: T340201
Change-Id: Ia9a1cf712b139fea5da72046e37035e6de39d8d5
I fixed some edge cases in the script that migrates to SQB and it
managed to fix these now.
Bug: T344971
Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
Interface was deprecated since 1.35 in favor of ExpirationAwareness
or StorageAwareness interfaces. No longer used anywhere, see dependent
patches.
Depends-On: Ida557b3180eb5e7ebae46968142b4f154f26ffbc
Depends-On: I3d6fbf535560655472ade27c37b0e42b3e11a535
Depends-On: I2b0a669d41d9e6a8a859cba314c0e9e4c0ef40d7
Depends-On: I776040c2c8f61e25ae986e93bb1975fdd8bf9dd5
Change-Id: I9c5ffa9f51aec6356e3e27458fd098a37cd754ad
Avoid clone of Parser object, create a new one
Reset the UrlUtils services after changing the server setting,
it is a dependency of the ParserFactory and gets initalizied earlier now
Bug: T250448
Change-Id: Ie62250242965d3d90873909795ced2cbda506ddb
When the value of the associated array is not used, there is no need to
use array_keys and create internal a copy of the array, just omit the
value with $_ to tell static analyzer that the var is unused.
Change-Id: I5c6d667e98c0167c0573c683f0d617bc1d4ca619
Motivation:
* Avoid code duplication.
* Hopefully make it easier to read.
* Also order stuff from cheap to expensive, if possible.
Change-Id: I575e3f2027ce60a0d0885be5b9bd3e07bc035eee
Duplicate the code of wfGetLangObj as private non-static function
MessageCache::getLanguageObject.
Bug: T332722
Change-Id: I9d422db270a401d6066e9869e1fa7a189959c374
Follow-up to I89e1a9b901aff6ff1bde729df8958ba42a45f3d5 where I forgot
to remove this line after initialization was moved to MessageCache::get.
Change-Id: Iae441ccedba08eb12685d81381259aad49b7b42f
This new hook is called only once, for all overrides, instead of
every time a message is fetched.
Overrides can be specified as string or a callable, to allow for
dynamically computing the override on-demand. These callables are
passed the message key, MessageCache instance, the language and a
boolean indicating if the message should be fetched from the
database.
The parameter choices are based upon current usages of the
MessageCache::get hook.
Bug: T328183
Change-Id: I89e1a9b901aff6ff1bde729df8958ba42a45f3d5
The $hashVolatile exception should only apply if the only reason
the local cache is considered stale is due to hash key volatility.
Bug: T258860
Change-Id: I03f595e000cec5a6f14c26c8096456ad3bb153aa
If the cluster cache lock fails due to an I/O error, we should fallback
to loading from the DB using a local server lock and only update
the local server cache.
Fix some code comments and documentation.
Bug: T258860
Change-Id: I672908a0f042f52dc0847a1f8e73723d35cdbc88
Patch Ifa7a9bc replaced some longer `=== null` constructs with the
new ??= operator we have since PHP 7.4. However, some of these can be
simplified even more with the ?? operator we have since PHP 7.0.
Follow-Up: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
Change-Id: I7b05e723810558bb5437adc97eab54ca04d38c06
The motivation is to make the code less confusing. I hope this is the
case.
?? is an older PHP 7.0 feature.
??= was added in PHP 7.4, which we can finally use.
Change-Id: Id807affa52bd1151a74c064623b41d950a389560