[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Minor documentation updates

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Minor documentation updates
..


Minor documentation updates

Update DatabaseBase type hint

Update some deprecated code usages

Change-Id: I86aa4507447040754d0c9f20171f7e22aed4a0cc
---
M OATHAuth.hooks.php
M OATHAuthUtils.php
M OATHUserRepository.php
M special/SpecialOATHLogin.php
4 files changed, 24 insertions(+), 8 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/OATHAuth.hooks.php b/OATHAuth.hooks.php
index a9100f0..39f269b 100644
--- a/OATHAuth.hooks.php
+++ b/OATHAuth.hooks.php
@@ -2,6 +2,7 @@
 
 use MediaWiki\Auth\AuthenticationRequest;
 use MediaWiki\Auth\AuthManager;
+use MediaWiki\MediaWikiServices;
 
 /**
  * Hooks for Extension:OATHAuth
@@ -20,7 +21,8 @@
static $service = null;
 
if ( $service == null ) {
-   $service = new OATHUserRepository( wfGetLB( 
$wgOATHAuthDatabase ) );
+   $factory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+   $service = new OATHUserRepository( $factory->getMainLB( 
$wgOATHAuthDatabase ) );
}
 
return $service;
@@ -167,10 +169,10 @@
 * Helper function for converting old users to the new schema
 * @see OATHAuthHooks::OATHAuthSchemaUpdates
 *
-* @param DatabaseBase $db
+* @param IDatabase $db
 * @return bool
 */
-   public static function schemaUpdateOldUsers( DatabaseBase $db ) {
+   public static function schemaUpdateOldUsers( IDatabase $db ) {
if ( !$db->fieldExists( 'oathauth_users', 'secret_reset' ) ) {
return true;
}
diff --git a/OATHAuthUtils.php b/OATHAuthUtils.php
index 00fe248..5fcf018 100644
--- a/OATHAuthUtils.php
+++ b/OATHAuthUtils.php
@@ -48,6 +48,8 @@
/**
 * Generate encryption and hmac keys, unique to this user, based on a 
single
 * wiki secret. Use a moderate pbkdf2 work factor in case we ever leak 
keys.
+* @param string $secret
+* @param string|int $userid
 * @return array including key for encryption and integrity checking
 */
private static function getUserKeys( $secret, $userid ) {
@@ -61,6 +63,9 @@
/**
 * Actually encrypt the data, using a new random IV, and prepend the 
hmac
 * of the encrypted data + IV, using a separate hmac key.
+* @param string $data
+* @param string $encKey
+* @param string $hmacKey
 * @return string $hmac.$iv.$ciphertext, each component b64 encoded
 */
private static function seal( $data, $encKey, $hmacKey ) {
@@ -80,9 +85,9 @@
/**
 * Decrypt data sealed using seal(). First checks the hmac to prevent 
various
 * attacks.
-* @param $encrypted
-* @param $encKey
-* @param $hmacKey
+* @param string $encrypted
+* @param string $encKey
+* @param string $hmacKey
 * @return string plaintext
 * @throws Exception
 */
diff --git a/OATHUserRepository.php b/OATHUserRepository.php
index a7f6a33..8185187 100644
--- a/OATHUserRepository.php
+++ b/OATHUserRepository.php
@@ -4,6 +4,10 @@
/** @var LoadBalancer */
protected $lb;
 
+   /**
+* OATHUserRepository constructor.
+* @param LoadBalancer $lb
+*/
public function __construct( LoadBalancer $lb ) {
$this->lb = $lb;
}
@@ -26,6 +30,9 @@
return $oathUser;
}
 
+   /**
+* @param OATHUser $user
+*/
public function persist( OATHUser $user ) {
$this->getDB( DB_MASTER )->replace(
'oathauth_users',
@@ -39,6 +46,9 @@
);
}
 
+   /**
+* @param OATHUser $user
+*/
public function remove( OATHUser $user ) {
$this->getDB( DB_MASTER )->delete(
'oathauth_users',
diff --git a/special/SpecialOATHLogin.php b/special/SpecialOATHLogin.php
index a50cc6c..c7a7681 100644
--- a/special/SpecialOATHLogin.php
+++ b/special/SpecialOATHLogin.php
@@ -109,8 +109,7 @@
 * @return bool
 */
public function onAbortLogin( User $user, $password, &$abort, 
&$errorMsg ) {
-   $result = $this->OATHUser
-   ->getKey()
+   $result = $this->OATHUser->getKey()
->verifyToken( $this->getRequest()->getVal( 'token' ), 
$this->OATHUser );
 
if ( $result ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/313621
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I86aa4507447040754d0c9f20171f7e22aed4a0cc
Gerrit-PatchSet: 3
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Apply rate limits to all token verifications

2016-10-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313774

Change subject: Apply rate limits to all token verifications
..

Apply rate limits to all token verifications

Extend the token validation failure checks introduced in I4884f6e to the
other interactions where OATHAuthKey::verifyToken is used.

Change-Id: Icbe5cdf561c683dc971a099d61cedff311b26b43
---
M OATHAuthKey.php
M api/ApiOATHValidate.php
M auth/TOTPSecondaryAuthenticationProvider.php
M special/SpecialOATHDisable.php
M special/SpecialOATHLogin.php
5 files changed, 28 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/74/313774/1

diff --git a/OATHAuthKey.php b/OATHAuthKey.php
index c119da3..63225d3 100644
--- a/OATHAuthKey.php
+++ b/OATHAuthKey.php
@@ -80,7 +80,7 @@
 * @return int|false Returns a constant represent what type of token 
was matched,
 *  or false for no match
 */
-   public function verifyToken( $token, $user ) {
+   public function verifyToken( $token, OATHUser $user ) {
global $wgOATHAuthWindowRadius;
 
if ( $this->secret['mode'] !== 'hotp' ) {
@@ -136,6 +136,9 @@
$lastWindow,
$this->secret['period'] * ( 1 + 2 * 
$wgOATHAuthWindowRadius )
);
+   } else {
+   // Increase rate limit counter for failed request
+   $user->getUser()->pingLimiter( 'badoath' );
}
 
return $retval;
diff --git a/api/ApiOATHValidate.php b/api/ApiOATHValidate.php
index cce6ab2..103d8d5 100644
--- a/api/ApiOATHValidate.php
+++ b/api/ApiOATHValidate.php
@@ -44,7 +44,7 @@
$this->dieUsageMsg( [ 'noname', $params['user'] ] );
}
 
-   // Don't increase pingLimiter, just check for limit exceeded
+   // Don't increase pingLimiter, just check for limit exceeded.
if ( $user->pingLimiter( 'badoath', 0 ) ) {
$this->dieUsageMsg( 'actionthrottledtext' );
}
@@ -66,11 +66,6 @@
$params['totp'], $oathUser ) 
!== false;
}
}
-   }
-
-   if ( !$result['valid'] ) {
-   // Increase rate limit counter for failed request
-   $user->pingLimiter( 'badoath' );
}
 
$this->getResult()->addValue( null, $this->getModuleName(), 
$result );
diff --git a/auth/TOTPSecondaryAuthenticationProvider.php 
b/auth/TOTPSecondaryAuthenticationProvider.php
index 23a83f8..4dc1f3c 100644
--- a/auth/TOTPSecondaryAuthenticationProvider.php
+++ b/auth/TOTPSecondaryAuthenticationProvider.php
@@ -74,6 +74,17 @@
return AuthenticationResponse::newAbstain();
}
 
+   // Don't increase pingLimiter, just check for limit exceeded.
+   if ( $user->pingLimiter( 'badoath', 0 ) ) {
+   return AuthenticationResponse::newUI(
+   [ new TOTPAuthenticationRequest() ],
+   new Message(
+   'oathauth-throttled',
+   // Arbitrary duration given here
+   [ Message::durationParam( 60 ) ]
+   ), 'error' );
+   }
+
if ( $oathuser->getKey()->verifyToken( $token, $oathuser ) ) {
$throttler->clear( $user->getName(), null );
return AuthenticationResponse::newPass();
diff --git a/special/SpecialOATHDisable.php b/special/SpecialOATHDisable.php
index b1879b9..0a75b27 100644
--- a/special/SpecialOATHDisable.php
+++ b/special/SpecialOATHDisable.php
@@ -95,6 +95,12 @@
 * @return array|bool
 */
public function onSubmit( array $formData ) {
+   // Don't increase pingLimiter, just check for limit exceeded.
+   if ( $this->OATHUser->getUser()->pingLimiter( 'badoath', 0 ) ) {
+   // Arbitrary duration given here
+   return [ 'oauthauth-throttled', Message::durationParam( 
60 ) ];
+   }
+
if ( !$this->OATHUser->getKey()->verifyToken( 
$formData['token'], $this->OATHUser ) ) {
return [ 'oathauth-failedtovalidateoauth' ];
}
diff --git a/special/SpecialOATHLogin.php b/special/SpecialOATHLogin.php
index a50cc6c..64061a5 100644
--- a/special/SpecialOATHLogin.php
+++ b/special/SpecialOATHLogin.php
@@ -109,6 +109,12 @@
 * @return bool
 */
public function onAbortLogin( User $user, $password, &$abort, 
&$errorMsg ) {
+

[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Replace deprecated .mw-ui-constructive with .mw-ui-progressive

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Replace deprecated .mw-ui-constructive with .mw-ui-progressive
..


Replace deprecated .mw-ui-constructive with .mw-ui-progressive

Bug: T146923
Change-Id: I1586a0519b7c1ae8f94d0fc8741bdee1a92048ca
---
M modules/dashboard/ext.cx.dashboard.js
M modules/header/ext.cx.header.js
M modules/publish/ext.cx.publish.js
3 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Santhosh: Looks good to me, approved
  Prtksxna: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/dashboard/ext.cx.dashboard.js 
b/modules/dashboard/ext.cx.dashboard.js
index 1ac0e2e..0be1eb1 100644
--- a/modules/dashboard/ext.cx.dashboard.js
+++ b/modules/dashboard/ext.cx.dashboard.js
@@ -193,7 +193,7 @@
 
this.$listHeader = $( '' ).addClass( 'translation-filter' 
);
this.$newTranslationButton = $( '' )
-   .addClass( 'cx-cta__new-translation mw-ui-button 
mw-ui-constructive' )
+   .addClass( 'cx-cta__new-translation mw-ui-button 
mw-ui-progressive' )
.text( mw.msg( 'cx-create-new-translation' ) );
this.$cta = $( '' )
.addClass( 'cx-cta' )
diff --git a/modules/header/ext.cx.header.js b/modules/header/ext.cx.header.js
index e1600d1..2651995 100644
--- a/modules/header/ext.cx.header.js
+++ b/modules/header/ext.cx.header.js
@@ -215,7 +215,7 @@
.addClass( 'cx-header__draft-status' );
 
this.$publishButton = $( '' )
-   .addClass( 'cx-header__publish-button mw-ui-button 
mw-ui-constructive' )
+   .addClass( 'cx-header__publish-button mw-ui-button 
mw-ui-progressive' )
.prop( 'disabled', true )
.text( mw.msg( 'cx-publish-button' ) );
 
diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index 201290d..27069ec 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -103,7 +103,7 @@
.prop( 'type', 'text' );
 
$publishButton = $( '' )
-   .addClass( 'cx-header__publish-captcha mw-ui-button 
mw-ui-constructive' )
+   .addClass( 'cx-header__publish-captcha mw-ui-button 
mw-ui-progressive' )
.text( mw.msg( 'cx-publish-button' ) );
 
$captchaForm.append( $captchaAnswer, $publishButton );

-- 
To view, visit https://gerrit.wikimedia.org/r/313520
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1586a0519b7c1ae8f94d0fc8741bdee1a92048ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Prtksxna 
Gerrit-Reviewer: Santhosh 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Enable deprecation warnings for WikiPage::getText()

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Enable deprecation warnings for WikiPage::getText()
..


Enable deprecation warnings for WikiPage::getText()

Deprecated since 1.21.

Bug: T145750
Change-Id: I226458e480bc44d4223bf7b271173bc27902f5ba
---
M includes/page/WikiPage.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  Daniel Kinzler: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 928fc14..4fa042e 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -693,7 +693,7 @@
 * @deprecated since 1.21, getContent() should be used instead.
 */
public function getText( $audience = Revision::FOR_PUBLIC, User $user = 
null ) {
-   ContentHandler::deprecated( __METHOD__, '1.21' );
+   wfDeprecated( __METHOD__, '1.21' );
 
$this->loadLastEdit();
if ( $this->mLastRevision ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/312744
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I226458e480bc44d4223bf7b271173bc27902f5ba
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Enigmaeth 
Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Srijancse 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Embedding member list and announcements page in Collaboratio...

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Embedding member list and announcements page in 
CollaborationHubContent pages.
..


Embedding member list and announcements page in CollaborationHubContent pages.

This embeds the /Members subpage where it exists and includes three random 
members. It also includes a button linking to the full list and a "join" button 
that just goes to action=edit on the members page. It also embeds the 
/Announcements subpage where it exists.

Also fixed:
* An error occurred if you tried to randomize a list with only one entry. This 
is fixed; if the list only has one entry, the randomizer just returns the 
one-entry list.
* Trying to add anything other than notes in the batch editor to entries that 
did not already have notes resulted in everything being interpreted as notes. 
This is now fixed. However, in the JavaScript per-item editor, making changes 
to the first item results in that first item being duplicated.
* CollaborationListContent styles now show up on hub pages.
* Module styles are now property loaded (T144526)

Bug: T144526
Change-Id: I55d83e7032275371f88633b936634ef360fa3833
---
M i18n/en.json
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationListContent.php
3 files changed, 135 insertions(+), 70 deletions(-)

Approvals:
  Isarra: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index ae14ca9..798bc7c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -58,8 +58,8 @@
"collaborationkit-editjsontab": "Edit as JSON",
"collaborationkit-hub-announcements-initial": "A new collaboration hub 
has been set up!",
"collaborationkit-hub-members-description": "Our members are below. 
Those who have not edited in over a month are moved to the inactive section.",
-   "collaborationkit-hub-members-header": "Members",
-   "collaborationkit-hub-members-signup": "Join Project",
+   "collaborationkit-hub-members-header": "Meet our members!",
+   "collaborationkit-hub-members-signup": "Join",
"collaborationkit-hub-members-view": "View full list",
"collaborationkit-hub-missingpage-note": "This feature does not exist. 
You can create a new project feature using the button below.",
"collaborationkit-hub-missingpage-create": "Create feature",
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 53a819c..c1c0409 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -226,7 +226,6 @@
 
// Dummy parse intro and footer to get categories and whatnot
$output = $wgParser->parse( $this->getIntroduction() . 
$this->getFooter(), $title, $options, true, true, $revId );
-
$html = '';
// set up hub with theme stuff
$html .= Html::openElement(
@@ -251,6 +250,12 @@
'div',
[ 'class' => 'wp-intro' ],
$this->getParsedIntroduction( $title, $options )
+   );
+   // get announcements
+   $html .= Html::rawElement(
+   'div',
+   [ 'class' => 'wp-announcements' ],
+   $this->getParsedAnnouncements( $title, $options )
);
// get table of contents
$html .= Html::rawElement(
@@ -278,6 +283,7 @@
$output->addModuleStyles( 'ext.CollaborationKit.main' );
$output->addModules( 'ext.CollaborationKit.icons' );
$output->addModules( 'ext.CollaborationKit.blots' );
+   $output->addModules( 'ext.CollaborationKit.list.styles' );
$output->setEnableOOUI( true );
}
 
@@ -314,56 +320,48 @@
 * @return string
 */
protected function getMembersBlock( Title $title, ParserOptions 
$options ) {
-   // deprecated; we need proper list handling to do this properly
-   /*
-   // Members
-   $membersTitle = Title::newFromText( $title->getFullText() . '/' 
. wfMessage( 'collaborationkit-hub-members-header' 
)->inContentLanguage()->text() );
-   $membersTitleRev = $title ? Revision::newFromTitle( 
$membersTitle ) : null;
-   if ( $membersTitleRev ) {
+   global $wgParser;
 
-   $prependiture .= Html::openElement(
-   'div',
-   [ 'id' => 'wp-header-members' ]
-   );
-   $prependiture .= Html::element(
-   'h2',
-   [],
-   wfmessage( 'collaborationkit-members-header' 
)->inContentLanguage()->text()
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update wikimedia/php-session-serializer to v1.0.4

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update wikimedia/php-session-serializer to v1.0.4
..


Update wikimedia/php-session-serializer to v1.0.4

github.com/wikimedia/php-session-serializer/compare/v1.0.3...v1.0.4

Change-Id: Ia0045329f4680a6f7c6acc9d886ae54ccf49c83d
Depends-On: I18ec214b6446f559e018673797efcab70523de39
---
M RELEASE-NOTES-1.28
M composer.json
2 files changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index 42d639a..24aaa0d 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -66,6 +66,7 @@
  Upgraded external libraries 
 * Updated es5-shim from v4.1.5 to v4.5.8
 * Updated composer/semver from v1.4.1 to v1.4.2
+* Updated wikimedia/php-session-serializer from v1.0.3 to v1.0.4
 
  New external libraries 
 * Added wikimedia/scoped-callback v1.0.0
diff --git a/composer.json b/composer.json
index f809d45..347b357 100644
--- a/composer.json
+++ b/composer.json
@@ -36,7 +36,7 @@
"wikimedia/composer-merge-plugin": "1.3.1",
"wikimedia/html-formatter": "1.0.1",
"wikimedia/ip-set": "1.1.0",
-   "wikimedia/php-session-serializer": "1.0.3",
+   "wikimedia/php-session-serializer": "1.0.4",
"wikimedia/relpath": "1.0.3",
"wikimedia/running-stat": "1.1.0",
"wikimedia/scoped-callback": "1.0.0",

-- 
To view, visit https://gerrit.wikimedia.org/r/313758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia0045329f4680a6f7c6acc9d886ae54ccf49c83d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/vendor[master]: Update wikimedia/php-session-serializer to v1.0.4

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update wikimedia/php-session-serializer to v1.0.4
..


Update wikimedia/php-session-serializer to v1.0.4

github.com/wikimedia/php-session-serializer/compare/v1.0.3...v1.0.4

Change-Id: I18ec214b6446f559e018673797efcab70523de39
---
M composer.json
M composer.lock
M composer/installed.json
M wikimedia/php-session-serializer/README.md
4 files changed, 59 insertions(+), 60 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index 3ddb223..9c17f29 100644
--- a/composer.json
+++ b/composer.json
@@ -39,7 +39,7 @@
"wikimedia/composer-merge-plugin": "1.3.1",
"wikimedia/html-formatter": "1.0.1",
"wikimedia/ip-set": "1.1.0",
-   "wikimedia/php-session-serializer": "1.0.3",
+   "wikimedia/php-session-serializer": "1.0.4",
"wikimedia/relpath": "1.0.3",
"wikimedia/running-stat": "1.1.0",
"wikimedia/scoped-callback": "1.0.0",
diff --git a/composer.lock b/composer.lock
index efd8472..4db74b4 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"hash": "a0be8dca46b0487f79cc777d78940f4a",
-"content-hash": "50416a3515ff05a598d0a6cfdf4fac9d",
+"content-hash": "e59fc06c030fa02586f8afe9786a0dbe",
 "packages": [
 {
 "name": "composer/semver",
@@ -1516,22 +1515,22 @@
 },
 {
 "name": "wikimedia/php-session-serializer",
-"version": "v1.0.3",
+"version": "v1.0.4",
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/php-session-serializer.git;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55"
+"reference": "4474af7aa8f0b20aa141c33eb4ad068a1c7d5b8c"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/php-session-serializer/zipball/61dec9a25bdcea4a0cc34a22fe6f43efca390d55;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55",
+"url": 
"https://api.github.com/repos/wikimedia/php-session-serializer/zipball/4474af7aa8f0b20aa141c33eb4ad068a1c7d5b8c;,
+"reference": "4474af7aa8f0b20aa141c33eb4ad068a1c7d5b8c",
 "shasum": ""
 },
 "require": {
 "mediawiki/at-ease": "^1.0",
 "php": ">=5.3.3",
-"psr/log": "1.0.0"
+"psr/log": "^1.0"
 },
 "require-dev": {
 "jakub-onderka/php-parallel-lint": "^0.9.0.0",
@@ -1556,7 +1555,7 @@
 ],
 "description": "Provides methods like PHP's session_encode and 
session_decode that don't mess with $_SESSION",
 "homepage": 
"https://www.mediawiki.org/wiki/Php-session-serializer;,
-"time": "2015-11-10 22:16:03"
+"time": "2016-10-01 13:19:49"
 },
 {
 "name": "wikimedia/relpath",
diff --git a/composer/installed.json b/composer/installed.json
index 033371b..8af424f 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -868,52 +868,6 @@
 "homepage": "https://www.mediawiki.org/wiki/CLDRPluralRuleParser;
 },
 {
-"name": "wikimedia/php-session-serializer",
-"version": "v1.0.3",
-"version_normalized": "1.0.3.0",
-"source": {
-"type": "git",
-"url": "https://github.com/wikimedia/php-session-serializer.git;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/php-session-serializer/zipball/61dec9a25bdcea4a0cc34a22fe6f43efca390d55;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55",
-"shasum": ""
-},
-"require": {
-"mediawiki/at-ease": "^1.0",
-"php": ">=5.3.3",
-"psr/log": "1.0.0"
-},
-"require-dev": {
-"jakub-onderka/php-parallel-lint": "^0.9.0.0",
-"mediawiki/mediawiki-codesniffer": "0.5.0",
-"phpunit/phpunit": "~4.5"
-},
-"time": "2015-11-10 22:16:03",
-"type": "library",
-"installation-source": "dist",
-"autoload": {
-"classmap": [
-"src/"
-]
-},
-"notification-url": "https://packagist.org/downloads/;,
-"license": [
-"GPL-2.0+"
-],
-"authors": [
-{
-"name": 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add primary key to change_tag and tag_summary tables

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add primary key to change_tag and tag_summary tables
..


Add primary key to change_tag and tag_summary tables

Based heavily on 43e386ca16411096bbbd7f14f9f4e15c5e268fe7.

Bug: T123225
Change-Id: I33480f4016812259700979f1145099744bb451d4
---
M includes/installer/MssqlUpdater.php
M includes/installer/MysqlUpdater.php
M includes/installer/OracleUpdater.php
M includes/installer/PostgresUpdater.php
M includes/installer/SqliteUpdater.php
A maintenance/archives/patch-change_tag-ct_id.sql
A maintenance/archives/patch-tag_summary-ts_id.sql
A maintenance/mssql/archives/patch-change_tag-ct_id.sql
A maintenance/mssql/archives/patch-tag_summary-ts_id.sql
M maintenance/mssql/tables.sql
A maintenance/oracle/archives/patch-change_tag-ct_id.sql
A maintenance/oracle/archives/patch-tag_summary-ts_id.sql
M maintenance/oracle/tables.sql
M maintenance/postgres/tables.sql
A maintenance/sqlite/archives/patch-change_tag-ct_id.sql
A maintenance/sqlite/archives/patch-tag_summary-ts_id.sql
M maintenance/tables.sql
17 files changed, 110 insertions(+), 4 deletions(-)

Approvals:
  Jcrespo: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/installer/MssqlUpdater.php 
b/includes/installer/MssqlUpdater.php
index 770d3bf..1175e9e 100644
--- a/includes/installer/MssqlUpdater.php
+++ b/includes/installer/MssqlUpdater.php
@@ -92,6 +92,8 @@
// 1.28
[ 'addIndex', 'recentchanges', 
'rc_name_type_patrolled_timestamp',

'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
+   [ 'addField', 'change_tag', 'ct_id', 
'patch-change_tag-ct_id.sql' ],
+   [ 'addField', 'tag_summary', 'ts_id', 
'patch-tag_summary-ts_id.sql' ],
];
}
 
diff --git a/includes/installer/MysqlUpdater.php 
b/includes/installer/MysqlUpdater.php
index 693b6ff..497f273 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -288,6 +288,8 @@

'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
[ 'doRevisionPageRevIndexNonUnique' ],
[ 'doNonUniquePlTlIl' ],
+   [ 'addField', 'change_tag', 'ct_id', 
'patch-change_tag-ct_id.sql' ],
+   [ 'addField', 'tag_summary', 'ts_id', 
'patch-tag_summary-ts_id.sql' ],
];
}
 
diff --git a/includes/installer/OracleUpdater.php 
b/includes/installer/OracleUpdater.php
index 8075aac..e1e0d0f 100644
--- a/includes/installer/OracleUpdater.php
+++ b/includes/installer/OracleUpdater.php
@@ -116,6 +116,8 @@
// 1.28
[ 'addIndex', 'recentchanges', 
'rc_name_type_patrolled_timestamp',

'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
+   [ 'addField', 'change_tag', 'ct_id', 
'patch-change_tag-ct_id.sql' ],
+   [ 'addField', 'tag_summary', 'ts_id', 
'patch-tag_summary-ts_id.sql' ],
 
// KEEP THIS AT THE BOTTOM!!
[ 'doRebuildDuplicateFunction' ],
diff --git a/includes/installer/PostgresUpdater.php 
b/includes/installer/PostgresUpdater.php
index be94d91..f3d2860 100644
--- a/includes/installer/PostgresUpdater.php
+++ b/includes/installer/PostgresUpdater.php
@@ -68,6 +68,8 @@
[ 'addSequence', 'archive', false, 'archive_ar_id_seq' 
],
[ 'addSequence', 'externallinks', false, 
'externallinks_el_id_seq' ],
[ 'addSequence', 'watchlist', false, 
'watchlist_wl_id_seq' ],
+   [ 'addSequence', 'change_tag', false, 
'change_tag_ct_id_seq' ],
+   [ 'addSequence', 'tag_summary', false, 
'tag_summary_ts_id_seq' ],
 
# new tables
[ 'addTable', 'category', 'patch-category.sql' ],
@@ -437,6 +439,10 @@
// 1.28
[ 'addPgIndex', 'recentchanges', 
'rc_name_type_patrolled_timestamp',
'( rc_namespace, rc_type, rc_patrolled, 
rc_timestamp )' ],
+   [ 'addPgField', 'change_tag', 'ct_id',
+   "INTEGER NOT NULL PRIMARY KEY DEFAULT 
nextval('change_tag_ct_id_seq')" ],
+   [ 'addPgField', 'tag_summary', 'ts_id',
+   "INTEGER NOT NULL PRIMARY KEY DEFAULT 
nextval('tag_summary_ts_id_seq')" ],
];
}
 
diff --git a/includes/installer/SqliteUpdater.php 
b/includes/installer/SqliteUpdater.php
index 1c6e6eb..388c034 100644
--- a/includes/installer/SqliteUpdater.php
+++ b/includes/installer/SqliteUpdater.php
@@ -156,6 

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Make 'flow-skip-summary' clearer

2016-10-02 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313773

Change subject: Make 'flow-skip-summary' clearer
..

Make 'flow-skip-summary' clearer

"Skip summary" seems like it is asking for a summary of why it is being
skipped. A plain "Skip" makes more sense and conveys that you can skip
the form rather than the implied but unclear "Skip [adding a] summary".

Change-Id: I55672163df2bb1b6b85214f58e18ba1a3751f3d2
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/73/313773/1

diff --git a/i18n/en.json b/i18n/en.json
index f1fa1bd..f349246 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -75,7 +75,7 @@
"flow-post-actions": "Actions",
"flow-topic-actions": "Actions",
"flow-cancel": "Cancel",
-   "flow-skip-summary": "Skip summary",
+   "flow-skip-summary": "Skip",
"flow-edit-summary-placeholder": "Describe briefly the outcome of this 
discussion",
"flow-summary-authored": "Summary by $1",
"flow-summary-edited": "Summary last {{GENDER:$1|edited}} by $1",

-- 
To view, visit https://gerrit.wikimedia.org/r/313773
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55672163df2bb1b6b85214f58e18ba1a3751f3d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] maps...deploy[master]: Update kartotherian to eb58ffc

2016-10-02 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313772

Change subject: Update kartotherian to eb58ffc
..

Update kartotherian to eb58ffc

List of changes:
eb58ffc Bumped npm-shrinkwrap
xxx Update node module dependencies

Change-Id: I7107edc88172c71b113984a2a69df9dfac365a96
---
M node_modules/kartotherian-autogen/package.json
M node_modules/kartotherian-cassandra/package.json
M node_modules/kartotherian-core/node_modules/xmldoc/package.json
M node_modules/kartotherian-core/package.json
M node_modules/kartotherian-demultiplexer/package.json
M node_modules/kartotherian-geoshapes/package.json
M node_modules/kartotherian-layermixer/package.json
M node_modules/kartotherian-maki/package.json
M node_modules/kartotherian-overzoom/package.json
M node_modules/kartotherian-server/package.json
M node_modules/kartotherian-snapshot/node_modules/abaculus/package.json
M 
node_modules/kartotherian-snapshot/node_modules/leaflet-headless/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json
M node_modules/kartotherian-snapshot/node_modules/leaflet-headless/package.json
M node_modules/kartotherian-snapshot/node_modules/mwapi/package.json
M node_modules/kartotherian-snapshot/package.json
M node_modules/kartotherian-substantial/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
A 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/benchmark.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
D 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/bcrypt-pbkdf/node_modules/tweetnacl/.npmignore
D 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/bcrypt-pbkdf/node_modules/tweetnacl/nacl-fast.js
D 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/bcrypt-pbkdf/node_modules/tweetnacl/nacl-fast.min.js
D 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/bcrypt-pbkdf/node_modules/tweetnacl/nacl.js
D 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/bcrypt-pbkdf/node_modules/tweetnacl/nacl.min.js
D 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/bcrypt-pbkdf/node_modules/tweetnacl/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json
M 
node_modules/mapnik/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json
M 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add "from" to MediaWiki:Search-redirect

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add "from" to MediaWiki:Search-redirect
..


Add "from" to MediaWiki:Search-redirect

Bug: T129941
Change-Id: If8871fe85b1c1c8202895c964d47ef250a1ed110
---
M languages/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index cbe755d..b7a0f83 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -993,7 +993,7 @@
"searchprofile-advanced-tooltip": "Search in custom namespaces",
"search-result-size": "$1 ({{PLURAL:$2|1 word|$2 words}})",
"search-result-category-size": "{{PLURAL:$1|1 member|$1 members}} 
({{PLURAL:$2|1 subcategory|$2 subcategories}}, {{PLURAL:$3|1 file|$3 files}})",
-   "search-redirect": "(redirect $1)",
+   "search-redirect": "(redirect from $1)",
"search-section": "(section $1)",
"search-category": "(category $1)",
"search-file-match": "(matches file content)",

-- 
To view, visit https://gerrit.wikimedia.org/r/313765
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If8871fe85b1c1c8202895c964d47ef250a1ed110
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Huji 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot...FLOSSbot[master]: plugin: item name before plugin name

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: plugin: item name before plugin name
..


plugin: item name before plugin name

It's easier to read.

Change-Id: I15fb5b1fd0fb45a3fb246a582e0ed13e8b0b5076
Signed-off-by: Loic Dachary 
---
M FLOSSbot/plugin.py
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Dachary: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/FLOSSbot/plugin.py b/FLOSSbot/plugin.py
index 259df3f..b273ce9 100644
--- a/FLOSSbot/plugin.py
+++ b/FLOSSbot/plugin.py
@@ -61,8 +61,9 @@
 def log(self, fun, item, message):
 label = item.labels.get('en', 'no label')
 fun("http://wikidata.org/wiki/; + item.getID() +
+" " + label +
 " " + self.__class__.__name__ +
-" " + label + " " + message)
+" " + message)
 
 def run_catch(self, item):
 try:

-- 
To view, visit https://gerrit.wikimedia.org/r/313771
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I15fb5b1fd0fb45a3fb246a582e0ed13e8b0b5076
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary 
Gerrit-Reviewer: Dachary 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot...FLOSSbot[master]: plugin: item name before plugin name

2016-10-02 Thread Dachary (Code Review)
Dachary has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313771

Change subject: plugin: item name before plugin name
..

plugin: item name before plugin name

It's easier to read.

Change-Id: I15fb5b1fd0fb45a3fb246a582e0ed13e8b0b5076
Signed-off-by: Loic Dachary 
---
M FLOSSbot/plugin.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/FLOSSbot 
refs/changes/71/313771/1

diff --git a/FLOSSbot/plugin.py b/FLOSSbot/plugin.py
index 259df3f..b273ce9 100644
--- a/FLOSSbot/plugin.py
+++ b/FLOSSbot/plugin.py
@@ -61,8 +61,9 @@
 def log(self, fun, item, message):
 label = item.labels.get('en', 'no label')
 fun("http://wikidata.org/wiki/; + item.getID() +
+" " + label +
 " " + self.__class__.__name__ +
-" " + label + " " + message)
+" " + message)
 
 def run_catch(self, item):
 try:

-- 
To view, visit https://gerrit.wikimedia.org/r/313771
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15fb5b1fd0fb45a3fb246a582e0ed13e8b0b5076
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: MWException: restore prior render() logic

2016-10-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313770

Change subject: MWException: restore prior render() logic
..

MWException: restore prior render() logic

Partially revert 00bee02 by restoring the prior MWException::report()
logic. MWExceptionRenderer does not handle all of the MWException
subclasses that somehow modify the default render() behavior. Notable
among these is Flow\Exception\FlowException and its subclasses which
modify the `$wgOut` global to divert HTML output to alternate locations.

Bug: T147122
Change-Id: Ibe3cadca229ce21ed0a3a2482433e3a22b5f5646
(cherry picked from commit eeb382e3c7addd13ee70a58542412628e884f8ec)
---
M includes/exception/MWException.php
1 file changed, 20 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/70/313770/1

diff --git a/includes/exception/MWException.php 
b/includes/exception/MWException.php
index 5496cb6..e958c94 100644
--- a/includes/exception/MWException.php
+++ b/includes/exception/MWException.php
@@ -199,7 +199,26 @@
 * It will be either HTML or plain text based on isCommandLine().
 */
public function report() {
-   MWExceptionRenderer::output( $this, 
MWExceptionRenderer::AS_PRETTY );
+   global $wgMimeType;
+
+   if ( defined( 'MW_API' ) ) {
+   // Unhandled API exception, we can't be sure that 
format printer is alive
+   self::header( 'MediaWiki-API-Error: 
internal_api_error_' . get_class( $this ) );
+   wfHttpError( 500, 'Internal Server Error', 
$this->getText() );
+   } elseif ( self::isCommandLine() ) {
+   $message = $this->getText();
+   // T17602: STDERR may not be available
+   if ( defined( 'STDERR' ) ) {
+   fwrite( STDERR, $message );
+   } else {
+   echo $message;
+   }
+   } else {
+   self::statusHeader( 500 );
+   self::header( "Content-Type: $wgMimeType; 
charset=utf-8" );
+
+   $this->reportHTML();
+   }
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/313770
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe3cadca229ce21ed0a3a2482433e3a22b5f5646
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: BryanDavis 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add NS_TEMPLATE to wgNamespacesWithSubpages in DefaultSettin...

2016-10-02 Thread Tjlsangria (Code Review)
Tjlsangria has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313769

Change subject: Add NS_TEMPLATE to wgNamespacesWithSubpages in 
DefaultSettings.php
..

Add NS_TEMPLATE to wgNamespacesWithSubpages in DefaultSettings.php

Bug: T47160
Change-Id: I504de3332bbc4b39d8d69fa324949988d56d0b67
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/313769/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index b1436b0..8c39c48 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -4023,6 +4023,7 @@
NS_FILE_TALK => true,
NS_MEDIAWIKI => true,
NS_MEDIAWIKI_TALK => true,
+   NS_TEMPLATE => true,
NS_TEMPLATE_TALK => true,
NS_HELP => true,
NS_HELP_TALK => true,

-- 
To view, visit https://gerrit.wikimedia.org/r/313769
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I504de3332bbc4b39d8d69fa324949988d56d0b67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Tjlsangria 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Special:NewPages - add for "originally created as..."

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Special:NewPages - add  for "originally created as..."
..


Special:NewPages - add  for "originally created as..."

Add span tag around the old title line in the Special New Page.

Bug: T146145
Change-Id: I7578e94284710250eab9f23dbef2777b58031faa
---
M includes/specials/SpecialNewpages.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialNewpages.php 
b/includes/specials/SpecialNewpages.php
old mode 100644
new mode 100755
index 718a6dc..d719e53
--- a/includes/specials/SpecialNewpages.php
+++ b/includes/specials/SpecialNewpages.php
@@ -376,7 +376,11 @@
 
if ( !$title->equals( $oldTitle ) ) {
$oldTitleText = $oldTitle->getPrefixedText();
-   $oldTitleText = $this->msg( 'rc-old-title' )->params( 
$oldTitleText )->escaped();
+   $oldTitleText = Html::rawElement(
+   'span',
+   [ 'class' => 'mw-newpages-oldtitle' ],
+   $this->msg( 'rc-old-title' )->params( 
$oldTitleText )->escaped()
+   );
}
 
return "{$time} {$dm}{$plink} {$hist} {$dm}{$length} "

-- 
To view, visit https://gerrit.wikimedia.org/r/313762
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7578e94284710250eab9f23dbef2777b58031faa
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sidhant-gupta-004 
Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] Don't ask for an option when -always is given

2016-10-02 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313768

Change subject: [bugfix] Don't ask for an option when -always is given
..

[bugfix] Don't ask for an option when -always is given

Bug: T147159
Change-Id: Ibb90f30a5c3a5f9dd09070ef2e21e378d5d07bdc
---
M scripts/solve_disambiguation.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/68/313768/1

diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 74ad11b..95c304a 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -836,7 +836,7 @@
 
 # TODO: Output context on each question
 answer = pywikibot.input_choice('Option', options,
-default=self.always)
+default=self.always, 
force=True)
 if answer == 'x':
 assert edited, 'invalid option before editing'
 break

-- 
To view, visit https://gerrit.wikimedia.org/r/313768
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb90f30a5c3a5f9dd09070ef2e21e378d5d07bdc
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Give sysops the deleterevision right by default.

2016-10-02 Thread Tjlsangria (Code Review)
Tjlsangria has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313767

Change subject: Give sysops the deleterevision right by default.
..

Give sysops the deleterevision right by default.

Bug: T70298
Change-Id: I9c29d068154c1e9bf7f2d6a101ee1c14e4b73557
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/67/313767/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index b1436b0..a419208 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5164,7 +5164,7 @@
 # $wgGroupPermissions['bureaucrat']['override-export-depth'] = true;
 
 # $wgGroupPermissions['sysop']['deletelogentry'] = true;
-# $wgGroupPermissions['sysop']['deleterevision'] = true;
+$wgGroupPermissions['sysop']['deleterevision'] = true;
 // To hide usernames from users and Sysops
 # $wgGroupPermissions['suppress']['hideuser'] = true;
 // To hide revisions/log items from users and Sysops

-- 
To view, visit https://gerrit.wikimedia.org/r/313767
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c29d068154c1e9bf7f2d6a101ee1c14e4b73557
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Tjlsangria 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Break down monuments_config in individual JSON files

2016-10-02 Thread Code Review
Jean-Frédéric has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313766

Change subject: Break down monuments_config in individual JSON files
..

Break down monuments_config in individual JSON files

monuments_config.py is extremely hard to edit
(and thus to add new countries)

This breaks down the huge Python dictionary into
individual JSON files, one for each (country,lang) config,
which are read and exposed by monuments_config.py

It adds two fields to each config:

- country, as it makes it much easier to infer from the config
  (rather than relying on the file naming for example)

- description, as a human-readable explication blurb:
  it makes it easier to find the right configuration file
  if one cannot remember the country code of a given country.

Bug: T145333
Change-Id: I2284dec18633b7a0e11175f5b5908117067f0ec2
---
M erfgoedbot/monuments_config.py
A erfgoedbot/monuments_config/ad_ca.json
A erfgoedbot/monuments_config/al_sq.json
A erfgoedbot/monuments_config/am_hy.json
A erfgoedbot/monuments_config/aq_en.json
A erfgoedbot/monuments_config/ar_es.json
A erfgoedbot/monuments_config/at_de.json
A erfgoedbot/monuments_config/az_az.json
A erfgoedbot/monuments_config/be-bru_nl.json
A erfgoedbot/monuments_config/be-vlg_en.json
A erfgoedbot/monuments_config/be-vlg_fr.json
A erfgoedbot/monuments_config/be-vlg_nl.json
A erfgoedbot/monuments_config/be-wal_en.json
A erfgoedbot/monuments_config/be-wal_fr.json
A erfgoedbot/monuments_config/be-wal_nl.json
A erfgoedbot/monuments_config/bo_es.json
A erfgoedbot/monuments_config/by_be-tarask.json
A erfgoedbot/monuments_config/ca_en.json
A erfgoedbot/monuments_config/ca_fr.json
A erfgoedbot/monuments_config/ch-old_en.json
A erfgoedbot/monuments_config/ch2_de.json
A erfgoedbot/monuments_config/ch3_de.json
A erfgoedbot/monuments_config/ch_de.json
A erfgoedbot/monuments_config/ch_fr.json
A erfgoedbot/monuments_config/ch_it.json
A erfgoedbot/monuments_config/cl_es.json
A erfgoedbot/monuments_config/cm_fr.json
A erfgoedbot/monuments_config/cn_en.json
A erfgoedbot/monuments_config/co_es.json
A erfgoedbot/monuments_config/cz_cs.json
A erfgoedbot/monuments_config/de-by_de.json
A erfgoedbot/monuments_config/de-he_de.json
A erfgoedbot/monuments_config/de-nrw-bm_de.json
A erfgoedbot/monuments_config/de-nrw-k_de.json
A erfgoedbot/monuments_config/dk-bygning_da.json
A erfgoedbot/monuments_config/dk-fortids_da.json
A erfgoedbot/monuments_config/dz_ar.json
A erfgoedbot/monuments_config/ee_et.json
A erfgoedbot/monuments_config/es-ct_ca.json
A erfgoedbot/monuments_config/es-gl_gl.json
A erfgoedbot/monuments_config/es-vc_ca.json
A erfgoedbot/monuments_config/es_ca.json
A erfgoedbot/monuments_config/es_es.json
A erfgoedbot/monuments_config/fr-object_fr.json
A erfgoedbot/monuments_config/fr_ca.json
A erfgoedbot/monuments_config/fr_fr.json
A erfgoedbot/monuments_config/gb-eng_en.json
A erfgoedbot/monuments_config/gb-nir_en.json
A erfgoedbot/monuments_config/gb-sct_en.json
A erfgoedbot/monuments_config/gb-wls_en.json
A erfgoedbot/monuments_config/ge_ka.json
A erfgoedbot/monuments_config/gh_en.json
A erfgoedbot/monuments_config/hk_en.json
A erfgoedbot/monuments_config/hu_hu.json
A erfgoedbot/monuments_config/ie_en.json
A erfgoedbot/monuments_config/il-npa_he.json
A erfgoedbot/monuments_config/il_he.json
A erfgoedbot/monuments_config/in_en.json
A erfgoedbot/monuments_config/ir_fa.json
A erfgoedbot/monuments_config/it-88_ca.json
A erfgoedbot/monuments_config/it-bz_de.json
A erfgoedbot/monuments_config/it_it.json
A erfgoedbot/monuments_config/jo_ar.json
A erfgoedbot/monuments_config/jp-nhs_en.json
A erfgoedbot/monuments_config/ke_en.json
A erfgoedbot/monuments_config/lu_lb.json
A erfgoedbot/monuments_config/mt_de.json
A erfgoedbot/monuments_config/mx_es.json
A erfgoedbot/monuments_config/nl-aw_en.json
A erfgoedbot/monuments_config/nl-aw_nl.json
A erfgoedbot/monuments_config/nl-gem_nl.json
A erfgoedbot/monuments_config/nl-prov_nl.json
A erfgoedbot/monuments_config/nl_nl.json
A erfgoedbot/monuments_config/no_no.json
A erfgoedbot/monuments_config/np_en.json
A erfgoedbot/monuments_config/pa_es.json
A erfgoedbot/monuments_config/ph_en.json
A erfgoedbot/monuments_config/pk_en.json
A erfgoedbot/monuments_config/pl_pl.json
A erfgoedbot/monuments_config/pt_pt.json
A erfgoedbot/monuments_config/ro_ro.json
A erfgoedbot/monuments_config/rs_sr.json
A erfgoedbot/monuments_config/ru_ru.json
A erfgoedbot/monuments_config/se-arbetsl_sv.json
A erfgoedbot/monuments_config/se-bbr_sv.json
A erfgoedbot/monuments_config/se-fornmin_sv.json
A erfgoedbot/monuments_config/se-ship_sv.json
A erfgoedbot/monuments_config/sk_de.json
A erfgoedbot/monuments_config/sk_sk.json
A erfgoedbot/monuments_config/sv_es.json
A erfgoedbot/monuments_config/th_th.json
A erfgoedbot/monuments_config/tn_fr.json
A erfgoedbot/monuments_config/ua_uk.json
A erfgoedbot/monuments_config/us-ca_en.json
A erfgoedbot/monuments_config/us_en.json
A 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add "from" to MediaWiki:Search-redirect

2016-10-02 Thread Huji (Code Review)
Huji has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313765

Change subject: Add "from" to MediaWiki:Search-redirect
..

Add "from" to MediaWiki:Search-redirect

Bug: T129941
Change-Id: If8871fe85b1c1c8202895c964d47ef250a1ed110
---
M languages/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/313765/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index cbe755d..b7a0f83 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -993,7 +993,7 @@
"searchprofile-advanced-tooltip": "Search in custom namespaces",
"search-result-size": "$1 ({{PLURAL:$2|1 word|$2 words}})",
"search-result-category-size": "{{PLURAL:$1|1 member|$1 members}} 
({{PLURAL:$2|1 subcategory|$2 subcategories}}, {{PLURAL:$3|1 file|$3 files}})",
-   "search-redirect": "(redirect $1)",
+   "search-redirect": "(redirect from $1)",
"search-section": "(section $1)",
"search-category": "(category $1)",
"search-file-match": "(matches file content)",

-- 
To view, visit https://gerrit.wikimedia.org/r/313765
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8871fe85b1c1c8202895c964d47ef250a1ed110
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Huji 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: NewPagesFeed should say it does not work in browsers older t...

2016-10-02 Thread Anantprsd5 (Code Review)
Anantprsd5 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313764

Change subject: NewPagesFeed should say it does not work in browsers older than 
IE9
..

NewPagesFeed should say it does not work in browsers older than IE9

The browser note at the top of Special:NewPagesFeed should change from "This 
tool may not work correctly in browsers older than Internet explorer 8" to 
"This tool may not work correctly in browsers older than Internet Explorer 9".

Bug: T130804
Change-Id: I5fd1b2ba50921297bda1a4d6a2f5bdbe96ea52e6
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/64/313764/1

diff --git a/i18n/en.json b/i18n/en.json
index 06216eb..4fda75f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -83,7 +83,7 @@
"pagetriage-filter-stat-blocked": "blocked users",
"pagetriage-filter-stat-username": "username: $1",
"pagetriage-no-pages": "No pages match your criteria.",
-   "pagetriage-warning-browser": "This tool may not work correctly in 
browsers older than Internet Explorer 8.",
+   "pagetriage-warning-browser": "This tool may not work correctly in 
browsers older than Internet Explorer 9.",
"pagetriage-welcome": "Please review new pages below and help improve 
{{SITENAME}}. [$1 Learn more] · [$2 Leave feedback]",
"pagetriage-note-reviewed": "This page has been reviewed.",
"pagetriage-note-not-reviewed": "This page has not yet been reviewed.",

-- 
To view, visit https://gerrit.wikimedia.org/r/313764
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fd1b2ba50921297bda1a4d6a2f5bdbe96ea52e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Anantprsd5 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Fix an invalid empty line in the global robots.txt

2016-10-02 Thread Kerberizer (Code Review)
Kerberizer has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313763

Change subject: Fix an invalid empty line in the global robots.txt
..

Fix an invalid empty line in the global robots.txt

The empty line here is in violation of the Robots Exclusion Standard
and may effectively disable all projects' custom MediaWiki:Robots.txt.

Bug: T146908
Change-Id: I0baff180531a414b8e564cdd165e13bbbd4b68b6
---
M robots.txt
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/63/313763/1

diff --git a/robots.txt b/robots.txt
index 216a00e..7f57f8e 100644
--- a/robots.txt
+++ b/robots.txt
@@ -420,7 +420,7 @@
 Disallow: /wiki/Wikiquote%3AVotes_for_deletion_archive/
 Disallow: /wiki/Wikiquote_talk:Votes_for_deletion_archive/
 Disallow: /wiki/Wikiquote_talk%3AVotes_for_deletion_archive/
-
+#
 # enwikibooks
 Disallow: /wiki/Wikibooks:Votes_for_deletion
 #

-- 
To view, visit https://gerrit.wikimedia.org/r/313763
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0baff180531a414b8e564cdd165e13bbbd4b68b6
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Kerberizer 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Special:NewPages - add for "originally created as..."

2016-10-02 Thread Sidhant-gupta-004 (Code Review)
Sidhant-gupta-004 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313762

Change subject: Special:NewPages - add  for "originally created as..."
..

Special:NewPages - add  for "originally created as..."

Add span tag around the old title line in the Special New Page.

Bug: T146145
Change-Id: I7578e94284710250eab9f23dbef2777b58031faa
---
M includes/specials/SpecialNewpages.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/313762/1

diff --git a/includes/specials/SpecialNewpages.php 
b/includes/specials/SpecialNewpages.php
old mode 100644
new mode 100755
index 718a6dc..af7b0e0
--- a/includes/specials/SpecialNewpages.php
+++ b/includes/specials/SpecialNewpages.php
@@ -371,12 +371,14 @@
$css = count( $classes ) ? ' class="' . implode( ' ', $classes 
) . '"' : '';
 
# Display the old title if the namespace/title has been changed
+
$oldTitleText = '';
$oldTitle = Title::makeTitle( $result->rc_namespace, 
$result->rc_title );
 
if ( !$title->equals( $oldTitle ) ) {
$oldTitleText = $oldTitle->getPrefixedText();
-   $oldTitleText = $this->msg( 'rc-old-title' )->params( 
$oldTitleText )->escaped();
+   $oldTitleText = Html::rawElement( 'span', [ 'class' => 
'mw-newpages-oldtitle' ],
+   $this->msg( 'rc-old-title' )->params( $oldTitleText 
)->escaped() );
}
 
return "{$time} {$dm}{$plink} {$hist} {$dm}{$length} "

-- 
To view, visit https://gerrit.wikimedia.org/r/313762
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7578e94284710250eab9f23dbef2777b58031faa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sidhant-gupta-004 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Extract CommonsCat templates data to JSON file

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Extract CommonsCat templates data to JSON file
..


Extract CommonsCat templates data to JSON file

- Add new JSON file containing the CommonsCat templates data
- Read it from getCommonscatTemplates via
  _load_wikipedia_commonscat_templates()

Also delete the ignoreTemplates data as it is unused.

Change-Id: Ib25b02eeaee9074548ac3708988d6814da1d63ca
---
M erfgoedbot/categorize_images.py
A erfgoedbot/data/wikipedia_commonscat_templates.json
2 files changed, 394 insertions(+), 144 deletions(-)

Approvals:
  Jean-Frédéric: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/erfgoedbot/categorize_images.py b/erfgoedbot/categorize_images.py
index d30bffb..734dd02 100644
--- a/erfgoedbot/categorize_images.py
+++ b/erfgoedbot/categorize_images.py
@@ -16,6 +16,8 @@
 python categorize_images.py -countrycode:ee -lang:et
 
 '''
+import json
+import os
 import re
 
 import pywikibot
@@ -41,150 +43,11 @@
 class NoCategoryToAddException(Exception):
 pass
 
-# Contains the commonscat templates for most Wikipedia's (taken from 
ex-commonscat.py)
-wikipedia_commonscat_templates = {
-'_default': (u'Commonscat', []),
-'af': (u'CommonsKategorie', [u'commonscat']),
-'an': (u'Commonscat', [u'Commons cat']),
-'ar': (u'تصنيف كومنز',
-   [u'Commonscat', u'تصنيف كومونز', u'Commons cat', u'CommonsCat']),
-'arz': (u'Commons cat', [u'Commoncat']),
-'az': (u'CommonsKat', [u'Commonscat']),
-'bn': (u'কমন্সক্যাট', [u'Commonscat']),
-'ca': (u'Commonscat', [u'Commons cat', u'Commons category']),
-'crh': (u'CommonsKat', [u'Commonscat']),
-'cs': (u'Commonscat', [u'Commons cat']),
-'da': (u'Commonscat',
-   [u'Commons cat', u'Commons category', u'Commonscat left',
-u'Commonscat2']),
-'en': (u'Commons category',
-   [u'Commoncat', u'Commonscat', u'Commons cat', u'Commons+cat',
-u'Commonscategory', u'Commons and category', u'Commonscat-inline',
-u'Commons category-inline', u'Commons2', u'Commons category multi',
-u'Cms-catlist-up', u'Catlst commons', u'Commonscat show2',
-u'Sister project links']),
-'es': (u'Commonscat',
-   [u'Ccat', u'Commons cat', u'Categoría Commons',
-u'Commonscat-inline']),
-'et': (u'Commonsi kategooria',
-   [u'Commonscat', u'Commonskat', u'Commons cat', u'Commons 
category']),
-'eu': (u'Commonskat', [u'Commonscat']),
-'fa': (u'ویکی‌انبار-رده',
-   [u'Commonscat', u'Commons cat', u'انبار رده', u'Commons category',
-u'انبار-رده', u'جعبه پیوند به پروژه‌های خواهر',
-u'در پروژه‌های خواهر', u'پروژه‌های خواهر']),
-'fr': (u'Commonscat', [u'CommonsCat', u'Commons cat', u'Commons 
category']),
-'frp': (u'Commonscat', [u'CommonsCat']),
-'ga': (u'Catcómhaoin', [u'Commonscat']),
-'he': (u'ויקישיתוף בשורה', []),
-'hi': (u'Commonscat', [u'Commons2', u'Commons cat', u'Commons category']),
-'hu': (u'Commonskat', [u'Közvagyonkat']),
-'hy': (u'Վիքիպահեստ կատեգորիա',
-   [u'Commonscat', u'Commons cat', u'Commons category']),
-'id': (u'Commonscat',
-   [u'Commons cat', u'Commons2', u'CommonsCat', u'Commons category']),
-'is': (u'CommonsCat', [u'Commonscat']),
-'ja': (u'Commonscat', [u'Commons cat', u'Commons category']),
-'jv': (u'Commonscat', [u'Commons cat']),
-'kaa': (u'Commons cat', [u'Commonscat']),
-'kk': (u'Commonscat', [u'Commons2']),
-'ko': (u'Commonscat', [u'Commons cat', u'공용분류']),
-'la': (u'CommuniaCat', []),
-'mk': (u'Ризница-врска',
-   [u'Commonscat', u'Commons cat', u'CommonsCat', u'Commons2',
-u'Commons category']),
-'ml': (u'Commonscat', [u'Commons cat', u'Commons2']),
-'ms': (u'Kategori Commons', [u'Commonscat', u'Commons category']),
-'nn': (u'Commonscat', [u'Commons cat']),
-'os': (u'Commonscat', [u'Commons cat']),
-'pt': (u'Commonscat', [u'Commons cat']),
-'ro': (u'Commonscat', [u'Commons cat']),
-'ru': (u'Commonscat', [u'Викисклад-кат', u'Commons category']),
-'simple': (u'Commonscat',
-   [u'Commons cat', u'Commons cat multi', u'Commons category',
-u'Commons category multi', u'CommonsCompact',
-u'Commons-inline']),
-'sh': (u'Commonscat', [u'Commons cat']),
-'sl': (u'Kategorija v Zbirki',
-   [u'Commonscat', u'Kategorija v zbirki', u'Commons cat',
-u'Katzbirke']),
-'sq': (u'Commonscat', [u'Commonskat', u'Commonsart', u'CommonsCat']),
-'sv': (u'Commonscat',
-   [u'Commonscat-rad', u'Commonskat', u'Commons cat', u'Commonscatbox',
-u'Commonscat-box']),
-'sw': (u'Commonscat', [u'Commons2', u'Commons cat']),
-'te': (u'Commonscat', [u'Commons cat']),
-'tr': (u'Commons kategori',
-   [u'CommonsKat', u'Commonscat', 

[MediaWiki-commits] [Gerrit] labs...wikibugs2[master]: Change project Project-Creators to Project-Admins

2016-10-02 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313761

Change subject: Change project Project-Creators to Project-Admins
..

Change project Project-Creators to Project-Admins

Bug: T142851
Change-Id: I54a88a3e90274e5ab8d3ad760c77ab266e7ab1c6
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 
refs/changes/61/313761/1


-- 
To view, visit https://gerrit.wikimedia.org/r/313761
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54a88a3e90274e5ab8d3ad760c77ab266e7ab1c6
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/wikibugs2
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Re-factor test of getCommonscatTemplates

2016-10-02 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313760

Change subject: Re-factor test of getCommonscatTemplates
..

Re-factor test of getCommonscatTemplates

Bug: T145574
Change-Id: Ia3a5642ca8e6c0a6dcba38e6cf997b92ff1d42f1
---
M tests/test_categorization.py
1 file changed, 38 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/60/313760/1

diff --git a/tests/test_categorization.py b/tests/test_categorization.py
index c8cf75c..b6492a1 100644
--- a/tests/test_categorization.py
+++ b/tests/test_categorization.py
@@ -7,23 +7,55 @@
 from erfgoedbot import categorize_images
 
 
+class TestLoadWikipediaCommonscatTemplates(unittest.TestCase):
+
+"""Test the _load_wikipedia_commonscat_templates method."""
+
+def test_load_wikipedia_commonscat_templates(self):
+"""Ensure commonscat json file is present and contains _default key."""
+try:
+data = categorize_images._load_wikipedia_commonscat_templates()
+except IOError:
+self.fail("Commonscat json file not found")
+self.assertIn(u'_default', data.keys())
+
+
 class TestGetCommonsCatTemplates(unittest.TestCase):
+
+"""Test the getCommonscatTemplates method."""
+
+def setUp(self):
+patcher = 
mock.patch('erfgoedbot.categorize_images._load_wikipedia_commonscat_templates')
+self.mock_load_templates = patcher.start()
+self.mock_load_templates.return_value = {
+"_default": [
+"default_cat", []
+],
+"lang_1": [
+"lang_1_main_cat", ["lang_1_cat_1"]
+],
+"lang_2": [
+"lang_2_main_cat", ["lang_2_cat_1", "lang_2_cat_2"]
+],
+}
+self.addCleanup(patcher.stop)
 
 def test_getCommonscatTemplates_with_defaults(self):
 result = categorize_images.getCommonscatTemplates()
-self.assertEquals(result, [u'Commonscat'])
+self.assertEquals(result, [u'default_cat'])
 
 def test_getCommonscatTemplates_with_one_alternative(self):
-result = categorize_images.getCommonscatTemplates(lang='af')
-self.assertEquals(result, [u'CommonsKategorie', u'commonscat'])
+result = categorize_images.getCommonscatTemplates(lang='lang_1')
+self.assertEquals(result, [u'lang_1_main_cat', u'lang_1_cat_1'])
 
 def test_getCommonscatTemplates_with_two_alternatives(self):
-result = categorize_images.getCommonscatTemplates(lang='ca')
-self.assertEquals(result, [u'Commonscat', u'Commons cat', u'Commons 
category'])
+result = categorize_images.getCommonscatTemplates(lang='lang_2')
+self.assertEquals(
+result, [u'lang_2_main_cat', u'lang_2_cat_1', u'lang_2_cat_2'])
 
 def test_getCommonscatTemplates_with_wikivoyage(self):
 result = categorize_images.getCommonscatTemplates(project='wikivoyage')
-self.assertEquals(result, [u'Commonscat'])
+self.assertEquals(result, [u'default_cat'])
 
 
 class TestReplaceCategories(unittest.TestCase):

-- 
To view, visit https://gerrit.wikimedia.org/r/313760
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3a5642ca8e6c0a6dcba38e6cf997b92ff1d42f1
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[2.0]: Allow non-urlencoded permalink

2016-10-02 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313759

Change subject: Allow non-urlencoded permalink
..

Allow non-urlencoded permalink

With browsers increasing their support for non-ascii urls the need
for the urlencode of the title is not always guaranteed. Adding an
optional parameter to permalink ensures this option becomes
available.

Change-Id: Ia7a5edd89347c6d1462fb220fd514469ac14dd83
(cherry picked from commit 7f12117a61ab3df5c1ee7f6deb718e66fde1a200)
---
M pywikibot/page.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/59/313759/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index a78ed9a..6f72ded 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -418,16 +418,20 @@
 # TODO: what about redirects, errors?
 return self._revisions[oldid].text
 
-def permalink(self, oldid=None):
+def permalink(self, oldid=None, percent_encoded=True):
 """Return the permalink URL of an old revision of this page.
 
 @param oldid: The revid of the revision desired.
 
 """
+if percent_encoded:
+title = self.title(asUrl=True)
+else:
+title = self.title(asUrl=False).replace(' ', '_')
 return "//%s%s/index.php?title=%s=%s" \
% (self.site.hostname(),
   self.site.scriptpath(),
-  self.title(asUrl=True),
+  title,
   (oldid if oldid is not None else self.latest_revision_id))
 
 @property

-- 
To view, visit https://gerrit.wikimedia.org/r/313759
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7a5edd89347c6d1462fb220fd514469ac14dd83
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Lokal Profil 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update wikimedia/php-session-serializer to v1.0.4

2016-10-02 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313758

Change subject: Update wikimedia/php-session-serializer to v1.0.4
..

Update wikimedia/php-session-serializer to v1.0.4

github.com/wikimedia/php-session-serializer/compare/v1.0.3...v1.0.4

Change-Id: Ia0045329f4680a6f7c6acc9d886ae54ccf49c83d
Depends-On: I18ec214b6446f559e018673797efcab70523de39
---
M RELEASE-NOTES-1.28
M composer.json
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/313758/1

diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index 4051987..ca3cd68 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -65,6 +65,7 @@
 
  Upgraded external libraries 
 * Updated es5-shim from v4.1.5 to v4.5.8
+* Updated wikimedia/php-session-serializer from v1.0.3 to v1.0.4
 
  New external libraries 
 * Added wikimedia/scoped-callback v1.0.0
diff --git a/composer.json b/composer.json
index 4d71c66..fc5549f 100644
--- a/composer.json
+++ b/composer.json
@@ -36,7 +36,7 @@
"wikimedia/composer-merge-plugin": "1.3.1",
"wikimedia/html-formatter": "1.0.1",
"wikimedia/ip-set": "1.1.0",
-   "wikimedia/php-session-serializer": "1.0.3",
+   "wikimedia/php-session-serializer": "1.0.4",
"wikimedia/relpath": "1.0.3",
"wikimedia/running-stat": "1.1.0",
"wikimedia/scoped-callback": "1.0.0",

-- 
To view, visit https://gerrit.wikimedia.org/r/313758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0045329f4680a6f7c6acc9d886ae54ccf49c83d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/vendor[master]: Update wikimedia/php-session-serializer to v1.0.4

2016-10-02 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313757

Change subject: Update wikimedia/php-session-serializer to v1.0.4
..

Update wikimedia/php-session-serializer to v1.0.4

github.com/wikimedia/php-session-serializer/compare/v1.0.3...v1.0.4

Change-Id: I18ec214b6446f559e018673797efcab70523de39
---
M composer.json
M composer.lock
M composer/installed.json
M wikimedia/php-session-serializer/README.md
4 files changed, 59 insertions(+), 60 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vendor 
refs/changes/57/313757/1

diff --git a/composer.json b/composer.json
index 3ddb223..9c17f29 100644
--- a/composer.json
+++ b/composer.json
@@ -39,7 +39,7 @@
"wikimedia/composer-merge-plugin": "1.3.1",
"wikimedia/html-formatter": "1.0.1",
"wikimedia/ip-set": "1.1.0",
-   "wikimedia/php-session-serializer": "1.0.3",
+   "wikimedia/php-session-serializer": "1.0.4",
"wikimedia/relpath": "1.0.3",
"wikimedia/running-stat": "1.1.0",
"wikimedia/scoped-callback": "1.0.0",
diff --git a/composer.lock b/composer.lock
index efd8472..4db74b4 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"hash": "a0be8dca46b0487f79cc777d78940f4a",
-"content-hash": "50416a3515ff05a598d0a6cfdf4fac9d",
+"content-hash": "e59fc06c030fa02586f8afe9786a0dbe",
 "packages": [
 {
 "name": "composer/semver",
@@ -1516,22 +1515,22 @@
 },
 {
 "name": "wikimedia/php-session-serializer",
-"version": "v1.0.3",
+"version": "v1.0.4",
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/php-session-serializer.git;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55"
+"reference": "4474af7aa8f0b20aa141c33eb4ad068a1c7d5b8c"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/php-session-serializer/zipball/61dec9a25bdcea4a0cc34a22fe6f43efca390d55;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55",
+"url": 
"https://api.github.com/repos/wikimedia/php-session-serializer/zipball/4474af7aa8f0b20aa141c33eb4ad068a1c7d5b8c;,
+"reference": "4474af7aa8f0b20aa141c33eb4ad068a1c7d5b8c",
 "shasum": ""
 },
 "require": {
 "mediawiki/at-ease": "^1.0",
 "php": ">=5.3.3",
-"psr/log": "1.0.0"
+"psr/log": "^1.0"
 },
 "require-dev": {
 "jakub-onderka/php-parallel-lint": "^0.9.0.0",
@@ -1556,7 +1555,7 @@
 ],
 "description": "Provides methods like PHP's session_encode and 
session_decode that don't mess with $_SESSION",
 "homepage": 
"https://www.mediawiki.org/wiki/Php-session-serializer;,
-"time": "2015-11-10 22:16:03"
+"time": "2016-10-01 13:19:49"
 },
 {
 "name": "wikimedia/relpath",
diff --git a/composer/installed.json b/composer/installed.json
index 033371b..8af424f 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -868,52 +868,6 @@
 "homepage": "https://www.mediawiki.org/wiki/CLDRPluralRuleParser;
 },
 {
-"name": "wikimedia/php-session-serializer",
-"version": "v1.0.3",
-"version_normalized": "1.0.3.0",
-"source": {
-"type": "git",
-"url": "https://github.com/wikimedia/php-session-serializer.git;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/php-session-serializer/zipball/61dec9a25bdcea4a0cc34a22fe6f43efca390d55;,
-"reference": "61dec9a25bdcea4a0cc34a22fe6f43efca390d55",
-"shasum": ""
-},
-"require": {
-"mediawiki/at-ease": "^1.0",
-"php": ">=5.3.3",
-"psr/log": "1.0.0"
-},
-"require-dev": {
-"jakub-onderka/php-parallel-lint": "^0.9.0.0",
-"mediawiki/mediawiki-codesniffer": "0.5.0",
-"phpunit/phpunit": "~4.5"
-},
-"time": "2015-11-10 22:16:03",
-"type": "library",
-"installation-source": "dist",
-"autoload": {
-"classmap": [
-"src/"
-]
-},
-"notification-url": "https://packagist.org/downloads/;,
-"license": [
-"GPL-2.0+"
-],
-"authors": [
- 

[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Special:UserLogin: Don't show login button when not required

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Special:UserLogin: Don't show login button when not required
..


Special:UserLogin: Don't show login button when not required

If no AuthenticationRequest requires a separate login button, it
shouldn'tbe visible. This is, for example, the case, when only
link providers are used, that require the user to redirect to a third
party site, as it usually just shows a single submit button.

In this case, the login button is still visible because of other additional
fields, such as the remember  me button. This change checks each primary
authentication provider, if it provides its provide his own submit
button or not, and if so, removes the login button completely.

Bug: T141471
Change-Id: Ib18a69582cb3f79d438ab009d8755f0d5e415bcb
---
M includes/specialpage/AuthManagerSpecialPage.php
M includes/specialpage/LoginSignupSpecialPage.php
M includes/specials/SpecialChangeCredentials.php
3 files changed, 33 insertions(+), 19 deletions(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specialpage/AuthManagerSpecialPage.php 
b/includes/specialpage/AuthManagerSpecialPage.php
index 9833c73..bf8ef9f 100644
--- a/includes/specialpage/AuthManagerSpecialPage.php
+++ b/includes/specialpage/AuthManagerSpecialPage.php
@@ -537,7 +537,7 @@
$form->setAction( $this->getFullTitle()->getFullURL( 
$this->getPreservedParams() ) );
$form->addHiddenField( $this->getTokenName(), 
$this->getToken()->toString() );
$form->addHiddenField( 'authAction', $this->authAction );
-   $form->suppressDefaultSubmit( !$this->needsSubmitButton( 
$formDescriptor ) );
+   $form->suppressDefaultSubmit( !$this->needsSubmitButton( 
$requests ) );
 
return $form;
}
@@ -555,24 +555,38 @@
}
 
/**
-* Returns true if the form has fields which take values. If all 
available providers use the
-* redirect flow, the form might contain nothing but submit buttons, in 
which case we should
-* not add an extra submit button which does nothing.
+* Returns true if the form built from the given AuthenticationRequests 
has fields which take
+* values. If all available providers use the redirect flow, the form 
might contain nothing
+* but submit buttons, in which case we should not add an extra submit 
button which does nothing.
 *
-* @param array $formDescriptor A HTMLForm descriptor
+* @param AuthenticationRequest[] $requests An array of 
AuthenticationRequests from which the
+*  form will be built
 * @return bool
 */
-   protected function needsSubmitButton( $formDescriptor ) {
-   return (bool)array_filter( $formDescriptor, function ( $item ) {
-   $class = false;
-   if ( array_key_exists( 'class', $item ) ) {
-   $class = $item['class'];
-   } elseif ( array_key_exists( 'type', $item ) ) {
-   $class = HTMLForm::$typeMappings[$item['type']];
+   protected function needsSubmitButton( array $requests ) {
+   foreach ( $requests as $req ) {
+   if ( $req->required === 
AuthenticationRequest::PRIMARY_REQUIRED &&
+   $this->doesRequestNeedsSubmitButton( $req )
+   ) {
+   return true;
}
-   return !is_a( $class, \HTMLInfoField::class, true ) &&
-   !is_a( $class, \HTMLSubmitField::class, true );
-   } );
+   }
+   return false;
+   }
+
+   /**
+* Checks if the given AuthenticationRequest needs a submit button or 
not.
+*
+* @param AuthenticationRequest $req The request to check
+* @return bool
+*/
+   protected function doesRequestNeedsSubmitButton( AuthenticationRequest 
$req ) {
+   foreach ( $req->getFieldInfo() as $field => $info ) {
+   if ( $info['type'] === 'button' ) {
+   return false;
+   }
+   }
+   return true;
}
 
/**
diff --git a/includes/specialpage/LoginSignupSpecialPage.php 
b/includes/specialpage/LoginSignupSpecialPage.php
index 2a9a938..90774ef 100644
--- a/includes/specialpage/LoginSignupSpecialPage.php
+++ b/includes/specialpage/LoginSignupSpecialPage.php
@@ -586,7 +586,7 @@
$this->fakeTemplate = $fakeTemplate; // FIXME there should be a 
saner way to pass this to the hook
// this will call onAuthChangeFormFields()
$formDescriptor = static::fieldInfoToFormDescriptor( $requests, 

[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Detect/use APCu properly

2016-10-02 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313756

Change subject: Detect/use APCu properly
..

Detect/use APCu properly

In PHP 5.5 and above, userland APC caching moved to an extension

Bug: T140587
Change-Id: Ie0871776cd7e67838471a4fe95451cf4164079b7
(cherry picked from commit c214c9a95255abf1032d389d0fe8bcbde38b55db)
---
M autoload.php
M includes/DefaultSettings.php
M includes/installer/Installer.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
M includes/libs/MemoizedCallable.php
M includes/libs/objectcache/APCBagOStuff.php
A includes/libs/objectcache/APCUBagOStuff.php
M includes/objectcache/ObjectCache.php
M tests/phpunit/includes/libs/MemoizedCallableTest.php
10 files changed, 133 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/313756/1

diff --git a/autoload.php b/autoload.php
index 679f5f3..f36e613 100644
--- a/autoload.php
+++ b/autoload.php
@@ -5,6 +5,7 @@
 
 $wgAutoloadLocalClasses = [
'APCBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/APCBagOStuff.php',
+   'APCUBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/APCUBagOStuff.php',
'AbstractContent' => __DIR__ . '/includes/content/AbstractContent.php',
'Action' => __DIR__ . '/includes/actions/Action.php',
'ActiveUsersPager' => __DIR__ . 
'/includes/specials/pagers/ActiveUsersPager.php',
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 613c219..5c6d204 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2193,7 +2193,7 @@
  *   - CACHE_NONE:   Do not cache
  *   - CACHE_DB: Store cache objects in the DB
  *   - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCachedServers
- *   - CACHE_ACCEL:  APC, XCache or WinCache
+ *   - CACHE_ACCEL:  APC, APCU, XCache or WinCache
  *   - (other):  A string may be used which identifies a cache
  *   configuration in $wgObjectCaches.
  *
@@ -2269,6 +2269,7 @@
],
 
'apc' => [ 'class' => 'APCBagOStuff', 'reportDupes' => false ],
+   'apcu' => [ 'class' => 'APCUBagOStuff', 'reportDupes' => false ],
'xcache' => [ 'class' => 'XCacheBagOStuff', 'reportDupes' => false ],
'wincache' => [ 'class' => 'WinCacheBagOStuff', 'reportDupes' => false 
],
'memcached-php' => [ 'class' => 'MemcachedPhpBagOStuff', 'loggroup' => 
'memcached' ],
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 84a665d..aace867 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -242,6 +242,7 @@
protected $objectCaches = [
'xcache' => 'xcache_get',
'apc' => 'apc_fetch',
+   'apcu' => 'apcu_fetch',
'wincache' => 'wincache_ucache_get'
];
 
diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json
index 2d9b991..f5440d4 100644
--- a/includes/installer/i18n/en.json
+++ b/includes/installer/i18n/en.json
@@ -57,6 +57,7 @@
"config-memory-bad": "Warning: PHP's 
memory_limit is $1.\nThis is probably too low.\nThe installation 
may fail!",
"config-xcache": "[http://xcache.lighttpd.net/ XCache] is installed",
"config-apc": "[http://www.php.net/apc APC] is installed",
+   "config-apcu": "[http://www.php.net/apcu APCu] is installed",
"config-wincache": "[http://www.iis.net/download/WinCacheForPhp 
WinCache] is installed",
"config-no-cache-apcu": "Warning: Could not find 
[http://www.php.net/apcu APCu], [http://xcache.lighttpd.net/ XCache] or 
[http://www.iis.net/download/WinCacheForPhp WinCache].\nObject caching is not 
enabled.",
"config-mod-security": "Warning: Your web server has 
[http://modsecurity.org/ mod_security]/mod_security2 enabled. Many common 
configurations of this will cause problems for MediaWiki and other software 
that allows users to post arbitrary content.\nIf possible, this should be 
disabled. Otherwise, refer to [http://modsecurity.org/documentation/ 
mod_security documentation] or contact your host's support if you encounter 
random errors.",
@@ -249,7 +250,7 @@
"config-cache-options": "Settings for object caching:",
"config-cache-help": "Object caching is used to improve the speed of 
MediaWiki by caching frequently used data.\nMedium to large sites are highly 
encouraged to enable this, and small sites will see benefits as well.",
"config-cache-none": "No caching (no functionality is removed, but 
speed may be impacted on larger wiki sites)",
-   "config-cache-accel": "PHP object caching (APC, XCache or WinCache)",
+   "config-cache-accel": "PHP object caching (APC, APCu, XCache or 
WinCache)",
"config-cache-memcached": "Use Memcached (requires additional setup and 
configuration)",

[MediaWiki-commits] [Gerrit] labs...heritage[master]: Updating .gitignore

2016-10-02 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313755

Change subject: Updating .gitignore
..

Updating .gitignore

Adding pywikibot directories to gitignore and structuring the file
per use case to get an overview.

Change-Id: If929404c0894bc0f882361ac532fc0f506109bb3
---
M .gitignore
1 file changed, 17 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/55/313755/1

diff --git a/.gitignore b/.gitignore
index da8817b..dd6dd21 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,26 @@
+*.pyc
+
+# erfgoedbot created files
 erfgoedbot/sql/create_table_monuments*
 erfgoedbot/sql/create_table_wlpa*
 
-.coverage
-.tox
-*.pyc
-*.gz
+# pywikibot created files
+logs
+apicache
+*.ctrl
 
-composer.lock
+# third-party libraries
 vendor
-
 node_modules
 
+# tox/composer/docker files
+.coverage
+.tox
+composer.lock
+erfgoedbot/database_config.yml
+conf/monuments_db.sql.gz
+
+# other
+tools/daily-uploads/bower_components
 *.iml
 
-daily-uploads/bower_components
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/313755
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If929404c0894bc0f882361ac532fc0f506109bb3
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: New Wikidata Build - 2016-10-02T10:00:01+0000

2016-10-02 Thread WikidataBuilder (Code Review)
WikidataBuilder has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313754

Change subject: New Wikidata Build - 2016-10-02T10:00:01+
..

New Wikidata Build - 2016-10-02T10:00:01+

Change-Id: I5d95eeea2cc69382f26b38b4d462a82f5394979e
---
M composer.lock
M extensions/ArticlePlaceholder/i18n/ar.json
M extensions/Wikibase/client/i18n/cdo.json
M extensions/Wikibase/client/i18n/it.json
M extensions/Wikibase/client/i18n/ja.json
M extensions/Wikibase/client/i18n/lb.json
M extensions/Wikibase/lib/i18n/ko.json
M extensions/Wikibase/lib/i18n/pt.json
M extensions/Wikibase/lib/i18n/sl.json
M extensions/Wikibase/repo/i18n/it.json
M extensions/Wikibase/repo/i18n/pl.json
M extensions/Wikibase/repo/i18n/pt.json
M extensions/Wikibase/repo/i18n/qqq.json
M extensions/Wikibase/repo/i18n/ru.json
M extensions/Wikibase/repo/i18n/sl.json
M extensions/Wikibase/repo/i18n/zh-hans.json
M extensions/Wikidata.org/i18n/bn.json
M vendor/composer/installed.json
18 files changed, 55 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata 
refs/changes/54/313754/1

diff --git a/composer.lock b/composer.lock
index 19a4eaa..9fd8fa4 100644
--- a/composer.lock
+++ b/composer.lock
@@ -788,12 +788,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-ArticlePlaceholder.git;,
-"reference": "06c446b0d45dbdf179d665bf4187b54a4ed83efa"
+"reference": "78ec8a810e07302ca0c6815e400cf4dff593e0a1"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-ArticlePlaceholder/zipball/06c446b0d45dbdf179d665bf4187b54a4ed83efa;,
-"reference": "06c446b0d45dbdf179d665bf4187b54a4ed83efa",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-ArticlePlaceholder/zipball/78ec8a810e07302ca0c6815e400cf4dff593e0a1;,
+"reference": "78ec8a810e07302ca0c6815e400cf4dff593e0a1",
 "shasum": ""
 },
 "require-dev": {
@@ -818,7 +818,7 @@
 ],
 "description": "Provides a special page with Wikibase information 
about a certain topic, with invitation to create an article for the topic",
 "homepage": 
"https://www.mediawiki.org/wiki/Extension:ArticlePlaceholder;,
-"time": "2016-09-28 20:21:57"
+"time": "2016-10-02 08:34:11"
 },
 {
 "name": "propertysuggester/property-suggester",
@@ -929,7 +929,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikidata.org;,
-"reference": "8568ac8e07741e6b9a5c609283a1645c783fec1b"
+"reference": "88b6d73ed0fd4994b0d9ddc92de59d336de823c3"
 },
 "require": {
 "php": ">=5.3.0"
@@ -973,7 +973,7 @@
 "support": {
 "irc": "irc://irc.freenode.net/wikidata"
 },
-"time": "2016-09-28 20:28:51"
+"time": "2016-10-02 08:44:26"
 },
 {
 "name": "wikibase/constraints",
@@ -1574,12 +1574,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git;,
-"reference": "1b1ecb300540124f696649a46f08578ecbcca3f3"
+"reference": "737a22976f340782dd3d5762ee2940b6d3dfbb0c"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/1b1ecb300540124f696649a46f08578ecbcca3f3;,
-"reference": "1b1ecb300540124f696649a46f08578ecbcca3f3",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/737a22976f340782dd3d5762ee2940b6d3dfbb0c;,
+"reference": "737a22976f340782dd3d5762ee2940b6d3dfbb0c",
 "shasum": ""
 },
 "require": {
@@ -1653,7 +1653,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2016-09-29 21:03:45"
+"time": "2016-10-02 08:44:01"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/ArticlePlaceholder/i18n/ar.json 
b/extensions/ArticlePlaceholder/i18n/ar.json
index 3ba24c7..4cc0114 100644
--- a/extensions/ArticlePlaceholder/i18n/ar.json
+++ b/extensions/ArticlePlaceholder/i18n/ar.json
@@ -2,13 +2,15 @@
"@metadata": {
"authors": [
"Maroen1990",
-   "محمد أحمد عبد الفتاح"
+   "محمد أحمد عبد الفتاح",
+   "ديفيد"
]

[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Support explicitly chosen namespace constant in wfAddNamespace

2016-10-02 Thread Eloquence (Code Review)
Eloquence has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313753

Change subject: Support explicitly chosen namespace constant in wfAddNamespace
..

Support explicitly chosen namespace constant in wfAddNamespace

This is for namespaces that contain characters that would be
invalid in PHP constants, e.g. periods or hyphens, or other cases
where the default behavior is unwanted.

Change-Id: I3e0c3eef8aa447d7db252f0f5e350ae3db5fc4f8
---
M Translate.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/53/313753/1

diff --git a/Translate.php b/Translate.php
index 14235ac..ed29189 100644
--- a/Translate.php
+++ b/Translate.php
@@ -632,12 +632,16 @@
  * restrictions and some other configuration.
  * @param $id \int Namespace number
  * @param $name \string Name of the namespace
+ * @param $constant \string (optional) name of namespace constant, defaults to
+ *   NS_ followed by upper case version of $name, e.g., NS_MEDIAWIKI
  */
-function wfAddNamespace( $id, $name ) {
+function wfAddNamespace( $id, $name, $constant = null ) {
global $wgExtraNamespaces, $wgContentNamespaces, 
$wgTranslateMessageNamespaces,
$wgNamespaceProtection, $wgNamespacesWithSubpages, 
$wgNamespacesToBeSearchedDefault;
 
-   $constant = strtoupper( "NS_$name" );
+   if ( is_null( $constant ) ) {
+   $constant = strtoupper( "NS_$name" );
+   }
 
define( $constant, $id );
define( $constant . '_TALK', $id + 1 );

-- 
To view, visit https://gerrit.wikimedia.org/r/313753
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e0c3eef8aa447d7db252f0f5e350ae3db5fc4f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Eloquence 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Modify "abusefilter-log-name" to use lowercase in "filter"

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Modify "abusefilter-log-name" to use lowercase in "filter"
..


Modify "abusefilter-log-name" to use lowercase in "filter"

Bug: T144702
Change-Id: I5802a7eceb00d4e8629e6c1f659c6c206a2c28f5
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 5fc586b..9657998 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -388,7 +388,7 @@
"abusefilter-topnav-log": "Abuse log",
"abusefilter-topnav-tools": "Debugging tools",
"abusefilter-topnav-import": "Import filter",
-   "abusefilter-log-name": "Abuse Filter log",
+   "abusefilter-log-name": "Abuse filter log",
"abusefilter-log-header": "This log shows a summary of changes made to 
filters.\nFor full details, see [[Special:AbuseFilter/history|the list]] of 
recent filter changes.",
"abusefilter-log-entry-modify": "modified $1 ($2)",
"abusefilter-log-noresults": "No results",

-- 
To view, visit https://gerrit.wikimedia.org/r/311385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5802a7eceb00d4e8629e6c1f659c6c206a2c28f5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 
Gerrit-Reviewer: Glaisher 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...ApiFeatureUsage[master]: Use core HTMLDateTimeField

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use core HTMLDateTimeField
..


Use core HTMLDateTimeField

Bug: T146340
Change-Id: I6558775e7759aaac5b0ec05a87d95b68f0afb747
Depends-On: Iaa8b5892b6c3a1f3698cef59684cc3cdc9d483ea
---
M SpecialApiFeatureUsage.php
M extension.json
D htmlform/HTMLDateField.php
D htmlform/HTMLDateRangeField.php
D htmlform/ext.apifeatureusage.htmlform.js
M i18n/en.json
M i18n/qqq.json
M phpcs.xml
8 files changed, 23 insertions(+), 438 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpecialApiFeatureUsage.php b/SpecialApiFeatureUsage.php
index 26a90c3..d965053 100644
--- a/SpecialApiFeatureUsage.php
+++ b/SpecialApiFeatureUsage.php
@@ -10,23 +10,13 @@
$this->setHeaders();
$this->checkPermissions();
 
-   /** @todo These should be migrated to core, once the jquery.ui
-* objectors write their own date picker. */
-   if ( !isset( HTMLForm::$typeMappings['date'] ) ||
-   !isset( HTMLForm::$typeMappings['daterange'] )
-   ) {
-   HTMLForm::$typeMappings['date'] = 
'ApiFeatureUsage_HTMLDateField';
-   HTMLForm::$typeMappings['daterange'] = 
'ApiFeatureUsage_HTMLDateRangeField';
-   $this->getOutput()->addModules( 
'ext.apifeatureusage.htmlform' );
-   }
-
$request = $this->getRequest();
 
$conf = ConfigFactory::getDefaultInstance()->makeConfig( 
'ApiFeatureUsage' );
$this->engine = ApiFeatureUsageQueryEngine::getEngine( $conf );
list( $start, $end ) = $this->engine->suggestDateRange();
 
-   $form = new HTMLForm( [
+   $form = HTMLForm::factory( 'ooui', [
'agent' => [
'type' => 'text',
'default' => '',
@@ -34,17 +24,17 @@
'required' => true,
],
 
-   'dates' => [
-   'type' => 'daterange',
-   'label-message' => 
'apifeatureusage-dates-label',
-   'layout-message' => 
'apifeatureusage-dates-layout',
-   'absolute' => true,
+   'startdate' => [
+   'type' => 'date',
+   'label-message' => 
'apifeatureusage-startdate-label',
'required' => true,
-   'allow-sameday' => true,
-   'default' => [
-   $start->format( 'Y-m-d' ),
-   $end->format( 'Y-m-d' ),
-   ],
+   'default' => $start->format( 'Y-m-d' ),
+   ],
+   'enddate' => [
+   'type' => 'date',
+   'label-message' => 
'apifeatureusage-enddate-label',
+   'required' => true,
+   'default' => $end->format( 'Y-m-d' ),
],
], $this->getContext() );
$form->setMethod( 'get' );
@@ -54,7 +44,9 @@
$form->setSubmitTextMsg( 'apifeatureusage-submit' );
 
$form->prepareForm();
-   if ( $request->getCheck( 'wpagent' ) || $request->getCheck( 
'wpdates' ) ) {
+   if ( $request->getCheck( 'wpagent' ) || $request->getCheck( 
'wpstartdate' ) ||
+   $request->getCheck( 'wpenddate' )
+   ) {
$status = $form->trySubmit();
} else {
$status = false;
@@ -121,8 +113,8 @@
 
public function onSubmit( $data, $form ) {
$agent = $data['agent'];
-   $start = new MWTimestamp( $data['dates'][0] . 'T00:00:00Z' );
-   $end = new MWTimestamp( $data['dates'][1] . 'T23:59:59Z' );
+   $start = new MWTimestamp( $data['startdate'] . 'T00:00:00Z' );
+   $end = new MWTimestamp( $data['enddate'] . 'T23:59:59Z' );
 
return $this->engine->execute( $agent, $start, $end );
}
diff --git a/extension.json b/extension.json
index 2c00f19..bdefccf 100644
--- a/extension.json
+++ b/extension.json
@@ -31,19 +31,12 @@
"ApiQueryFeatureUsage": "ApiQueryFeatureUsage.php",
"ApiFeatureUsageQueryEngine": "ApiFeatureUsageQueryEngine.php",
"ApiFeatureUsageQueryEngineElastica": 
"ApiFeatureUsageQueryEngineElastica.php",
-   "ApiFeatureUsageQueryEngineElasticaConnection": 
"ApiFeatureUsageQueryEngineElastica.php",
-   

[MediaWiki-commits] [Gerrit] mediawiki...Babel[master]: Remove non-existing configuration option BabelPreferISO639_3

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove non-existing configuration option BabelPreferISO639_3
..


Remove non-existing configuration option BabelPreferISO639_3

Has not been used at least since extension registration.

Change-Id: Ib075691e779a01334f73320ec041cfa63f34b53e
---
M extension.json
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 5a0d6bc..315d686 100644
--- a/extension.json
+++ b/extension.json
@@ -60,7 +60,6 @@
"BabelMainCategory": "%code%",
"BabelDefaultLevel": "N",
"BabelUseUserLanguage": false,
-   "BabelPreferISO639_3": false,
"BabelUseDatabase": false,
"BabelCentralDb": false,
"BabelCentralApi": false

-- 
To view, visit https://gerrit.wikimedia.org/r/313390
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib075691e779a01334f73320ec041cfa63f34b53e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add a class to the element of the interlanguage link

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add a class to the  element of the interlanguage link
..


Add a class to the  element of the interlanguage link

This will allow precise querying for this element in the DOM.
Some gadgets add other  elements, and this make querying
not precise. See bug T135378.

Change-Id: I06c80945af785477be52096022c8493e7f82c298
---
M includes/skins/SkinTemplate.php
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  Nikerabbit: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index ed7c6df..3efbd3b 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -180,6 +180,7 @@
'text' => $ilLangName,
'title' => $ilTitle,
'class' => $class,
+   'link-class' => 
'interlanguage-link-target',
'lang' => $ilInterwikiCodeBCP47,
'hreflang' => $ilInterwikiCodeBCP47,
];

-- 
To view, visit https://gerrit.wikimedia.org/r/309731
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I06c80945af785477be52096022c8493e7f82c298
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Amire80 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Santhosh 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Revert "Blank user pages should be editable"

2016-10-02 Thread Phuedx (Code Review)
Phuedx has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313690

Change subject: Revert "Blank user pages should be editable"
..

Revert "Blank user pages should be editable"

This reverts commit ebad58b9b65de9601d1bd9d76720e242240b3124, which
introduced a regression in the way protected pages are handled, e.g.
https://integration.wikimedia.org/ci/job/selenium-MobileFrontend/177/.

Bug: T143854
Change-Id: If0f51d0fffbf5472192ab26d406138bd82e5ed46
---
M includes/skins/SkinMinerva.php
M tests/browser/features/step_definitions/user_page_steps.rb
M tests/browser/features/support/pages/user_page.rb
M tests/browser/features/user_page.feature
4 files changed, 9 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/90/313690/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 3ed347e..d3a570b 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -140,8 +140,8 @@
 *   the user is on the main page
 * 
 *
-* The "edit" page action is not allowed if editing is not possible on 
the page
-* see @method: isCurrentPageEditable
+* The "edit" page action is allowed if the content of the page 
supports direct editing via the
+* API.
 *
 * The "switch-language" is allowed if there are interlanguage links on 
the page,
 * or $wgMinervaAlwaysShowLanguageButton
@@ -163,7 +163,10 @@
}
 
if ( $action === 'edit' ) {
-   return $this->isCurrentPageEditable();
+   $contentHandler = $this->getContentHandler();
+
+   return $contentHandler->supportsDirectEditing() &&
+   $contentHandler->supportsDirectApiEditing();
}
 
if ( $action === 'switch-language' ) {
@@ -1060,22 +1063,17 @@
}
 
/**
-* Checks to see if the current page is (probably) editable and it is 
possible for the
-* editor to handle the existing content handler type.
+* Checks to see if the current page is (probably) editable.
 *
-* This is mostly the same check that sets wgIsProbablyEditable later 
in the page output
+* This is the same check that sets wgIsProbablyEditable later in the 
page output
 * process.
 *
 * @return boolean
 */
protected function isCurrentPageEditable() {
-   $contentHandler = $this->getContentHandler();
-
$title = $this->getTitle();
$user = $this->getUser();
return $title->quickUserCan( 'edit', $user )
-   && $contentHandler->supportsDirectEditing()
-   && $contentHandler->supportsDirectApiEditing()
&& ( $title->exists() || $title->quickUserCan( 
'create', $user ) );
}
 
@@ -1171,7 +1169,7 @@
// Explicitly add the mobile watchstar code.
$modules[] = 'skins.minerva.watchstar';
}
-   if ( $this->isCurrentPageEditable() ) {
+   if ( $this->isAllowedPageAction( 'edit' ) ) {
$modules[] = 'skins.minerva.editor';
}
}
diff --git a/tests/browser/features/step_definitions/user_page_steps.rb 
b/tests/browser/features/step_definitions/user_page_steps.rb
index 936ed10..a10c0cd 100644
--- a/tests/browser/features/step_definitions/user_page_steps.rb
+++ b/tests/browser/features/step_definitions/user_page_steps.rb
@@ -22,14 +22,3 @@
 Then(/^there should be a link to my uploads$/) do
   expect(on(UserPage).uploads_link_element).to be_visible
 end
-
-Then(/^there should be a link to create my user page$/) do
-  expect(on(UserPage).edit_link_element).to be_visible
-end
-
-When(/^I click the create my user page link$/) do
-  on(UserPage) do |page|
-page.wait_until_rl_module_ready('skins.minerva.editor')
-page.edit_link_element.click
-  end
-end
diff --git a/tests/browser/features/support/pages/user_page.rb 
b/tests/browser/features/support/pages/user_page.rb
index 77b0803..1c82d8e 100644
--- a/tests/browser/features/support/pages/user_page.rb
+++ b/tests/browser/features/support/pages/user_page.rb
@@ -5,7 +5,6 @@
 
   h1(:heading, css: '#section_0')
   ul(:user_links, css: '.user-links')
-  div(:cta_holder, css: '.cta-holder')
   a(:talk_link) do |page|
 page.user_links_element.element.a(href: /User_talk:/)
   end
@@ -14,8 +13,5 @@
   end
   a(:uploads_link) do |page|
 page.user_links_element.element.a(href: /Special:Uploads\//)
-  end
-  a(:edit_link) do |page|
-page.cta_holder_element.element.a(href: %r{#/editor/0})
   end
 end
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add PasswordFactory to MediaWikiServices

2016-10-02 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313689

Change subject: Add PasswordFactory to MediaWikiServices
..

Add PasswordFactory to MediaWikiServices

Instead of having basically every caller do:
$pf = new PasswordFactory();
$pf->init( RequestContext::getMain()->getConfig() );

Just create a single PasswordFactory via MediaWikiServices and pass that
around. Things that want to use their own config can still pass settings
via the new constructor.

This will eventually let us remove the init() function, removing the
only hard dependency upon MediaWiki, to make it easier to librarize
(T89742).

Change-Id: I0fc7520dc023b11a7fa66083eff7b88ebfe49c7b
---
M includes/MediaWikiServices.php
M includes/ServiceWiring.php
M includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php
M includes/password/PasswordFactory.php
M includes/specials/SpecialBotPasswords.php
M includes/user/BotPassword.php
M includes/user/User.php
M maintenance/wrapOldPasswords.php
M tests/phpunit/includes/MediaWikiServicesTest.php
M tests/phpunit/includes/TestUser.php
M tests/phpunit/includes/api/ApiLoginTest.php
M 
tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php
M tests/phpunit/includes/session/BotPasswordSessionProviderTest.php
M tests/phpunit/includes/user/BotPasswordTest.php
14 files changed, 64 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/313689/1

diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php
index b16044e..8c5de56 100644
--- a/includes/MediaWikiServices.php
+++ b/includes/MediaWikiServices.php
@@ -19,6 +19,7 @@
 use MediaWiki\Services\NoSuchServiceException;
 use MWException;
 use ObjectCache;
+use PasswordFactory;
 use ProxyLookup;
 use SearchEngine;
 use SearchEngineConfig;
@@ -597,6 +598,14 @@
return $this->getService( 'VirtualRESTServiceClient' );
}
 
+   /**
+* @since 1.28
+* @return PasswordFactory
+*/
+   public function getPasswordFactory() {
+   return $this->getService( 'PasswordFactory' );
+   }
+

///
// NOTE: When adding a service getter here, don't forget to add a test
// case for it in MediaWikiServicesTest::provideGetters() and in
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index 11ee616..9644244 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -236,6 +236,14 @@
return $vrsClient;
},
 
+   'PasswordFactory' => function( MediaWikiServices $services ) {
+   $config = $services->getMainConfig();
+   return new PasswordFactory(
+   $config->get( 'PasswordConfig' ),
+   $config->get( 'PasswordDefault' )
+   );
+   },
+

///
// NOTE: When adding a service here, don't forget to add a getter 
function
// in the MediaWikiServices class. The convenience getter should just 
call
diff --git a/includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php 
b/includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php
index f5bfc2a..b0a6525 100644
--- a/includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php
+++ b/includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php
@@ -53,8 +53,10 @@
 */
protected function getPasswordFactory() {
if ( $this->passwordFactory === null ) {
-   $this->passwordFactory = new PasswordFactory();
-   $this->passwordFactory->init( $this->config );
+   $this->passwordFactory = new PasswordFactory(
+   $this->config->get( 'PasswordConfig' ),
+   $this->config->get( 'PasswordDefault' )
+   );
}
return $this->passwordFactory;
}
diff --git a/includes/password/PasswordFactory.php 
b/includes/password/PasswordFactory.php
index 3383fe3..e21bdd7 100644
--- a/includes/password/PasswordFactory.php
+++ b/includes/password/PasswordFactory.php
@@ -77,7 +77,23 @@
return $this->default;
}
 
+   /**.
+* @param array $config Mapping of $type => $options
+* @param string $default Default type
+*/
+   public function __construct( array $config = [], $default = '' ) {
+   foreach ( $config as $type => $options ) {
+   $this->register( $type, $options );
+   }
+
+   if ( $default !== '' )  {
+   $this->setDefaultType( $default );
+   }
+   }
+
/**
+* @deprecated since 1.28 Initialize settings 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: pydocstyle 1.1.0 is incompatible with 1.0.x

2016-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: pydocstyle 1.1.0 is incompatible with 1.0.x
..


pydocstyle 1.1.0 is incompatible with 1.0.x

Bug: T147126
Change-Id: Iabf7b612b1da55a3788148bb38721b9bdea3b672
---
M tox.ini
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tox.ini b/tox.ini
index f053a96..5514562 100644
--- a/tox.ini
+++ b/tox.ini
@@ -52,6 +52,7 @@
 basepython = python2.7
 deps = flake8<3
pyflakes >= 1.1
+   pydocstyle != 1.1.0
hacking
flake8-docstrings>=0.2.6
flake8-putty>=0.3.2

-- 
To view, visit https://gerrit.wikimedia.org/r/313677
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iabf7b612b1da55a3788148bb38721b9bdea3b672
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move MWCryptHash into libs/

2016-10-02 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313687

Change subject: Move MWCryptHash into libs/
..

Move MWCryptHash into libs/

Remove the single wfDebug() call that was making this class MW specific,
someone can log the return value of MWCryptHash::hashAlgo() if they'd
like to know the specific implementation being used.

Change-Id: Ibb7ead7594edab7861631046dd8316daab613401
---
M autoload.php
R includes/libs/MWCryptHash.php
2 files changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/313687/1

diff --git a/autoload.php b/autoload.php
index 8d9a80f..5e81e83 100644
--- a/autoload.php
+++ b/autoload.php
@@ -771,7 +771,7 @@
'MWCallableUpdate' => __DIR__ . 
'/includes/deferred/MWCallableUpdate.php',
'MWContentSerializationException' => __DIR__ . 
'/includes/content/ContentHandler.php',
'MWCryptHKDF' => __DIR__ . '/includes/utils/MWCryptHKDF.php',
-   'MWCryptHash' => __DIR__ . '/includes/utils/MWCryptHash.php',
+   'MWCryptHash' => __DIR__ . '/includes/libs/MWCryptHash.php',
'MWCryptRand' => __DIR__ . '/includes/utils/MWCryptRand.php',
'MWDebug' => __DIR__ . '/includes/debug/MWDebug.php',
'MWDocGen' => __DIR__ . '/maintenance/mwdocgen.php',
diff --git a/includes/utils/MWCryptHash.php b/includes/libs/MWCryptHash.php
similarity index 97%
rename from includes/utils/MWCryptHash.php
rename to includes/libs/MWCryptHash.php
index 1117357..f9b7172 100644
--- a/includes/utils/MWCryptHash.php
+++ b/includes/libs/MWCryptHash.php
@@ -52,7 +52,6 @@
foreach ( $preference as $algorithm ) {
if ( in_array( $algorithm, $algos ) ) {
self::$algo = $algorithm;
-   wfDebug( __METHOD__ . ': Using the ' . 
self::$algo . " hash algorithm.\n" );
 
return self::$algo;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/313687
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb7ead7594edab7861631046dd8316daab613401
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move most of MWCryptRand into libs

2016-10-02 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313688

Change subject: Move most of MWCryptRand into libs
..

Move most of MWCryptRand into libs

Dependency-inject the MW-specific parts of MWCryptRand via
MediaWikiServices into a generic CryptRand class that is in libs/.

Note that this removes the wfGetAllCallers() debug logging from
generate().

Change-Id: I9742735c266ee69fb247199d3c553cd2ad2a3987
---
M includes/MediaWikiServices.php
M includes/ServiceWiring.php
A includes/libs/CryptRand.php
M includes/utils/MWCryptRand.php
4 files changed, 435 insertions(+), 350 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/313688/1

diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php
index b16044e..0f56797 100644
--- a/includes/MediaWikiServices.php
+++ b/includes/MediaWikiServices.php
@@ -3,6 +3,7 @@
 
 use Config;
 use ConfigFactory;
+use CryptRand;
 use EventRelayerGroup;
 use GenderCache;
 use GlobalVarConfig;
@@ -524,6 +525,14 @@
 
/**
 * @since 1.28
+* @return CryptRand
+*/
+   public function getCryptRand() {
+   return $this->getService( 'CryptRand' );
+   }
+
+   /**
+* @since 1.28
 * @return MediaHandlerFactory
 */
public function getMediaHandlerFactory() {
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index 11ee616..13b6a5c 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -158,6 +158,30 @@
return new WatchedItemQueryService( 
$services->getDBLoadBalancer() );
},
 
+   'CryptRand' => function( MediaWikiServices $services ) {
+   $secretKey = $services->getMainConfig()->get( 'SecretKey' );
+   return new CryptRand(
+   [
+   // To try vary the system information of the 
state a bit more
+   // by including the system's hostname into the 
state
+   'wfHostname',
+   // It's mostly worthless but throw the wiki's 
id into the data
+   // for a little more variance
+   'wfWikiID',
+   // If we have a secret key set then throw it 
into the state as well
+   function() use ( $secretKey ) {
+   return $secretKey ?: '';
+   }
+   ],
+   // The config file is likely the most often edited file 
we know should
+   // be around so include its stat info into the state.
+   // The constant with its location will almost always be 
defined, as
+   // WebStart.php defines MW_CONFIG_FILE to 
$IP/LocalSettings.php unless
+   // being configured with MW_CONFIG_CALLBACK (e.g. the 
installer).
+   defined( 'MW_CONFIG_FILE' ) ? [ MW_CONFIG_FILE ] : []
+   );
+   },
+
'MediaHandlerFactory' => function( MediaWikiServices $services ) {
return new MediaHandlerFactory(
$services->getMainConfig()->get( 'MediaHandlers' )
diff --git a/includes/libs/CryptRand.php b/includes/libs/CryptRand.php
new file mode 100644
index 000..872095e
--- /dev/null
+++ b/includes/libs/CryptRand.php
@@ -0,0 +1,395 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @author Daniel Friesen
+ * @file
+ */
+use Psr\Log\LoggerInterface;
+
+
+class CryptRand {
+   /**
+* Minimum number of iterations we want to make in our drift 
calculations.
+*/
+   const MIN_ITERATIONS = 1000;
+
+   /**
+* Number of milliseconds we want to spend generating each separate byte
+* of the final generated bytes.
+* This is used in combination with the hash length to determine the 
duration
+* we should spend doing drift calculations.
+*/
+   const MSEC_PER_BYTE = 0.5;
+
+   /**
+* Singleton instance for public use
+*/
+   protected static $singleton = null;
+
+   /**
+* A boolean indicating whether the previous random generation was done 
using
+* cryptographically strong random number generator or not.
+*/
+   protected $strong = null;
+
+   /**
+* List of functions to call to generate some random state
+*
+* @var callable[]
+*/
+   protected $randomFuncs = [];
+
+   /**
+* List of files to generate some random state from
+*
+* @var string[]
+*/
+   protected $randomFiles = [];
+
+   /**
+* @var LoggerInterface
+*/
+   protected $logger;
+
+   public function __construct( array $randomFuncs, array 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: http: Use Psr\Log instead of wfDebug*

2016-10-02 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313686

Change subject: http: Use Psr\Log instead of wfDebug*
..

http: Use Psr\Log instead of wfDebug*

MWHttpRequest::factory() will pass in a logger to move the dependency up
to the factory instead of individual functions.

Change-Id: I4e428f060c90ef49cb3acb3e3dceab64bd952330
---
M includes/http/CurlHttpRequest.php
M includes/http/Http.php
M includes/http/MWHttpRequest.php
M includes/http/PhpHttpRequest.php
4 files changed, 38 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/313686/1

diff --git a/includes/http/CurlHttpRequest.php 
b/includes/http/CurlHttpRequest.php
index 7714818..f58c3a9 100644
--- a/includes/http/CurlHttpRequest.php
+++ b/includes/http/CurlHttpRequest.php
@@ -108,7 +108,7 @@
if ( $this->followRedirects && $this->canFollowRedirects() ) {
MediaWiki\suppressWarnings();
if ( !curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, 
true ) ) {
-   wfDebug( __METHOD__ . ": Couldn't set 
CURLOPT_FOLLOWLOCATION. " .
+   $this->logger->debug( __METHOD__ . ": Couldn't 
set CURLOPT_FOLLOWLOCATION. " .
"Probably open_basedir is set.\n" );
// Continue the processing. If it were in 
curl_setopt_array,
// processing would have halted on its entry
@@ -149,13 +149,13 @@
public function canFollowRedirects() {
$curlVersionInfo = curl_version();
if ( $curlVersionInfo['version_number'] < 0x071304 ) {
-   wfDebug( "Cannot follow redirects with libcurl < 7.19.4 
due to CVE-2009-0037\n" );
+   $this->logger->debug( "Cannot follow redirects with 
libcurl < 7.19.4 due to CVE-2009-0037\n" );
return false;
}
 
if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
if ( strval( ini_get( 'open_basedir' ) ) !== '' ) {
-   wfDebug( "Cannot follow redirects when 
open_basedir is set\n" );
+   $this->logger->debug( "Cannot follow redirects 
when open_basedir is set\n" );
return false;
}
}
diff --git a/includes/http/Http.php b/includes/http/Http.php
index 46d2047..43ae2d0 100644
--- a/includes/http/Http.php
+++ b/includes/http/Http.php
@@ -50,6 +50,7 @@
 *  to avoid attacks on intranet 
services accessible by HTTP.
 *- userAgent   A user agent, if you want to override the 
default
 *  MediaWiki/$wgVersion
+*- logger  A \Psr\Logger\LoggerInterface instance for 
debug logging
 * @param string $caller The method making this request, for profiling
 * @return string|bool (bool)false on failure or a string on success
 */
diff --git a/includes/http/MWHttpRequest.php b/includes/http/MWHttpRequest.php
index 30a5c21..458854a 100644
--- a/includes/http/MWHttpRequest.php
+++ b/includes/http/MWHttpRequest.php
@@ -18,6 +18,11 @@
  * @file
  */
 
+use MediaWiki\Logger\LoggerFactory;
+use Psr\Log\LoggerInterface;
+use Psr\Log\LoggerAwareInterface;
+use Psr\Log\NullLogger;
+
 /**
  * This wrapper class will call out to curl (if available) or fallback
  * to regular PHP if necessary for handling internal HTTP requests.
@@ -25,7 +30,7 @@
  * Renamed from HttpRequest to MWHttpRequest to avoid conflict with
  * PHP's HTTP extension.
  */
-class MWHttpRequest {
+class MWHttpRequest implements LoggerAwareInterface {
const SUPPORTS_FILE_POSTS = false;
 
protected $content;
@@ -68,6 +73,11 @@
protected $profileName;
 
/**
+* @var LoggerInterface;
+*/
+   protected $logger;
+
+   /**
 * @param string $url Url to use. If protocol-relative, will be 
expanded to an http:// URL
 * @param array $options (optional) extra params to pass (see 
Http::request())
 * @param string $caller The method making this request, for profiling
@@ -80,6 +90,12 @@
 
$this->url = wfExpandUrl( $url, PROTO_HTTP );
$this->parsedUrl = wfParseUrl( $this->url );
+
+   if ( isset( $options['logger'] ) ) {
+   $this->logger = $options['logger'];
+   } else {
+   $this->logger = new NullLogger();
+   }
 
if ( !$this->parsedUrl || !Http::isValidURI( $this->url ) ) {
$this->status = Status::newFatal( 'http-invalid-url', 
$url );
@@ -125,6 +141,13 @@
}
 
/**
+* @param LoggerInterface $logger
+

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Split HttpFunctions.php into separate files

2016-10-02 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313685

Change subject: Split HttpFunctions.php into separate files
..

Split HttpFunctions.php into separate files

Change-Id: I30d5f77de08e42ec43baf5722f40d9205c4bde67
---
M autoload.php
D includes/HttpFunctions.php
A includes/http/CurlHttpRequest.php
A includes/http/Http.php
A includes/http/MWHttpRequest.php
A includes/http/PhpHttpRequest.php
6 files changed, 1,177 insertions(+), 1,126 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/313685/1

diff --git a/autoload.php b/autoload.php
index 8d9a80f..41875de 100644
--- a/autoload.php
+++ b/autoload.php
@@ -298,7 +298,7 @@
'CssContent' => __DIR__ . '/includes/content/CssContent.php',
'CssContentHandler' => __DIR__ . 
'/includes/content/CssContentHandler.php',
'CsvStatsOutput' => __DIR__ . '/maintenance/language/StatOutputs.php',
-   'CurlHttpRequest' => __DIR__ . '/includes/HttpFunctions.php',
+   'CurlHttpRequest' => __DIR__ . '/includes/http/CurlHttpRequest.php',
'DBAccessBase' => __DIR__ . '/includes/dao/DBAccessBase.php',
'DBAccessError' => __DIR__ . 
'/includes/libs/rdbms/exception/DBAccessError.php',
'DBAccessObjectUtils' => __DIR__ . 
'/includes/dao/DBAccessObjectUtils.php',
@@ -576,7 +576,7 @@
'Html' => __DIR__ . '/includes/Html.php',
'HtmlArmor' => __DIR__ . '/includes/libs/HtmlArmor.php',
'HtmlFormatter' => __DIR__ . '/includes/HtmlFormatter.php',
-   'Http' => __DIR__ . '/includes/HttpFunctions.php',
+   'Http' => __DIR__ . '/includes/http/Http.php',
'HttpError' => __DIR__ . '/includes/exception/HttpError.php',
'HttpStatus' => __DIR__ . '/includes/libs/HttpStatus.php',
'IApiMessage' => __DIR__ . '/includes/api/ApiMessage.php',
@@ -780,7 +780,7 @@
'MWExceptionRenderer' => __DIR__ . 
'/includes/exception/MWExceptionRenderer.php',
'MWFileProps' => __DIR__ . '/includes/utils/MWFileProps.php',
'MWGrants' => __DIR__ . '/includes/utils/MWGrants.php',
-   'MWHttpRequest' => __DIR__ . '/includes/HttpFunctions.php',
+   'MWHttpRequest' => __DIR__ . '/includes/http/MWHttpRequest.php',
'MWLBFactory' => __DIR__ . '/includes/db/MWLBFactory.php',
'MWMemcached' => __DIR__ . '/includes/compat/MemcachedClientCompat.php',
'MWMessagePack' => __DIR__ . '/includes/libs/MWMessagePack.php',
@@ -1057,7 +1057,7 @@
'Pbkdf2Password' => __DIR__ . '/includes/password/Pbkdf2Password.php',
'PerRowAugmentor' => __DIR__ . '/includes/search/PerRowAugmentor.php',
'PermissionsError' => __DIR__ . 
'/includes/exception/PermissionsError.php',
-   'PhpHttpRequest' => __DIR__ . '/includes/HttpFunctions.php',
+   'PhpHttpRequest' => __DIR__ . '/includes/http/PhpHttpRequest.php',
'PhpXmlBugTester' => __DIR__ . '/includes/installer/PhpBugTests.php',
'Pingback' => __DIR__ . '/includes/Pingback.php',
'PoolCounter' => __DIR__ . '/includes/poolcounter/PoolCounter.php',
diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
deleted file mode 100644
index 2ca5e1b..000
--- a/includes/HttpFunctions.php
+++ /dev/null
@@ -1,1122 +0,0 @@
-http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup HTTP
- */
-
-/**
- * @defgroup HTTP HTTP
- */
-
-use MediaWiki\Logger\LoggerFactory;
-
-/**
- * Various HTTP related functions
- * @ingroup HTTP
- */
-class Http {
-   static public $httpEngine = false;
-
-   /**
-* Perform an HTTP request
-*
-* @param string $method HTTP method. Usually GET/POST
-* @param string $url Full URL to act on. If protocol-relative, will be 
expanded to an http:// URL
-* @param array $options Options to pass to MWHttpRequest object.
-*  Possible keys for the array:
-*- timeout Timeout length in seconds
-*- connectTimeout  Timeout for connection, in seconds (curl 
only)
-*- postDataAn array of key-value pairs or a 
url-encoded form data
-*- proxy   The proxy to use.
-*  Otherwise it will use $wgHTTPProxy (if set)
-*  Otherwise it will use the environment 
variable "http_proxy" (if set)
-*- noProxy Don't use any proxy at all. Takes 
precedence over proxy value(s).
-*- sslVerifyHost   Verify hostname against certificate
-*- sslVerifyCert   Verify SSL certificate
-*- caInfo  Provide CA information
-*- maxRedirectsMaximum number of redirects to follow 
(defaults to 5)
-*- followRedirects Whether to follow redirects (defaults to 
false).
-*  Note: this should only be used when 
the target URL is 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove pre-5.5 compat from MultiHttpClient

2016-10-02 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313684

Change subject: Remove pre-5.5 compat from MultiHttpClient
..

Remove pre-5.5 compat from MultiHttpClient

Change-Id: I5f9f1a94c0207a14c0d5cc77292aa04af4ac6470
---
M includes/libs/MultiHttpClient.php
1 file changed, 11 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/313684/1

diff --git a/includes/libs/MultiHttpClient.php 
b/includes/libs/MultiHttpClient.php
index fdcbf49..a870204 100644
--- a/includes/libs/MultiHttpClient.php
+++ b/includes/libs/MultiHttpClient.php
@@ -184,14 +184,12 @@
unset( $req ); // don't assign over this by accident
 
$indexes = array_keys( $reqs );
-   if ( function_exists( 'curl_multi_setopt' ) ) { // PHP 5.5
-   if ( isset( $opts['usePipelining'] ) ) {
-   curl_multi_setopt( $chm, CURLMOPT_PIPELINING, 
(int)$opts['usePipelining'] );
-   }
-   if ( isset( $opts['maxConnsPerHost'] ) ) {
-   // Keep these sockets around as they may be 
needed later in the request
-   curl_multi_setopt( $chm, CURLMOPT_MAXCONNECTS, 
(int)$opts['maxConnsPerHost'] );
-   }
+   if ( isset( $opts['usePipelining'] ) ) {
+   curl_multi_setopt( $chm, CURLMOPT_PIPELINING, 
(int)$opts['usePipelining'] );
+   }
+   if ( isset( $opts['maxConnsPerHost'] ) ) {
+   // Keep these sockets around as they may be needed 
later in the request
+   curl_multi_setopt( $chm, CURLMOPT_MAXCONNECTS, 
(int)$opts['maxConnsPerHost'] );
}
 
// @TODO: use a per-host rolling handle window (e.g. 
CURLMOPT_MAX_HOST_CONNECTIONS)
@@ -258,10 +256,8 @@
unset( $req ); // don't assign over this by accident
 
// Restore the default settings
-   if ( function_exists( 'curl_multi_setopt' ) ) { // PHP 5.5
-   curl_multi_setopt( $chm, CURLMOPT_PIPELINING, 
(int)$this->usePipelining );
-   curl_multi_setopt( $chm, CURLMOPT_MAXCONNECTS, 
(int)$this->maxConnsPerHost );
-   }
+   curl_multi_setopt( $chm, CURLMOPT_PIPELINING, 
(int)$this->usePipelining );
+   curl_multi_setopt( $chm, CURLMOPT_MAXCONNECTS, 
(int)$this->maxConnsPerHost );
 
return $reqs;
}
@@ -292,12 +288,7 @@
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
 
$url = $req['url'];
-   // PHP_QUERY_RFC3986 is PHP 5.4+ only
-   $query = str_replace(
-   [ '+', '%7E' ],
-   [ '%20', '~' ],
-   http_build_query( $req['query'], '', '&' )
-   );
+   $query = http_build_query( $req['query'], '', '&', 
PHP_QUERY_RFC3986 );
if ( $query != '' ) {
$url .= strpos( $req['url'], '?' ) === false ? 
"?$query" : "&$query";
}
@@ -422,10 +413,8 @@
protected function getCurlMulti() {
if ( !$this->multiHandle ) {
$cmh = curl_multi_init();
-   if ( function_exists( 'curl_multi_setopt' ) ) { // PHP 
5.5
-   curl_multi_setopt( $cmh, CURLMOPT_PIPELINING, 
(int)$this->usePipelining );
-   curl_multi_setopt( $cmh, CURLMOPT_MAXCONNECTS, 
(int)$this->maxConnsPerHost );
-   }
+   curl_multi_setopt( $cmh, CURLMOPT_PIPELINING, 
(int)$this->usePipelining );
+   curl_multi_setopt( $cmh, CURLMOPT_MAXCONNECTS, 
(int)$this->maxConnsPerHost );
$this->multiHandle = $cmh;
}
return $this->multiHandle;

-- 
To view, visit https://gerrit.wikimedia.org/r/313684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f9f1a94c0207a14c0d5cc77292aa04af4ac6470
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits