lhc/web/wiklou.git
5 years agoImprove timeouts in MultiHttpClient
Tim Starling [Fri, 15 Jun 2018 10:31:02 +0000 (20:31 +1000)]
Improve timeouts in MultiHttpClient

* PHP 7 only checks for request/connection timeout after the timeout
  passed to curl_multi_select() expires. So it's necessary to use a
  select timeout which is much shorter than 10s. I filed
  https://bugs.php.net/bug.php?id=76480 for this.
* Use millisecond resolution timeout parameters. These have been
  available since libcurl 7.16.2, released Jan 2008, available in
  Debian 7, Ubuntu 14.04 and CentOS 6.

Change-Id: Ia07b824dde179b33e14b81a76d580ce547bca315

5 years agoMerge "Hard deprecate a trio of functions from Language.php"
jenkins-bot [Wed, 13 Jun 2018 23:36:51 +0000 (23:36 +0000)]
Merge "Hard deprecate a trio of functions from Language.php"

5 years agoMerge "Do not require titles on Special:ComparePages"
jenkins-bot [Wed, 13 Jun 2018 22:58:28 +0000 (22:58 +0000)]
Merge "Do not require titles on Special:ComparePages"

5 years agoMerge "Provide backwards compatibility for RevisionInsertComplete hook."
jenkins-bot [Wed, 13 Jun 2018 20:07:02 +0000 (20:07 +0000)]
Merge "Provide backwards compatibility for RevisionInsertComplete hook."

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 13 Jun 2018 20:02:55 +0000 (22:02 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I0c3b7f72cd71155ca6c5cd5fa1571fcb702508df

5 years agoProvide backwards compatibility for RevisionInsertComplete hook.
daniel [Wed, 13 Jun 2018 18:18:47 +0000 (20:18 +0200)]
Provide backwards compatibility for RevisionInsertComplete hook.

Call the RevisionInsertComplete from RevisionStore for now, so extensions
that still rely on this hook don't break when more code uses RevisionStore
instead of Revision.

This specifically avoid breaking EventBus and Translate when If610c68f491
is merged.

Change-Id: I3356c8250d7934e0089d4627fdebddf7983f194f

5 years agoHard deprecate a trio of functions from Language.php
C. Scott Ananian [Wed, 13 Jun 2018 17:48:02 +0000 (13:48 -0400)]
Hard deprecate a trio of functions from Language.php

These have been soft deprecated since 1.28; let's start the process of
actually removing them.

Change-Id: I33bb6f501e5df419683d06fb9e4516fddc03741b

5 years agoDeprecate Language::markNoConversion, which confuses readers
C. Scott Ananian [Fri, 8 Jun 2018 16:18:05 +0000 (12:18 -0400)]
Deprecate Language::markNoConversion, which confuses readers

Language::markNoConversion is used only within Parser.php and differs
from LanguageConverter::markNoConversion in that, contrary to its name
and its namesake, it only protects *things which look like URLs* from
language conversion.

This wasted several days of my time before I realized what was going on.
It's needless; just hoist the "looks like a URL" special casing inline
to the single place where that functionality is used.  (And I wonder
if the "looks like a URL" case is actually needed at all any more,
since most of those cases are probably free external links, which
go through a different code path, not bracketed external links.)

This is a clean-up to the clean-up that liangent performed in 2012
with e01adbfc0bd9f39adffc1f955ccc711e73818194.

Change-Id: I80479600f34170651732b032e8881855aa1204d8

5 years agoMerge "Move RELEASE-NOTES-1.31 into HISTORY"
jenkins-bot [Wed, 13 Jun 2018 16:36:58 +0000 (16:36 +0000)]
Merge "Move RELEASE-NOTES-1.31 into HISTORY"

5 years agoMerge "Update feedbacklink text"
jenkins-bot [Wed, 13 Jun 2018 16:34:04 +0000 (16:34 +0000)]
Merge "Update feedbacklink text"

5 years agoMerge "Expose sort orders from search engine in ApiQuerySearch"
jenkins-bot [Wed, 13 Jun 2018 16:29:36 +0000 (16:29 +0000)]
Merge "Expose sort orders from search engine in ApiQuerySearch"

5 years agoMove RELEASE-NOTES-1.31 into HISTORY
James D. Forrester [Wed, 13 Jun 2018 16:14:34 +0000 (09:14 -0700)]
Move RELEASE-NOTES-1.31 into HISTORY

Change-Id: I82f6707af79846688cc8ccbbe30909198c647f1a

5 years agoUpdate feedbacklink text
Hagar Shilo [Mon, 11 Jun 2018 17:26:24 +0000 (20:26 +0300)]
Update feedbacklink text

Bug: T195902
Change-Id: I69a9c42ed44eb45513084c01882d8ea8f376c6de

5 years agoMerge "mediawiki.ui: Don't style non-MWUI `<input type="number">` elements"
jenkins-bot [Wed, 13 Jun 2018 16:11:37 +0000 (16:11 +0000)]
Merge "mediawiki.ui: Don't style non-MWUI `<input type="number">` elements"

5 years agoMerge "Silently drop unknown titles in completion search"
jenkins-bot [Wed, 13 Jun 2018 16:04:40 +0000 (16:04 +0000)]
Merge "Silently drop unknown titles in completion search"

5 years agoExpose sort orders from search engine in ApiQuerySearch
Erik Bernhardson [Sat, 19 May 2018 13:42:54 +0000 (06:42 -0700)]
Expose sort orders from search engine in ApiQuerySearch

Selectable sort orders were added to search some time ago, but never
appear to have been used.  Expose them in ApiQuerySearch.

There is one large problem here, but it's not easily solvable.
Specifically supported sort orders vary per search engine, but the
available api parameters are calculated with the default search
engine. This is already a problem with search profiles so it's
nothing new, just continuing the existing problem. Much like
search profiles we hide the functionality when multiple engines
are available.

Bug: T195071
Change-Id: I187a530bc973c08386d2c2126e02a85b952d9022

5 years agoMerge "Push pagination decision for search into SearchEngine"
jenkins-bot [Wed, 13 Jun 2018 15:55:31 +0000 (15:55 +0000)]
Merge "Push pagination decision for search into SearchEngine"

5 years agoMerge "Pass $parser, &$query and &$widthOption to the 'ImageBeforeProduceHTML' hook"
jenkins-bot [Wed, 13 Jun 2018 15:31:01 +0000 (15:31 +0000)]
Merge "Pass $parser, &$query and &$widthOption to the 'ImageBeforeProduceHTML' hook"

5 years agoMerge "Use 'trash' icon in the saved filters menu & change 'remove' to 'delete'"
jenkins-bot [Wed, 13 Jun 2018 14:37:19 +0000 (14:37 +0000)]
Merge "Use 'trash' icon in the saved filters menu & change 'remove' to 'delete'"

5 years agoUse 'trash' icon in the saved filters menu & change 'remove' to 'delete'
Hagar Shilo [Mon, 11 Jun 2018 17:12:07 +0000 (20:12 +0300)]
Use 'trash' icon in the saved filters menu & change 'remove' to 'delete'

Using 'trash' icon instead of misleading 'clear' and changing 'remove'
to 'delete' accordingly.

Bug: T191530
Change-Id: I8369977df5cdf0dca63683bc682e470223cf6fed

5 years agoMerge "Use more diverse unicode chars in basic browser tests"
jenkins-bot [Wed, 13 Jun 2018 13:27:54 +0000 (13:27 +0000)]
Merge "Use more diverse unicode chars in basic browser tests"

5 years agoMerge "Disable WebResponse setters for post-send processing"
jenkins-bot [Wed, 13 Jun 2018 13:21:51 +0000 (13:21 +0000)]
Merge "Disable WebResponse setters for post-send processing"

5 years agoshell.php: update PsySH from 0.8.11 to 0.9.6
Gergő Tisza [Tue, 12 Jun 2018 15:56:57 +0000 (17:56 +0200)]
shell.php: update PsySH from 0.8.11 to 0.9.6

Major changes: fix for T186936, external editor support,
timeit command, emulate HISTCONTROL=ignorespace,
fixed tab completion

mediawiki/vendor patch: I5f604250fb213618f734e6ac9c48969ceeb3e7fb

Change-Id: I994689638632f39d86ce88027445d8fe4ea4f649

5 years agoUse more diverse unicode chars in basic browser tests
WMDE-Fisch [Thu, 1 Feb 2018 08:52:10 +0000 (09:52 +0100)]
Use more diverse unicode chars in basic browser tests

See comment in I3423011c467b0a6426cfa0dad522435618f24bd0
and https://mathiasbynens.be/notes/javascript-unicode#poo-test

Decided on using something more positive than a pile of poo though.

Change-Id: Ic34d0d78044cede71fd1cd8742214c117ed2e99f

5 years agoselenium, page spec, make "should be editable" actually edit
addshore [Fri, 8 Jun 2018 12:11:38 +0000 (13:11 +0100)]
selenium, page spec, make "should be editable" actually edit

This was using the same content for the edit before this
patch, so no edit was actually made, (just a null edit).

Change-Id: I945090647226e82f22b5b10a414a2a0bf9f2bc19

5 years agoselenium: page spec, make it easier to see where strings come from
addshore [Fri, 8 Jun 2018 12:08:49 +0000 (13:08 +0100)]
selenium: page spec, make it easier to see where strings come from

Having randomly generated strings is great, but sometimes
it can help to allow a human to easily see where the string
is actually being generated in code, so add an optional suffix
to the string being generated.

Change-Id: Ibfe45f74b4880a70a76c01223a787dabcd43607e

5 years agoUse wd/hub not /wd/hub in selenium.sh
addshore [Thu, 7 Jun 2018 16:27:06 +0000 (17:27 +0100)]
Use wd/hub not /wd/hub in selenium.sh

I have run into this before and we fixed it in the README
but not in this script (I wasn't using this script at the time)

This was changed in the README in change:
I85a9e7dbd9a66418c85585969adb5ac1548f5ef6

Bug: T182421
Change-Id: I6ab92c6a61a57dc313b05321d0789dcbeb776c94

5 years agoDon't use killall in selenium.sh
addshore [Thu, 7 Jun 2018 16:20:59 +0000 (17:20 +0100)]
Don't use killall in selenium.sh

git bash for windows apparently doesn't have killall
by default, so instead get the PID of the chrome driver
we start and kill that specifically.

Change-Id: I8a9a773a7d3dc23807dc3ec12f5b3ef03661c9e3

5 years agoMerge "RCFilters: Reduce min-height for Watchlist"
jenkins-bot [Wed, 13 Jun 2018 11:02:58 +0000 (11:02 +0000)]
Merge "RCFilters: Reduce min-height for Watchlist"

5 years agoImprove LinkRenderer::getLinkText() coverage
Kunal Mehta [Sun, 10 Jun 2018 19:12:52 +0000 (12:12 -0700)]
Improve LinkRenderer::getLinkText() coverage

Change-Id: I067522025c247346888c9f5a3d905bf03a93b7bc

5 years agoRemove deprecated Linker::getLinkColour()
Kunal Mehta [Sun, 10 Jun 2018 19:05:31 +0000 (12:05 -0700)]
Remove deprecated Linker::getLinkColour()

Change-Id: I1818d9eb369c620cc436c13446a5362816e8362d

5 years agoMerge "linker: Hard-deprecate LinkBegin and LinkEnd hooks"
jenkins-bot [Wed, 13 Jun 2018 06:02:23 +0000 (06:02 +0000)]
Merge "linker: Hard-deprecate LinkBegin and LinkEnd hooks"

5 years agomediawiki.ui: Don't style non-MWUI `<input type="number">` elements
Bartosz Dziewoński [Wed, 13 Jun 2018 02:15:27 +0000 (04:15 +0200)]
mediawiki.ui: Don't style non-MWUI `<input type="number">` elements

These styles mess with the styles for OOUI NumberInputWidget.

Change-Id: I9b7c8a010bc704c922cb6200a0316ed8e48851c5

5 years agoMerge "rdbms: make getCPInfoFromCookieValue() stricter about allowed values"
jenkins-bot [Tue, 12 Jun 2018 23:51:49 +0000 (23:51 +0000)]
Merge "rdbms: make getCPInfoFromCookieValue() stricter about allowed values"

5 years agoRemove unnecessary Parser::getConverterLanguage() indirection
C. Scott Ananian [Fri, 8 Jun 2018 15:45:07 +0000 (11:45 -0400)]
Remove unnecessary Parser::getConverterLanguage() indirection

The getConverterLanguage() method was added in March 2012 in commit
561424c266128a8c2c213cd803d4786313fc20cc as a workaround for a regression
in mediawiki 1.19.  It was an indirection which checked the global variable
$wgBug34832TransitionalRollback to return a different converter language
for Chinese wikis.

When this temporary bugfix was reverted in January 2013 in commit
a3fbdaaa2c4eb5ddc6bfbd62ae57a7804a307f12, the temporary global variable
was removed, but not the getConverterLanguage() indirection.  Since then,
new code in the parser seems to have faithfully used getConverterLanguage()
instead of getTargetLanguage(), even though they are identical and the
need for getConverterLanguage() has long since passed.

Strike a small blow for elegant minimalism by removing the completely
unnecessary Parser::getConverterLanguage() indirection.  Well, sort
of: since this blight has been slowly growing inside Parser.php for
so long, we need to deprecate getConverterLanguage() first just in
case any external dependency has been infected.  Next release we
can finally excise the unnecessary method.

Change-Id: I567c29c9c7699020955699b76cbe8578d02e2fe6

5 years agoMerge "Add @coversNothing to tests that don't cover specific PHP classes"
jenkins-bot [Tue, 12 Jun 2018 23:17:06 +0000 (23:17 +0000)]
Merge "Add @coversNothing to tests that don't cover specific PHP classes"

5 years agoMerge "hooks.txt: Clean-up whitespace and wrapping for consistency"
jenkins-bot [Tue, 12 Jun 2018 22:34:54 +0000 (22:34 +0000)]
Merge "hooks.txt: Clean-up whitespace and wrapping for consistency"

5 years agoRCFilters: Reduce min-height for Watchlist
Roan Kattouw [Tue, 12 Jun 2018 22:31:53 +0000 (15:31 -0700)]
RCFilters: Reduce min-height for Watchlist

Bug: T195903
Change-Id: I8d4622951026cb5058efd63aa1adcb3607dd79bc

5 years agoUse PHP 7 '??' operator instead of if-then-else
Fomafix [Tue, 12 Jun 2018 20:44:33 +0000 (22:44 +0200)]
Use PHP 7 '??' operator instead of if-then-else

Change-Id: I790b86e2e9e3e41386144637659516a4bfca1cfe

5 years agoAdd @coversNothing to tests that don't cover specific PHP classes
Kunal Mehta [Tue, 12 Jun 2018 20:27:09 +0000 (13:27 -0700)]
Add @coversNothing to tests that don't cover specific PHP classes

Change-Id: Idbd364561bc28547e9fac20d7a80b9a44edf14a9

5 years agohooks.txt: Clean-up whitespace and wrapping for consistency
James D. Forrester [Tue, 12 Jun 2018 15:42:29 +0000 (08:42 -0700)]
hooks.txt: Clean-up whitespace and wrapping for consistency

This file is a disaster, but now at least we actually wrap at 80 chars
for all the hooks, not just the ones where the developer felt like it.

Change-Id: I10d3d51412af29b135fd7e9a0393ff0b57eb25aa

5 years agohooks.txt: Label which hooks are deprecated when
James D. Forrester [Tue, 12 Jun 2018 15:41:34 +0000 (08:41 -0700)]
hooks.txt: Label which hooks are deprecated when

Many of these are still soft-deprecated, so tracking down their age
and kicking off the full deprecation process is hard, let alone
actually removing them. Doing this makes that future work easier.

Change-Id: Ib096190accceabf9082f621ba96243f7dedb025d

5 years agoMerge "Follow-up 23cfebd3d25: Hard-deprecate LanguageGetMagic hook"
jenkins-bot [Tue, 12 Jun 2018 19:52:24 +0000 (19:52 +0000)]
Merge "Follow-up 23cfebd3d25: Hard-deprecate LanguageGetMagic hook"

5 years agoMerge "Follow-up 23cfebd3d25: Hard-deprecate LanguageGetSpecialPageAliases hook"
jenkins-bot [Tue, 12 Jun 2018 19:52:22 +0000 (19:52 +0000)]
Merge "Follow-up 23cfebd3d25: Hard-deprecate LanguageGetSpecialPageAliases hook"

5 years agoMerge "Fix typehint-typo in MediaWikiTestCase"
jenkins-bot [Tue, 12 Jun 2018 19:19:23 +0000 (19:19 +0000)]
Merge "Fix typehint-typo in MediaWikiTestCase"

5 years agoMerge "Convert SearchResultSet to typical iteration"
jenkins-bot [Tue, 12 Jun 2018 19:04:43 +0000 (19:04 +0000)]
Merge "Convert SearchResultSet to typical iteration"

5 years agoFix typehint-typo in MediaWikiTestCase
Marius Hoch [Tue, 12 Jun 2018 18:20:49 +0000 (20:20 +0200)]
Fix typehint-typo in MediaWikiTestCase

Change-Id: I3817d586cfaaaf38439820741e68eff044e9bf76

5 years agordbms: make getCPInfoFromCookieValue() stricter about allowed values
Aaron Schulz [Mon, 11 Jun 2018 21:52:37 +0000 (14:52 -0700)]
rdbms: make getCPInfoFromCookieValue() stricter about allowed values

All components, not just the write index, must now be present.

Bug: T194403
Change-Id: I279ba3e16d470aca09fdb74cec91d28efb5e2f95

5 years agoDisable WebResponse setters for post-send processing
Brad Jorsch [Fri, 8 Jun 2018 18:51:25 +0000 (14:51 -0400)]
Disable WebResponse setters for post-send processing

When jobs are being run synchronously post-send, we don't want to allow
bugs to result in a job somehow setting cookies or headers that
interfere with those that were intended to be set in the request.

Bug: T191537
Change-Id: Ib5714a17af417797140f99e41eaacbba1bfd20f4

5 years agoFollow-up 23cfebd3d25: Hard-deprecate LanguageGetMagic hook
James D. Forrester [Tue, 12 Jun 2018 15:44:31 +0000 (08:44 -0700)]
Follow-up 23cfebd3d25: Hard-deprecate LanguageGetMagic hook

Change-Id: I7e442e20744a196644d6be186158fd901f9db1ce

5 years agoCategory: Lock the category row before the categorylinks rows
Brad Jorsch [Tue, 12 Jun 2018 15:28:25 +0000 (11:28 -0400)]
Category: Lock the category row before the categorylinks rows

We've noticed a large increase in deadlocks between
LinksDeletionUpdate deleting categorylinks rows and
Category::refreshCounts() trying to update the category table.

My best guess as to what's going on there is that LinksDeletionUpdate
locks the category row via the call to WikiPage::updateCategoryCounts()
then the categorylinks rows via its own deletions, while Category first
locks the categorylinks rows (in share mode) and then the category row
when it tries to update or delete it.

To break the deadlock, let's have Category do a SELECT FOR UPDATE on the
category row first before it locks the categorylinks rows.

Bug: T195397
Change-Id: Ie11baadf2ff0ba2afbc86b10bc523525c570a490

5 years agoMerge "Link to revisions and log entries from tag logs"
jenkins-bot [Tue, 12 Jun 2018 15:21:22 +0000 (15:21 +0000)]
Merge "Link to revisions and log entries from tag logs"

5 years agoFollow-up 23cfebd3d25: Hard-deprecate LanguageGetSpecialPageAliases hook
James D. Forrester [Tue, 12 Jun 2018 14:53:18 +0000 (07:53 -0700)]
Follow-up 23cfebd3d25: Hard-deprecate LanguageGetSpecialPageAliases hook

Change-Id: I543c2ff9e9d82869a4b443410528a179f65e3d02

5 years agoAdd release notes for 0eb4eaefd3 and f7f71359
Kunal Mehta [Tue, 12 Jun 2018 01:11:08 +0000 (18:11 -0700)]
Add release notes for 0eb4eaefd3 and f7f71359

Change-Id: Ie139db2f178660aa42009661716290158d60c8fc

5 years agoMerge "parser: Validate $length in padleft/padright parser functions"
jenkins-bot [Tue, 12 Jun 2018 00:39:53 +0000 (00:39 +0000)]
Merge "parser: Validate $length in padleft/padright parser functions"

5 years agoMake $wgEmailConfirmToEdit only affect edit actions.
Brian Wolff [Fri, 26 Aug 2016 01:29:58 +0000 (01:29 +0000)]
Make $wgEmailConfirmToEdit only affect edit actions.

Previously it would affect all actions that use Title::userCan.
This used to be less noticable, but recently was expanded to include
the 'read' action. This only affected the case where both
$wgBlockDisablesLogin and $wgEmailConfirmedToEdit were enabled.

I don't think anyone was relying on the old behaviour as it was
undocumented, and only affected obscure permissions (checked with
Title::userCan and not depending on "edit" rights)

Follow-up b675be2083

Bug: T143790
Change-Id: I4ad93ed78de4f1ed444f73df6dc26d405a67e553

5 years agoMerge "Remove deprecated hook EditPageBeforeEditChecks"
jenkins-bot [Mon, 11 Jun 2018 23:53:58 +0000 (23:53 +0000)]
Merge "Remove deprecated hook EditPageBeforeEditChecks"

5 years agoMerge "PHP: Use short ternary operator (?:) where possible"
jenkins-bot [Mon, 11 Jun 2018 23:06:59 +0000 (23:06 +0000)]
Merge "PHP: Use short ternary operator (?:) where possible"

5 years agoRemove deprecated hook EditPageBeforeEditChecks
Bartosz Dziewoński [Wed, 30 Aug 2017 19:07:49 +0000 (21:07 +0200)]
Remove deprecated hook EditPageBeforeEditChecks

Change-Id: I525a3a81787214dae42d3ce641d8c62761d17797

5 years agoregistration: Catch correct exception type from ObjectCache
Kunal Mehta [Mon, 11 Jun 2018 20:57:58 +0000 (13:57 -0700)]
registration: Catch correct exception type from ObjectCache

ObjectCache::newFromId() now throws an InvalidArgumentException if the
specific id can't be found.

Change-Id: Idcb0f2158a38555c1ec1681ba0635c7903e48718

5 years agoSilently drop unknown titles in completion search
Erik Bernhardson [Thu, 14 Dec 2017 01:03:20 +0000 (17:03 -0800)]
Silently drop unknown titles in completion search

This mimics how full text works by silenty dropping results returned from
search that no longer exist. This could be because the search index is slightly
out of sync with reality, or the search engine could simply be broken.

Only silent from the users perspective. We maintain a count in statsd of
the number of titles dropped. This can be monitored over time to
recognize any increases.

Bug: T115756
Change-Id: I2f29d73e258cd448a14d35a2b4902a4fb6f61c68

5 years agoPush pagination decision for search into SearchEngine
Erik Bernhardson [Tue, 19 Dec 2017 22:19:49 +0000 (14:19 -0800)]
Push pagination decision for search into SearchEngine

Various code using the search engine shouldn't need to implement it's
own methods, such as over-fetching, to determine if there are more
results available. This should be knowledge internal to search that is
exposed by a boolean.

Change-Id: Ica094428700637dfdedb723b03f6aeadfe12b9f4

5 years agoConvert SearchResultSet to typical iteration
Erik Bernhardson [Thu, 10 May 2018 22:03:55 +0000 (15:03 -0700)]
Convert SearchResultSet to typical iteration

The funky iteration here was at best annoying. Switch
it over to an iterator based approach with appropriate
BC code to simulate the old iteration style.

Depends-On: I19a8d6621a130811871dec9335038797627d9448
Change-Id: I9fccda15dd58a0dc35771d3b5cd7a6e8b02514a0

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 11 Jun 2018 20:14:10 +0000 (22:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I266e6f3e0974d9e597e86b5790871cd118043d57

5 years agoMerge "Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient"
jenkins-bot [Mon, 11 Jun 2018 19:29:55 +0000 (19:29 +0000)]
Merge "Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient"

5 years agoMerge "npm selenium command, use bash"
jenkins-bot [Mon, 11 Jun 2018 18:03:59 +0000 (18:03 +0000)]
Merge "npm selenium command, use bash"

5 years agoUse PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Fomafix [Mon, 11 Jun 2018 17:23:15 +0000 (19:23 +0200)]
Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient

This is a followup to 485f66f1.

Change-Id: I7a2a44b7e933103178929b3cdc015859612c8b35

5 years agoAdd langauge 'zgh' Standard Moroccan Amazigh
Étienne Beaulé [Wed, 23 May 2018 02:33:16 +0000 (23:33 -0300)]
Add langauge 'zgh' Standard Moroccan Amazigh

This change adds the Standard Moroccan Amazigh language with ISO
639-3 code 'zgh' with 'kab' (Kabyle) fallback. The default script is the
Neo-Tifinagh script.

Bug: T137491
Change-Id: Idd13f92d7ae05cd47267558c8ff4fa368b701e24

5 years agoPHP: Use short ternary operator (?:) where possible
Fomafix [Mon, 11 Jun 2018 09:16:48 +0000 (11:16 +0200)]
PHP: Use short ternary operator (?:) where possible

Change-Id: Idcc7e4fcdd4d8302ceda44bf6d294fa8c2219381

5 years agonpm selenium command, use bash
addshore [Thu, 7 Jun 2018 16:15:30 +0000 (17:15 +0100)]
npm selenium command, use bash

On Windows this seems to complain unless bash is specified

Change-Id: I4515c851ffea143d4c1c6d111ffdd64b62f9f304

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 10 Jun 2018 20:02:06 +0000 (22:02 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ie01e48ef17e431ae619237e8ae1e2810d454d1de

5 years agolinker: Hard-deprecate LinkBegin and LinkEnd hooks
Kunal Mehta [Sun, 10 Jun 2018 18:30:15 +0000 (11:30 -0700)]
linker: Hard-deprecate LinkBegin and LinkEnd hooks

Change-Id: Ia1d766d019a2711c96e7c41913055774eff9f777

5 years agoparser: Validate $length in padleft/padright parser functions
Kunal Mehta [Sun, 10 Jun 2018 18:09:07 +0000 (11:09 -0700)]
parser: Validate $length in padleft/padright parser functions

$length is user input, so cast it to an int before passing it to min().
If there is nothing to add at that point, return immediately.

In PHP 7.1+ this raised a warning of "A non-numeric value encountered"
because min() will return the junk value, returning a string. Then we
try and subtract an int from it (return value of mb_strlen()),
triggering the warning.

Added a parser test to verify the behavior, and confirmed that it
triggers warnings without the patch.

Bug: T180403
Change-Id: I614750962104f6251a864519035366ac9798fc0f

5 years agoSECURITY: Special:BotPasswords should reauthenticate
Brad Jorsch [Wed, 9 May 2018 19:14:38 +0000 (15:14 -0400)]
SECURITY: Special:BotPasswords should reauthenticate

More specifically, it should reauthenticate when creating a bot password
or resetting the password. But we may as well do it for all accesses.

Bug: T193237
Change-Id: I9a38a3109492753fff1f33c0f280e5b0f1fc1a76

5 years agoPass $parser, &$query and &$widthOption to the 'ImageBeforeProduceHTML' hook
Jack Phoenix [Sun, 10 Jun 2018 15:31:56 +0000 (18:31 +0300)]
Pass $parser, &$query and &$widthOption to the 'ImageBeforeProduceHTML' hook

This allows extensions to essentially reimplement Linker#makeImageLink
completely. Before this wasn't 100% possible as these three are needed for
that.

Inspired by wikiHow's core hacks to /includes/Linker.php, which can now be
moved to an ImageBeforeProduceHTML hook subscriber. wikiHow uses those
changes together with the WikihowArticle extension to heavily modify the
article DOM for various extensions and the default skin.

Change-Id: I8b5ab42d9cf021d66b90d15be68a0239643c10e3

5 years agoMerge "WebInstaller::docLink: Use Html::element to generate the link"
jenkins-bot [Sun, 10 Jun 2018 08:17:23 +0000 (08:17 +0000)]
Merge "WebInstaller::docLink: Use Html::element to generate the link"

5 years agoMerge "WebInstaller::getDocUrl: Use getUrl to generate the URL"
jenkins-bot [Sun, 10 Jun 2018 08:16:52 +0000 (08:16 +0000)]
Merge "WebInstaller::getDocUrl: Use getUrl to generate the URL"

5 years agoMerge "Localize some special pages into Korean (ko)"
jenkins-bot [Sun, 10 Jun 2018 08:02:59 +0000 (08:02 +0000)]
Merge "Localize some special pages into Korean (ko)"

5 years agoMerge "resourceloader: Re-enable testGetBlobCached() test case"
jenkins-bot [Sun, 10 Jun 2018 07:58:42 +0000 (07:58 +0000)]
Merge "resourceloader: Re-enable testGetBlobCached() test case"

5 years agoMerge "FormatJson: cleanup after PHP 5.5 support removal"
jenkins-bot [Sun, 10 Jun 2018 07:58:40 +0000 (07:58 +0000)]
Merge "FormatJson: cleanup after PHP 5.5 support removal"

5 years agoLocalize some special pages into Korean (ko)
Yongmin Hong [Sat, 2 Jun 2018 13:05:37 +0000 (22:05 +0900)]
Localize some special pages into Korean (ko)

* (Manually) synced from MessagesEn.php
* Changed Listfiles so it is less ambigious.

Change-Id: I59da5461efcc34511f99872cfc26d2ae63a52531
Signed-off-by: Yongmin Hong <revi@pobox.com>
5 years agoMerge "Escape text in Linker::specialLink()"
jenkins-bot [Sun, 10 Jun 2018 07:49:49 +0000 (07:49 +0000)]
Merge "Escape text in Linker::specialLink()"

5 years agoMerge "Get rid of call_user_func(_array)(), part 3"
jenkins-bot [Sun, 10 Jun 2018 02:46:30 +0000 (02:46 +0000)]
Merge "Get rid of call_user_func(_array)(), part 3"

5 years agoGet rid of call_user_func(_array)(), part 3
Max Semenik [Sat, 9 Jun 2018 23:26:32 +0000 (16:26 -0700)]
Get rid of call_user_func(_array)(), part 3

Also cleaned up nearby code in a couple places.

Change-Id: Ibf44ee7c0ceb739d7e79406e4ff39303c316e285

5 years agoClean up CSPRNG support for PHP7
Max Semenik [Fri, 19 Jan 2018 22:42:56 +0000 (14:42 -0800)]
Clean up CSPRNG support for PHP7

Replace it all with random_bytes(), leave
only MWCryptRand::generateHex() as a convenience helper.

Change-Id: Ic30376a90e66d8f00dab86e7e6466fb3a750b87d

5 years agoMerge "Remove PhanParamReqAfterOpt from blacklist"
jenkins-bot [Sat, 9 Jun 2018 19:43:46 +0000 (19:43 +0000)]
Merge "Remove PhanParamReqAfterOpt from blacklist"

5 years agoMerge "LoginSignupSpecialPage: Use $this->msg instead of wfMessage"
jenkins-bot [Sat, 9 Jun 2018 14:30:39 +0000 (14:30 +0000)]
Merge "LoginSignupSpecialPage: Use $this->msg instead of wfMessage"

5 years agoMerge "Replace call_user_func_array(), part 2"
jenkins-bot [Sat, 9 Jun 2018 14:25:26 +0000 (14:25 +0000)]
Merge "Replace call_user_func_array(), part 2"

5 years agoDo not require titles on Special:ComparePages
Matěj Suchánek [Sat, 9 Jun 2018 14:05:28 +0000 (14:05 +0000)]
Do not require titles on Special:ComparePages

By default, title fields are required, so the form cannot be submitted
without them. However, here we need either the title or the revision id.

Change-Id: Iedafec485851d7e91affb69a2c9c3fd40d31ded4

5 years agoLoginSignupSpecialPage: Use $this->msg instead of wfMessage
Fomafix [Sat, 9 Jun 2018 12:57:26 +0000 (14:57 +0200)]
LoginSignupSpecialPage: Use $this->msg instead of wfMessage

Change-Id: If1313112f39a449857028da6a4a22d6950c500a3

5 years agoFormatJson: cleanup after PHP 5.5 support removal
Kevin Israel [Sat, 9 Jun 2018 13:06:02 +0000 (09:06 -0400)]
FormatJson: cleanup after PHP 5.5 support removal

* Use PHP 5.6 constant expression support in definition of ALL_OK.
* Remove one level of nesting in encode(). Follows up I801eaffc.
* Update HTML5 section number in doc comment for XMLMETA_OK.
* Made other minor doc comment fixes, such as capitalizing "JSON".
* Not done: changing $badChars and $badCharsEscaped to constants.
  This will have to wait until HHVM 3.18 support is dropped.

Change-Id: I06413dfe0fedddfd20d3e375eadd9daad6d6230e

5 years agoMerge "Hard deprecate Interwiki static methods"
jenkins-bot [Sat, 9 Jun 2018 09:33:09 +0000 (09:33 +0000)]
Merge "Hard deprecate Interwiki static methods"

5 years agoRemove PhanParamReqAfterOpt from blacklist
Erik Bernhardson [Fri, 8 Jun 2018 21:46:41 +0000 (14:46 -0700)]
Remove PhanParamReqAfterOpt from blacklist

Change-Id: I569656068c9034f7325312afcce837e2712b4f29

5 years agoMerge "Resolve required parameter after optional in language"
jenkins-bot [Sat, 9 Jun 2018 09:20:54 +0000 (09:20 +0000)]
Merge "Resolve required parameter after optional in language"

5 years agoMerge "Resolve required parameter after optional in specials"
jenkins-bot [Sat, 9 Jun 2018 09:14:24 +0000 (09:14 +0000)]
Merge "Resolve required parameter after optional in specials"

5 years agoMerge "Resolve required parameter after optional in Xml"
jenkins-bot [Sat, 9 Jun 2018 09:08:46 +0000 (09:08 +0000)]
Merge "Resolve required parameter after optional in Xml"

5 years agoMerge "Resolve required parameter after optional in Message"
jenkins-bot [Sat, 9 Jun 2018 08:53:09 +0000 (08:53 +0000)]
Merge "Resolve required parameter after optional in Message"

5 years agoMerge "Resolve required parameter after optional parameter in Linker"
jenkins-bot [Sat, 9 Jun 2018 08:49:54 +0000 (08:49 +0000)]
Merge "Resolve required parameter after optional parameter in Linker"

5 years agoEscape text in Linker::specialLink()
Matěj Suchánek [Thu, 16 Mar 2017 20:24:55 +0000 (20:24 +0000)]
Escape text in Linker::specialLink()

Linker::linkKnown -> Linker::link -> $text is wrapped by HtmlArmor

Bug: T85864
Change-Id: I8755948131ffca4a0b5949b2f8cabf19f59c1c9e

5 years agoMerge "Rewrite IEUrlExtensionTest using a data provider"
jenkins-bot [Sat, 9 Jun 2018 08:42:02 +0000 (08:42 +0000)]
Merge "Rewrite IEUrlExtensionTest using a data provider"