Commit graph

3516 commits

Author SHA1 Message Date
jenkins-bot
13aa7bed1a Merge "Changed 'expiry' to American English 'expiration' in en.json" 2016-02-18 19:34:26 +00:00
Krzysztof Zbudniewek
e0b2d4a487 Changed 'expiry' to American English 'expiration' in en.json
Added British 'expiry' strings to en-gb.json.

https://translatewiki.net/wiki/Thread:Support/British_English_in_Mediawiki_messages

Change-Id: I3913449fc697770122ce01c1733f15ee3a7976de
2016-02-18 20:07:27 +01:00
Timo Tijhof
04362aa613 registration: Avoid double slashes in localBasePath
Noticed it in APC usage for ResourceLoader that various keys from
FileContentsHasher contain double slashes. All from extensions that
use the `"localBasePath": ""` trick in extension.json (e.g. Citoid).

Change-Id: I5bac1e2e05e063aa7ff251ce7ffaa965a3451db9
2016-02-18 10:25:02 -08:00
jenkins-bot
aeb7882171 Merge "CSSMin: Make isRemoteUrl and isLocalUrl really private, now that we can in PHP 5.5" 2016-02-18 08:21:35 +00:00
Bartosz Dziewoński
b9903564fa ExportTest: Simplify code that failed on 5.3 because of reserved word 'namespace'
Reserved words, like 'namespace', are perfectly fine now to use as object
keys, but it seems they used to not be in PHP 5.3, necessitating workarounds.

Change-Id: Iecb79fda19803461dfb3800b8af4d31e971551b8
2016-02-17 21:23:49 +00:00
Bartosz Dziewoński
ab44c1a6f4 LinkFilterTests: Uncomment test cases that should pass on PHP 5.5
Change-Id: If62f964c3a8e0eaaab6e7193d426cc4ddaa47ade
2016-02-17 19:35:20 +00:00
Bartosz Dziewoński
1decdbce53 CSSMin: Make isRemoteUrl and isLocalUrl really private, now that we can in PHP 5.5
Well, protected, because we want to have unit tests for them, apparently.

Change-Id: I734b88599e5860aa59a07a89cc5389eb73b48813
2016-02-17 15:50:08 +01:00
Kunal Mehta
b9668d6d80 build: Update mediawiki-codesniffer to 0.6.0, add "composer fix"
* Fix errors spotted by new release
* Introduce "composer fix", which uses phpcbf to automatically fix some
errors spotted by phpcs.
* Drop $PHPCS_ARGS variable that didn't work on Windows, and add -s flag
* Remove rules from phpcs.xml that are now in MW-CS ruleset.

Change-Id: I13e2155695918c918b67497ac65b85a03897095e
2016-02-17 02:54:42 -08:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
jenkins-bot
d8e2b67516 Merge "Session: Implement ArrayAccess" 2016-02-16 18:59:52 +00:00
Cindy Cicalese
86c08b2401 Converted ApiQueryPageProps to use PageProps; added multi-property query to PageProps.
Change-Id: Icd4540001e044052ae5759c87c8b83a70ab5c30f
2016-02-16 13:39:47 -05:00
Brad Jorsch
1aedd2df73 Session: Implement ArrayAccess
Now that we dropped support for PHP 5.3.3, we can do this.

The behavior of $session['foo'] when that key doesn't already exist is a
little unexpected (it implicitly assigns null), but it's the best we can
do.

Change-Id: Ibef878867d46591a8bf542139a1719dfec3b83ab
2016-02-16 17:33:33 +00:00
Bryan Davis
db47c86bc5 Update AutoLoaderTest and ran maintenance/generateLocalAutoload.php
AutoLoaderTest didn't know about traits.

generateLocalAutoload found a  missing Trait from the autoloader and
a class map ordering issue.

Change-Id: I34bf2698ad838b6a977c9bf39f6e416330ff0e5d
2016-02-12 13:12:20 +00:00
jenkins-bot
197ee74f2b Merge "Log multiple IPs using the same session or the same user account" 2016-02-12 00:35:12 +00:00
jenkins-bot
4e0f4a3a10 Merge "Add MediaWikiTestCase convenience method for mocking a logger" 2016-02-12 00:14:07 +00:00
Bryan Davis
9750adacdd SessionProvider::mergeMetadata: Log additional data
Add the data values and types to the exception raised when mismatched
session data is processed. This is done by passing the old and new
values on via a new MetadataMergeException class. The attached data is
added to the debug logging context info when caught.

