Commit graph

108693 commits

Author SHA1 Message Date
C. Scott Ananian
e997f811ef Revert "ParserOutput: Use page language instead of site content language for conversion"
This reverts commit 0fdd607a84.

This attempt to fix T295187 caused other issues (T303235). A proper
fix is in Ie0f1d7b6daffc8ff47228f6f086a257518f72717.

Bug: T303235
Change-Id: Ib273f88531c340b561072ee9f616aa60725091e6
2022-03-08 16:01:08 -05:00
jenkins-bot
7b9928008a Merge "[Skin] Remove legacy fallbacks in menu labels" 2022-03-08 19:32:52 +00:00
jenkins-bot
c268687d46 Merge "Hard deprecate Sanitizer::removeHTMLtags()" 2022-03-08 19:29:55 +00:00
jenkins-bot
3a8c3a8940 Merge "DummyServicesTrait: remove extra parameter to createMock()" 2022-03-08 18:50:45 +00:00
jenkins-bot
4420102e99 Merge "Fix edge cases in schema validation." 2022-03-08 17:48:26 +00:00
jenkins-bot
277453fe78 Merge "Define MW_INSTALL_PATH constant and BaseDirectory config." 2022-03-08 17:44:09 +00:00
jenkins-bot
d1cfc0317d Merge "Add explicit casts between scalar types" 2022-03-08 17:32:26 +00:00
jenkins-bot
c28c9dc573 Merge "Wikipage: Inline single-use private function" 2022-03-08 17:29:03 +00:00
jenkins-bot
44cff5716b Merge "Deprecate protected and public properties of OutputPage" 2022-03-08 17:13:41 +00:00
Umherirrender
6ea3d6ac2c Add explicit casts between scalar types
php internal functions like floor/round/ceil documented to return
float, most cases the result is used as int, added casts

Found by phan strict checks

Change-Id: I92daeb0f7be8a0566fd9258f66ed3aced9a7b792
2022-03-08 16:59:01 +00:00
Ammarpad
ff26974ac3 Wikipage: Inline single-use private function
Change-Id: I9fb81ad444f422e060f816123736aed60283c14e
2022-03-08 17:56:07 +01:00
jenkins-bot
347275f940 Merge "Add configuration for write both on templatelinks table" 2022-03-08 16:15:57 +00:00
Jon Robson
16f1ee7319 [Skin] Remove legacy fallbacks in menu labels
These can all be removed now as skin- prefixed messages or no-prefixed
messages should always exist now.

Bug: T301203
Change-Id: Ifa383f807e9e0a0fb2880bbd6bc87010d82e7f61
2022-03-08 08:03:40 -08:00
daniel
404f4a8512 Fix edge cases in schema validation.
Since PHP arrays make no clear distinction between lists (JSON arrays)
and maps (JSON objects), some edge case handling is needed to make
validation work reliably when we declare types for all arrays:

1) Allow array keys to be ignored, so an associative PHP array validates
as a JSON array. This is needed for the SessionProviders setting.

2) Allow associative arrays with numeric keys to validate as JSON
objects. This is done by ignoring the type validation when numeric keys
are detected. A warning is returned in the status object.

3) Work around validation failing on float values that are expected to
be integers. All numbers come from the yaml parser as floats, and the
"integer" type in JSON schema should accept floats with if the
fractional part is 0. But that doesn't seem to work, we need to cast the
values to integers explicitly.

Also, this fixes some mistakes in the schema: LockManagers is a list,
so it should use the JSON type "array". NamespacesToBeSearchedDefault
is a map (JSON object), even though it uses numeric keys. The Actions
registry is also a map.

Change-Id: I9d0453d740c377b7cce574df743536c39a0ec619
2022-03-08 13:59:19 +01:00
jenkins-bot
72609bbffe Merge "apisandbox: Use calculated value for label of limit" 2022-03-08 12:11:49 +00:00
jenkins-bot
9196a0e6ab Merge "Fix User::getRealName() test" 2022-03-08 12:08:10 +00:00
jenkins-bot
64c40b669d Merge "search: Use NS_MAIN instead of hard coded 0" 2022-03-08 09:45:00 +00:00
Tim Starling
b6c3bf46dc Fix User::getRealName() test
Make it do what the assertion message says

Change-Id: If63b8e664d0361a028cd1d47d614b475463b74cd
2022-03-08 20:02:14 +11:00
Translation updater bot
a6527647ad Localisation updates from https://translatewiki.net.
Change-Id: Ie384f27fb82d36d4c9f8f38eafb8c77afe066150
2022-03-08 08:46:31 +01:00
jenkins-bot
9c4ea8ba88 Merge "DefaultSettings.php: Add example for $wgSkinMetaTags" 2022-03-08 07:01:44 +00:00
Func
059d815c9c apisandbox: Use calculated value for label of limit
apiSandboxMax is defined inside createWidgetForParameter method.

