Commit graph

3232 commits

Author SHA1 Message Date
jenkins-bot
3e68722e29 Merge "Update documentation in DefaultSettings to reflect new Preprocessor default" 2019-06-20 22:39:16 +00:00
C. Scott Ananian
ce1bd86a4b Remove $wgUseKeyHeader and OutputPage::getKeyHeader(), deprecated in 1.32
These implemented a since-abandoned draft IETF spec, and the code was
broken due to (1) case-(in)sensitivity issues with the Accept-Language
header and (2) the BCP47 language code compatibility workaround we use.

Change-Id: Ia53d07cd8ce8ab1497294ea244c13c7499f632c7
2019-06-19 15:14:54 -04:00
C. Scott Ananian
da0a0a85c3 Update documentation in DefaultSettings to reflect new Preprocessor default
This is a follow-up to Ica5d1ad5b1e677542962fc36d582a793f941155e and
updates a bit of documentation missed in the original patch.

Change-Id: Iaf2b07be4b6946782780a846f026c071edaaf567
2019-06-19 01:58:37 -04:00
Fomafix
110a5877e9 Use [...] instead of array(...) in PHP comments and documentation
Change-Id: I0c83783051bf35fe785bc01644eeb2946902b6b2
2019-06-17 21:15:09 +02:00
C. Scott Ananian
53fe91ded5 Hard deprecate Preprocessor_DOM
The Preprocessor_DOM implementation doesn't interact well with PHP memory
profiling, and has some limitations not present in the Preprocessor_Hash
implementation (see T216664).  There is no reason to keep around two
versions of the preprocessor: it just complicates on-going wikitext
feature development.

Hard deprecate use of Preprocessor_DOM, so we can remove the redundant
code in a future release.

Bug: T204945
Depends-On: Id38c9360e4d02b570996dbf7a660f964f02f1a2c
Change-Id: Ica5d1ad5b1e677542962fc36d582a793f941155e
2019-06-14 12:21:40 -04:00
jenkins-bot
7c966af21a Merge "REST API initial commit" 2019-06-13 22:18:21 +00:00
Tim Starling
3f0056a252 REST API initial commit
Add some of the basic REST API class hierarchies:

* EntryPoint
* Router
* Request
* Response
* Handler

The actual entry point file rest.php has been moved to a separate
commit, so this is just an unused library and service.

Bug: T221177
Change-Id: Ifca6bcb8a304e8e8b7f52b79c607bdcebf805cd1
2019-06-12 10:22:28 +10:00
Brion Vibber
2e83387666 Relax HTML sniffing checks on image upload
Allows uploaded files to include some HTML tag strings that were
previously forbidden in the first 1k or so of the file:
* <a href
* <img
* <pre
* <table
* <title

They are now allowed as long as the IE MIME type detection heuristic
would not change their types. This should reduce the number of false
positive checks in JPEGs with EXIF data with links.

Also deprecates $wgAllowTitlesInSVG and allows it by default.

This should still protect against malformed PNG attacks on old IE
versions, though false positive checks are conceivable on PNG files
containing comments very close to the beginning of the file.

Adds $wgVerifyMimeTypeIE config var to allow disabling the IE checks
entirely, if desired, but leaves it in place by default. These are
more conservative than the checks that were removed.

Added test cases for the old IE5/6 bug and the particular sort of
JPEG metadata that struck false positives previously.

Bug: T27707
Change-Id: I66642a74fce1a1894cad67d62b0da61020db469a
2019-06-07 14:21:00 -07:00
Brian Wolff
616525021b SECURITY: rate-limit and prevent blocked users from changing email
This is to counter spam where people use Special:ChangeEmail to
spam people with the confirmation email and using the username
to promote their thing

Bug: T209794
Change-Id: I8b2bd0f60c66f44c91dc78e3512a73e4237df2f3
2019-06-06 16:37:18 +00:00
Simon Legner
eb59b8f10b Fix typos in DefaultSettings
Change-Id: I692286d68bdf5585694c8a65d9d9d512f813fb9e
2019-05-28 23:59:06 +02:00
James D. Forrester
f9f8dff40f Rename CDN config variables to be generic, deprecating the old names
Hook, methods, classes still to rename where appropriate.

Bug: T104148
Depends-On: Id34339dff88bc6d1863378ac94b96b2d590b891d
Depends-On: I4e2938395bcbf7956b83fff00978f09c61dcfa36
Change-Id: I7a725dae551c867a4fa7c213838d52c7fb862756
2019-05-24 21:09:22 +00:00
jenkins-bot
d029197c7c Merge "Enable configuration to supply options for Special:Search form" 2019-05-23 14:48:55 +00:00
Stanislav Malyshev
3562f0afc7 Enable configuration to supply options for Special:Search form
This for example will allow to display descriptions by setting:

