Commit graph

4577 commits

Author SHA1 Message Date
jenkins-bot
171255101f Merge "Use file width/height instead of metadata for getContentHeaders" 2017-05-24 06:44:54 +00:00
Kunal Mehta
7e48fdd76f session: Avoid deprecated wfMemcKey()
Change-Id: I4d77c2c52ef43cbc54878ce920595befd270a28e
2017-05-23 22:25:27 -07:00
Gilles Dubuc
84e4d75088 Use file width/height instead of metadata for getContentHeaders
This allows us to populate X-Content-Dimensions without touching the
existing metadata format. Which makes the migration of existing content a lot faster by
only having to run refreshFileHeaders.

Bug: T150741
Change-Id: I2c0f39b2b01f364c3fab997ccc2f874b7f101d8a
2017-05-23 19:18:58 +00:00
jenkins-bot
82c5dd51e6 Merge "Avoid SearchEnginePrefixTest postgres failures" 2017-05-23 16:06:03 +00:00
jenkins-bot
f494883ac2 Merge "Use test user helper methods in UserGroupMembershipTest/UserTest" 2017-05-23 13:12:47 +00:00
jenkins-bot
e109000943 Merge "Remove TestingAccessWrapper class (now available via composer)" 2017-05-23 07:51:36 +00:00
jenkins-bot
cfb04229b2 Merge "resourceloader: Add tests for OutputPage::buildExemptModules" 2017-05-23 01:00:55 +00:00
Aaron Schulz
daaeb407af Avoid SearchEnginePrefixTest postgres failures
Slash was ranked a bit differently in how postgres sorts
(seems to be based on the utf8 units as raw bytes).

Bug: T75174
Change-Id: I0a7f3859945218319b3f418f607c0299d8569c61
2017-05-22 17:28:42 -07:00
Gergő Tisza
fcd495ffef Remove $wgExceptionHooks
Skip deprecation period because it is very unlikely that anyone used this:
it does not appear anywhere on gerrit/git, no nontrivial google hits,
the documentation has been flat out wrong for 9 years and no one
noticed it, and the whole feature is fairly useless as you need to declare
it separately for every single exception class you expect.

Change-Id: I85844a238d3135d05eeba10331149624b04bafe2
2017-05-22 00:57:44 +02:00
jenkins-bot
d6b65d8b91 Merge "resourceloader: Allow modules to be registered via a factory callback" 2017-05-21 17:28:32 +00:00
daniel
2b3762ecb4 resourceloader: Allow modules to be registered via a factory callback
This should work the same way as registering API modules via a factory callback.
Point in case: Ifb8611473a971 could avoid global state using this mechanism.

Change-Id: Ifbf29006141ce2a2dff42efa352f406502a06bc6
2017-05-21 17:12:37 +00:00
TK-999
c182df6e38 In Autopromote skip edit count lookup if requirement is 0 or invalid
Autopromote makes a DB call to fetch user edit count when checking edit count requirements. We can skip this call if requirement is set to 0 or invalid (less than 0).

Bug: T157718
Change-Id: I7bcfa6e7e4991fe7b48bef84ad24621564261abc
2017-05-21 14:30:42 +00:00
jenkins-bot
9e8355c87d Merge "Allow namespaces defined in extension.json to be overwritten locally." 2017-05-21 08:02:22 +00:00
jenkins-bot
c6d01b6e43 Merge "Various test fixes for postgres" 2017-05-20 19:11:35 +00:00
Timo Tijhof
8628893d99 resourceloader: Add tests for OutputPage::buildExemptModules
Bug: T147667
Change-Id: I40245359925ef5dc4e01ada396503a758d6b95fe
2017-05-20 18:54:43 +00:00
Timo Tijhof
0d14ed25e2 Disable broken TemplateCategoriesTest unit test
Bug: T165099
Change-Id: I370e48965fdfc948aa02533ebfeb0a540fb53c12
2017-05-20 11:36:25 +00:00
Marius Hoch
91159d39d5 Fix Closure detection in MediaWikiTestCase
Sometimes the closure are hidden in arrays, catch this.

The $maxDepth check is just for sanity, I don't think it's
actually needed.

Follows-Up: c2c7452577

Bug: T111641
Change-Id: Id5e036ce4949b8106873fd938f54c2774d3d6a4a
2017-05-19 23:06:58 +02:00
jenkins-bot
36fd859eef Merge "Add workaround for HHVM issue 6206" 2017-05-19 19:33:48 +00:00
jenkins-bot
dbf71d7429 Merge "Avoid postgres PrefixSearchTest failures due to collation differences" 2017-05-19 19:33:33 +00:00
Aaron Schulz
0f4b3764ce Use test user helper methods in UserGroupMembershipTest/UserTest
This avoids postgres failures when trying to insert users with name
"false" (cast to 0, which fails since integer != text type).

