Commit graph

63437 commits

Author SHA1 Message Date
Ori Livneh
207dfd2adf Add RejectParserCacheValue hook
Add a new hook, 'RejectParserCacheValue', which allows extensions to reject an
otherwise-successful parser cache lookup. The intent is to allow extensions to
manage the eviction of archaic HTML output from the cache.

Change-Id: I660679a48c46608f859bd52b31d6a888aabcc9ac
2015-06-23 11:23:57 -07:00
jenkins-bot
87e78ac110 Merge "Set Southern Kurdish to use Kurdish ordered list style type" 2015-06-23 11:35:48 +00:00
jenkins-bot
dae916558f Merge "EditPage: Check $wgContentHandlerUseDB" 2015-06-23 11:14:17 +00:00
jenkins-bot
33a995c696 Merge "Hygiene: Use [i] instead of charAt(i) for string index access" 2015-06-23 10:55:51 +00:00
jenkins-bot
8b04c0f0ae Merge "Added pre-emptive session renewal to avoid "random" submission errors" 2015-06-23 10:51:21 +00:00
jenkins-bot
0290b14a9c Merge "MediaWiki.php: Factor out tryNormaliseRedirect" 2015-06-23 09:14:04 +00:00
jenkins-bot
a72247699b Merge "Implement wfGlobalCacheKey() for database-agnostic keys" 2015-06-23 07:15:05 +00:00
Timo Tijhof
0f64b61271 Implement wfGlobalCacheKey() for database-agnostic keys
Some code paths abuse wfForeignMemcKey() for this purpose. This is semantically
incorrect and seems fragile. Also the empty second argument (for db-prefix) is
either misused or akwardly set to the empty string.

It also creates a namespace conflict between arbitrary application keys (from
the software) and any database names (from users). This commit reduces the
conflict surface down to a single key (namely, "global").

Also added unit tests to assert the implicit restrictions and
assumptions between these cache key functions are valid.

Change-Id: Ia0953b51005fe3de3b881dd1bd64c9d3c85e8c66
2015-06-23 07:52:18 +01:00
Timo Tijhof
64431fcf8e MediaWiki.php: Factor out tryNormaliseRedirect
This is in preparation for fixing T67402, which requires adding
logic inside this condition block. However the to-be-added code
will influences whether or not a redirect should be made.

In case a redirect is not made, it has to fall through to the next
'elseif' handler in MediaWiki::performRequest(), which is not possible
from inside the 'if' block.

Hence, move it out in a separate block and use a boolean return value
to communicate whether the case has been handled.

This also allows us to unit test this thing. Which is desperately
needed. Albeit ugly as it requires lots of mocking.

Change-Id: If3157f2ff1fd3ab2ca20a5d1f550d864ea62c493
2015-06-23 07:18:35 +01:00
jenkins-bot
25636af162 Merge "Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache" 2015-06-23 04:14:15 +00:00
jenkins-bot
ed42627460 Merge "Suppress deprecation warnings in 'jquery.mwExtension.test'" 2015-06-23 04:00:45 +00:00
Ori Livneh
b0a79e9245 Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache
'isParserCachedUsed' implies that the parser cache usage has already occurred,
and obscures the true purpose of this method, which is to determine whether or
not the requested page *should* be looked up in the parser cache.

Only usage in extensions is in TextExtracts, which I changed to be both
backward- and forward-compatible in If5d5da8eab13.

Change-Id: I7de67937f0e57b1dffb466319192e4d400b867de
2015-06-22 20:55:34 -07:00
Timo Tijhof
3fa451966b Suppress deprecation warnings in 'jquery.mwExtension.test'
Follows-up b0ee0c0.

Change-Id: I1e38ec9b7e822c177e038b2c83827a3910fe75ad
2015-06-23 03:52:08 +00:00
Ori Livneh
428c931271 Declare .icc files to be binary in .gitattributes
Follows I2ae35ddad: TinyRGB support for JPG thumbnails.

Change-Id: Ib8e7a74a6bc7b6cfbc674c8e271faa35b1f1a3c7
2015-06-22 20:49:25 -07:00
Ori Livneh
c099155a17 ellapsed => elapsed
Also fix some files that don't end with a newline.

Change-Id: Id0672d685b929a5832b42f733dad49683536180a
2015-06-23 03:32:33 +00:00
Ori Livneh
0586f3a44a WikiPage::isParserCacheUsed: change 'oldid' to 'oldId'
Change-Id: Ic68206a1f276c9e5a5b09ed5e2b0422589dfa161
2015-06-23 03:29:08 +00:00
Timo Tijhof
0b89dadc58 Hygiene: Use [i] instead of charAt(i) for string index access
Was mostly this way for IE6 compatibility which is no longer
relevant for our JavaScript runtime.

