Commit graph

96595 commits

Author SHA1 Message Date
jenkins-bot
32c0b452ee Merge "docs - minor cleanup, including fixing markdown syntax" 2020-05-25 09:32:10 +00:00
daniel
504e9c446f CreationHandler: fix redirect URL
Add missing version prefix to Location header emitted after successful
creation.

Bug: T253143
Change-Id: I6262f61668cefacce12ed6f2a976340e10cf105b
2020-05-25 11:13:18 +02:00
Umherirrender
3d27353cd2 Fix param type for Status::msgInLang
Message params could be an array or another Message object
Message class itself documented with mixed

Change-Id: Ia675ba2d2f5faa73904f90cc26e4f0e2d1317da5
2020-05-25 07:51:40 +00:00
Translation updater bot
bdf7e3b250 Localisation updates from https://translatewiki.net.
Change-Id: Ie873f38c1fa9856eee43114d201564730aca927b
2020-05-25 08:37:27 +02:00
jenkins-bot
67d6d6d14a Merge "Revision: Ensure getRevisionByTitle() works for foreign wikis" 2020-05-25 01:59:01 +00:00
jenkins-bot
5449df0437 Merge "Relax symfony/yaml to allow ~3.4|~4.5|~5.0" 2020-05-25 01:45:54 +00:00
Daimona Eaytoy
43c0e67853 Relax symfony/yaml to allow ~3.4|~4.5|~5.0
Allowing 3.4 was removed in Ia12658554c94497a204b7f65f1. As explained
there, the removal was not intentional. It was a rebase issue due
to I9e9390975024a2667ce7bf570d0218345 being merged in the meanwhile.

Bug: T235403
Change-Id: I477652c093d5d511d7bbc5980bd7c14babc4ed36
2020-05-25 01:17:34 +00:00
DannyS712
b1df019009 SpecialChangeContentModel: Only call spam checks on non-empty reasons
This fixes a fatal error thrown since I12120b51073c, when opening the
Special:ChangeContentModel form, due to a strict string typehint
for SpamChecker.

Bug: T252963
Change-Id: Ie29d7bf5cda4a86321a08a76fb18d747a055420f
2020-05-25 00:12:04 +00:00
jenkins-bot
78b1ff0ec9 Merge "linker: Move Linker::normaliseSpecialPage to LinkRenderer class" 2020-05-24 23:31:43 +00:00
jenkins-bot
a5f1fe5827 Merge "ParserOptionsTest: Rename non-global variable $wgLang" 2020-05-24 23:31:34 +00:00
Derick A
707567bd73 linker: Move Linker::normaliseSpecialPage to LinkRenderer class
Would have love to just kill Linker::normaliseSpecialPage() but
the deprecation policy has to be followed and we'll drop the above
method in 1.36.

For now, we'll just soft and hard deprecate it, also, callers have
been updated.

Dependency inject SpecialPageFactory to LinkRenderer service and
note that ->normalizeTarget() is only for internal use by Linker
& DummyLinker via their `->normaliseSpecialPage()` methods.

Also, updated unit tests to capture injecting the special page
factory class.

Change-Id: I951403c89ff497fd1f7441ad0304dd5bc9442ad7
2020-05-24 23:11:55 +00:00
DannyS712
a8ba047008 ParserOptionsTest: Rename non-global variable $wgLang
Bug: T160814
Change-Id: I281e71e22f335427829e07b9fce25a753e7f5246
2020-05-24 23:10:55 +00:00
Ori Livneh
7c9e19ed5e mime: Document null return from MimeAnalyzer::improveTypeFromExtension()
This method returns null when $mime is 'unknown/unknown' and the file
extension is unknown to MediaWiki. The inline documentation and @return
annotation omitted this.

I don't think this was an intentional design choice, but it's the
existing behavior and I'm not sure it's safe to change.

Since it is the existing behavior, document it and add a test case, to
ensure that any changes to this behavior are intentional.