$wgSpecialSearchFormOptions['showDescriptions'] = true;

Bug: T55652

Change-Id: Ifdbca4c508314cb950f2835ee65caea18e0af5b1
2019-05-22 17:30:53 -07:00
Adam Wight
2eec94991b Deprecate $wgWikiDiff2MovedParagraphDetectionCutoff
Bug: T194272
Change-Id: I174192dc2b91409e023c06b054bc1bba8bfc571f
2019-05-22 15:42:20 +02:00
Fomafix
79de0a4e5a Use HTTPS instead of protocol relative for WMF links
The WMF websites redirect from HTTP to HTTPS.

Change-Id: I916c97697b4ffa9774eec9c8e6ab650a08bb6edd
2019-05-17 08:12:10 +02:00
Marko Obrovac
01c2e25f0a Allow the request ID to be passed in via the X-Request-Id header
For tracing and logging purposes, we want to be able to see/generate the
list of all of the requests that happen in the environment for a given
external incoming request. To that end, allow Mediawiki to accept the
request ID provided by the incoming request as its own.

Since this may be problematic for set-ups that don't have an entity in
front of MW that sanitises the headers on the way in, introduce a new
global variable, `$wgAllowExternalReqID`, that can disable this
behaviour. By default, the feature is disabled.

Bug: T201409
Change-Id: I605471fb8b5bbc290baeecc7d80d9d715cb240c9
2019-05-15 07:27:38 +00:00
jenkins-bot
11f73158fb Merge "Remove rcenhancedfilters from $wgDefaultUserOptions" 2019-05-08 21:12:22 +00:00
Roan Kattouw
3c9f343ecb Remove rcenhancedfilters from $wgDefaultUserOptions
This preference was removed earlier, but we forgot to clean this up.

Bug: T196033
Change-Id: I449bcaf8c031d9d26a6f6be3eb0ef4abc5892611
2019-05-08 13:34:54 -07:00
Timo Tijhof
b96e187cbd localisation: Improve documentation around wgLocalisationCacheConf
Bug: T218207
Change-Id: I15a77d5df7b358b69cd9049036a69a28d31ebaae
2019-05-07 22:40:44 +00:00
jenkins-bot
d848678e55 Merge "rcfeed: Replace usage of deprecated class RCFeedEngine (in comments)" 2019-05-06 11:43:00 +00:00
Aryeh Gregor
9018579681 Deprecate the Http class
All methods got moved to HttpRequestFactory or MWHttpRequest or dropped.

I made the return value of the new HttpRequestFactory::request/get/post
methods null on error instead of false, so that when we drop PHP 7
support, we can use a "?string" return value. This could theoretically
change behavior of code that was switched from the old Http methods, but
probably won't. I kept the old behavior for the deprecated methods.

I changed the default value of $wgHTTPProxy from false to ''. This way
it should be usable directly without a trivial wrapper method. For the
benefit of anyone who might have set it to false in LocalSettings.php, I
also recommend casting to string just in case.

Http::$httpEngine is deprecated. Eventually it will be removed along
with the curl and PHP engines, leaving only the Guzlle engine.

I also added deprecation of MWHttpRequest::factory, which occurred in
1.31, to the release notes for 1.34. Now hopefully we can hard-deprecate
it in another couple of versions.

Bug: T214390
Change-Id: I2a316a758d793857f248bd251b90f5e9a6440e3a
2019-05-06 12:07:26 +03:00
Aaron Schulz
4d8bfbdca4 Add UserOptionsUpdateJob class
This can help avoid DB master queries on HTTP GET requests

Change-Id: I6fa2d53d96509d88f5d3e1ff18f3ca1de8fa4bb1
2019-05-03 12:02:20 -07:00
Brad Jorsch
d16d8bdf07 Default $wgActorTableSchemaMigrationStage to SCHEMA_COMPAT_NEW
Probably good to start testing this in CI sometime soon.

This also updates a bunch of tests that were forcing an older stage to
force SCHEMA_COMPAT_NEW instead, or to test both ways (until a future
patch removes the _OLD version).

Bug: T188327
Change-Id: Icb9b55cb9d754f2d30d6883005658b9670834756
2019-05-01 00:48:54 +00:00
Derick Alangi
0001b213e5 rcfeed: Replace usage of deprecated class RCFeedEngine (in comments)
Doing the replacement for code logic for where it's used is breaking
compatibility, the first change set did this but as adviced, let's wait
for a while until the class is removed.