Bug: T75174
Change-Id: I809edd94117811d22492eaba440fad6aaea1195b
2017-05-19 19:07:21 +00:00
Marius Hoch
c2c7452577 Add workaround for HHVM issue 6206
Just use the actual global on HHVM, like we do on
Zend, but avoid hitting the warning.

This is a workaround for https://github.com/facebook/hhvm/issues/6206

Bug: T111641
Change-Id: I15ef0e90827c94a8b2609484b0dddcb78f04284c
2017-05-19 19:02:50 +00:00
Derk-Jan Hartman
f441e09c9a Tests: correct order of assertEquals arguments
Change-Id: Ib8d1e8aa92172a9abc0495dc0c18ea5df850dd5e
2017-05-19 13:41:16 +02:00
Aaron Schulz
99772f2d8a Avoid postgres PrefixSearchTest failures due to collation differences
Bug: T75174
Change-Id: I6b1df27ca6ae5c2da46134be3dbd7aed404d9601
2017-05-18 19:04:03 -07:00
Aaron Schulz
c1f348da1e Various test fixes for postgres
* Add another TS_MW timestamp coercion to WatchedItemStore.
* Do not expect timestamp conversion for pager mOffset.
  They have been used in Pager URLs for ages.
* Do not assume the user_id for UTSysop is 1; use the row value.

Bug: T75174
Change-Id: I590a4b7363ccff26d9ac9f51b95fc1aa072503b2
2017-05-18 20:30:13 +00:00
jenkins-bot
bb30f8de1d Merge "Make sure unique keys carry over to postgres table duplicates" 2017-05-18 18:09:26 +00:00
Aaron Schulz
44577c3962 Make sure unique keys carry over to postgres table duplicates
This fixes BotPasswordTest failures.

Change-Id: I81003187af0c57020f9fc4cbcd2606e71907a903
2017-05-16 19:20:42 -07:00
Gilles Dubuc
cf539bb316 Apply EXIF rotation to X-Content-Dimensions
Also adds integration tests for a few formats.

Bug: T150741
Change-Id: I686f7ef42457faf5bc688e60e6ce09a8550ca5aa
2017-05-16 15:57:00 +02:00
jenkins-bot
5891a2e733 Merge "registration: Move attributes out of the top level" 2017-05-16 04:00:28 +00:00
Kunal Mehta
fdb7e94104 registration: Move attributes out of the top level
This moves attributes out of the top level, and namespaces them under
each extension. If the extension that it belongs to is not installed,
the attribute is not exported and dropped.

The full name of the attribute is the name of the extension plus the
name of the attribute key. This enforces the recommendation that the
attribute name start with the extension's name.

Add test coverage for attributes under manifest_version 1 and 2.

Bug: T133627
Depends-On: I5a148763f68989c8da313a4fb1d0213658ee4495
Depends-On: I5a148763f68989c8da313a4fb1d0213658ee4459
Change-Id: I8613a027c56e2c9d2c6a83ca14749eb1c8fc23be
2017-05-15 20:09:50 -07:00
Geoffrey Mon
53fa809a62 Pager class for filtering by date range
New abstract class RangeChronologicalPager to provide shared date range
filtering capability (with unit tests)

I18n msgs to use as common labels for date range inputs

Expose some ReverseChronologicalParser::getDateCond logic so we can
convert year/month date filters to datestamp date filters

Bug: T120733
Change-Id: I65fdc00368f406f5fa2492600e95e07ce442c165
2017-05-12 14:55:54 +02:00
daniel
e4fc1ffec3 Allow namespaces defined in extension.json to be overwritten locally.
This allows extension namespaces to be assigned a custom ID, e.g. in case
the namespace pre-defined by the extension is already taken on the local
wiki.

This is done by defining the respective namespace constant in
LocalSettings.php.

Bug: T160462
Change-Id: If648d6e218847e6632d643ea724cd3da3945db70
2017-05-11 12:16:24 +02:00
jenkins-bot
9ac5ab1bf0 Merge "Make LocalPasswordPrimaryAuthenticationProviderTest use TS_MW timestamp conversion" 2017-05-10 18:32:10 +00:00
jenkins-bot
a244391c0d Merge "Fix some postgres test failures" 2017-05-10 17:25:45 +00:00
jenkins-bot
5fbb170cfa Merge "Avoid assuming a user with ID 0 exists in ApiMainTest::testAssert" 2017-05-10 17:07:58 +00:00
Brian Wolff
73f5937047 Add collation for Bashkir (ba)
This is based on a numeric uppercase collation. Bashkir characters
will be remapped to the private use area for the purpose of sorting.

Bug: T162823
Change-Id: I65f1af0b57ff6ded7d464e39efd401f178a3519e
2017-05-10 04:17:46 +00:00
Aaron Schulz
3441ed1900 Make LocalPasswordPrimaryAuthenticationProviderTest use TS_MW timestamp conversion
Bug: T75174
Change-Id: I217a8e1847a21d54434693fafa7f618ec5840876
2017-05-09 19:32:24 -07:00
Aaron Schulz
b8340df640 Avoid assuming a user with ID 0 exists in ApiMainTest::testAssert
If the load() triggered by User method calls fails, then mId becomes 0
which means there is no "user" right set in getAutomaticGroups().