Bug: T253483
Change-Id: Ie6615a4bd9ae77e9ab59cfe76edb237cace693b1
2020-05-24 15:51:08 -04:00
Umherirrender
4a97ea35d9 Fix return type for SpecialBlock::validateTargetField
Change-Id: Id80d64eb23e5687115f242c16958cffa8175e36a
2020-05-24 20:56:45 +02:00
Ariel T. Glenn
29992f2527 Xml dumps should not die when the page redirect target cannot be determined
Bug: T253468
Change-Id: I4212073df993d60669d199c254fec242bde653d7
2020-05-24 17:33:33 +03:00
DannyS712
743edb1be0 Merge htmlform.checker.js into special.userlogin.signup.js module
Bug: T253362
Change-Id: I749c1955b765ce4ca1b9a191d1a051933a21f16a
2020-05-24 05:45:13 +00:00
Timo Tijhof
2ee29c7e37 Rename mediawiki.special.userlogin.signup.js to mediawiki.special.createaccount
The name was outdated and also confusing when ending in ".js".
This is internal to the CreateAccount feature (not used elsewhere).

Change-Id: I33778ce2eb69f7b247e6cc80e4de393abaa6946b
2020-05-24 02:01:01 +01:00
Yuki Shira
c6ad095a7e site: Update @since tag from 1.20 to 1.21 for $wgSiteTypes
$wgSiteTypes was introduced in 1.21 (7389d7c690)
Follows up d9c1bc7262

Change-Id: I0dd968054d72b8c65e097eba56914f11339a2110
2020-05-24 08:46:22 +09:00
jdlrobson
05d29c7bc3 Treat languages and toolbox like other sidebar links
This will require some changes to individual skins but the toolbox
and languages portals should be included in the SidebarBeforeOutput
hook. Otherwise two new hooks for adding languages and toolboxes
will be needed.

The mapInterwikiToLanguage,
buildNavUrls, buildFeedUrls and getLanguages functions are moved
from SkinTemplate up to Skin. The bodies of these functions remain the
same with the following changes:

* slight readability tweak inside getLanguages and buildFeedUrls
to simplify the return value.
* buildNavUrls is modified to use a local
variable for thispage rather than the public variable on SkinTemplate.
* title and user cached inside buildNavUrls rather than calling getTitle
and getUser multiple times
* Use the hook service rather than Hooks::run

This will allow us to DRY up every skin which sets these sidebar portals
on when they are not set as well as allow extensions to add items to
the toolbox and language portals just like any other sidebar portal.

https://codesearch.wmflabs.org/skins/?q=TOOLBOX&i=nope&files=&repos=

Note: We will need to make modifications to all skins to remove
their existing hardcoding of these portals.

Bug: T252917
Change-Id: Ie33f85a77299da8f3b98ab8b363761d1f8277708
2020-05-23 13:23:40 -07:00
jenkins-bot
c33ca73e03 Merge "VueComponentParser: Add test case for self-closing tags" 2020-05-23 20:01:19 +00:00
Aaron Schulz
2d1c2154fa filerepo: bump LocalFile::VERSION following 88e17d3f7c
Bug: T253405
Change-Id: I0f7e885997d60dfa9b65ade1d66dfa0aebfda896
2020-05-23 11:19:24 -07:00
jenkins-bot
b336d9ba83 Merge "filerepo: make LocalRepo::getSharedCacheKey() use makeGlobalKey()" 2020-05-23 17:54:18 +00:00
jenkins-bot
8f3e59c642 Merge "skins: Use local getters rather than globals or static functions" 2020-05-23 17:48:18 +00:00
Aaron Schulz
88e17d3f7c filerepo: make LocalRepo::getSharedCacheKey() use makeGlobalKey()
Also rename image_redirect key to file_redirect while at it.
This assures that stale keys are not still in use.

Bug: T253405
Change-Id: I31a9bb6672b33fbfa1b974955d78fdfd8d58f5da
2020-05-23 17:32:55 +00:00
mainframe98
7a727b0882 skins: Use local getters rather than globals or static functions
Also reuse local variables and introduce these where local getters
are called multiple times.

