Commit graph

6834 commits

Author SHA1 Message Date
jenkins-bot
c99dbcc7d5 Merge "resourceloader: Support isKnownEmpty for general modules" 2017-09-25 15:42:34 +00:00
jenkins-bot
b32408604f Merge "RCFilters: remove wgStructuredChangeFiltersEnableExperimentalViews" 2017-09-22 17:35:07 +00:00
Stephane Bisson
9e0764d988 RCFilters: remove wgStructuredChangeFiltersEnableExperimentalViews
Not used anymore.

Change-Id: I1afe736db76eef6ddae5c602d8e24fddfd807a3a
2017-09-21 16:24:38 -04:00
Max Semenik
19b739bd19 EditPage: Don't allow clients that mangle unicode to edit
Get rid of the hack that turns unicode into hexadecimal codes for
browsers that don't support unicode, and prevent their edits entirely.

And instead of relying on $wgBrowserBlacklist, use a hidden HTML form
field - if the contents are mangled and don't match the original, then
reject the edit.

Bug: T67297
Change-Id: I20c2e396d7dfd6a3b23b94b218f94a847522576b
2017-09-20 19:57:51 -07:00
jenkins-bot
510d5dd7cb Merge "Fix case of SpecialRecentChanges class" 2017-09-20 21:29:47 +00:00
Umherirrender
9b8fcb4331 Fix case of SpecialRecentChanges class
Test fails with $wgAutoloadAttemptLowercase = false

Change-Id: Ib8cd202d36d35a36e7513f81cea4a7f8346661bc
2017-09-20 22:12:22 +02:00
Umherirrender
c5fee4a6ba Set wgUseRCPatrol in ChangesListSpecialPageTest
wgUseRCPatrol = false makes the tests fail

Change-Id: I18965d33171137ff182800512c8c0e8e63de124e
2017-09-20 21:21:25 +02:00
jenkins-bot
a08d8261f1 Merge "Do not run tests that depend on curl if it is not loaded" 2017-09-20 04:49:13 +00:00
Huji Lee
595d2e5fd0 Do not run tests that depend on curl if it is not loaded
Bug: T176193
Change-Id: Ia7b9b0196f800eb14463acc2a24df5ac1e48f3ed
2017-09-19 21:51:59 -04:00
jenkins-bot
617d05ae4c Merge "CSSMin: Mangle whitespace in embedded SVGs" 2017-09-19 21:27:31 +00:00
jenkins-bot
bdc10df7d0 Merge "CSSMin: Improve encoding of quotes in embedded SVGs" 2017-09-19 19:01:18 +00:00
Roan Kattouw
dfd42d2653 CSSMin: Mangle whitespace in embedded SVGs
Convert newlines and tabs to spaces (which can be unencoded),
and consolidate runs of multiple spaces into a single space.
Also remove any leading and trailing spaces that might result
(most files end in a newline, for example).