Change-Id: I7c441c7b40f40bb2974c4da5ea9f7a87119e7462
2015-06-23 00:34:24 +01:00
Ori Livneh
2f89482acb Fix undeclared dependency on jquery.mwExtension
Since jquery.mwExtension is deprecated, fix the undeclared dependency by making
the module not depend on $.ucFirst rather than by declaring the dependency.

Change-Id: I32b57662464e7dde0f61d6875196764fb61dcfba
2015-06-22 15:12:35 -07:00
jenkins-bot
f8ebb995b0 Merge "Make proxy behaviour of detectServer() configurable" 2015-06-22 22:00:06 +00:00
Gilles Dubuc
b276829806 Make proxy behaviour of detectServer() configurable
Bug: T75510
Change-Id: Ia6540962f8d913d925547189e101124f76d969c7
2015-06-22 21:19:22 +02:00
jenkins-bot
f6d42e3e4f Merge "Restore namespace-number keys in APIQuerySiteinfo siprop=namespaces" 2015-06-22 19:08:25 +00:00
jenkins-bot
2423f74d6e Merge "Use Linker::linkKnown for some links to MediaWiki pages from navigation" 2015-06-22 19:05:05 +00:00
jenkins-bot
6a35b1f500 Merge "Fix comment for grep in SpecialWantedfiles.php" 2015-06-22 19:05:01 +00:00
jenkins-bot
195f7096c7 Merge "Avoid undefined index on Special:Tags" 2015-06-22 19:04:55 +00:00
jenkins-bot
d68a94c735 Merge "Add LinkBatch to ImagePage for user pages in the file history" 2015-06-22 19:04:48 +00:00
Translation updater bot
c5a445f9b7 Localisation updates from https://translatewiki.net.
Change-Id: I414ed14d3d4e5a06c093eccd27ef73516239ac75
2015-06-22 20:52:00 +02:00
jenkins-bot
2a25c8ad7d Merge "Construct clean canonical URLs for wiki pages, ignoring request URL" 2015-06-22 18:18:40 +00:00
Ori Livneh
ade24dadcd Construct clean canonical URLs for wiki pages, ignoring request URL
Canonical URLs allow webmasters to indicate the preferred URL form for
accessing some content that can be reached via a multitude of URL patterns.
It is usually (but not always) distinct from the request URL, which may
feature things like aliases and session-specific query parameters.
We currently derive canonical URLs from request URLs, which is backwards:
it is the web application, not the client, that ought to know the canonical
way to refer to some content.

This patch ensures MediaWiki derives a clean canonical URL for all wiki
pages from the request context's title object and action.

For some assurance that this is the correct approach, see:
  http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

This Google blog post identifies Wikia as exemplary in its usage of canonical
URLs. Wikia disregards things like the requested revision ID (oldid=NNN) when
constructing the canonical URL. See, for example:
  http://fallout.wikia.com/wiki/Aqua_Pura_delivery_program?oldid=2171222

Wikia goes as far as canonicalizing the action=history to the page view URL.
I think that this is incorrect, because the history and info actions are not
views of the page content, but rather its associated metadata.

This affects all requests where "setArticleRelated" is true. This is typically
all urls that show content (title query, curid, oldid, diff), and all actions
thereof (edit, delete, purge, info, history etc.). It does not apply to
File pages and Special pages.

Bug: T67402
Change-Id: I1549ca056637981a0d751020c634b9fab387f7bc
2015-06-22 18:45:34 +01:00
Kunal Mehta
ed8ef675aa EditPage: Check $wgContentHandlerUseDB
Reject any edits that attempt to change the content model of a page if
$wgContentHandlerUseDB is false.

Change-Id: Ic2e0ed8f74c3a54864793a457a452f72fe637f73
2015-06-22 09:51:52 -07:00
Gilles Dubuc
584a239318 TinyRGB support for JPG thumbnails
TinyRGB is an ICC profile released by Facebook under CC0.
It is designed to be fully compatible with sRGB.
It offers the vast advantages of being much smaller than sRGB,
as well as being free as in freedom (the sRGB profile found in the
majority of JPGs is copyrighted).

This change aims to provide the ability to swap sRGB for TinyRGB at
the time thumbnails are generated.

JPGs that use another ICC profile than sRGB or no profile at all are
unaffected.

Bug: T100976
Change-Id: I2ae35ddad4e8a82db8b9541974367dc76c884e7a
2015-06-22 16:17:54 +00:00
jenkins-bot
e8e8670e7c Merge "Remove i18n references to Popularpages" 2015-06-22 14:56:38 +00:00
jenkins-bot
1f54fccca8 Merge "Deprecate jquery.mwExtension" 2015-06-22 13:58:39 +00:00
jenkins-bot
e846f0e068 Merge "Remove use of $.escapeRE in favour of mw.RegExp.escape" 2015-06-22 13:58:36 +00:00
jenkins-bot
4d264a3762 Merge "Introduce mediawiki.RegExp module" 2015-06-22 13:58:32 +00:00
mjbmr
f14356df5f Set Southern Kurdish to use Kurdish ordered list style type
* http://unicode.org/cldr/trac/ticket/8445

