Commit graph

42271 commits

Author SHA1 Message Date
Bryan Davis
8b413431d7 Guard against allowing intermediate caching when cookies are present
Output cache-control headers that disable intermediate caching even if
OutputPage->mEnableClientCache is true when the response includes
set-cookie headers as well. This change mirrors logic that has been in
use on the Wikimedia Foundation production cluster's Varnish cache
system for over 2 years to guard against accidentally caching backend
responses which include Set-Cookie headers.

Co-Author: Max Semenik <maxsem.wiki@gmail.com>
Bug: T127993
Change-Id: I1a0d38a5b9dba754b91a7832371b3dc0df51bd5a
2016-02-29 15:29:58 -07:00
Ricordisamoa
7972c460ed Add missing 'public' keywords to some MediaHandler methods
* getParamMap
* validateParam
* makeParamString
* parseParamString
* canRender
* mustRender
* isMultiPage

Change-Id: I0c00a61abf9be400dca5407370ca2c232d57ae17
2016-02-24 00:47:02 +01:00
Translation updater bot
7a31c491d4 Localisation updates from https://translatewiki.net.
Change-Id: I38e60872965bf5f1f0074c41a9b3773487331fa8
2016-02-23 22:09:58 +01:00
Ori Livneh
2c1e550b6f Revert "Log multiple IPs using the same session or the same user account"
This reverts commit f22549a605.
Per T125455#2054194.

Bug: T125455
Change-Id: Ic2049381e98586e91974fc5b47d9e857a73414a4
2016-02-23 20:13:48 +00:00
jenkins-bot
bdb6d28079 Merge "resourceloader: Remove $wgUser optimization that uses session " 2016-02-23 19:54:05 +00:00
Bryan Davis
77e51f50e7 resourceloader: Remove $wgUser optimization that uses session
Remove optimization that avoids unstubbing $wgUser because $wgUser
is not a plain object for the current user name.

It's a stub with mFrom='session' until methods are called that need
the info, such as getName(), which then lazy loads the object based on
the session information.

We want to make load.php session-less.

Bug: T127233
Change-Id: Ica482e5d1892cb29456e6f2a91cd70017cf414c5
2016-02-23 19:45:26 +00:00
jenkins-bot
517e327a3f Merge "JsonContent: Call member functions with '$this->', not 'self::'" 2016-02-23 17:34:16 +00:00
jenkins-bot
82da53219b Merge "Avoid pointless doBatchLookups() query for user contributions" 2016-02-23 17:21:54 +00:00
jenkins-bot
7c0213066b Merge "CachedBagOStuff: cache backend misses" 2016-02-23 15:03:42 +00:00
jenkins-bot
5a010ca89d Merge "Add toggle checkboxes to action=history" 2016-02-23 08:29:46 +00:00
jenkins-bot
2827bfbca5 Merge "Remove wfCheckEntropy() as unused and deprecated in 1.27" 2016-02-23 08:24:46 +00:00
jenkins-bot
8515a2e32d Merge "Fix resource path check when ResourceBasePath is an empty string" 2016-02-23 01:53:38 +00:00
Bryan Davis
2bcf34421a CachedBagOStuff: cache backend misses
Cache misses from the backend cache the same as hits.

Bug: T127772
Change-Id: If2fe1920411b24862acea888c627db13717da8bd
2016-02-22 18:45:20 -07:00
Aaron Schulz
69ca735c69 Avoid pointless doBatchLookups() query for user contributions
This shows up in slow query reports a lot.

Change-Id: Ic1cf45fae87655e0b9d09fdc96aa2b2c22de2c11
2016-02-22 16:56:36 -08:00
jenkins-bot
1dd2acf48c Merge "Enforce MW_NO_SESSION, add MW_NO_SESSION_HANDLER" 2016-02-22 23:49:12 +00:00
Tim Starling
a2530a9fb8 Fix resource path check when ResourceBasePath is an empty string
If you have MediaWiki installed in the root of the domain, then
$wgScriptPath and $wgResourceBasePath is an empty string. In HHVM and
PHP, passing an empty string as the second parameter of strpos() causes
a warning and returns false, which will cause the condition to fail, as
if the path were not within the base path.

So, normalize such paths. Using substr() instead of strpos() for a
"starts with" check would have worked except that RelPath also fails
when given an empty string.