Change-Id: If8a7174399289bc284ca1b36052ba515c8857c50
2016-02-11 14:21:14 -07:00
Gergő Tisza
f22549a605 Log multiple IPs using the same session or the same user account
As an attempt to detect SessionManager errors that log people into
the wrong account, log multiple IPs using the same session, or the same
user account.

Bug: T125455
Change-Id: I27468a3f6d582d9b46984227b9307dc71190fd6a
2016-02-11 08:00:28 -08:00
jenkins-bot
04ca989e86 Merge "Add tests for LanguageConverter classes that didn't have them" 2016-02-11 04:06:00 +00:00
jenkins-bot
460fc8b4a3 Merge "Disable testIPTCParseForcedUTFButInvalid on PHP > 5.6.0 but < 5.6.10" 2016-02-11 03:45:43 +00:00
Reedy
9d19133bad Remove < PHP 5.4 register_shutdown_function() from phpunit.php
Change-Id: Ic4efeca82762b3c50cd2e1b45e43a6f1ef0f5710
2016-02-10 22:06:45 +00:00
Gergő Tisza
a684a2a66b Add MediaWikiTestCase convenience method for mocking a logger
Change-Id: I2f96eddf9f010333ab515c980f4158dce410a13a
2016-02-10 13:32:52 -08:00
Reedy
63b343d8af Disable testIPTCParseForcedUTFButInvalid on PHP > 5.6.0 but < 5.6.10
Bug: T124574
Change-Id: I6893f7f549bb4145296c97ba2fc12583cd22e18e
2016-02-10 21:22:11 +00:00
jenkins-bot
d5ac32cc4f Merge "ApiMessage: Use a trait to avoid code duplication" 2016-02-10 19:23:09 +00:00
jenkins-bot
bc86ab6eb2 Merge "Remove unused imports from Session classes" 2016-02-10 19:21:27 +00:00
Brad Jorsch
cf9fc81e96 Remove "$that" from SessionManager
Also "function () use ( &$ref )" that was being done for similar
reasons.

Change-Id: If4ec263a9a9c02c1c6a414b26a0e77ba144437f1
2016-02-10 12:10:38 -05:00
Thiemo Mättig
e5159debbb Remove unused imports from Session classes
Change-Id: Ia3cdd923728870f5eff0bd90fd2f6605047291c0
2016-02-10 18:09:02 +01:00
jenkins-bot
283962b59e Merge "Fix case of Html class in HtmlTest comments" 2016-02-10 16:29:35 +00:00
Brad Jorsch
c5be121442 ApiMessage: Use a trait to avoid code duplication
Change-Id: I19eb63bdc4c4cbd137f4d2101d37c81ce91aa6b3
2016-02-10 10:40:15 -05:00
addshore
be3176e75a Stop doing $that = $this in Tests
Closures support $this as of 5.4

Change-Id: Ibe73c789d093ef994b61bed23b4c76f7ef057a33
2016-02-09 23:27:25 -08:00
umherirrender
8e76bdf98f Fix case of Html class in HtmlTest comments
Change-Id: I92eace17e643b3a40b38c077e9dcb3d60a7f5faf
2016-02-09 22:00:38 +01:00
Aaron Schulz
f4a4457403 Convert page modification to using startAtomic()/endAtomic()
A few semantic changes result from this:
* If multiple pages are edited in a request, the updates happen
  in the same order relative to each other, but all in one second
  step instead of after each page edit.
* If the same page is edited twice in a request, the WikiPage hook
  argument will reflect the last request edit, not always the edit
  that fired the hook.

Bug: T120718
Change-Id: I9429f29e5a90f24e4d7af5797a80e63a9cc34146
2016-02-09 00:03:05 +00:00
jenkins-bot
74bc2fc1eb Merge "Implement action=mergehistory" 2016-02-08 23:30:32 +00:00
jenkins-bot
79e51b55e5 Merge "Update session log messages" 2016-02-08 16:02:45 +00:00
jenkins-bot
35a89b1be9 Merge "Allow callbacks to be passed to $wgContentHandlers" 2016-02-08 09:11:21 +00:00
jenkins-bot
1f2706b499 Merge "Output PHP version before running PHPUnit tests" 2016-02-08 02:09:34 +00:00
Kunal Mehta
82c6f0ff03 Output PHP version before running PHPUnit tests
For sanity checking CI changes, as well as to match the PHPUnit
version output.