Follow-up to I9310a3b4a50c0b8ea6551d9f45e7a2e276a8a389

Change-Id: I6093494c4813b872323bb750cadfc024d6b5ed32
2015-06-22 12:31:13 +00:00
Translation updater bot
cd618c1bfd Localisation updates from https://translatewiki.net.
Change-Id: I430a6c78fac98611b4a6c31b0a75ec42afeade41
2015-06-21 19:27:55 +02:00
Vivek Ghaisas
ec02aba4c0 Change spaces to tabs
Bug: T103243
Change-Id: I145c056ef1b058c9c24b4a402ac9e7778b23e260
2015-06-21 10:00:58 +03:00
Vivek Ghaisas
d6def861bf Explicitly declare property visibility, remove use of var
Codesniffer says that the `var` keyword must not be used to declare a
property and that visibility must be declared on class properties.

Change-Id: I28240aa0f394588b1df315621dbcd260c51430c1
2015-06-21 00:07:13 +03:00
Vivek Ghaisas
9359cfffd4 tests/phpunit/phpunit.php: Add @codingStandardsIgnore comment
MediaWiki Codesniffer warns that "Silencing errors is discouraged".
Assuming this was done with good reason, this patch surrounds the
offending line with comments asking codesniffer to ignore the line.

Ironically, silencing errors about silencing errors.

Change-Id: Ib811b03b0a53735ce0da38bc8861ff38f9d1a666
2015-06-20 23:55:06 +03:00
Vivek Ghaisas
96c93a8cce maintenance/exportSites: Fix minor whitespace issue
Opening parentheses should be followed by a single space.

Change-Id: I9d73334c3c79bf5277248c56e0f146a91938b35c
2015-06-20 23:49:49 +03:00
This, that and the other
f0d6c2bf9f Restore namespace-number keys in APIQuerySiteinfo siprop=namespaces
Per discussion at the task.

Bug: T102645
Change-Id: Ic40f7fa3f5612b3d994cc01bcd0929545576041d
2015-06-20 22:24:31 +10:00
Timo Tijhof
4559185ae8 Remove use of $.escapeRE in favour of mw.RegExp.escape
Removes dependency on the generic jquery.mwExtension module I
wrote in 2011 which has rotten and contains largely unused utilities.

Change-Id: Id7025dc2be958840735f4a9a5b020bd876011740
2015-06-20 07:17:23 +01:00
Ori Livneh
b0ee0c01c2 Deprecate jquery.mwExtension
* Deprecating per Krinkle's comment on PS2 of Ie5f0e7d1c.
* No usage in NS_MEDIAWIKI on Wikimedia wikis after these two edits:
  - https://www.mediawiki.org/w/index.php?diff=prev&oldid=923287
  - https://www.mediawiki.org/w/index.php?diff=prev&oldid=923290

Change-Id: Ifb57ae9643bfc652c385b271a73f51577186f2d2
2015-06-20 07:10:05 +01:00
Timo Tijhof
8bee338d1c Introduce mediawiki.RegExp module
Simple module based on the $.escapeRE method of the old
"jquery.mwExtension" module.

Change-Id: I9e108a3f8c24d87bb239b63a14807a691c25aa3e
2015-06-20 07:10:00 +01:00
Aaron Schulz
03c1d480a7 resourceloader: Small code cleanups to ResourceLoaderModule
* Changed Exception => LogicException
* Broke some 100 char+ lines

Change-Id: I37bc72065cb567fdd9596f707facc27c6841c434
2015-06-20 04:01:42 +01:00
umherirrender
b4068ae922 Remove double str_replace( ' ', '_', $ ) when using LinkBatch
LinkBatch::add already handle the underscore/space part, that means it
is not need to do it on the caller side when adding user names to
LinkBatch

Change-Id: I09e80712903a539164141cc0a88d321203114677
2015-06-19 22:04:25 +02:00
umherirrender
79c44dd0a6 Add LinkBatch to ImagePage for user pages in the file history
Each user in the file history trigger an own query to get the state of
the user page, talk page and gender information. Use a LinkBatch to
combine all of these queries to two (one for pages, one for gender).

Change-Id: Ic1973c1ccfa17002b343d8c0d110a7c1d20b0460
2015-06-19 21:53:02 +02:00
jenkins-bot
352656b319 Merge "Fix some line indent of string concat" 2015-06-19 19:10:54 +00:00
jenkins-bot
f7ab1be261 Merge "Uncomment wfDeprecated call from I6ccd4df" 2015-06-19 19:09:40 +00:00
umherirrender
6b24d10b6d Fix some line indent of string concat
Change-Id: I5883c9cd57d106168648b4502051b4b49046fea2
2015-06-19 20:52:43 +02:00