Change-Id: I927b57dd593e05a45e9cd9f40124bc1310496745
2020-05-23 12:42:28 +02:00
jenkins-bot
820bed0fee Merge "Use private instead of protected in CommentStore" 2020-05-23 10:16:18 +00:00
DannyS712
8f92469c6c docs - minor cleanup, including fixing markdown syntax
Use code highlighting where relevant
Fix list syntax in memcached.md to render lists without paragraph breaks
Add a missing period to schema.md

Change-Id: I763cfd479968cedbf952c231283d33b82a0910d6
2020-05-23 07:58:14 +00:00
DannyS712
74a7ebce44 docs/README: Update link to php documentation on doc.wikimedia.org
https://doc.wikimedia.org/mediawiki-core/master/php/html/ no longer
works, https://doc.wikimedia.org/mediawiki-core/master/php/ is where
the php documentation lies

Change-Id: I518027861ea60bcee66e6c0fb50cc4dabef714f0
2020-05-23 07:46:33 +00:00
Roan Kattouw
f6135a5995 VueComponentParser: Add test case for self-closing tags
Some HTML parsers don't deal with this the way we want. libxml does, so
this test case passes, but I'm adding it for if we try switching to a
different HTML parser that breaks this.

Change-Id: I02d14e1d78320217646cda9691a78bcbf2005f52
2020-05-22 22:16:01 -07:00
Ori Livneh
9971d4dced mime: Add test for MimeAnalyzer::addExtra{Types,Info}
..and for adding file extensions by modifying the mExtToMime field.
All three interfaces will be deprecated in a follow-up change.

Change-Id: I7ec940a8b2fe02cd0fe01593cd6897f75777a8fa
2020-05-23 01:11:41 -04:00
jenkins-bot
cb71d80ef0 Merge "installer: Fix failure of web installer CSS due to main stash" 2020-05-23 03:01:45 +00:00
Tim Starling
4baa688fd1 installer: Fix failure of web installer CSS due to main stash
Bug: T253433
Change-Id: Iff9ad9f75ae137e911bed15f3d61fb4b848b61ae
2020-05-23 02:41:44 +00:00
jenkins-bot
a900b0e59f Merge "Ajax watch: Move JS config var to packageFiles" 2020-05-23 01:12:27 +00:00
jenkins-bot
276261bcf6 Merge "upload: Fix incorrect handling of missing file extension in UploadStash" 2020-05-23 01:08:58 +00:00
jenkins-bot
a7faaaa00f Merge "mediawiki.util: Add mw.util.parseImageUrl" 2020-05-23 00:39:06 +00:00
suecarmol
b32e71aa60 Ajax watch: Move JS config var to packageFiles
To improve performance, the watchlist expiry flag was moved to
packageFiles instead of the OutputPage.php file

Bug: T249259
Change-Id: If57030db7d1e90b0890ee2a1ad466772a2f8b8bc
2020-05-22 19:21:45 -05:00
Gergő Tisza
a08dab6fd0 mediawiki.util: Add mw.util.parseImageUrl
Refactor the URL parsing logic in mw.Title into mw.util.parseImageUrl
and parse the thumbnail width as well alongside the file name.

Also tighten up the thumbnail regexes a little bit.

Bug: T244210
Change-Id: I1e0ff7c2b15aff2e150f4070f3d42803399cb6a2
2020-05-23 00:20:09 +00:00
jenkins-bot
0f97cb3e2a Merge "Remove unused CSS styles from Parsoid's stylesheet" 2020-05-22 23:55:19 +00:00
jenkins-bot
e7b6ee8b1c Merge "phpunit: Move "Logs generated by test" from middle to end of result" 2020-05-22 23:34:21 +00:00
Subramanya Sastry
76f6345fde Remove unused CSS styles from Parsoid's stylesheet
* We moved to using the Cite extension's resources in 2014
  https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/170936

* This unused CSS is just a source of confusion.

* The sub rule is not Cite-specific but since Parsoid doesn't
  special-case that tag, it doesn't belong here either.

Change-Id: I753dd0aa969158a23a424f7e7bfcb0e50e710b1b
2020-05-22 17:52:27 -05:00
Ori Livneh
0a82600a27 upload: Fix incorrect handling of missing file extension in UploadStash
The problematic code:

  $extensions = explode( ' ', $magic->getExtensionsForType( $mimeType ) );
  if ( count( $extensions ) ) {
    $extension = $extensions[0];
  }