Change-Id: I3cc0593080f0d51b380c9cdbabc646459e6798e1
2019-04-30 12:07:37 +00:00
jenkins-bot
8c2eb40f59 Merge "Remove block notice tracking" 2019-04-24 13:59:44 +00:00
Dayllan Maza
dadaf0ac2c Remove block notice tracking
This is a clean up after collecting the necessary data related to
blocks and how often users see the block notices

See: https://phabricator.wikimedia.org/T189724

Bug: T214214
Depends-On: I047587c064e63e8bd4b933351edfec298f7c7956
Depends-On: I532a0cd95009109ba25caa8dd31badd5c1900da7
Change-Id: Icfa74ad6337c0a4f12ae24b43d36c0e3cb302a3b
2019-04-23 17:49:12 -04:00
Gilles Dubuc
7433fa97f6 Make the ratio of requests getting Priority Hints configurable
This will allow to create 2 separate populations in
order to verify the effect of the hint.

It's fine if it's not exactly balanced in practice,
what matters is getting a significant amount of
traffic for both scenarios (origin trial is enabled +
an image is given high prio/origin trial is enabled +
no image is given special treatment).

Bug: T216499
Change-Id: I373960b2bed8437c2e97e6d729d43aff6901046c
2019-04-22 22:00:19 +03:00
jenkins-bot
da89b88536 Merge "Add ability to override mb_strtoupper in Language::ucfirst" 2019-04-17 16:44:47 +00:00
Giuseppe Lavagetto
d46835ef4f Add ability to override mb_strtoupper in Language::ucfirst
Different PHP versions treat unicode differently, and specifically some
wiki resources become unreachable if mb_strtoupper's behavior has changed.
This patch allows to introduce an override table that allows to smooth
the transition period.

It also provides maintenance scripts to generate such an override table.

Bug: T219279
Change-Id: I0503ff4207fded4648c58c7b50e67c55422a4849
2019-04-17 15:18:44 +00:00
Aryeh Gregor
e6df285854 Remove all $wgParser use from core
Bug: T160811

Change-Id: I0556c04d33386d0339e02e2bf7a1ee74d97c2abd
2019-04-17 15:16:50 +03:00
Gilles Dubuc
0e2f0a2f28 Reporting API and Feature Policy reporting support
These are experimental APIs that lets one report
policy violations:

https://www.w3.org/TR/reporting/
https://github.com/w3c/webappsec-feature-policy/blob/master/reporting.md

Bug: T209572
Change-Id: I002e7802000ec37b3320d8ae761cc1888d4f6edb
2019-04-13 09:28:27 +02:00
Fomafix
9cbb8f104d Use https://www.php.net/ instead of https://secure.php.net/
Change-Id: I0acca592c6909e91b28b904da49dcbd6a43cd2a5
2019-04-12 06:44:48 +02:00
jenkins-bot
e3c745fea0 Merge "Prepare for REL1_33 cut, labelling master as 1.34-alpha" 2019-04-11 00:29:00 +00:00
James D. Forrester
4310469dd8 Prepare for REL1_33 cut, labelling master as 1.34-alpha
Change-Id: I841ee1c898a6db2e4a10b5e8c68647d45f046dc7
2019-04-10 16:50:58 -07:00
jenkins-bot
013b6fac88 Merge "NamespaceInfo service to replace MWNamespace" 2019-04-10 05:46:24 +00:00
Aryeh Gregor
76661cf129 NamespaceInfo service to replace MWNamespace
MWNamespace::clearCaches() has been removed entirely, along with the
$rebuild parameter to MWNamespace::getCanonicalNamespaces(). The rest of
MWNamespace is deprecated.

Diff best viewed with -C1 so git notices that NamespaceInfo is a copy of
MWNamespace.

Depends-On: Icb7a4a2a5d19fb1f2453b4b57a5271196b0e316d
Depends-On: Ib3c914fc99394e4876ac9fe27317a1eafa2ff69e
Change-Id: I1a03d4e146f5414ae73c7d1a5807c873323e8abc
2019-04-10 02:07:36 +00:00
Brad Jorsch
0301c8e03a Default $wgActorTableSchemaMigrationStage to READ_NEW
Probably good to start testing this in CI sometime soon.

The unit tests being changed here are:
* Hacky importing of a revision in MessageCacheTest, changed to use an
  interwiki username.
* WikiPageDbTestBase will get null rather than 0 for ar_user.
* DumpTestCase was using a custom IP $wgUser when creating its test
  revisions, which was winding up referring to an actor_id that had been
  deleted from the database. Fixed by having it use a registered user
  instead.

Also this has MediaWikiTestCase reset the $wgUser User object when the
actor table is truncated, as various tests were otherwise failing because
it was caching a later-deleted actor ID for User:127.0.0.1.