Bug: T175318
Change-Id: Ic66c6acb37079cae84dd80ab2d5f2c829cf2df96
2017-09-19 18:52:54 +00:00
Roan Kattouw
5e3165f008 CSSMin: Improve encoding of quotes in embedded SVGs
When a URL (data: or otherwise) contains quotes, don't wrap it in
double quotes (") but in single quotes ('). This then allows
us to unencode double quotes (") in the data URI embedding of SVGs.

Bug: T175318
Change-Id: I3e7eab64e1c3e82066014fb594f82d786983ce90
2017-09-19 18:04:27 +00:00
jenkins-bot
925dbe97f8 Merge "Remove unused variables from closures" 2017-09-19 17:27:52 +00:00
jenkins-bot
a5b41a26b6 Merge "Fix link prefix/suffixes around Category and Language links (take 2)." 2017-09-19 16:59:58 +00:00
jenkins-bot
426719108b Merge "Hooks: Introduce Hooks::runWithoutAbort() alongside Hooks::run()" 2017-09-19 10:04:49 +00:00
Fomafix
f7e28d6d60 Remove unused variables from closures
Change-Id: I5d2e0cd423a4080677f8517bcf3dcee10bf44799
2017-09-19 06:25:16 +02:00
jenkins-bot
78ff5ea9a6 Merge "RCFilters: Actually check whether defaults are empty and update state" 2017-09-18 20:42:42 +00:00
Moriel Schottlender
6a046755fc RCFilters: Actually check whether defaults are empty and update state
Defaults come from either the backend or the saved queries, and that can
also change during the session. Allow the system to update itself properly
over whether defaults are empty at any given state, and hide/show the
proper button at the correct state.

Bug: T172387
Change-Id: I173c72a391886b41e899ac64621b504c5eb55b0c
2017-09-18 13:08:22 -07:00
jenkins-bot
a6841c9106 Merge "Revert "Xml: Fix Xml::fieldset() when $content is not given"" 2017-09-18 18:13:40 +00:00
Timo Tijhof
0b1a7d4c59 resourceloader: Support isKnownEmpty for general modules
It was already supported for only=scripts and only=styles, but
not yet for general modules loaded as 'combined'.

This is especially useful for general modules that are private/embedded,
as this allows us to skip the loader.implement() boilerplate.

Bug: T176159
Change-Id: I83e9f74dad75867c10ebd0a94b87c31e4adbb57f
2017-09-18 18:37:13 +01:00
jenkins-bot
354c8fa3d5 Merge "Improve encoding of embedded SVGs" 2017-09-18 16:29:48 +00:00
jenkins-bot
eca49eb5d2 Merge "phpunit.php: omit --quiet in help" 2017-09-18 14:45:31 +00:00
Bartosz Dziewoński
15dc2f8eaa Revert "Xml: Fix Xml::fieldset() when $content is not given"
Apparently that is intentional and documented. Huh. Whoops.

This reverts commit 0f1cc3bb6e.

Also add test cases for this bizarre function.

Change-Id: I0311f7c85cd575f2a66d50589ec364072be486fb
2017-09-17 19:25:01 +02:00
Gergő Tisza
1cd91412e7 phpunit.php: omit --quiet in help
Bug: T176060
Change-Id: Iee7a0df6ba9fadf92d8e2d9f170cdfc66244d3d5
2017-09-17 06:15:38 +00:00
Huji Lee
f05821e87c Do not run CollationFaTest if 'intl' is not loaded
Bug: T176040
Change-Id: I6b19bf1123d4dca5a1c8e002c0de65bab2138180
2017-09-16 16:30:18 -04:00
jenkins-bot
9167845fa3 Merge "RCFilters: Allow empty saved query" 2017-09-15 13:00:07 +00:00
Moriel Schottlender
164e7b8bd2 RCFilters: Allow empty saved query
For this, we also need to check for saved query visibility on the
saved query model initialization, because since the model starts
its life all-empty, if the saved query is also all-empty, it will
not trigger any item updates on the main model.

Bonus: Actually check whether defaults are empty; there was a
typo and problem with the original test.

Bug: T172387
Change-Id: Ibc536b577e4c3abcc04fa229f9978b651b2f9e61
2017-09-14 17:26:39 -07:00
Roan Kattouw
a4631b92e7 Improve encoding of embedded SVGs
Unencode spaces, slashes, colons and equals signs.

Bug: T175318
Change-Id: Idebdfca8f93d5e090deba5bf5a256d7054e2d6c8
2017-09-14 11:39:57 -07:00
jenkins-bot
ed520fddd9 Merge "mw.loader: Add unit test to confirm implicit 'site' dependency for 'user'" 2017-09-14 13:47:48 +00:00
Timo Tijhof
695d3ed5e3 mw.loader: Add unit test to confirm implicit 'site' dependency for 'user'
The underlying logic is in mw.loader#execute and mw.loader#runScript,
but currently untested.

Adding tests in prep for refactoring this code.

Change-Id: I77ffb5f23443e24ca1d86f36ddf434673e9c1538
2017-09-14 11:48:03 +02:00
jenkins-bot
6559312106 Merge "Improve flaky SiteStatsTest" 2017-09-14 02:35:10 +00:00
jenkins-bot
7653760090 Merge "Sync up with Parsoid parserTests.txt" 2017-09-13 20:36:48 +00:00
Subramanya Sastry
3a37c76ce0 Sync up with Parsoid parserTests.txt
This now aligns with Parsoid commit dcf2706cff795b84fbbfb6cd22749a86655b04f2

Change-Id: I24700184204000465922930dbac2b019259b5a01
2017-09-13 15:20:40 -05:00
jenkins-bot
afbf5e7899 Merge "Do not double decode HTML entities for IDs" 2017-09-13 17:50:37 +00:00
jenkins-bot
9f1169147d Merge "Remove @covers from private Sanitizer method" 2017-09-12 23:43:51 +00:00
jenkins-bot
616913584d Merge "Enable recursive partials in TemplateParser" 2017-09-12 20:08:47 +00:00
jenkins-bot
65f436cfdf Merge "Reduce code duplication for parsing messages into dropdown menus" 2017-09-12 19:35:26 +00:00
Bartosz Dziewoński
a5c3d029c5 Reduce code duplication for parsing messages into dropdown menus
The same behavior was implemented by Xml::listDropDown(),
Article::confirmDelete() and HTMLFormField::getOptions().
A new function Xml::listDropDownOptions() is added and
all three are changed to use it.

Additionally:
* Xml::listDropDown() now uses XmlSelect internally to generate the
  dropdown HTML.
* Xml::listDropDownOptionsOoui() is introduced to handle converting
  the existing format to the OOUI format, which was previously
  duplicated in Article::confirmDelete() and HTMLFormField::getOptionsOOUI().
* This change allows HTMLForm 'select' fields (HTMLSelectField) to
  support nested options (optgroups) in OOUI mode. This is a
  prerequisite for T117781.

Bug: T117781
Change-Id: I0a088f61eb32ec59677113583c7ecdcbc3fd2af0
2017-09-12 20:49:20 +02:00
Arlo Breault
ea75da8eb8 Sync up with Parsoid parserTests.txt
This now aligns with Parsoid commit c695317294087a691bad649237f9d86fbfce64c5

Change-Id: I6cb1eafcaf23846aba25714e6177c0e510c0b174
2017-09-12 13:53:42 -04:00
Reedy
e1a849cfd4 Remove @covers from private Sanitizer method
Breaks mediawiki-core-code-coverage

https://integration.wikimedia.org/ci/job/mediawiki-core-code-coverage/3003/console

Change-Id: I3204289c1d45e5ea0bee5c4bb6869434152e6017
2017-09-12 16:40:34 +00:00
Brad Jorsch
d0b093d4bd Improve flaky SiteStatsTest
SiteStatsTest::testJobsCountGetCached() is somewhat flaky in that if it
runs after a test that adds a page (thereby producing htmlCacheUpdate
and recentChangesUpdate jobs) but doesn't have the CI framework reset
the `page` tables (which has the side effect of clearing all such jobs),
it will fail.

This change manually clears those jobs so it doesn't depend on test
ordering.

Change-Id: I1277e633c81b29bda7564fa12d23f13ded7298c7
2017-09-12 11:48:41 -04:00
Fomafix
b6c895ddc5 Do not double decode HTML entities for IDs
* in links (T103714)
* in indicators (T104196)

This change removes the automatic Sanitizer::decodeCharReferences from
Sanitizer::escapeId and Sanitizer::escapeIdInternal. Where decoding of
HTML entities are wanted an explicit call to
Sanitizer::decodeCharReferences is added.

Explicit decode HTML entities in non local autocomments. (T104311)

Bug: T103714
Bug: T104196
Bug: T104311
Change-Id: I88e8e2077e6f5eec2b232391f7818370894a62dc
2017-09-12 15:42:17 +02:00
jenkins-bot
af09cc1088 Merge "Port BCP47 formatter from PHP to JavaScript" 2017-09-12 11:43:49 +00:00
Niklas Laxström
990c1f0ad2 Port BCP47 formatter from PHP to JavaScript
It can be accessed via mw.language.bcp47.
To be used in ContentTranslation, see T157212

Change-Id: I37d32ab8a55c7101b903b03869899f00a39afd11
2017-09-12 11:07:31 +00:00
jenkins-bot
fa8d4b1c72 Merge "Don't percent-encode HTML5 IDs" 2017-09-12 01:38:59 +00:00
Max Semenik
7ad5282938 Don't percent-encode HTML5 IDs
During the TechCom meeting, it was decided this is the better way.

Bug: T152540

Change-Id: I6c3ec1c407225b4e925b7373bf52208e2f6b6c4a
2017-09-11 18:22:04 -07:00
Subramanya Sastry
ea3b95e20d Fix bug in dl-dt list output generation
* An open <dt> (;) should be closed when we encounter a new <dd> (:)
  char even if it is on a new line that has other nested lists inside.

* Tidy was hiding this PHP parser bug by closing a <dt> and opening
  a <dd> when given this HTML: "<dl><dt>a<ul><li>b</li></ul></dt></dl>"
  It generates "<dl><dt>a</dt><dd><ul><li>b</li></ul></dd></dl>"

  However, a HTML5 parser like RemexHTML, domino (used by Parsoid),
  or browsers don't do this fixup.

* So, what I thought was a bug in RemexHTML turned out to be a bug
  in the PHP parser that was being hidden by the use of Tidy.

* Added a regression test.

Bug: T175099
Change-Id: I6d5b225b82cecf9a43f23837ed8ec359b31aadad
2017-09-12 01:10:44 +00:00
Antoine Musso
875fe1693c tests: ensure parserTestRunner restores $wgParser
ParserTestRunner::addArticle() set a dummy $wgParser to ease test
running. However if doEditContent() fails, it would abort and never
restore $wgParser.

Make sure the restoration is done even on exception.

I caught that one while running parser tests with Scribunto and Cite. My
setup lacked a luastandalone which causes Scribunto to throw an
exception. When the Cite tests are run, the MessageCache parser ended up
using $wgParser = ParserTestMockParser;

Change-Id: I33a0a5c1f40f197405d40b7925cc043342e6757e
2017-09-11 12:58:13 +02:00
jenkins-bot
2b28851462 Merge "build: Updating mediawiki/mediawiki-codesniffer to 0.12.0" 2017-09-10 23:06:47 +00:00