Bug: T127652
Change-Id: If7e94ae638d6834f7cc0f31f67a5fe6a2f74771c
2016-02-23 09:19:26 +11:00
Translation updater bot
d651abc99d Localisation updates from https://translatewiki.net.
Change-Id: I2d18d11d274f565e92623563b5f0550a5ed527c1
2016-02-22 21:24:10 +01:00
Kunal Mehta
3167a7162c JsonContent: Call member functions with '$this->', not 'self::'
Change-Id: I7dab69ff77c98439f90e7d79f31d0e9128728683
2016-02-22 11:48:35 -08:00
Reedy
95b2be3bd3 Fix function call casing
Change-Id: I20600c865b9f239ac281a1f8c5776ad4dbec4359
2016-02-22 18:30:33 +00:00
jenkins-bot
2b7c158231 Merge "Fix session store logging" 2016-02-22 17:28:35 +00:00
jenkins-bot
62ec66bb11 Merge "Use hex2bin() instead of pack()" 2016-02-22 17:18:00 +00:00
Brad Jorsch
f61cb18b71 Enforce MW_NO_SESSION, add MW_NO_SESSION_HANDLER
When an entry point specifies MW_NO_SESSION, actually enforce that by
having both SessionManager and PHP's session handling (session_start()
and friends) throw exceptions.

If an entry point needs the old behavior of using PHP's default session
handling (as defined in php.ini), it should define
MW_NO_SESSION_HANDLER instead of or in addition to MW_NO_SESSION.

This also makes PHPSessionHandler be installed in CLI mode, where it
wasn't installed before.

Bug: T127233
Change-Id: I2a3db06ee8e44a044096c57a819b5fd5e51c5c5c
2016-02-22 12:17:31 -05:00
Brad Jorsch
405c2c8b6b Fix session store logging
Two things were wrong here:
1. SessionManager shouldn't override the configured logger of the
   underlying store.
2. CachedBagOStuff shouldn't override the configured logger of the
   backend store on construction.

Change-Id: I24ed5a81d5b238a42934a7890dd8d0a9f9bb3b6f
2016-02-22 17:13:03 +00:00
jenkins-bot
a103e82647 Merge "Remove some unused variables" 2016-02-22 17:03:23 +00:00
Brion VIBBER
a399affb65 Merge "Tidy: <source> and <track> are empty elements" 2016-02-22 15:24:23 +00:00
jenkins-bot
d60ca49846 Merge "Don't URL encode titles when revdeling from Special:Undelete" 2016-02-22 01:12:39 +00:00
Arlo Breault
87f43fd803 Match html5 unquoted attribute parsing
* Brings us closer to the html5 attribute parsing algorithm described
   in http://www.w3.org/TR/html5/syntax.html#before-attribute-value-state

 * There's a similar patch for the Parsoid in,
   I2160a23b2a3c914eb369347bbf5d58328440041d

 * The spec says <div class=  style="123">hi</div> should parse as
   <div class="style=\"123\"">hi</div>, which it now does, whereas it
   used to yield <div class="" style="123">hi</div>.

 * Merge with caution. This is going to break pages like,
   frwikisource/La_Mirlitantouille_(Lenotre)?oldid=4669681

Bug: T108134
Change-Id: Ic2fc1b573a55a847e6c05707678b58c1189ecc52
2016-02-22 00:50:06 +00:00
Translation updater bot
222814598b Localisation updates from https://translatewiki.net.
Change-Id: I9d1b78ddb3fa02956e4b01c137691cf6f290b958
2016-02-21 21:57:15 +01:00
Luke Faraone
1cfa5d284b Don't URL encode titles when revdeling from Special:Undelete
URL encoding is here handled by getFullURL so calling wfUrlencode resulted in
double-encoding.

Bug: T127091
Change-Id: Ibc32afb80bd220b87d2c4a816398cc10345e7ac4
2016-02-21 20:35:24 +00:00
Luke Faraone
460ea2524c Add toggle checkboxes to action=history
This breaks out the toggle checkbox code into a separate class in
includes/ListToggle.php

Bug: T92230
Change-Id: I8d1aefb83008053e63d59abf8b8915b93e15fcc2
2016-02-21 20:34:42 +00:00
Derk-Jan Hartman
72f54e4f85 Tidy: <source> and <track> are empty elements
Seems these got accidently added as inline items, even though they
should be and are output as empty elements. This should correct that.

Bug: T122787
Change-Id: I6e75529c9d349050479c1b7ad758320d1e948e78
2016-02-21 19:30:55 +01:00
jenkins-bot
d69210b4ff Merge "Document memory-limit as a possible exit reason" 2016-02-21 17:07:11 +00:00
jenkins-bot
41a15e0df3 Merge "CatMembChange use timestamp from revision where possible" 2016-02-21 06:31:18 +00:00
jenkins-bot
edc2aedbf8 Merge "resourceloader: Add content hash to static debug urls" 2016-02-21 02:40:28 +00:00
Timo Tijhof
792054a2a4 resourceloader: Add content hash to static debug urls
This way, they automatically bypass any stale client or server cache.