Bug: T303241
Change-Id: Ieb72e5882188362d832e30543f77ae89fd3fd1ab
2022-03-08 14:34:11 +08:00
jenkins-bot
d838da1e26 Merge "Add inline taint information for Sanitizer::remove*Tags()" 2022-03-08 03:58:12 +00:00
jenkins-bot
f527d72f9c Merge "Only apply transformations for &uselang=qqx when actually using it" 2022-03-08 03:47:05 +00:00
jenkins-bot
c520932478 Merge "Status: Ensure MessageLocalizer is used if provided" 2022-03-08 03:34:16 +00:00
jenkins-bot
28f90b434a Merge "Use Message::newFromSpecifier() in wfMessage()" 2022-03-08 03:33:11 +00:00
jenkins-bot
cd7a8532a2 Merge "Re-apply "Show message fallback keys when using &uselang=qqx"" 2022-03-08 03:16:52 +00:00
C. Scott Ananian
ef871db2f3 Deprecate protected and public properties of OutputPage
We plan to refactor these properties and move them into a value object
instance.  Mark them deprecated for 1.38 so we can move/remove them
in a future release.

Bug: T301020
Change-Id: I8ec2e903bd7cde8d54fe0366707cbcf625f1f1a1
2022-03-07 22:11:07 -05:00
C. Scott Ananian
d6576e5dc6 Hard deprecate Sanitizer::removeHTMLtags()
Rename Sanitizer::removeHTMLtags() into an @internal method named
::internalRemoveHtmlTags() so that we can deprecate external use.

Code search:
https://codesearch.wmcloud.org/deployed/?q=removeHTMLtags&i=nope&files=&excludeFiles=&repos=

Followup-To: Ic864c01471c292f11799c4fbdac4d7d30b8bc50f
Depends-On: Iaca83ed06e9c61d8366579cd2283cba653c82319
Depends-On: I1963bfe9a99198ea02ca482a5769467ce806cd58
Depends-On: I83923d8b38d33f3638cd53958dd10f257ec21f7c
Depends-On: I018b34bb5f6e113056da9b04cc72d4318422adce
Change-Id: I202826f8b27519f7be89643e24eda47a6e3fc9f6
2022-03-07 22:04:56 -05:00
jenkins-bot
9f78e4a7cc Merge "file: Use File::getName instead of class property" 2022-03-08 02:18:00 +00:00
Reedy
396534681b DefaultSettings.php: Add example for $wgSkinMetaTags
Change-Id: I722f112d96f0abb244240e4ba422a8c46d5eb64d
2022-03-08 02:06:43 +00:00
jenkins-bot
2b818a673c Merge "Introduces skin- prefixed message key for nav items" 2022-03-08 01:57:42 +00:00
Bartosz Dziewoński
ba96351f46 Only apply transformations for &uselang=qqx when actually using it
Depends-On: I4f3b01eccf571475f1248db838a8aa6cba18b93e
Depends-On: I0a0681b332abb623fc6871ab78da9e64a79fad84
Bug: T300069
Bug: T302469
Change-Id: I45f58034117e9041fe5403dbfcf83ba25f20518d
2022-03-08 01:50:44 +00:00
Bartosz Dziewoński
599223ce30 Status: Ensure MessageLocalizer is used if provided
Change-Id: I1eff51af271f7d6e4685a23360cd23c397593c53
2022-03-08 01:50:37 +00:00
Bartosz Dziewoński
0954804d0a Use Message::newFromSpecifier() in wfMessage()
As a result, when an existing Message object is passed in the $key
parameter, the function will return a clone of that object, rather
than a new Message constructed based on the key extracted from the
old message.

This is mostly relevant when the passed object is an instance of
a subclass like RawMessage or ApiMessage, but it could have other
unpredictable consequences. No test failures, though!

Change-Id: I4815e92dfaf5fbcc8c9356106738716c6b9ae0da
2022-03-08 02:49:51 +01:00
DannyS712
5ef90d5b87 DummyServicesTrait: remove extra parameter to createMock()
Left over from my changes in
I25b8f0256d222d994173eee66f379fb5422994b5 when it used to
be a createNoOpMock() call instead.

Change-Id: I20fc8aaa62c296160236443ab03a4cf272fe8395
2022-03-08 01:41:12 +00:00
Bartosz Dziewoński
04b9dd6b2f Re-apply "Show message fallback keys when using &uselang=qqx"
This affects messages created using wfMessageFallback() and related
functions, in particular many messages used for navigation tabs in
skins.