If $mimeType is not known to MediaWiki,
   $magic->getExtensionsForType($mimeType) will return null.
explode( ' ', null ) is [""]. (Thank you so much, PHP!)
This means $extensions is nonempty (it contains the empty string), so
$extension is set to ''.

Change-Id: Icf387a9c93cb7351c2f48c69f413e7ad2224ba6b
2020-05-22 18:26:18 -04:00
Aaron Schulz
96ad0db6b4 filerepo: use makeGlobalKey() in ForiegnDBViaLBRepo::getSharedCacheKey()
Keys used by multiple wikis should use this key generation method.
It also means settings like "coalesceKeys" in WANObjectCache will
correctly identify these keys as being global.

This change should be deployed on all wikis at once.

Bug: T253405
Change-Id: Ie19613ef7643af92aeb56db203e3d79139143231
2020-05-22 21:24:37 +00:00
jenkins-bot
a001686895 Merge "Hard deprecate Revision::insertOn" 2020-05-22 20:42:22 +00:00
Reedy
141e0b0b35 Normalise length of language fields to varbinary(35)
Update length in patch-langlinks.sql and fix PK too
Update length in patch-sites.sql and fix PK too
Update length in patch-l10n_cache.sql and fix PK too

Re-use patch-langlinks-ll_lang-20.sql and update

Bug: T253276
Change-Id: I95bef3ef279cb59d54a3127c646a03826fa0da6b
2020-05-22 20:41:15 +00:00
jenkins-bot
5ec716b1f7 Merge "ExtensionRegistry: Fix doc typos" 2020-05-22 20:40:46 +00:00
jenkins-bot
a535c0bdde Merge "Make images on Special:NewFiles natively lazy-loaded" 2020-05-22 20:30:56 +00:00
Reedy
702a897aba ExtensionRegistry: Fix doc typos
Change-Id: Iae35e28c0b0751ebaf24a10865d1c94b9769e3c6
2020-05-22 20:23:06 +00:00
gilles
3e687333f3 Make images on Special:NewFiles natively lazy-loaded
Bug: T252423
Change-Id: I96a058469d21c37cc8d8a4f4ff21b73cbd93380c
2020-05-22 20:12:23 +00:00
Timo Tijhof
0c910b1684 phpunit: Move "Logs generated by test" from middle to end of result
The previous output meant that when reviewing the build output,
it was quite hard to quickly find what the problem was and in
which test because the start of the result (which mentions the
test suite) and the expected/actual diff, were often separated
by dozens or hundreds of lines of "helpful" debug logs.

These are now moved to the after the expected/actual/stacktrace
portion so that "Name of test" and "expected/actual" remain
together.

Before

> 1) ResourceLoaderFilePathTest::testGetters
> === Logs generated by test case
> …
> …
> …
> …
> …
> …
> …
> ===
> Failed asserting that two strings are identical.
> --- Expected
> +++ Actual
> @@ @@
> -'dummy/pat'
> +'bla'
> /var/mediawiki/tests/phpunit/resourceloader/ResourceLoaderFilePathTest.php:22

After

> 1) ResourceLoaderFilePathTest::testGetters
> Failed asserting that two strings are identical.
> --- Expected
> +++ Actual
> @@ @@
> -'dummy/pat'
> +'bla'
> /var/mediawiki/tests/phpunit/resourceloader/ResourceLoaderFilePathTest.php:22
> === Logs generated by test case
> …
> …
> …
> …
> …
> …
> …
> ===

Change-Id: I31f1a4b730a0dd8597a059034b4e6abdc5f48552
2020-05-22 20:48:28 +01:00
C. Scott Ananian
e71e025aba Add 'ParsoidModules' as a top-level core attribute in extension.json
See also I20f641a1ff032a6da3549b01dfaf8f4cf1eb5071, which uses this
attribute, and the earlier discussion in the (abandoned)
Ia251d631febf5be7fcad21cd8b73a68ec2785137.

Bug: T133320
Change-Id: I6c74938883376ec17f3790678b435585083a440f
2020-05-22 18:19:00 +00:00