Bug: T75174
Change-Id: I2d719e4b96c0142e9d408aa2d4f7c5e7a767a754
2017-05-09 19:25:56 -07:00
Aaron Schulz
6793b60eca Fix some postgres test failures
Bug: T75174
Change-Id: If9812ae301f0af84fa012e2e980b92036c1b29b2
2017-05-10 01:59:47 +00:00
Gilles Dubuc
cdfe08439c Store original media dimensions as additional header
For storage repos that support headers (such as Swift), this will store the original
media dimensions as an extra custom header, X-Content-Dimensions.
The header is formatted to minimize its length when dealing with multipage
documents, by expressing the information as page ranges keyed by dimensions.

Example for a multipage documents with some pages of different sizes:
X-Content-Dimensions: 1903x899:1-9,11/1903x873:10

Example for a single page document:
X-Content-Dimensions: 800x600:1

Bug: T150741
Change-Id: Ic4c6a86557b3705cf75d074753e9ce2ee070a6df
2017-05-09 15:49:28 -07:00
jenkins-bot
58e1e472ba Merge "Allow callback functions for creating jobs" 2017-05-09 18:38:57 +00:00
Lucas Werkmeister
a57252a1f5 Allow callback functions for creating jobs
$wgJobClasses can now specify a factory function for creating a job,
instead of a class to be instantiated directly. This makes it possible
to inject services in a job constructor, and register a factory function
that calls the constructor with default services.

This follows Ieb85493a7765 and Ia2107dc5af78, which introduced factory
functions for API modules and special pages.

Change-Id: I0461e59da2a8fa6681e3b1fcdfc38bfed7f3ac32
2017-05-09 19:26:13 +02:00
jenkins-bot
93be2c205a Merge "Change delimiter for multiple namespaces and tags" 2017-05-09 11:41:48 +00:00
Matthew Flaschen
efe994d3c3 Change delimiter for multiple namespaces and tags
It's ; for namespaces (since that is generally what we're using,
e.g. for STRING_OPTIONS), and | for tags.  I would have
preferred them to all be consistent, but there is one revision
that has a ;, and this seems better than modifying the DB.

Comma is already used as a delimiter between separate parameters
(e.g. hideanons and namepsace).

Also, fix multiple namespaces for parseParameters and add test
cases.

Bug: T164132
Bug: T164133
Change-Id: Iad061e0bc17e3522a3f5d330ac2c8bf9cf0e614f
2017-05-08 23:03:46 -04:00
Brad Jorsch
1aac0a2992 Wrap parser output in <div class="mw-parser-output">
This will allow CSS to target just the parser output, without also
accidentally targeting the edit form, diff tables, and so on.

Bug: T37247
Change-Id: If4eb5bf71f94fa366ec4eddb6964e8f4df6b824a
Depends-On: I330c6aa4aaee045614b1801ed34bc9e03be69650
Depends-On: I52a518fa44e017841fe78474012cd69823e0a41d
2017-05-08 05:32:03 +00:00
Timo Tijhof
eb19c590a5 config: Add @covers to complete GlobalVarConfig and MultiConfig
Change-Id: Ifff51c8b078ba3a3026720f13263c7af0d7d1145
2017-05-05 17:26:01 -07:00
Timo Tijhof
bd534c0409 phpunit: Fix broken @covers for swapICCProfile in JpegTest
Follows-up a428e3f067.

Change-Id: I5755dc560fbb3314578775839b02653a4e2113d5
2017-05-05 13:20:43 -07:00
jenkins-bot
dca600fe7c Merge "CSSMin: Support parenthesis and quotes in url references" 2017-05-05 18:58:22 +00:00
Timo Tijhof
bb36c7b32a CSSMin: Support parenthesis and quotes in url references
Previously they were often being cut short due to the url pattern
ending at the first single quote, double quote or closing parenthesis
regardless of which of those started the url match.

Running benchmarkCSSMin.php before and after the change doesn't seem
produce consistent improvement or regression. Repeated runs with count=100
with and without this change both have a median between 2.6ms and 2.9ms
using PHP 5.6, and between 2.6ms and 2.8ms using HHVM 3.12.

Bug: T60473
Change-Id: I6d6a077ad76588f3ed81b1901a26b7e56d2157ee
2017-05-05 18:33:24 +00:00
Paladox
54c56da85a Fix php code style
Preparation change for updating mediawiki code sniffer to 0.8.0

Change-Id: Ib0b3fe4afea9096ffa3a1347b4f7e07d3398b0b2
2017-05-05 12:03:54 +00:00
jenkins-bot
ca95cad6cc Merge "Fix contradictory RC filters and add back-compat" 2017-05-04 18:16:36 +00:00