Bug: T188327
Change-Id: Ic483d0fda931810ac639b9de1cc5e5a4ef8161cc
Depends-On: I1bd0288cc132627d75b4001219522ec5e952eda7
2019-04-09 13:50:41 -04:00
Aaron Schulz
196ef348c5 jobqueue: remove entire unused JobQueueAggregator class hierarchy
Change-Id: I3d56d5db54fcb4278c7cf2a8d08933c27773c3f7
2019-03-29 20:25:05 -07:00
Aaron Schulz
798d3d048a Clean up some database domain ID related code and fix some comments
Change-Id: Id5c5640e05301161dbb7c2be363e32d7d1c9a511
2019-03-29 14:30:21 -07:00
jenkins-bot
a3ab671e61 Merge "Remove temporary rollback confirmation toggle" 2019-03-28 09:28:12 +00:00
Aaron Schulz
c4e284f113 rdbms: codify DatabaseDomain table "_" prefix convention
Alos simplify isCompatible() slightly and make the string
case in convertToString() explicit.

Change-Id: Ifb61bb5fb012491520525bbebfbde2269fa55b52
2019-03-26 21:04:51 +00:00
Tim Eulitz
8736acada9 Remove temporary rollback confirmation toggle
This patch removes the temporary rollback confirmation toggle that was
implemented to allow certain wikis to disable the rollback confirmation
feature while still showing the option in the user preferences.

For reference:

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/494249

Bug: T217437
Change-Id: I001d7927f6f44a4cc517a80b71f5b83aca33824c
2019-03-26 10:13:45 +01:00
Derick Alangi
26118ad094 DefaultSettings: Remove deprecated $wgDBmysql5 from core
This was an experimental configuration setting and was supposed
to be removed in 1.33. Also, remove option from db.

Bug: T196185
Change-Id: I357348505589ff963d668acadce3b58fe2a1b0bb
2019-03-23 14:52:33 +01:00
Tim Eulitz
c4e5364ea0 Implement temporary rollback confirmation toggle
This change implements a temporary feature toggle for the rollback
confirmation change. The main purpose is to allow users of certain wikis
(de-wiki, pl-wiki, for example) to turn off this upcoming feature before
it is released to production.

Bug: T217039
Change-Id: I6ed59afde5b75756053da3ae46858304dda9317d
2019-03-21 14:21:13 +01:00
daniel
45f3912bf1 Make the XML dump schema version configurable.
Bug: T174031
Change-Id: I979b6c8f0a72bc1f5ecce1d499d3fdfa0f671588
2019-03-21 12:43:32 +01:00
Tim Eulitz
341320457c Show confirmation prompt on rollback links
Bug: T215020
Change-Id: Ic831888e30808a20a04397912498fe2ca04f80ba
2019-03-21 10:13:22 +00:00
Gilles Dubuc
e83e1fc1ee Add support for Element Timing API
https://github.com/WICG/element-timing

Bug: T216598
Change-Id: Ieda41f5074784957760c17dc15f7c891e56b6795
2019-03-20 09:54:02 +01:00
Timo Tijhof
074ce9ab14 User: Remove redundant wgClockSkewFudge code
Ensuring the new value is at least as high as 1 second higher
than the current value is sufficient.

The main code paths using this are checkAndSetTouched (for user group
changes) and saveSettings(), both of which use makeUpdateConditions() which
ensures we bail out if something else already wrote to it in the mean time.
As such, there is no longer a need to make sure our time is higher than
something another server may have written, given that is no longer something
we support.

This variable was introduced in 2005 (MW 1.4) with r9403 (1d12276bcb),
and factored out as newTouchedTimestamp() in 2007 (MW 1.8)
with r16772 (c1094ba987).

Change-Id: I940fb0dd125286a4a348c11e2c8d197f9288a75d
2019-03-15 20:03:54 +00:00
Timo Tijhof
4677392718 Remove wgSitesCacheFile and rebuildSitesCache.php (unused)
This seems to have been intended as optimization for SiteStore,
but was never used as far as I can tell. Instead, SiteStore is
already cached via LocalServerCache (APC).

Keep the FileBasedSiteLookup class for one release cycle in case
third parties not indexed by MediaWiki Codesearch are using it.

== History

* 2013: Report of high memcached usage by Wikibase via SiteStore.
* 2014: Lazy-load the data in Wikibase (d3f2e99cb6).
* 2014: Implement the file-based cache (via T47532 and 90f6efc360).
* 2015: Use local-server cache (APC), per T58602.

The file-based code was never used. The related task marked
invalid (T47532).

Change-Id: I8e2d9edcf3880149f824cc3de37793ca57435b49
2019-03-15 20:03:44 +00:00
jenkins-bot
5a2e5db4fc Merge "Add password policy setting suggestChangeOnLogin" 2019-03-12 16:35:00 +00:00