Remove an old wfExpandUrl() call that would interfere with
transformResourcePath()'s ability to recognise the path.

Expanding the url there wasn't needed anyway. Whether it's on a separate host
(eg. bits.wikimedia.org), or path-absolute, either way works as-is.

Bug: T90983
Change-Id: I64eb3291adcfc3733ef96690399c09c06e19b3aa
2016-02-20 22:40:44 +00:00
Translation updater bot
3a595014a7 Localisation updates from https://translatewiki.net.
Change-Id: I80bb2ffabf103ac061320924ff1bee7f6c13769c
2016-02-20 21:46:29 +01:00
Niklas Laxström
daf2abc4f5 Document memory-limit as a possible exit reason
Change-Id: I96748cd8397969447bd2315f0e6b6e7989ddfc4f
2016-02-20 21:33:41 +01:00
Reedy
f8a58fa67e Remove some unused variables
Change-Id: Ia3a290555f06c564c063591710380367a04cb1cc
2016-02-20 20:22:56 +00:00
Reedy
6ad9e97182 Remove wfCheckEntropy() as unused and deprecated in 1.27
Change-Id: Ib2eda8c5ab7b124a283b9e0ec934c034d3da864c
2016-02-20 20:19:43 +00:00
Kevin Israel
6492c009ef Use hex2bin() instead of pack()
This function was added in PHP 5.4.0 and can be used now that MediaWiki
only works with PHP 5.5.9 or higher.

Also fixed a bug in ApiQueryCategoryMembers::validateHexSortkey() that
allowed a single line feed at the end of the string to pass.

Change-Id: I5b577e7dcc5fb6a06ab550429aae657dbcc79083
2016-02-20 00:27:24 -05:00
Translation updater bot
49b06bc91d Localisation updates from https://translatewiki.net.
Change-Id: I72d9974730d1ae1dfbd1b02968a9e1dfab71b525
2016-02-19 21:49:58 +01:00
Fomafix
6b976d825a Update comments about language codes
* RFC 3066 is obsoleted by RFC 4646.
* RFC 4646 is obsoleted by RFC 5646.
* All are also known as BCP 47.
* Language codes must treated as case insensitive.
* There exist conventions for the capitalization of some of the subtags.
* Write a space between BCP and 47 in comments.
* http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf is not available.
* https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2014-12/XMPSpecificationPart1.pdf
  is the new position.

Change-Id: I91e305fd5754cf4dedf8fd7460f7d3375f792c89
2016-02-19 07:31:51 +00:00
jdlrobson
d9a3ae564c EditPage: Style anonymous editor warning as a warningbox for consistency
Most projects override this anyway, but for default installs, let's
be consistent with other warning messages so it's clearer what is
going on.

Bug: T127403
Change-Id: I22c51a46a249247abccda709d74356e8e31a19a8
2016-02-19 00:38:49 +00:00
jenkins-bot
a85d1b9d0c Merge "rc_old/new_len null for CategoryMembership RC change" 2016-02-18 23:45:50 +00:00
Timo Tijhof
17b9ee558f MimeMagic: Recognise .htc as text/x-component
Matches behaviour of nginx:
https://github.com/wikimedia/operations-debs-nginx/blob/be600c8b/debian/conf/mime.types#L15
>  text/x-component                      htc;

Without this, wmfstatic fails to serve "csshover.min.htc".

Bug: T99096
Change-Id: I90c546ff5204ddd9ffa99fdaebee78c7856c32ed
2016-02-18 21:19:40 +00:00
jenkins-bot
1fe596cbe6 Merge "Minor code clean up in SpecialBooksources" 2016-02-18 21:04:06 +00:00
Translation updater bot
215c8bd889 Merge "Localisation updates from https://translatewiki.net." 2016-02-18 20:57:11 +00:00
jenkins-bot
5899a83ea8 Merge "Stop doing $that = $this in includes/specials" 2016-02-18 20:57:06 +00:00
Translation updater bot
dbab0702e0 Localisation updates from https://translatewiki.net.
Change-Id: I3dece5b748fbe9b4c57cbf823c60f8464ccf8de3
2016-02-18 21:52:46 +01:00
Kunal Mehta
0ec0fa4028 Don't send RC_CATEGORIZE events to the IRC feed
Bug: T127360
Change-Id: I21e4c0edf25fc0b7f16ef3029de879d3b7a2923d
2016-02-18 12:19:08 -08:00