Previous attempt in 11d7d97768,
reverted in c83b530f95 due to T302469.

This attempt doesn't introduce any new placeholders to avoid that
issue.

Bug: T300069
Change-Id: Ib0e282b3864caf345e42dd7af4a529f43ae7ba67
2022-03-08 00:56:12 +00:00
jenkins-bot
5bfdcba924 Merge "tests: Avoid unsafe use of setUpBeforeClass() in ApiFormatXmlTest" 2022-03-07 22:25:04 +00:00
Aaron Schulz
5c3547a5bb tests: Avoid unsafe use of setUpBeforeClass() in ApiFormatXmlTest
This avoids "Can't create user on real database" errors that can
occur if the order of test classes changes.

Bug: T50217
Change-Id: Iccd6a2d4f207d2a9ddf62544b3a24a9db15bda55
2022-03-07 21:59:49 +00:00
Aaron Schulz
3960005202 ApiQuerySiteinfoTest: Don't access MW services in dataProvider
Bug: T297292
Change-Id: Ib310b83d26f2badb628965c62f7ca4caf1414e5b
2022-03-07 21:57:59 +00:00
C. Scott Ananian
a5e96d9d66 Add inline taint information for Sanitizer::remove*Tags()
This moves the taint information to be directly on the method,
moving it out of the SecurityCheckPlugin.  See discussion on
Ieb202ef92bd9888ce767f8dd4d97f19eeb10a073.

We also fix a legit "double-escape" issue flagged by the phan
SecurityCheckPlugin once the correct taint information has been
added.

Followup-To: Ic864c01471c292f11799c4fbdac4d7d30b8bc50f
Change-Id: I0f873618d43cb6daf9c43394a669125469462223
2022-03-07 16:50:58 -05:00
jenkins-bot
ab7c86ba6b Merge "Add namespaces for Gun (guw)" 2022-03-07 21:49:52 +00:00
Umherirrender
0f13be599b file: Use File::getName instead of class property
The class property name is lazy initalize, which can result in use of
null in File::getThumbDisposition

Found by phan strict checks

Change-Id: I0532bb47d97bb73400a8b84a35e9cb7ebabae5c1
2022-03-07 21:30:26 +01:00
Umherirrender
9f7e9166b2 search: Use NS_MAIN instead of hard coded 0
Change-Id: I97f7b6e3d2c56eb8bcb134a8fc6b7e718a4b96cc
2022-03-07 21:09:46 +01:00
Umherirrender
a9aa1e7346 Fix type of value directly passed to php internal functions
Found by phan strict checks

Change-Id: Icc44cd143f2e98fa3ca188e625a3289441de0f73
2022-03-07 20:41:55 +01:00
jenkins-bot
fbe222eb4c Merge "pageupdater.md: Update and fix references to code" 2022-03-07 19:28:24 +00:00
Amir E. Aharoni
8b808f8868 Add namespaces for Gun (guw)
Sent by User:Samatics here:
https://meta.wikimedia.org/w/index.php?title=User_talk:Amire80&oldid=22958673#Gungbe_Namespace_Translated_list_(Updated)_2

Change-Id: I77d4f767c55f38446b8d127cbe42f5b09b0b80ad
2022-03-07 18:46:56 +00:00
Jon Robson
40d041e064 Introduces skin- prefixed message key for nav items
This takes precedent over the other messages e.g. action-protect

Since only 3 messages clash with the protection forms, only 3 are
ported for now.

The action-protect, action-move and action-undelete are reverted
to their old values as they were in
98fa55566a9df1d6dd74654979f890d75c602220

Bug: T303012
Change-Id: I5594ba4d1a60d141dbcc5ac3bd97428f765709d6
2022-03-07 08:59:32 -08:00
jenkins-bot
595f1e379b Merge "rdbms: Simplify TransactionManager class a bit now the code has moved" 2022-03-07 16:16:35 +00:00
Translation updater bot
61553a98cc Localisation updates from https://translatewiki.net.
Change-Id: Ifefb2e524d516bf1b4a73c5a8279cecfd8dd1028
2022-03-07 07:55:19 +01:00
Amir Sarabadani
15acb7380a rdbms: Simplify TransactionManager class a bit now the code has moved
- The public method that is being called internally only, is now private.
 - The getters are replaced with direct access.
 - Make calls to TransactionManager a batch.

Bug: T299698
Change-Id: Id9c5d6a692abd573793c1cab3d07ebf0ee8760f4
2022-03-07 07:27:56 +01:00