Change-Id: Ib807f8650992adada97226cd96282484392f71e8
2016-02-07 17:43:33 -08:00
jenkins-bot
8ea3e9135d Merge "Introduce User::INVALID_TOKEN" 2016-02-08 00:55:04 +00:00
Tim Starling
f0ba7a69a1 Add tests for LanguageConverter classes that didn't have them
Some of them don't have many test cases, or have test cases that don't
represent the ideal transliteration and so are subject to change. But
this is better than nothing.

Change-Id: I4aae693bd77d9ff365f48113923ed7f9fed8d668
2016-02-08 09:19:25 +11:00
Reedy
0f19a8e771 Remove duplicate array keys from tests
Change-Id: I437b87151be6589a8d5c984b90cd249c2d0ecd3c
2016-02-07 21:22:53 +00:00
Bryan Davis
f60fd42b33 Update session log messages
* Use PSR-3 templates and context where applicable
* Add log coverage for exceptional events

Bug: T125452
Change-Id: I8f96fa1c5766c739a21219abcae2dbb76de53e2a
2016-02-06 16:18:01 -07:00
Geoffrey Mon
e74f36ebe0 Implement action=mergehistory
* New class ApiMergeHistory handles action=mergehistory
* Merge History functionality moved from SpecialMergeHistory to
  MergeHistory
* SpecialMergeHistory now uses MergeHistory for actual merging
* Unit tests and i18n messages for above

Bug: T69742
Change-Id: Ic5078307dae78a2b3687e34a5d0a584988d483a1
2016-02-06 10:39:27 -05:00
Bene
9e3e3306b0 Allow callbacks to be passed to $wgContentHandlers
Change-Id: Icf980313a6e7fcc83f5183c450b0a824353596b8
2016-02-06 09:48:11 +01:00
jenkins-bot
5a4fdb5b4e Merge "[debug] Remove BC code from AvroFormatter" 2016-02-04 13:17:31 +00:00
jenkins-bot
ff20437da7 Merge "Include completion search into SearchEngine" 2016-02-04 02:09:46 +00:00
Bartosz Dziewoński
0fd1a6b62b Merge "Revert "Preprocessor: Don't allow unclosed extension tags (matching until end of input)"" 2016-02-04 01:10:58 +00:00
Legoktm
543f46e9c0 Revert "Preprocessor: Don't allow unclosed extension tags (matching until end of input)"
This reverts commit f51d0d9a81.

Breaks templates with non-closed </noinclude> tags, which
were previously acceptable.

Bug: T125754
Change-Id: I8bafb15eefac4e1d3e727c1c84782636d8b82c2b
2016-02-04 00:38:35 +00:00
Stanislav Malyshev
027972a20f Include completion search into SearchEngine
By default it still uses PrefixSearch and supports PrefixSearchBackend
but it can be deprecated and phased out and SearchEngine extensions used
instead.

New APIs:
- SearchEngine
	public function defaultPrefixSearch( $search );
	public function completionSearch( $search );
	public function completionSearchWithVariants( $search );

Search engines should override:
protected function completionSearchBackend( $search );

Bug: T121430
Change-Id: Ie78649591dff94d21b72fad8e4e5eab010a461df
2016-02-03 23:41:49 +00:00
Brad Jorsch
30a9eae821 Introduce User::INVALID_TOKEN
To avoid having to have SessionManager try to reset sessions on every
request, we set the user_token to a special value. When that value is
present, User::getToken() returns a different value every time (so
existing checks will fail) and User::setToken() refuses to alter it.

Bug: T124414
Change-Id: Ie4c84ce993e40a081288cf5a543f8ba99f98806a
2016-02-03 21:45:45 +00:00
Brad Jorsch
25dbd91513 Clean up after Ie161e0f
Ie161e0f was done in a hurry, and so didn't do things in the best ways.
This introduces a new "CachedBagOStuff" that transparently handles all
the logic that had been copy-pasted all over in Ie161e0f.

The differences between CachedBagOStuff and MultiWriteBagOStuff are:
* CachedBagOStuff supports only one "backend".
* There's a flag for writes to only go to the in-memory cache.
* The in-memory cache is always updated.
* Locks go to the backend cache (with MultiWriteBagOStuff, it would wind
  up going to the HashBagOStuff used for the in-memory cache).

Change-Id: Iea494729bd2e8c6c5ab8facf4c241232e31e8215
2016-02-03 21:45:18 +00:00
Brad Jorsch
2257fe4228 Revert "Remove SessionManager, temporarily"
This reverts commit 823db5d63dd5200d04c63da50ba6bf16f928e70b.

Change-Id: Ibb3e023e4eb6715295586dea87d0725c344a8271
2016-02-03 21:44:59 +00:00