[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Clean up release notes

2017-06-29 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362213 )

Change subject: Clean up release notes
..

Clean up release notes

Change-Id: Ief5b9a69a5ace43efe8a221e3118c09059361d36
---
M RELEASE-NOTES-1.30
1 file changed, 17 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/13/362213/2

diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30
index 5772798..260276f 100644
--- a/RELEASE-NOTES-1.30
+++ b/RELEASE-NOTES-1.30
@@ -6,27 +6,21 @@
 production.
 
 === Configuration changes in 1.30 ===
-* The C.UTF-8 locale should be used for $wgShellLocale, if available, to avoid
-  unexpected behavior when things use local-sensitive string comparisons. For
-  example, Scribunto considers "bar" < "Foo" in most locales since it ignores
-  case.
+* The "C.UTF-8" locale should be used for $wgShellLocale, if available, to 
avoid
+  unexpected behavior when code uses locale-sensitive string comparisons. For
+  example, the Scribunto extension considers "bar" < "Foo" in most locales
+  since it ignores case.
 * $wgShellLocale now affects LC_ALL rather than only LC_CTYPE. See
   documentation of $wgShellLocale for details.
-* $wgJobClasses may now specify callback functions
-  as an alternative to plain class names.
-  This is intended for extensions that want control
-  over the instantiation of their jobs,
-  to allow for proper dependency injection.
+* $wgShellLocale is now applied for all requests. wfInitShellLocale() is
+  deprecated and a no-op, as it is no longer needed.
+* $wgJobClasses may now specify callback functions as an alternative to plain
+  class names. This is intended for extensions that want control over the
+  instantiation of their jobs, to allow for proper dependency injection.
 * $wgResourceModules may now specify callback functions as an alternative
   to plain class names, using the 'factory' key in the module description
   array. This allows dependency injection to be used for ResourceLoader 
modules.
 * $wgExceptionHooks has been removed.
-* $wgShellLocale is now applied for all requests. wfInitShellLocale() is
-  deprecated and a no-op, as it is no longer needed.
-* WikiPage::getParserOutput() will now throw an exception if passed
-  ParserOptions would pollute the parser cache. Callers should use
-  WikiPage::makeParserOptions() to create the ParserOptions object and only
-  change options that affect the parser cache key.
 * (T45547) $wgUsePigLatinVariant added (off by default).
 
 === New features in 1.30 ===
@@ -105,9 +99,9 @@
   deprecated. There are no known callers.
 * File::getStreamHeaders() was deprecated.
 * MediaHandler::getStreamHeaders() was deprecated.
-* Title::canTalk() was deprecated, the new Title::canHaveTalkPage() should be
+* Title::canTalk() was deprecated. The new Title::canHaveTalkPage() should be
   used instead.
-* MWNamespace::canTalk() was deprecated, the new 
MWNamespace::hasTalkNamespace()
+* MWNamespace::canTalk() was deprecated. The new 
MWNamespace::hasTalkNamespace()
   should be used instead.
 * The ExtractThumbParameters hook (deprecated in 1.21) was removed.
 * The OutputPage::addParserOutputNoText and ::getHeadLinks methods (both
@@ -120,7 +114,7 @@
   or wikilinks.
 * (T163966) Page moves are now counted as edits for the purposes of
   autopromotion, i.e., they increment the user_editcount field in the database.
-* Two new hooks, LogEventsListLineEnding and NewPagesLineEnding were added for
+* Two new hooks, LogEventsListLineEnding and NewPagesLineEnding, were added for
   manipulating Special:Log and Special:NewPages lines.
 * The OldChangesListRecentChangesLine, EnhancedChangesListModifyLineData,
   PageHistoryLineEnding, ContributionsLineEnding and 
DeletedContributionsLineEnding
@@ -128,6 +122,10 @@
   RC/history lines. EnhancedChangesListModifyBlockLineData can do that via the
   $data['attribs'] subarray.
 * (T130632) The OutputPage::enableTOC() method was removed.
+* WikiPage::getParserOutput() will now throw an exception if passed
+  ParserOptions that would pollute the parser cache. Callers should use
+  WikiPage::makeParserOptions() to create the ParserOptions object and only
+  change options that affect the parser cache key.
 
 == Compatibility ==
 MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for
@@ -148,7 +146,7 @@
 == Upgrading ==
 1.30 has several database changes since 1.29, and will not work without schema
 updates. Note that due to changes to some very large tables like the revision
-table, the schema update may take quite long (minutes on a medium sized site,
+table, the schema update may take a long time (minutes on a medium sized site,
 many hours on a large site).
 
 Don't forget to always back up your database before upgrading!

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

Gerrit-Messag

[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: Fix the web updater

2017-05-19 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354616 )

Change subject: Fix the web updater
..

Fix the web updater

It kept failing with Error: 1064 You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right syntax 
to use near 'ESCAPE '`'' at line 1 (localhost)

Bug: T165805
Change-Id: I2671415fc34b1e6226104c88ca21fafc860bb7fb
---
M includes/installer/MysqlInstaller.php
1 file changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/354616/1

diff --git a/includes/installer/MysqlInstaller.php 
b/includes/installer/MysqlInstaller.php
index 09051f4..4f0b66c 100644
--- a/includes/installer/MysqlInstaller.php
+++ b/includes/installer/MysqlInstaller.php
@@ -179,8 +179,8 @@
 
# Determine existing default character set
if ( $conn->tableExists( "revision", __METHOD__ ) ) {
-   $revision = $conn->buildLike( $this->getVar( 
'wgDBprefix' ) . 'revision' );
-   $res = $conn->query( "SHOW TABLE STATUS $revision", 
__METHOD__ );
+   $revision = $this->escapeLikeInternal( $this->getVar( 
'wgDBprefix' ) . 'revision', '\\' );
+   $res = $conn->query( "SHOW TABLE STATUS LIKE 
'$revision'", __METHOD__ );
$row = $conn->fetchObject( $res );
if ( !$row ) {
$this->parent->showMessage( 
'config-show-table-status' );
@@ -222,6 +222,16 @@
}
 
/**
+* @param string $s
+* @return string
+*/
+   protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
+   return str_replace( [ $escapeChar, '%', '_' ],
+   [ "{$escapeChar}{$escapeChar}", "{$escapeChar}%", 
"{$escapeChar}_" ],
+   $s );
+   }
+
+   /**
 * Get a list of storage engines that are available and supported
 *
 * @return array

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2671415fc34b1e6226104c88ca21fafc860bb7fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: TTO 
Gerrit-Reviewer: Paladox 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix output issues with cleanupInvalidDbKeys.php maint script

2017-05-04 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/352072 )

Change subject: Fix output issues with cleanupInvalidDbKeys.php maint script
..

Fix output issues with cleanupInvalidDbKeys.php maint script

The output was pretty screwed. Now it works properly if you redirect
STDOUT to a file like you're supposed to.

Change-Id: I750b4fb3e7072ae3cdd8c40733b066a1e76de366
---
M maintenance/cleanupInvalidDbKeys.php
1 file changed, 22 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/352072/2

diff --git a/maintenance/cleanupInvalidDbKeys.php 
b/maintenance/cleanupInvalidDbKeys.php
index 423686e..217589d 100644
--- a/maintenance/cleanupInvalidDbKeys.php
+++ b/maintenance/cleanupInvalidDbKeys.php
@@ -63,9 +63,7 @@
 broken, the titles are corrected to a valid version or the rows are deleted
 entirely, depending on the table.
 
-Key progress output is printed to STDERR, while a full log of all entries that
-are deleted is sent to STDOUT. You are strongly advised to capture STDOUT into
-a file.
+The script runs with the expectation that STDOUT is redirected to a file.
 TEXT
);
$this->addOption( 'fix', 'Actually clean up invalid titles. If 
this parameter is ' .
@@ -87,7 +85,10 @@
}
}
 
-   $this->output( 'Done! Cleaned up invalid DB keys on ' . 
wfWikiID() . "!\n" );
+   $this->outputStatus( 'Done!' );
+   if ( $this->hasOption( 'fix' ) ) {
+   $this->outputStatus( ' Cleaned up invalid DB keys on ' 
. wfWikiID() . "!\n" );
+   }
}
 
/**
@@ -97,10 +98,10 @@
 * @param string $str Text to write to both places
 * @param string|null $channel Ignored
 */
-   protected function output( $str, $channel = null ) {
+   protected function outputStatus( $str, $channel = null ) {
// Make it easier to find progress lines in the STDOUT log
if ( trim( $str ) ) {
-   fwrite( STDOUT, '*** ' );
+   fwrite( STDOUT, '*** ' . trim( $str ) . "\n" );
}
fwrite( STDERR, $str );
}
@@ -132,7 +133,7 @@
$tableParams['titleField'] :
"{$prefix}_title";
 
-   $this->output( "Looking for invalid $titleField entries in 
$table...\n" );
+   $this->outputStatus( "Looking for invalid $titleField entries 
in $table...\n" );
 
// Do all the select queries on the replicas, as they are slow 
(they use
// unanchored LIKEs). Naturally this could cause problems if 
rows are
@@ -163,9 +164,9 @@
[ 'LIMIT' => $this->mBatchSize ]
);
 
-   $this->output( "Number of invalid rows: " . $res->numRows() . 
"\n" );
+   $this->outputStatus( "Number of invalid rows: " . 
$res->numRows() . "\n" );
if ( !$res->numRows() ) {
-   $this->output( "\n" );
+   $this->outputStatus( "\n" );
return;
}
 
@@ -191,9 +192,9 @@
}
 
if ( $table !== 'page' && $table !== 'redirect' ) {
-   $this->output( "Run with --fix to clean up 
these rows\n" );
+   $this->outputStatus( "Run with --fix to clean 
up these rows\n" );
}
-   $this->output( "\n" );
+   $this->outputStatus( "\n" );
return;
}
 
@@ -205,7 +206,7 @@
// This shouldn't happen on production wikis, 
and we already have a script
// to handle 'page' rows anyway, so just notify 
the user and let them decide
// what to do next.
-   $this->output( <outputStatus(
"Updating these rows, setting 
$titleField to the closest valid DB key...\n" );
$affectedRowCount = 0;
foreach ( $res as $row ) {
@@ -235,7 +236,7 @@
$affectedRowCount += 
$dbw->affectedRows();
}
wfWaitForSlaves();
-   $this->output( "Updated $affectedRowCount rows 
on $table.\n" );
+   $this->outputStatus( "Updated $affectedRowCount 
rows on $table.\n" );
 
break;
 
@@ -245,17 +246,17 @@
// Since these broken titles can't exist, 
there's really nothing to watch,

[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: Expire the cache of a User object when a group membership is...

2017-04-27 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350700 )

Change subject: Expire the cache of a User object when a group membership is 
set to expire
..

Expire the cache of a User object when a group membership is set to expire

To avoid user permissions persisting for up to 1 hour beyond their expiry
time.

Bug: T163691
Change-Id: I85b578e6b7816639c3d0101d66efb1efedb17af6
(cherry picked from commit 9ee4e74e3174b8abab063008ebc7e4fce1bdcd41)
---
M includes/user/User.php
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/350700/1

diff --git a/includes/user/User.php b/includes/user/User.php
index b8a36b8..3edd49f 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -509,6 +509,17 @@
 
$ttl = $cache->adaptiveTTL( wfTimestamp( 
TS_UNIX, $this->mTouched ), $ttl );
 
+   // if a user group membership is about to 
expire, the cache needs to
+   // expire at that time (T163691)
+   foreach ( $this->mGroupMemberships as $ugm ) {
+   if ( $ugm->getExpiry() ) {
+   $secondsUntilExpiry = 
wfTimestamp( TS_UNIX, $ugm->getExpiry() ) - time();
+   if ( $secondsUntilExpiry > 0 && 
$secondsUntilExpiry < $ttl ) {
+   $ttl = 
$secondsUntilExpiry;
+   }
+   }
+   }
+
return $data;
 
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85b578e6b7816639c3d0101d66efb1efedb17af6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Expire the cache of a User object when a group membership is...

2017-04-24 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350116 )

Change subject: Expire the cache of a User object when a group membership is 
set to expire
..

Expire the cache of a User object when a group membership is set to expire

To avoid user permissions persisting for up to 1 hour beyond their expiry
time.

Bug: T163691
Change-Id: I85b578e6b7816639c3d0101d66efb1efedb17af6
---
M includes/user/User.php
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/350116/1

diff --git a/includes/user/User.php b/includes/user/User.php
index b8a36b8..3edd49f 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -509,6 +509,17 @@
 
$ttl = $cache->adaptiveTTL( wfTimestamp( 
TS_UNIX, $this->mTouched ), $ttl );
 
+   // if a user group membership is about to 
expire, the cache needs to
+   // expire at that time (T163691)
+   foreach ( $this->mGroupMemberships as $ugm ) {
+   if ( $ugm->getExpiry() ) {
+   $secondsUntilExpiry = 
wfTimestamp( TS_UNIX, $ugm->getExpiry() ) - time();
+   if ( $secondsUntilExpiry > 0 && 
$secondsUntilExpiry < $ttl ) {
+   $ttl = 
$secondsUntilExpiry;
+   }
+   }
+   }
+
return $data;
 
},

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove old IP addresses from autoblock_whitelist message

2017-04-12 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348035 )

Change subject: Remove old IP addresses from autoblock_whitelist message
..

Remove old IP addresses from autoblock_whitelist message

These addresses were added way back in r17937 (2006) and I doubt
whether they really need to be there anymore. The addresses in
question appear to still be registered to AOL, but there's a good
chance their addressing infrastructure has changed in the last 9
years. 

The page http://webmaster.info.aol.com/proxyinfo.html doesn't exist
anymore, and the AOL website barely mentions proxies:
https://google.com/search?q=site:aol.com+proxy

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/348035/2

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 582f5f7..a4e2a03 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -3549,7 +3549,7 @@
"autoredircomment": "Redirected page to [[$1]]",
"autosumm-new": "Created page with \"$1\"",
"autosumm-newblank": "Created blank page",
-   "autoblock_whitelist": "AOL 
http://webmaster.info.aol.com/proxyinfo.html\n*64.12.96.0/19\n*149.174.160.0/20\n*152.163.240.0/21\n*152.163.248.0/22\n*152.163.252.0/23\n*152.163.96.0/22\n*152.163.100.0/23\n*195.93.32.0/22\n*195.93.48.0/22\n*195.93.64.0/19\n*195.93.96.0/19\n*195.93.16.0/20\n*198.81.0.0/22\n*198.81.16.0/20\n*198.81.8.0/23\n*202.67.64.128/25\n*205.188.192.0/20\n*205.188.208.0/23\n*205.188.112.0/20\n*205.188.146.144/30\n*207.200.112.0/21";,
+   "autoblock_whitelist": "",
"size-bytes": "$1 {{PLURAL:$1|byte|bytes}}",
"size-kilobytes": "$1 KB",
"size-megabytes": "$1 MB",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica2a8dc4251e78271530d4adb1dbe22fa406826a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove $wgDisableUserGroupExpiry feature flag

2017-04-11 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/347594 )

Change subject: Remove $wgDisableUserGroupExpiry feature flag
..

Remove $wgDisableUserGroupExpiry feature flag

This feature flag was added to comply with WMF's schema change policy.
It is no longer needed now that the feature is enabled on WMF sites.
External MW installations will run update.php or manually do DB updates
as required before upgrading MW.

Bug: T162517
Change-Id: I5b532d79fd1e8b178490cf2617499ae62967de2c
---
M RELEASE-NOTES-1.29
M includes/DefaultSettings.php
M includes/SiteStats.php
M includes/api/ApiQueryAllImages.php
M includes/api/ApiQueryAllUsers.php
M includes/api/ApiQueryContributors.php
M includes/api/ApiQueryUsers.php
M includes/api/ApiUserrights.php
M includes/specials/SpecialUserrights.php
M includes/specials/pagers/ActiveUsersPager.php
M includes/specials/pagers/ContribsPager.php
M includes/specials/pagers/NewFilesPager.php
M includes/specials/pagers/UsersPager.php
M includes/user/UserGroupMembership.php
14 files changed, 34 insertions(+), 107 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/94/347594/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 4b7de88..453b0d6 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -28,9 +28,6 @@
   $wgNamespacesWithSubpages[NS_TEMPLATE] to false to keep the old behavior.
 * $wgRunJobsAsync is now false by default (T142751). This change only affects
   wikis with $wgJobRunRate > 0.
-* A temporary feature flag, $wgDisableUserGroupExpiry, is provided to disable
-  new features that rely on the schema changes to the user_groups table. This
-  feature flag will likely be removed before 1.29 is released.
 * (T158474) "Unknown user" has been added to $wgReservedUsernames.
 * (T156983) $wgRateLimitsExcludedIPs now accepts CIDR ranges as well as single 
IPs.
 * $wgDummyLanguageCodes is deprecated. Additional language code mappings may be
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index d158c1e..db5f128 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5894,15 +5894,6 @@
  */
 $wgBotPasswordsDatabase = false;
 
-/**
- * Whether to disable user group expiry. This is a transitional feature flag
- * in accordance with WMF schema change policy, and will be removed later
- * (hopefully before MW 1.29 release).
- *
- * @since 1.29
- */
-$wgDisableUserGroupExpiry = false;
-
 /** @} */ # end of user rights settings
 
 ///**
diff --git a/includes/SiteStats.php b/includes/SiteStats.php
index bc6b842..3f75843 100644
--- a/includes/SiteStats.php
+++ b/includes/SiteStats.php
@@ -188,7 +188,6 @@
wfMemcKey( 'SiteStats', 'groupcounts', $group ),
$cache::TTL_HOUR,
function ( $oldValue, &$ttl, array &$setOpts ) use ( 
$group ) {
-   global $wgDisableUserGroupExpiry;
$dbr = wfGetDB( DB_REPLICA );
 
$setOpts += Database::getCacheSetOptions( $dbr 
);
@@ -198,9 +197,7 @@
'COUNT(*)',
[
'ug_group' => $group,
-   $wgDisableUserGroupExpiry ?
-   '1' :
-   'ug_expiry IS NULL OR 
ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
+   'ug_expiry IS NULL OR ug_expiry 
>= ' . $dbr->addQuotes( $dbr->timestamp() )
],
__METHOD__
);
diff --git a/includes/api/ApiQueryAllImages.php 
b/includes/api/ApiQueryAllImages.php
index daeedbe..250bee6 100644
--- a/includes/api/ApiQueryAllImages.php
+++ b/includes/api/ApiQueryAllImages.php
@@ -205,9 +205,7 @@
[
'ug_group' => 
User::getGroupsWithPermission( 'bot' ),
'ug_user = img_user',
-   $this->getConfig()->get( 
'DisableUserGroupExpiry' ) ?
-   '1' :
-   'ug_expiry IS NULL OR 
ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+   'ug_expiry IS NULL OR ug_expiry 
>= ' . $db->addQuotes( $db->timestamp() )
]
] ] );
$groupCond = ( $params['filterbots'] == 
'nobots' ? 'NULL' : 'NOT NULL' );
diff 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable user group expiry in production

2017-04-10 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/347545 )

Change subject: Enable user group expiry in production
..

Enable user group expiry in production

Bug: T159416
Change-Id: I5b495831892c3d31dc0ba531771fdf5354900b20
---
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
2 files changed, 0 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/45/347545/2

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 1a10a2a..1b29f82 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -260,10 +260,6 @@
'default' => false,
],
 
-   '-wgDisableUserGroupExpiry' => [
-   'default' => false,
-   ],
-
///
/// --- BetaFeatures start --
///
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index f0e8491..12e0fcb 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -7660,10 +7660,6 @@
'enwiki' => true, // T152076
 ],
 
-'wgDisableUserGroupExpiry' => [
-   'default' => true,
-],
-
 # groupOverrides @{
 'groupOverrides' => [
// Note: don't change the default setting here, because it won't take

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b495831892c3d31dc0ba531771fdf5354900b20
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO 
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]: Improve grammar of message on Special:GoToInterwiki

2017-04-09 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/347218 )

Change subject: Improve grammar of message on Special:GoToInterwiki
..

Improve grammar of message on Special:GoToInterwiki

Change-Id: Idd19a8455b82c86cf5a891efb17199fc9f625286
---
M languages/i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/347218/2

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index e08a439..1708e7d 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -4290,8 +4290,8 @@
"pageid": "page ID $1",
"rawhtml-notallowed": " tags cannot be used outside of 
normal pages.",
"gotointerwiki": "Leaving {{SITENAME}}",
-   "gotointerwiki-invalid": "The specified title was invalid.",
-   "gotointerwiki-external": "You are about to leave {{SITENAME}} to visit 
[[$2]] which is a separate website.\n\n[$1 Click here to continue on to $1].",
+   "gotointerwiki-invalid": "The specified title is invalid.",
+   "gotointerwiki-external": "You are about to leave {{SITENAME}} to visit 
[[$2]], which is a separate website.\n\n[$1 Click here to continue to $1].",
"undelete-cantedit": "You cannot undelete this page as you are not 
allowed to edit this page.",
"undelete-cantcreate": "You cannot undelete this page as there is no 
existing page with this name and you are not allowed to create this page."
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd19a8455b82c86cf5a891efb17199fc9f625286
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Add proper message when user group expiry is changed

2017-04-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/347144 )

Change subject: Add proper message when user group expiry is changed
..

Add proper message when user group expiry is changed

There's a lot more that could be done to improve user "rights"
notifications (really user group notifications), but this will do for now.

Change-Id: I27d52bc5c39219c832bf63a491faa1e421b0c024
Depends-On: I5d32445f8e5b41599889b8488a2431e7a908f858
Bug: T159301
---
M Hooks.php
M i18n/en.json
M includes/formatters/UserRightsPresentationModel.php
3 files changed, 46 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/44/347144/1

diff --git a/Hooks.php b/Hooks.php
index 8891532..33284b1 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -679,7 +679,9 @@
 *
 * @return bool
 */
-   public static function onUserGroupsChanged( $user, $add, $remove, 
$performer, $reason ) {
+   public static function onUserGroupsChanged( $user, $add, $remove, 
$performer,
+   $reason, array $oldUGMs = [], array $newUGMs = [] ) {
+
if ( !$performer ) {
// TODO: Implement support for autopromotion
return true;
@@ -695,13 +697,41 @@
return true;
}
 
-   if ( $add || $remove ) {
+   // If any old groups are in $add, those groups are having their 
expiry
+   // changed, not actually being added
+   $expiryChanged = [];
+   $reallyAdded = [];
+   foreach ( $add as $group ) {
+   if ( isset( $oldUGMs[$add] ) ) {
+   $expiryChanged[] = $group;
+   } else {
+   $reallyAdded[] = $group;
+   }
+   }
+
+   if ( $expiryChanged ) {
+   // use a separate notification for these, so the 
notification text doesn't
+   // get too long
EchoEvent::create(
[
'type' => 'user-rights',
'extra' => [
'user' => $user->getID(),
-   'add' => $add,
+   'expiry-changed' => 
$expiryChanged,
+   'reason' => $reason,
+   ],
+   'agent' => $performer,
+   ]
+   );
+   }
+
+   if ( $reallyAdded || $remove ) {
+   EchoEvent::create(
+   [
+   'type' => 'user-rights',
+   'extra' => [
+   'user' => $user->getID(),
+   'add' => $reallyAdded,
'remove' => $remove,
'reason' => $reason,
],
diff --git a/i18n/en.json b/i18n/en.json
index cf1f3ee..d95ef17 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -166,6 +166,7 @@
"notification-header-user-rights-add-only": "{{GENDER:$4|Your}} user 
rights were {{GENDER:$1|changed}}. You have been added to: $2.",
"notification-header-user-rights-remove-only": "{{GENDER:$4|Your}} user 
rights were {{GENDER:$1|changed}}. You are no longer a member of: $2.",
"notification-header-user-rights-add-and-remove": "{{GENDER:$6|Your}} 
user rights were {{GENDER:$1|changed}}. You have been added to: $2. You are no 
longer a member of: $4.",
+   "notification-header-user-rights-expiry-change": "The expiry of 
{{GENDER:$4|your}} membership in the following {{PLURAL:$3|group|groups}} has 
been {{GENDER:$1|changed}}: $2.",
"notification-body-user-rights": "$1",
"notification-header-welcome": "{{GENDER:$2|Welcome}} to {{SITENAME}}, 
$1! We're glad {{GENDER:$2|you're}} here.",
"notification-welcome-link": "",
diff --git a/includes/formatters/UserRightsPresentationModel.php 
b/includes/formatters/UserRightsPresentationModel.php
index 2499627..c706d3f 100644
--- a/includes/formatters/UserRightsPresentationModel.php
+++ b/includes/formatters/UserRightsPresentationModel.php
@@ -19,7 +19,18 @@
[ $this->language, 'embedBidi' ],
$this->getLocalizedGroupNames( array_values( 
$this->event->getExtraParam( 'remove', [] ) ) )
);
-   if ( $add && !$remove ) {
+   $expiryChanged = array_map(
+   [ $this->

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add UserGroupMembership details to the UserGroupsChanged hook

2017-04-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/347143 )

Change subject: Add UserGroupMembership details to the UserGroupsChanged hook
..

Add UserGroupMembership details to the UserGroupsChanged hook

For Echo.

Bug: T159301
Change-Id: I5d32445f8e5b41599889b8488a2431e7a908f858
---
M docs/hooks.txt
M includes/specials/SpecialUserrights.php
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/347143/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index bee4477..af0eb06 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3589,6 +3589,10 @@
 $performer: User who performed the change, false if via autopromotion
 $reason: The reason, if any, given by the user performing the change,
 false if via autopromotion.
+$oldUGMs: An associative array (group name => UserGroupMembership object) of
+the user's group memberships before the change.
+$newUGMs: An associative array (group name => UserGroupMembership object) of
+the user's current group memberships.
 
 'UserIsBlockedFrom': Check if a user is blocked from a specific page (for
 specific block exemptions).
diff --git a/includes/specials/SpecialUserrights.php 
b/includes/specials/SpecialUserrights.php
index b33aa7d..127b530 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -387,7 +387,8 @@
$user->invalidateCache();
 
// update groups in external authentication database
-   Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, 
$this->getUser(), $reason ] );
+   Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, 
$this->getUser(),
+   $reason, $oldUGMs, $newUGMs ] );
MediaWiki\Auth\AuthManager::callLegacyAuthPlugin(
'updateExternalDBGroups', [ $user, $add, $remove ]
);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Convert various FormActions to OOUI

2017-03-10 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342302 )

Change subject: Convert various FormActions to OOUI
..

Convert various FormActions to OOUI

Support for OOUI is added to FormAction, and subclasses can enable it as
required.

PurgeAction, RevertAction, WatchAction and UnwatchAction are converted
to OOUI, with minor changes to the forms to give them a neater appearance.

Bug: T160236
Change-Id: I5294e5d886e8641e9b63eabc9d7fa8ea93e0df96
---
M includes/actions/FormAction.php
M includes/actions/PurgeAction.php
M includes/actions/RevertAction.php
M includes/actions/UnwatchAction.php
M includes/actions/WatchAction.php
M languages/i18n/en.json
M languages/i18n/qqq.json
7 files changed, 66 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/342302/1

diff --git a/includes/actions/FormAction.php b/includes/actions/FormAction.php
index e94a188..0141b9e 100644
--- a/includes/actions/FormAction.php
+++ b/includes/actions/FormAction.php
@@ -59,6 +59,14 @@
}
 
/**
+* Whether the form should use OOUI
+* @return bool
+*/
+   protected function usesOOUI() {
+   return false;
+   }
+
+   /**
 * Get the HTMLForm to control behavior
 * @return HTMLForm|null
 */
@@ -68,7 +76,11 @@
// Give hooks a chance to alter the form, adding extra fields 
or text etc
Hooks::run( 'ActionModifyFormFields', [ $this->getName(), 
&$this->fields, $this->page ] );
 
-   $form = new HTMLForm( $this->fields, $this->getContext(), 
$this->getName() );
+   if ( $this->usesOOUI() ) {
+   $form = HTMLForm::factory( 'ooui', $this->fields, 
$this->getContext(), $this->getName() );
+   } else {
+   $form = new HTMLForm( $this->fields, 
$this->getContext(), $this->getName() );
+   }
$form->setSubmitCallback( [ $this, 'onSubmit' ] );
 
$title = $this->getTitle();
diff --git a/includes/actions/PurgeAction.php b/includes/actions/PurgeAction.php
index 942b731..210751a 100644
--- a/includes/actions/PurgeAction.php
+++ b/includes/actions/PurgeAction.php
@@ -75,12 +75,24 @@
}
}
 
-   protected function alterForm( HTMLForm $form ) {
-   $form->setSubmitTextMsg( 'confirm_purge_button' );
+   protected function usesOOUI() {
+   return true;
}
 
-   protected function preText() {
-   return $this->msg( 'confirm-purge-top' )->parse();
+   protected function getFormFields() {
+   return [
+   'intro' => [
+   'type' => 'info',
+   'vertical-label' => true,
+   'raw' => true,
+   'default' => $this->msg( 'confirm-purge-top' 
)->parse()
+   ]
+   ];
+   }
+
+   protected function alterForm( HTMLForm $form ) {
+   $form->setWrapperLegendMsg( 'confirm-purge-title' );
+   $form->setSubmitTextMsg( 'confirm_purge_button' );
}
 
protected function postText() {
diff --git a/includes/actions/RevertAction.php 
b/includes/actions/RevertAction.php
index e466e65..a914c9b 100644
--- a/includes/actions/RevertAction.php
+++ b/includes/actions/RevertAction.php
@@ -66,6 +66,10 @@
}
}
 
+   protected function usesOOUI() {
+   return true;
+   }
+
protected function alterForm( HTMLForm $form ) {
$form->setWrapperLegendMsg( 'filerevert-legend' );
$form->setSubmitTextMsg( 'filerevert-submit' );
diff --git a/includes/actions/UnwatchAction.php 
b/includes/actions/UnwatchAction.php
index 7f043e4..aa17b89 100644
--- a/includes/actions/UnwatchAction.php
+++ b/includes/actions/UnwatchAction.php
@@ -31,22 +31,27 @@
return 'unwatch';
}
 
-   protected function getDescription() {
-   return $this->msg( 'removewatch' )->escaped();
-   }
-
public function onSubmit( $data ) {
self::doUnwatch( $this->getTitle(), $this->getUser() );
 
return true;
}
 
-   protected function alterForm( HTMLForm $form ) {
-   $form->setSubmitTextMsg( 'confirm-unwatch-button' );
+   protected function getFormFields() {
+   return [
+   'intro' => [
+   'type' => 'info',
+   'vertical-label' => true,
+   'raw' => true,
+   'default' => $this->msg( 'confirm-unwatch-top' 
)->parse()
+   ]
+   ];
}
 
-   protected function preText() {
-   return

[MediaWiki-commits] [Gerrit] mediawiki...DisableAccount[master]: Update blockDisabledAccounts script to account for expiring ...

2017-03-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341951 )

Change subject: Update blockDisabledAccounts script to account for expiring 
user groups
..

Update blockDisabledAccounts script to account for expiring user groups

Bug: T160022
Change-Id: I1569dfc98c04a99ebab39de1190cd11132e7c4e6
---
M blockDisabledAccounts.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisableAccount 
refs/changes/51/341951/2

diff --git a/blockDisabledAccounts.php b/blockDisabledAccounts.php
index 49f52a6..05567b8 100644
--- a/blockDisabledAccounts.php
+++ b/blockDisabledAccounts.php
@@ -23,7 +23,10 @@
$ids = $dbr->selectFieldValues(
'user_groups',
'ug_user',
-   array( 'ug_group' => 'inactive' ),
+   array(
+   'ug_group' => 'inactive',
+   'ug_expiry IS NULL OR ug_expiry >= ' . 
$dbr->addQuotes( $dbr->timestamp() )
+   ),
__METHOD__
);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1569dfc98c04a99ebab39de1190cd11132e7c4e6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DisableAccount
Gerrit-Branch: master
Gerrit-Owner: TTO 
Gerrit-Reviewer: Anomie 
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...Translate[master]: Update translator-stats to account for expiring user groups

2017-03-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341949 )

Change subject: Update translator-stats to account for expiring user groups
..

Update translator-stats to account for expiring user groups

Bug: T160026
Change-Id: Ie1674cb5e75f7dc68b51332546f93ca3c691870d
---
M scripts/translator-stats.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/49/341949/2

diff --git a/scripts/translator-stats.php b/scripts/translator-stats.php
index 9c7eac7..913ea45 100644
--- a/scripts/translator-stats.php
+++ b/scripts/translator-stats.php
@@ -43,7 +43,11 @@
[
'user_groups' => [
'LEFT JOIN',
-   [ 'user_id=ug_user', 'ug_group' => 
'translator' ]
+   [
+   'user_id=ug_user',
+   'ug_group' => 'translator',
+   'ug_expiry IS NULL OR ug_expiry 
>= ' . $dbr->addQuotes( $dbr->timestamp() )
+   ]
]
]
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1674cb5e75f7dc68b51332546f93ca3c691870d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Update queries to account for expiring user groups

2017-03-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341947 )

Change subject: Update queries to account for expiring user groups
..

Update queries to account for expiring user groups

Bug: T157015
Change-Id: I8f65d36fceabaadbc8f538ee740c3f286a4d1f6f
---
M frontend/specialpages/reports/ValidationStatistics_body.php
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs 
refs/changes/47/341947/2

diff --git a/frontend/specialpages/reports/ValidationStatistics_body.php 
b/frontend/specialpages/reports/ValidationStatistics_body.php
index 96d32ab..5f7dada 100644
--- a/frontend/specialpages/reports/ValidationStatistics_body.php
+++ b/frontend/specialpages/reports/ValidationStatistics_body.php
@@ -232,13 +232,19 @@
 
protected function getEditorCount() {
return $this->db->selectField( 'user_groups', 'COUNT(*)',
-   array( 'ug_group' => 'editor' ),
+   array(
+   'ug_group' => 'editor',
+   'ug_expiry IS NULL OR ug_expiry >= ' . 
$this->db->addQuotes( $this->db->timestamp() )
+   ),
__METHOD__ );
}
 
protected function getReviewerCount() {
return $this->db->selectField( 'user_groups', 'COUNT(*)',
-   array( 'ug_group' => 'reviewer' ),
+   array(
+   'ug_group' => 'reviewer',
+   'ug_expiry IS NULL OR ug_expiry >= ' . 
$this->db->addQuotes( $this->db->timestamp() )
+   ),
__METHOD__ );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f65d36fceabaadbc8f538ee740c3f286a4d1f6f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: ContributionsQuery: Disregard bots whose group membership ha...

2017-03-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341943 )

Change subject: ContributionsQuery: Disregard bots whose group membership has 
expired
..

ContributionsQuery: Disregard bots whose group membership has expired

Bug: T157017
Change-Id: I300b6ffbf99cde0b64d1a81937f27576560ee8a9
---
M includes/Formatter/ContributionsQuery.php
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/43/341943/2

diff --git a/includes/Formatter/ContributionsQuery.php 
b/includes/Formatter/ContributionsQuery.php
index 789110f..5160c24 100644
--- a/includes/Formatter/ContributionsQuery.php
+++ b/includes/Formatter/ContributionsQuery.php
@@ -318,16 +318,18 @@
}
$minUserId = (int) ( $max - $max / 100 );
 
-   // exclude all users withing groups with bot permission
+   // exclude all users within groups with bot permission
$excludeUserIds = array();
$groupsWithBotPermission = User::getGroupsWithPermission( 'bot' 
);
if ( count( $groupsWithBotPermission ) ) {
-   $rows = $pager->getDatabase()->select(
+   $db = $pager->getDatabase();
+   $rows = $db->select(
array( 'user', 'user_groups' ),
'user_id',
array(
'user_id > ' . $minUserId,
-   'ug_group' => $groupsWithBotPermission
+   'ug_group' => $groupsWithBotPermission,
+   'ug_expiry IS NULL OR ug_expiry >= ' . 
$db->addQuotes( $db->timestamp() )
),
__METHOD__,
array(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I300b6ffbf99cde0b64d1a81937f27576560ee8a9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: TTO 
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]: Avoid breaking wikis that were modifying $wgDummyLanguageCodes

2017-03-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341937 )

Change subject: Avoid breaking wikis that were modifying $wgDummyLanguageCodes
..

Avoid breaking wikis that were modifying $wgDummyLanguageCodes

Follow-up to If73c74ee87d8235381449cab7dcd9f46b0f23590.

Change-Id: I51b7ecf51860bfddea87fcf7cad17295088e1dd9
---
M RELEASE-NOTES-1.29
M includes/DefaultSettings.php
M includes/Setup.php
3 files changed, 16 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/341937/3

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 5bc66fd..e0c6e54 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -33,6 +33,8 @@
   feature flag will likely be removed before 1.29 is released.
 * (T158474) "Unknown user" has been added to $wgReservedUsernames.
 * (T156983) $wgRateLimitsExcludedIPs now accepts CIDR ranges as well as single 
IPs.
+* $wgDummyLanguageCodes is deprecated. Additional language code mappings may be
+  added to $wgExtraLanguageCodes instead.
 
 === New features in 1.29 ===
 * (T5233) A cookie can now be set when a user is autoblocked, to track that 
user
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index dce6d3c..192ad08 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2905,6 +2905,14 @@
 ];
 
 /**
+ * Functionally the same as $wgExtraLanguageCodes, but deprecated. Instead of
+ * appending values to this array, append them to $wgExtraLanguageCodes.
+ *
+ * @deprecated since 1.29
+ */
+$wgDummyLanguageCodes = [];
+
+/**
  * Set this to true to replace Arabic presentation forms with their standard
  * forms in the U+0600-U+06FF block. This only works if $wgLanguageCode is
  * set to "ar".
diff --git a/includes/Setup.php b/includes/Setup.php
index e686cd8..ecfce1e 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -403,13 +403,12 @@
$wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + 
$wgExtraNamespaces;
 }
 
-// Merge in the legacy language codes, unless overridden in the config
-if ( !isset( $wgDummyLanguageCodes ) ) {
-   $wgDummyLanguageCodes = [
-   'qqq' => 'qqq', // Used for message documentation
-   'qqx' => 'qqx', // Used for viewing message keys
-   ] + $wgExtraLanguageCodes + LanguageCode::getDeprecatedCodeMapping();
-}
+// Merge in the legacy language codes, incorporating overrides from the config
+$wgDummyLanguageCodes = [
+   'qqq' => 'qqq', // Used for message documentation
+   'qqx' => 'qqx', // Used for viewing message keys
+] + $wgDummyLanguageCodes + $wgExtraLanguageCodes +
+   LanguageCode::getDeprecatedCodeMapping();
 
 // These are now the same, always
 // To determine the user language, use $wgLang->getCode()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51b7ecf51860bfddea87fcf7cad17295088e1dd9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...BoilerPlate[master]: Remove i18n files other than en and qqq

2017-02-14 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337562 )

Change subject: Remove i18n files other than en and qqq
..

Remove i18n files other than en and qqq

Bug: T156569
Change-Id: I16531b1c458f623827df297a3e9d4594f316a0e9
---
D i18n/af.json
D i18n/ast.json
D i18n/ba.json
D i18n/bcl.json
D i18n/be-tarask.json
D i18n/br.json
D i18n/ca.json
D i18n/ce.json
D i18n/da.json
D i18n/de.json
D i18n/diq.json
D i18n/dsb.json
D i18n/en-gb.json
D i18n/eo.json
D i18n/es.json
D i18n/fa.json
D i18n/fi.json
D i18n/fo.json
D i18n/fr.json
D i18n/frp.json
D i18n/gl.json
D i18n/he.json
D i18n/hi.json
D i18n/hsb.json
D i18n/ht.json
D i18n/hu.json
D i18n/ia.json
D i18n/id.json
D i18n/it.json
D i18n/ja.json
D i18n/kk-cyrl.json
D i18n/kn.json
D i18n/ko.json
D i18n/ksh.json
D i18n/lb.json
D i18n/lt.json
D i18n/lus.json
D i18n/map-bms.json
D i18n/mk.json
D i18n/mr.json
D i18n/ms.json
D i18n/mt.json
D i18n/nb.json
D i18n/nl.json
D i18n/oc.json
D i18n/pl.json
D i18n/pms.json
D i18n/ps.json
D i18n/pt-br.json
D i18n/pt.json
D i18n/roa-tara.json
D i18n/ru.json
D i18n/si.json
D i18n/sv.json
D i18n/ta.json
D i18n/te.json
D i18n/tl.json
D i18n/uk.json
D i18n/yi.json
D i18n/zh-hans.json
D i18n/zh-hant.json
61 files changed, 0 insertions(+), 649 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BoilerPlate 
refs/changes/62/337562/1

diff --git a/i18n/af.json b/i18n/af.json
deleted file mode 100644
index faf1737..000
--- a/i18n/af.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-   "@metadata": {
-   "authors": [
-   "Oesjaar"
-   ]
-   },
-   "helloworld": "Hello wêreld"
-}
diff --git a/i18n/ast.json b/i18n/ast.json
deleted file mode 100644
index 594ae3e..000
--- a/i18n/ast.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-   "@metadata": {
-   "authors": [
-   "Xuacu"
-   ]
-   },
-   "boilerplate-desc": "Esta ye una estensión d'exemplu",
-   "boilerplate-i18n-welcome": "Bienveníu al ficheru de llocalización de 
la estensión BoilerPlate.",
-   "boilerplate-helloworld": "¡Bones, mundu!",
-   "boilerplate-helloworld-intro": "Bienllegaos a la páxina especial 
«Bones, mundu» de la estensión BoilerPlate.",
-   "helloworld": "HolaMundu"
-}
diff --git a/i18n/ba.json b/i18n/ba.json
deleted file mode 100644
index 3099903..000
--- a/i18n/ba.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-   "@metadata": {
-   "authors": [
-   "Sagan",
-   "Янмурза Баки"
-   ]
-   },
-   "boilerplate-desc": "Был ҡушымта өлгөһө",
-   "boilerplate-i18n-welcome": "BoilerPlate киңәйтеүе локализация файлына 
рөхсәт итегеҙ.",
-   "boilerplate-helloworld": "Һаумы, донъя!",
-   "boilerplate-helloworld-intro": "BoilerPlate ҡушымтаһының «Һаумы, 
донъя!» махсус битенә рәхим итегеҙ!",
-   "helloworld": "Һаумы, донъя!"
-}
diff --git a/i18n/bcl.json b/i18n/bcl.json
deleted file mode 100644
index d40e06d..000
--- a/i18n/bcl.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-   "@metadata": {
-   "authors": [
-   "Geopoet"
-   ]
-   },
-   "boilerplate-desc": "Ini sarong ehemplo nin ekstensyon",
-   "boilerplate-i18n-welcome": "Marhayon na pag-abot sa sagunson nin 
lokalisasyon kan ekstensyon nin GagaangPlato."
-}
diff --git a/i18n/be-tarask.json b/i18n/be-tarask.json
deleted file mode 100644
index bc4e8ec..000
--- a/i18n/be-tarask.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-   "@metadata": {
-   "authors": [
-   "Wizardist",
-   "Red Winged Duck"
-   ]
-   },
-   "boilerplate-desc": "Гэта прыклад пашырэньня",
-   "boilerplate-i18n-welcome": "Вітаем у лякалізацыйным файле пашырэньня 
BoilerPlate.",
-   "boilerplate-helloworld": "Hello world!",
-   "boilerplate-helloworld-intro": "Вітаем на спэцыяльнай старонцы «Hello 
world» пашырэньня BoilerPlate",
-   "helloworld": "HelloWorld"
-}
diff --git a/i18n/br.json b/i18n/br.json
deleted file mode 100644
index 51e48ca..000
--- a/i18n/br.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-   "@metadata": {
-   "authors": [
-   "Fohanno",
-   "Fulup"
-   ]
-   },
-   "boilerplate-desc": "Setu amañ ur skouer astenn",
-   "helloworld": "HelloWorld"
-}
diff --git a/i18n/ca.json b/i18n/ca.json
deleted file mode 100644
index 1aee39c..000
--- a/i18n/ca.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-   "@metadata": {
-   "authors": [
-   "Arnaugir"
-   ]
-   },
-   "boilerplate-desc": "Aquesta és una extensió d'exemple"
-}
diff --git a/i18n/ce.json b/i18n/ce.json
deleted file mode 100644
index 92e75ee..000
--- a/i18n/ce.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{

[MediaWiki-commits] [Gerrit] translatewiki[master]: Remove MediaWiki extension BoilerPlate

2017-02-13 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337525 )

Change subject: Remove MediaWiki extension BoilerPlate
..

Remove MediaWiki extension BoilerPlate

This is supposed to be a copy-paste-able boilerplate template for
creating your own extension. As such, it doesn't make sense to have
i18n files other than en and qqq in the repository -- the first
thing a developer has to do when basing an extension on BoilerPlate
is to delete them.

Localisable information about this extension should be kept on
MediaWiki.org, not in the repository.

Bug: T156569
Change-Id: I1f688f4f60507509e66f1c5240d4bc0b48fb3f2d
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/25/337525/2

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 032eded..6f77d31 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -515,7 +515,7 @@
 
 # Blue Spice Sub Page Tree // no i18n
 
-Boiler Plate
+# Boiler Plate excluded per T156569
 
 Book Manager
 descmsg = bm-printversion-desc

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f688f4f60507509e66f1c5240d4bc0b48fb3f2d
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Show a marker next to temporary user groups on Special:Centr...

2017-02-04 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335983 )

Change subject: Show a marker next to temporary user groups on 
Special:CentralAuth
..

Show a marker next to temporary user groups on Special:CentralAuth

Bug: T157016
Change-Id: I33c35dacb5342e223bd01f6268ad31507a854445
---
M includes/CentralAuthUser.php
M includes/specials/SpecialCentralAuth.php
2 files changed, 19 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/83/335983/1

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 64027be..18aeb3a 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -53,7 +53,7 @@
'mCasToken'
);
 
-   const VERSION = 7;
+   const VERSION = 8;
 
const HIDDEN_NONE = '';
const HIDDEN_LISTS = 'lists';
@@ -911,7 +911,7 @@
$priorityGroups = array( 'checkuser', 'oversight', 
'bureaucrat', 'sysop' );
foreach ( $priorityGroups as $group ) {
foreach ( $migrationSet as $wiki => $local ) {
-   if ( in_array( $group, $local['groups'] ) ) {
+   if ( isset( $local['groupMemberships'][$group] 
) ) {
$found[] = $wiki;
}
}
@@ -2230,7 +2230,7 @@
array_map(
function ( $local ) use ( &$localgroups ) {
$localgroups = array_unique( array_merge(
-   $localgroups, $local['groups']
+   $localgroups, array_keys( 
$local['groupMemberships'] )
) );
},
$this->queryAttached()
@@ -2401,7 +2401,9 @@
wfTimestampOrNull( TS_MW, 
$row->user_registration ),
'password' => $row->user_password,
'editCount' => $row->user_editcount,
+   /** @deprecated Use 'groupMemberships' instead */
'groups' => array(),
+   'groupMemberships' => array(), // array of (group name 
=> UserGroupMembership object)
'blocked' => false );
 
// Edit count field may not be initialized...
@@ -2414,20 +2416,9 @@
}
 
// And we have to fetch groups separately, sigh...
-   global $wgDisableUserGroupExpiry;
-   $result = $db->select( 'user_groups',
-   array( 'ug_group' ),
-   array(
-   'ug_user' => $data['id'],
-   $wgDisableUserGroupExpiry ?
-   '1' :
-   'ug_expiry IS NULL OR ug_expiry >= ' . 
$db->addQuotes( $db->timestamp() ),
-   ),
-   __METHOD__ );
-   foreach ( $result as $row ) {
-   $data['groups'][] = $row->ug_group;
-   }
-   $result->free();
+   $data['groupMemberships'] =
+   UserGroupMembership::getMembershipsForUser( 
$data['id'], $db );
+   $data['groups'] = array_keys( $data['groupMemberships'] );
 
// And while we're in here, look for user blocks :D
$result = $db->select( 'ipblocks',
diff --git a/includes/specials/SpecialCentralAuth.php 
b/includes/specials/SpecialCentralAuth.php
index c0cc484..75d8554 100644
--- a/includes/specials/SpecialCentralAuth.php
+++ b/includes/specials/SpecialCentralAuth.php
@@ -622,10 +622,19 @@
 * @return string
 */
private function formatGroups( $row ) {
-   if ( !count( $row['groups'] ) ) {
+   if ( !count( $row['groupMemberships'] ) ) {
return '';
}
-   return htmlspecialchars( $this->getLanguage()->commaList( 
$row['groups'] ) );
+
+   $list = [];
+   foreach ( $row['groupMemberships'] as $group => $ugm ) {
+   if ( $ugm->getExpiry() ) {
+   $list[] = $this->msg( 
'centralauth-group-temporary-marker', $group )->text();
+   } else {
+   $list[] = $group;
+   }
+   }
+   return htmlspecialchars( $this->getLanguage()->commaList( $list 
) );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33c35dacb5342e223bd01f6268ad31507a854445
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/exte

[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Disregard expired user groups when populating the voter list

2017-02-02 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335644 )

Change subject: Disregard expired user groups when populating the voter list
..

Disregard expired user groups when populating the voter list

I didn't touch cli/wm-scripts/bv2013/doSpam.php, as it is an old archived
script.

Bug: T157018
Change-Id: I67632761d0bbb2bf7f7f170ae7cff019f10e668e
---
M includes/jobs/PopulateVoterListJob.php
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/44/335644/1

diff --git a/includes/jobs/PopulateVoterListJob.php 
b/includes/jobs/PopulateVoterListJob.php
index 03d380e..d3fe3c8 100644
--- a/includes/jobs/PopulateVoterListJob.php
+++ b/includes/jobs/PopulateVoterListJob.php
@@ -265,6 +265,7 @@
}
 
// Criterion 3: Not in a listed group
+   global $wgDisableUserGroupExpiry;
if ( $this->params['list_exclude-groups'] ) {
$res = $dbr->select(
array( 'user', 'user_groups' ),
@@ -280,6 +281,9 @@
'user_groups' => array( 'LEFT 
OUTER JOIN', array(
'ug_user = 
user_id',
'ug_group' => 
$this->params['list_exclude-groups'],
+   ( !isset( 
$wgDisableUserGroupExpiry ) || $wgDisableUserGroupExpiry ) ?
+   '1' :
+   
'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ),
)
),
)
@@ -304,7 +308,10 @@
array(
"ug_user >= $min",
"ug_user < $max",
-   'ug_group' => 
$this->params['list_include-groups']
+   'ug_group' => 
$this->params['list_include-groups'],
+   ( !isset( 
$wgDisableUserGroupExpiry ) || $wgDisableUserGroupExpiry ) ?
+   '1' :
+   'ug_expiry IS NULL OR 
ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ),
)
);
$list = array();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67632761d0bbb2bf7f7f170ae7cff019f10e668e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Disregard expired user groups in queries

2017-02-02 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335638 )

Change subject: Disregard expired user groups in queries
..

Disregard expired user groups in queries

Bug: T157016
Change-Id: Ida50a92f6695e252ddd60792753f3455c23e252c
---
M includes/CentralAuthUser.php
M maintenance/migrateStewards.php
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/38/335638/1

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 208e1ee..96aaf44 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -2414,9 +2414,15 @@
}
 
// And we have to fetch groups separately, sigh...
+   global $wgDisableUserGroupExpiry;
$result = $db->select( 'user_groups',
array( 'ug_group' ),
-   array( 'ug_user' => $data['id'] ),
+   array(
+   'ug_user' => $data['id'],
+   ( isset( $wgDisableUserGroupExpiry ) && 
$wgDisableUserGroupExpiry ) ?
+   '1' :
+   'ug_expiry IS NULL OR ug_expiry >= ' . 
$db->addQuotes( $db->timestamp() ),
+   ),
__METHOD__ );
foreach ( $result as $row ) {
$data['groups'][] = $row->ug_group;
diff --git a/maintenance/migrateStewards.php b/maintenance/migrateStewards.php
index 547ca16..fbf2faf 100644
--- a/maintenance/migrateStewards.php
+++ b/maintenance/migrateStewards.php
@@ -15,6 +15,9 @@
array( 'user_name' ),
array(
'ug_group' => 'steward',
+   ( isset( $wgDisableUserGroupExpiry ) && 
$wgDisableUserGroupExpiry ) ?
+   '1' :
+   'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( 
$db->timestamp() ),
'user_id = ug_user'
),
'migrateStewards.php'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida50a92f6695e252ddd60792753f3455c23e252c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make last remaining user_groups queries honor $wgDisableUser...

2017-02-01 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335574 )

Change subject: Make last remaining user_groups queries honor 
$wgDisableUserGroupExpiry
..

Make last remaining user_groups queries honor $wgDisableUserGroupExpiry

Follow-up to I94102ceb00398940965280d8742a2747631dcc87

Change-Id: I62952c42b2f6ee1bed0088e17826e19dfc23471c
---
M includes/api/ApiQueryAllUsers.php
M includes/specials/pagers/ActiveUsersPager.php
2 files changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/335574/1

diff --git a/includes/api/ApiQueryAllUsers.php 
b/includes/api/ApiQueryAllUsers.php
index 1c3b171..136f60e 100644
--- a/includes/api/ApiQueryAllUsers.php
+++ b/includes/api/ApiQueryAllUsers.php
@@ -147,7 +147,9 @@
$this->addJoinConds( [ 'ug1' => [ 'LEFT OUTER JOIN',
array_merge( [
'ug1.ug_user=user_id',
-   'ug1.ug_expiry IS NULL OR ug1.ug_expiry 
>= ' . $db->addQuotes( $db->timestamp() )
+   $this->getConfig()->get( 
'DisableUserGroupExpiry' ) ?
+   '1' :
+   'ug1.ug_expiry IS NULL OR 
ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
], $exclude )
] ] );
$this->addWhere( 'ug1.ug_user IS NULL' );
@@ -163,7 +165,9 @@
$this->addFields( [ 'groups' =>
$db->buildGroupConcatField( '|', 'user_groups', 
'ug_group', [
'ug_user=user_id',
-   'ug_expiry IS NULL OR ug_expiry >= ' . 
$db->addQuotes( $db->timestamp() )
+   $this->getConfig()->get( 
'DisableUserGroupExpiry' ) ?
+   '1' :
+   'ug_expiry IS NULL OR ug_expiry 
>= ' . $db->addQuotes( $db->timestamp() )
] )
] );
}
diff --git a/includes/specials/pagers/ActiveUsersPager.php 
b/includes/specials/pagers/ActiveUsersPager.php
index 1fec05d..0d6f493 100644
--- a/includes/specials/pagers/ActiveUsersPager.php
+++ b/includes/specials/pagers/ActiveUsersPager.php
@@ -111,7 +111,9 @@
'user_groups', '1', [
'ug_user = user_id',
'ug_group' => $group,
-   'ug_expiry IS NULL OR ug_expiry 
>= ' . $dbr->addQuotes( $dbr->timestamp() )
+   $this->getConfig()->get( 
'DisableUserGroupExpiry' ) ?
+   '1' :
+   'ug_expiry IS NULL OR 
ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
]
) . ')';
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Don't try to drop ug_user_group index if it doesn't exist

2017-02-01 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335414 )

Change subject: Don't try to drop ug_user_group index if it doesn't exist
..

Don't try to drop ug_user_group index if it doesn't exist

This is needed for MySQL only.

Bug: T156901
Change-Id: I351fa1b7ce5a9b1c7b19ecb7d26d8a1f699d88f8
---
M includes/installer/MysqlUpdater.php
A maintenance/archives/patch-drop-ug_user_group-index.sql
M maintenance/archives/patch-user_groups-ug_expiry.sql
3 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/335414/1

diff --git a/includes/installer/MysqlUpdater.php 
b/includes/installer/MysqlUpdater.php
index 7a27f5f..ae86e76 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -294,6 +294,7 @@
 
// 1.29
[ 'addField', 'externallinks', 'el_index_60', 
'patch-externallinks-el_index_60.sql' ],
+   [ 'dropIndex', 'user_groups', 'ug_user_group', 
'patch-drop-ug_user_group-index.sql' ],
[ 'addField', 'user_groups', 'ug_expiry', 
'patch-user_groups-ug_expiry.sql' ],
];
}
diff --git a/maintenance/archives/patch-drop-ug_user_group-index.sql 
b/maintenance/archives/patch-drop-ug_user_group-index.sql
new file mode 100644
index 000..7a94048
--- /dev/null
+++ b/maintenance/archives/patch-drop-ug_user_group-index.sql
@@ -0,0 +1,5 @@
+-- Drop redundant unique index, to be replaced by a primary key in the next
+-- sequential update (patch-user_groups-ug_expiry.sql) 
+
+ALTER TABLE /*$wgDBprefix*/user_groups
+  DROP INDEX ug_user_group;
diff --git a/maintenance/archives/patch-user_groups-ug_expiry.sql 
b/maintenance/archives/patch-user_groups-ug_expiry.sql
index 2ce2c9e..a8f6ec9 100644
--- a/maintenance/archives/patch-user_groups-ug_expiry.sql
+++ b/maintenance/archives/patch-user_groups-ug_expiry.sql
@@ -1,7 +1,6 @@
 -- Primary key and expiry column in user_groups table
 
 ALTER TABLE /*$wgDBprefix*/user_groups
-  DROP INDEX ug_user_group,
   ADD PRIMARY KEY (ug_user, ug_group),
   ADD COLUMN ug_expiry varbinary(14) NULL default NULL,
   ADD INDEX ug_expiry (ug_expiry);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Merge duplicate SpecialSearchTest files

2017-01-31 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335228 )

Change subject: Merge duplicate SpecialSearchTest files
..

Merge duplicate SpecialSearchTest files

Change-Id: I1d6be3f6c32102ee8c7f4ee3dc6f0c752ef05534
---
M tests/phpunit/includes/specials/SpecialSearchTest.php
D tests/phpunit/specials/SpecialSearchTest.php
2 files changed, 21 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/335228/1

diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php 
b/tests/phpunit/includes/specials/SpecialSearchTest.php
index e9cf6a3..13c21c0 100644
--- a/tests/phpunit/includes/specials/SpecialSearchTest.php
+++ b/tests/phpunit/includes/specials/SpecialSearchTest.php
@@ -205,6 +205,27 @@
 
return $mock;
}
+
+   public function testSubPageRedirect() {
+   $this->setMwGlobals( [
+   'wgScript' => '/w/index.php',
+   ] );
+
+   $ctx = new RequestContext;
+   $sp = Title::newFromText( 'Special:Search/foo_bar' );
+   SpecialPageFactory::executePath( $sp, $ctx );
+   $url = $ctx->getOutput()->getRedirect();
+   // some older versions of hhvm have a bug that doesn't parse 
relative
+   // urls with a port, so help it out a little bit.
+   // https://github.com/facebook/hhvm/issues/7136
+   $url = wfExpandUrl( $url, PROTO_CURRENT );
+
+   $parts = parse_url( $url );
+   $this->assertEquals( '/w/index.php', $parts['path'] );
+   parse_str( $parts['query'], $query );
+   $this->assertEquals( 'Special:Search', $query['title'] );
+   $this->assertEquals( 'foo bar', $query['search'] );
+   }
 }
 
 class SpecialSearchTestMockResultSet extends SearchResultSet {
diff --git a/tests/phpunit/specials/SpecialSearchTest.php 
b/tests/phpunit/specials/SpecialSearchTest.php
deleted file mode 100644
index 20e88f5..000
--- a/tests/phpunit/specials/SpecialSearchTest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-getOutput()->getRedirect();
-   // some older versions of hhvm have a bug that doesn't parse 
relative
-   // urls with a port, so help it out a little bit.
-   // https://github.com/facebook/hhvm/issues/7136
-   $url = wfExpandUrl( $url, PROTO_CURRENT );
-
-   $parts = parse_url( $url );
-   $this->assertEquals( '/w/index.php', $parts['path'] );
-   parse_str( $parts['query'], $query );
-   $this->assertEquals( 'Special:Search', $query['title'] );
-   $this->assertEquals( 'foo bar', $query['search'] );
-   }
-}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Prevent circumventing restrictions on removing user groups w...

2017-01-31 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335217 )

Change subject: Prevent circumventing restrictions on removing user groups with 
expiries
..

Prevent circumventing restrictions on removing user groups with expiries

I hadn't thought through what happens if a user has permission to add but
not remove a user group, or vice versa. This cleans up the UI logic,
showing controls that are available to users and vice versa, and the data
validation as well.

In particular, if user B can add users to the 'sysop' group but not remove
them from it, and user X is a sysop expiring in 1 year, user B should not
be allowed to modify the expiry to 1 second (which has the same effect as
removing the group). With this patch, user B can only extend user X's
membership of group A; they can no longer bring forward the expiry date.

I'm omitting this check from the API on purpose. The API's validation
of the expiry dates seems to be there solely to reject bogus/invalid data.
Notably, the API doesn't throw an error when the user passes a group that
they can't add or remove.

Bug: T156784
Change-Id: I0c0dadc2035c0cdf19accd5a97f08e33151a08ba
---
M includes/specials/SpecialUserrights.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 58 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/335217/1

diff --git a/includes/specials/SpecialUserrights.php 
b/includes/specials/SpecialUserrights.php
index b0808f6..e4d0b84 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -257,6 +257,7 @@
$addgroup = [];
$groupExpiries = []; // associative array of (group name => 
expiry)
$removegroup = [];
+   $existingUGMs = $user->getGroupMemberships();
 
// This could possibly create a highly unlikely race condition 
if permissions are changed between
//  when the form is loaded and when the form is saved. 
Ignoring it for the moment.
@@ -269,12 +270,14 @@
if ( $this->canProcessExpiries() ) {
// read the expiry information from the 
request
$expiryDropdown = 
$this->getRequest()->getVal( "wpExpiry-$group" );
+   if ( $expiryDropdown === 'existing' ) {
+   continue;
+   }
+
if ( $expiryDropdown === 'other' ) {
$expiryValue = 
$this->getRequest()->getVal( "wpExpiry-$group-other" );
-   } elseif ( $expiryDropdown !== 
'existing' ) {
-   $expiryValue = $expiryDropdown;
} else {
-   continue;
+   $expiryValue = $expiryDropdown;
}
 
// validate the expiry
@@ -288,6 +291,16 @@
if ( $groupExpiries[$group] && 
$groupExpiries[$group] < wfTimestampNow() ) {
return Status::newFatal( 
'userrights-expiry-in-past', $group );
}
+
+   // if the user can only add this group 
(not remove it), the expiry time
+   // cannot be brought forward (T156784)
+   if ( !$this->canRemove( $group ) &&
+   isset( $existingUGMs[$group] ) 
&&
+   
$existingUGMs[$group]->getExpiry() &&
+   
$existingUGMs[$group]->getExpiry() > $groupExpiries[$group]
+   ) {
+   return Status::newFatal( 
'userrights-cannot-shorten-expiry', $group );
+   }
}
} else {
$removegroup[] = $group;
@@ -300,7 +313,8 @@
}
 
/**
-* Save user groups changes in the database.
+* Save user groups changes in the database. This function does not 
throw errors;
+* instead, it ignores groups that the performer does not have 
permission to set.
 *
 * @param User|UserRightsProxy $user
 * @param array $add Array of groups to add
@@ -317,6 +331,7 @@
// Validate input set...
$isself = $user->getName() == $this->getUser()->getName();
$groups = $us

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Don't return expired user groups in UserRightsProxy

2017-01-31 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335205 )

Change subject: Don't return expired user groups in UserRightsProxy
..

Don't return expired user groups in UserRightsProxy

Also add a missing type hint in UserGroupMembership.

Bug: T156779
Change-Id: Ica31541f59115db3db92de82592e6a9422082bba
---
M includes/user/UserGroupMembership.php
M includes/user/UserRightsProxy.php
2 files changed, 3 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/335205/1

diff --git a/includes/user/UserGroupMembership.php 
b/includes/user/UserGroupMembership.php
index bb0b7d2..59ca31c 100644
--- a/includes/user/UserGroupMembership.php
+++ b/includes/user/UserGroupMembership.php
@@ -313,7 +313,7 @@
 * @param IDatabase|null $db Optional database connection
 * @return array Associative array of (group name => 
UserGroupMembership object)
 */
-   public static function getMembershipsForUser( $userId, $db = null ) {
+   public static function getMembershipsForUser( $userId, IDatabase $db = 
null ) {
if ( !$db ) {
$db = wfGetDB( DB_REPLICA );
}
diff --git a/includes/user/UserRightsProxy.php 
b/includes/user/UserRightsProxy.php
index 23c2177..d801fa0 100644
--- a/includes/user/UserRightsProxy.php
+++ b/includes/user/UserRightsProxy.php
@@ -198,15 +198,7 @@
 * @return array
 */
function getGroups() {
-   $res = $this->db->select( 'user_groups',
-   [ 'ug_group' ],
-   [ 'ug_user' => $this->id ],
-   __METHOD__ );
-   $groups = [];
-   foreach ( $res as $row ) {
-   $groups[] = $row->ug_group;
-   }
-   return $groups;
+   return array_keys( self::getGroupMemberships() );
}
 
/**
@@ -216,15 +208,7 @@
 * @since 1.29
 */
function getGroupMemberships() {
-   $res = $this->db->select( 'user_groups',
-   UserGroupMembership::selectFields(),
-   [ 'ug_user' => $this->id ],
-   __METHOD__ );
-   $ugms = [];
-   foreach ( $res as $row ) {
-   $ugms[$row->ug_group] = 
UserGroupMembership::newFromRow( $row );
-   }
-   return $ugms;
+   return UserGroupMembership::getMembershipsForUser( $this->id, 
$this->db );
}
 
/**

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...timeline[master]: Include article name in Ploticus error messages

2017-01-30 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335038 )

Change subject: Include article name in Ploticus error messages
..

Include article name in Ploticus error messages

Bug: T138036
Change-Id: Ie3136a6ddcf5f247df09db61986c05b10e7e0a34
---
M EasyTimeline.pl
M Timeline.body.php
2 files changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/timeline 
refs/changes/38/335038/1

diff --git a/EasyTimeline.pl b/EasyTimeline.pl
index a4dcb00..8390de3 100755
--- a/EasyTimeline.pl
+++ b/EasyTimeline.pl
@@ -113,6 +113,7 @@
 my $ploticus_command;
 my $articlepath;
 my $font_file;
+my $page_title;
 
 my $true  = 1;
 my $false = 0;
@@ -283,6 +284,9 @@
 
 # For MediaWiki: Path of an article, relative to this servers root
 $articlepath = $options{"A"};
+
+# For MediaWiki: Title of the page on which the timeline is being parsed
+$page_title = $options{"N"};
 
 # font to use. Must be in environemnt variable
 # GDFONTPATH unless builtin "ascii" font
@@ -3940,6 +3944,11 @@
 
 print "Running Ploticus to generate svg file $file_vector\n";
 
+my $errmsgpre = "";
+if ($page_title ne "") {
+$errmsgpre = " -errmsgpre '" . EscapeShellArg($page_title) . "'";
+}
+
 my $escaped_font_file = EscapeShellArg($font_file);
 my $cmd =
   EscapeShellArg($pl)
@@ -3948,7 +3957,8 @@
 . EscapeShellArg($file_script)
 . " -tightcrop"
 . " -font '$escaped_font_file'"
-. " -xml_encoding UTF-8";
+. " -xml_encoding UTF-8"
+. $errmsgpre;
 print "$cmd\n";
 system($cmd);
 
@@ -3993,7 +4003,8 @@
 . EscapeShellArg($file_bitmap) . " "
 . EscapeShellArg($file_script)
 . " -tightcrop -font "
-. EscapeShellArg($font_file);
+. EscapeShellArg($font_file)
+. $errmsgpre;
 print "$cmd\n";
 system($cmd);
 
diff --git a/Timeline.body.php b/Timeline.body.php
index 8cc9519..2ecd4c7 100644
--- a/Timeline.body.php
+++ b/Timeline.body.php
@@ -93,7 +93,8 @@
. " -m -P " . wfEscapeShellArg( 
$wgTimelinePloticusCommand )
. " -T " . wfEscapeShellArg( 
$wgTmpDirectory )
. " -A " . wfEscapeShellArg( 
$wgArticlePath )
-   . " -f " . wfEscapeShellArg( 
$wgTimelineFontFile );
+   . " -f " . wfEscapeShellArg( 
$wgTimelineFontFile )
+   . " -N " . wfEscapeShellArg( 
$parser->getTitle()->getPrefixedText() );
 
// Actually run the command...
wfDebug( "Timeline cmd: $cmdline\n" );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3136a6ddcf5f247df09db61986c05b10e7e0a34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/timeline
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make user_groups queries honor $wgDisableUserGroupExpiry

2017-01-30 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335026 )

Change subject: Make user_groups queries honor $wgDisableUserGroupExpiry
..

Make user_groups queries honor $wgDisableUserGroupExpiry

Follow-up to Icf78cce3f3e362677d10897b8d1103b3df91fa08.

Change-Id: I94102ceb00398940965280d8742a2747631dcc87
---
M includes/SiteStats.php
M includes/api/ApiQueryAllImages.php
M includes/api/ApiQueryAllUsers.php
M includes/api/ApiQueryContributors.php
M includes/api/ApiQueryUsers.php
M includes/specials/pagers/ActiveUsersPager.php
M includes/specials/pagers/ContribsPager.php
M includes/specials/pagers/NewFilesPager.php
M includes/specials/pagers/UsersPager.php
9 files changed, 30 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/335026/1

diff --git a/includes/SiteStats.php b/includes/SiteStats.php
index 42b080f..105a581 100644
--- a/includes/SiteStats.php
+++ b/includes/SiteStats.php
@@ -186,6 +186,7 @@
wfMemcKey( 'SiteStats', 'groupcounts', $group ),
$cache::TTL_HOUR,
function ( $oldValue, &$ttl, array &$setOpts ) use ( 
$group ) {
+   global $wgDisableUserGroupExpiry;
$dbr = wfGetDB( DB_REPLICA );
 
$setOpts += Database::getCacheSetOptions( $dbr 
);
@@ -195,7 +196,9 @@
'COUNT(*)',
[
'ug_group' => $group,
-   'ug_expiry IS NULL OR ug_expiry 
>= ' . $dbr->addQuotes( $dbr->timestamp() )
+   $wgDisableUserGroupExpiry ?
+   '1' :
+   'ug_expiry IS NULL OR 
ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
],
__METHOD__
);
diff --git a/includes/api/ApiQueryAllImages.php 
b/includes/api/ApiQueryAllImages.php
index 22561a9..ef6bb6a 100644
--- a/includes/api/ApiQueryAllImages.php
+++ b/includes/api/ApiQueryAllImages.php
@@ -198,7 +198,9 @@
[
'ug_group' => 
User::getGroupsWithPermission( 'bot' ),
'ug_user = img_user',
-   'ug_expiry IS NULL OR ug_expiry 
>=' . $db->addQuotes( $db->timestamp() )
+   $this->getConfig()->get( 
'DisableUserGroupExpiry' ) ?
+   '1' :
+   'ug_expiry IS NULL OR 
ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
]
] ] );
$groupCond = ( $params['filterbots'] == 
'nobots' ? 'NULL' : 'NOT NULL' );
diff --git a/includes/api/ApiQueryAllUsers.php 
b/includes/api/ApiQueryAllUsers.php
index 3faccf9..1c3b171 100644
--- a/includes/api/ApiQueryAllUsers.php
+++ b/includes/api/ApiQueryAllUsers.php
@@ -122,7 +122,9 @@
[
'ug1.ug_user=user_id',
'ug1.ug_group' => 
$params['group'],
-   'ug1.ug_expiry IS NULL OR 
ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+   $this->getConfig()->get( 
'DisableUserGroupExpiry' ) ?
+   '1' :
+   'ug1.ug_expiry IS NULL 
OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
]
]
] );
diff --git a/includes/api/ApiQueryContributors.php 
b/includes/api/ApiQueryContributors.php
index 89fffd6..148e315 100644
--- a/includes/api/ApiQueryContributors.php
+++ b/includes/api/ApiQueryContributors.php
@@ -163,7 +163,9 @@
[
'ug_user=rev_user',
'ug_group' => $limitGroups,
-   'ug_expiry IS NULL OR ug_expiry >= ' . 
$db->addQuotes( $db->timestamp() )
+   $this->getConfig()->get( 
'DisableUserGroupExpiry' ) ?
+   '1' :
+   'ug_expiry IS NULL OR ug_expiry 
>= ' . $db->addQuotes( $db->timestamp() )
]
   

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Add missing API documentation strings on subclasses

2017-01-27 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334735 )

Change subject: Add missing API documentation strings on subclasses
..

Add missing API documentation strings on subclasses

Follow-up from core change I93c955dc7a970f78e32aa503c01c67da30971d1a
to fix failing tests.

Change-Id: I67eee8a468b1a5d046d64490efdccdaad82b9291
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/35/334735/2

diff --git a/i18n/en.json b/i18n/en.json
index b9eba11..9ff7774 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -508,6 +508,7 @@
"apihelp-globaluserrights-param-user": "Global user name.",
"apihelp-globaluserrights-param-userid": "Global user ID.",
"apihelp-globaluserrights-param-add": "Add the user to these global 
groups.",
+   "apihelp-globaluserrights-param-expiry": "This parameter is currently 
unused.",
"apihelp-globaluserrights-param-remove": "Remove the user from these 
global groups.",
"apihelp-globaluserrights-param-reason": "Reason for the change.",
"apihelp-globaluserrights-param-tags": "This parameter is currently 
unused.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4ebc5b9..fe43f77 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -524,6 +524,7 @@
"apihelp-globaluserrights-param-user": 
"{{doc-apihelp-param|globaluserrights|user}}",
"apihelp-globaluserrights-param-userid": 
"{{doc-apihelp-param|globaluserrights|userid}}",
"apihelp-globaluserrights-param-add": 
"{{doc-apihelp-param|globaluserrights|add}}",
+   "apihelp-globaluserrights-param-expiry": 
"{{doc-apihelp-param|globaluserrights|expiry}}",
"apihelp-globaluserrights-param-remove": 
"{{doc-apihelp-param|globaluserrights|remove}}",
"apihelp-globaluserrights-param-reason": 
"{{doc-apihelp-param|globaluserrights|reason}}",
"apihelp-globaluserrights-param-tags": 
"{{doc-apihelp-param|globaluserrights|tags}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67eee8a468b1a5d046d64490efdccdaad82b9291
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: TTO 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable expiring user groups on beta

2017-01-24 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333652 )

Change subject: Enable expiring user groups on beta
..

Enable expiring user groups on beta

Change-Id: Ib33c85ee9988d30ca9e2a0e4558c30ad0967363f
---
M wmf-config/InitialiseSettings-labs.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/52/333652/2

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 718bc92..52f6f51 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -261,7 +261,7 @@
],
 
'-wgDisableUserGroupExpiry' => [
-   'default' => true,
+   'default' => false,
],
 
///

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib33c85ee9988d30ca9e2a0e4558c30ad0967363f
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO 
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]: New maintenance script to recalculate category membership co...

2017-01-24 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333917 )

Change subject: New maintenance script to recalculate category membership counts
..

New maintenance script to recalculate category membership counts

The category membership counts stored in the category table have a habit of
drifting away from the actual number of pages in the category. This script
refreshes incorrect counts by selecting those rows where the counts do not
match the number of relevant categorylinks, and issuing an UPDATE...SELECT
query to update those counts directly on the master DB (thereby avoiding
locking issues).

The script seems to run quickly on all but the very largest wikis.

Bug: T18765
Change-Id: I555f068fbf3aee20a7775d5532781f421f706346
---
M autoload.php
A maintenance/recountCategories.php
2 files changed, 152 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/333917/1

diff --git a/autoload.php b/autoload.php
index 7ed08df..d7624fb 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1167,6 +1167,7 @@
'RecentChange' => __DIR__ . '/includes/changes/RecentChange.php',
'RecentChangesUpdateJob' => __DIR__ . 
'/includes/jobqueue/jobs/RecentChangesUpdateJob.php',
'RecompressTracked' => __DIR__ . 
'/maintenance/storage/recompressTracked.php',
+   'RecountCategories' => __DIR__ . '/maintenance/recountCategories.php',
'RedirectSpecialArticle' => __DIR__ . 
'/includes/specialpage/RedirectSpecialPage.php',
'RedirectSpecialPage' => __DIR__ . 
'/includes/specialpage/RedirectSpecialPage.php',
'RedisBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/RedisBagOStuff.php',
diff --git a/maintenance/recountCategories.php 
b/maintenance/recountCategories.php
new file mode 100644
index 000..5b01404
--- /dev/null
+++ b/maintenance/recountCategories.php
@@ -0,0 +1,151 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * Maintenance script that refreshes category membership counts in the category
+ * table.
+ *
+ * (The populateCategory.php script will also recalculate counts, but
+ * recountCategories only updates rows that need to be updated, making it more
+ * efficient.)
+ *
+ * @ingroup Maintenance
+ */
+class RecountCategories extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this->addDescription( <<<'TEXT'
+This script refreshes the category membership counts stored in the category
+table. As time passes, these counts often drift from the actual number of
+category members. The script identifies rows where the value in the category
+table does not match the number of categorylinks rows for that category, and
+updates the category table accordingly.
+TEXT
+   );
+   $this->addOption(
+   'mode',
+   '(REQUIRED) Which category count column to recompute: 
"pages", "subcats" or "files".',
+   true,
+   true
+   );
+   $this->addOption(
+   'begin',
+   'Only recount categories with cat_id greater than the 
given value',
+   false,
+   true
+   );
+   $this->addOption(
+   'throttle',
+   'Wait this many milliseconds after each batch. Default: 
0',
+   false,
+   true
+   );
+
+   $this->setBatchSize( 500 );
+   }
+
+   public function execute() {
+   $this->mode = $this->getOption( 'mode' );
+   if ( !in_array( $this->mode, [ 'pages', 'subcats', 'files' ] ) 
) {
+   $this->error( 'Please specify a valid mode: one of 
"pages", "subcats" or "files".', 1 );
+   }
+
+   $this->minimumId = intval( $this->getOption( 'begin', 0 ) );
+
+   // do the work, batch by batch
+   $affectedRows = 0;
+   while ( ( $result = $this->doWork() ) !== false ) {
+   $affectedRows += $result;
+   wfWaitForSlaves();
+   usleep( $this->getOption( 'throttle', 0 ) * 1000 );
+   }
+
+   $this->output( "Done! Updated the {$this->mode} counts of 
$affectedRows categories.\n" .
+   "Now run the script using the other --mode options if 
you haven't already.\n" );
+   if ( $this->mode === 'pages' ) {
+   $this->output(
+   "Also run 'php cleanupEmptyCategories.php 
--mode remove' to remove empty,\n" .
+   "nonexistent categories from the category 
table.\n\n" );
+   }
+  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: New maintenance script to clean up rows with invalid DB keys

2017-01-22 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333486 )

Change subject: New maintenance script to clean up rows with invalid DB keys
..

New maintenance script to clean up rows with invalid DB keys

The TitleValue constructor, used by the link cache among other things,
throws an exception for DB keys which do not satisfy a simple sanity test
(starting or ending with _, or containing a space, tab, CR or LF
character). This has broken certain special pages on a number of WMF sites;
see T99736, T146778 and T155091.

The new cleanupInvalidDbKeys.php script allows these bogus entries to be
removed from the DB, making sure these exceptions won't be thrown in the
future. It cleans the title columns of the page, archive, redirect,
logging, category, protected_titles, recentchanges, watchlist, pagelinks,
templatelinks, and categorylinks tables.

The script doesn't support batching; most wikis should have fewer than 500
of broken entries in each table. If need be, the script can be run several
times.

Bug: T155091
Change-Id: I908e795e884e35be91852c0eaf056d6acfda31d8
---
M autoload.php
A maintenance/cleanupInvalidDbKeys.php
2 files changed, 327 insertions(+), 0 deletions(-)


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

diff --git a/autoload.php b/autoload.php
index 7ed08df..81ed7f1 100644
--- a/autoload.php
+++ b/autoload.php
@@ -252,6 +252,7 @@
'CleanupAncientTables' => __DIR__ . 
'/maintenance/cleanupAncientTables.php',
'CleanupBlocks' => __DIR__ . '/maintenance/cleanupBlocks.php',
'CleanupEmptyCategories' => __DIR__ . 
'/maintenance/cleanupEmptyCategories.php',
+   'CleanupInvalidDbKeys' => __DIR__ . 
'/maintenance/cleanupInvalidDbKeys.php',
'CleanupPreferences' => __DIR__ . '/maintenance/cleanupPreferences.php',
'CleanupRemovedModules' => __DIR__ . 
'/maintenance/cleanupRemovedModules.php',
'CleanupSpam' => __DIR__ . '/maintenance/cleanupSpam.php',
diff --git a/maintenance/cleanupInvalidDbKeys.php 
b/maintenance/cleanupInvalidDbKeys.php
new file mode 100644
index 000..39c57c9
--- /dev/null
+++ b/maintenance/cleanupInvalidDbKeys.php
@@ -0,0 +1,326 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * Maintenance script that cleans up invalid titles in various tables.
+ *
+ * @ingroup Maintenance
+ */
+class CleanupInvalidDbKeys extends Maintenance {
+   /** @var resource */
+   protected $reportFile;
+
+   /** @var array List of tables to clean up, and the field prefix for 
that table */
+   protected static $tables = [
+   // Data tables
+   [ 'page', 'page' ],
+   [ 'redirect', 'rd', 'idField' => 'rd_from' ],
+   [ 'archive', 'ar' ],
+   [ 'logging', 'log' ],
+   [ 'protected_titles', 'pt', 'idField' => 0 ],
+   [ 'category', 'cat', 'nsField' => 14 ],
+   [ 'recentchanges', 'rc' ],
+   [ 'watchlist', 'wl' ],
+   // The querycache tables' qc(c)_title and qcc_titletwo may 
contain titles,
+   // but also usernames or other things like that, so we leave 
them alone
+
+   // Links tables
+   [ 'pagelinks', 'pl', 'idField' => 'pl_from' ],
+   [ 'templatelinks', 'tl', 'idField' => 'tl_from' ],
+   [ 'categorylinks', 'cl', 'idField' => 'cl_from', 'nsField' => 
14, 'titleField' => 'cl_to' ],
+   ];
+
+   public function __construct() {
+   parent::__construct();
+   $this->addDescription( <<<'TEXT'
+This script cleans up the title fields in various tables to remove entries that
+will be rejected by the constructor of TitleValue.  This constructor throws an
+exception when invalid data is encountered, which will not normally occur on
+regular page views, but can happen on query special pages.
+
+The script targets titles matching the regular expression /^_|[ \r\n\t]|_$/.
+Because any foreign key relationships involving these titles will already be
+broken, the titles are corrected to a valid version or the rows are deleted
+entirely, depending on the table.
+TEXT
+   );
+   $this->addOption( 'fix', 'Actually clean up invalid titles. If 
this parameter is ' .
+   'not specified, the script will report invalid titles 
but not clean them up.',
+   false, false );
+   // We require a log file to write to. The script can output a 
lot of stuff,
+   // and it is unrecoverable if it scrolls off the top of your 
console or if you
+   // forget to specify the parameter.
+   $this->addOption( 'report-file', '(REQUIRED) File to which a 
log of all actions ' .
+   'will be written', true, true );
+   

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Temporarily set $wgDisableUserGroupExpiry to true on labs

2017-01-21 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333476 )

Change subject: Temporarily set $wgDisableUserGroupExpiry to true on labs
..

Temporarily set $wgDisableUserGroupExpiry to true on labs

Per discussion at https://gerrit.wikimedia.org/r/328377.

Change-Id: Id825e77495c530464982b76fe1dc156dc198ee67
---
M wmf-config/InitialiseSettings-labs.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/76/333476/2

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 52f6f51..718bc92 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -261,7 +261,7 @@
],
 
'-wgDisableUserGroupExpiry' => [
-   'default' => false,
+   'default' => true,
],
 
///

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id825e77495c530464982b76fe1dc156dc198ee67
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix typo in README

2017-01-20 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/24 )

Change subject: Fix typo in README
..

Fix typo in README

Change-Id: If32667e5e41d924f14ad803c470a21cd54f3f17b
---
M README
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/24/2

diff --git a/README b/README
index 6d3ab80..ad9b9d9 100644
--- a/README
+++ b/README
@@ -19,7 +19,7 @@
 * Ready to get started?
 ** https://www.mediawiki.org/wiki/Special:MyLanguage/Download
 * Looking for the technical manual?
-** https://www.mediawiki.org/wiki/Special:MyLangyage/Manual:Contents
+** https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents
 * Seeking help from a person?
 ** https://www.mediawiki.org/wiki/Special:MyLanguage/Communication
 * Looking to file a bug report or a feature request?

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If32667e5e41d924f14ad803c470a21cd54f3f17b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Further updates to .mailmap for the generation of CREDITS

2017-01-17 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332722 )

Change subject: Further updates to .mailmap for the generation of CREDITS
..

Further updates to .mailmap for the generation of CREDITS

Mostly adding current and former WMF/WMDE employees, and a couple of
others, under the correct version of their full names.

Change-Id: I36ca297967125cc211705509466358d9d762e5c8
---
M .mailmap
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/332722/3

diff --git a/.mailmap b/.mailmap
index 7aa3257..232824d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -209,6 +209,7 @@
 Jeff Hall  
 Jeff Hobson 
 Jeff Janes 
+Jeremy Baron 
 Jeremy Postlethwaite  

 Jeroen De Dauw 
 Jeroen De Dauw  
@@ -217,6 +218,7 @@
 Jimmy Collins  
 Joel Sahleen 
 John Du Hart  
+John Erling Blad 
 Jon Harald Søby  
 Jon Robson 
 Jon Robson  
@@ -272,6 +274,7 @@
 Matt Johnston  
 Matthew Britton  
 Matthew Flaschen 
+Matthew Walker 
 Matthias Mullie 
 Matthias Mullie  
 Matěj Grabovský  
@@ -288,7 +291,6 @@
 MrBlueSky 
 MrBlueSky  
 Mukunda Modell 
-Mwalker 
 MZMcBride 
 nadeesha  
 Namit 
@@ -311,10 +313,12 @@
 Owen Davis 
 Owen Davis  
 paladox 
+Patricio Molina 
 Patrick Reilly 
 Patrick Reilly  
 Patrick Westerhoff 
 Paul Copperman  
+Peter Coombe 
 Peter Coti 
 Peter Potrowl  
 Petr Kadlec 
@@ -399,10 +403,10 @@
 Stephen Liang 
 Steve Sanbeg  
 Steven Roddis 
+Steven Walling 
 Subramanya Sastry 
 Sucheta Ghoshal 
 Sumit Asthana 
-Swalling 
 Thalia Chan 
 Thiemo Mättig (WMDE) 
 Thiemo Mättig (WMDE)  
@@ -420,7 +424,6 @@
 Timo Tijhof  
 Timo Tijhof  
 Tina Johnson 
-Tjones 
 Tom Maaswinkel  
 Tomasz Finc  
 Tomasz W. Kozlowski 
@@ -431,9 +434,11 @@
 Trevor Parscal 
 Trevor Parscal  
 Trevor Parscal  
+Trey Jones 
 Tyler Cipriani 
 Tyler Romeo 
 Umherirrender 
+Victor Barbu 
 Victor Vasiliev 
 Victor Vasiliev  
 Victor Vasiliev  

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36ca297967125cc211705509466358d9d762e5c8
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Set wgDisableUserGroupExpiry to true on production, false on...

2017-01-17 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332721 )

Change subject: Set wgDisableUserGroupExpiry to true on production, false on 
labs
..

Set wgDisableUserGroupExpiry to true on production, false on labs

This is a no-op until https://gerrit.wikimedia.org/r/328377 is merged.

Bug: T155605
Change-Id: Ie5774343cd776847f048d9d055b7dfc94a5b2d36
---
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
2 files changed, 8 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 9722d3c..52f6f51 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -260,6 +260,10 @@
'default' => false,
],
 
+   '-wgDisableUserGroupExpiry' => [
+   'default' => false,
+   ],
+
///
/// --- BetaFeatures start --
///
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 9fbdabc..65a911c 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -7442,6 +7442,10 @@
'testwiki' => true, // T150991
 ],
 
+'wgDisableUserGroupExpiry' => [
+   'default' => true,
+],
+
 # groupOverrides @{
 'groupOverrides' => [
// Note: don't change the default setting here, because it won't take

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove some ancient upgrade information from release notes

2017-01-16 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332422 )

Change subject: Remove some ancient upgrade information from release notes
..

Remove some ancient upgrade information from release notes

Also mention MariaDB.

Change-Id: Ia74974e3fec2b5df517ab81294eb06c75679e1cb
---
M RELEASE-NOTES-1.29
M UPGRADE
2 files changed, 14 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/332422/2

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index fac6f7e..9ddb11c 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -190,8 +190,8 @@
 MediaWiki 1.29 requires PHP 5.5.9 or later. There is experimental support for
 HHVM 3.6.5 or later.
 
-MySQL is the recommended DBMS. PostgreSQL or SQLite can also be used, but
-support for them is somewhat less mature. There is experimental support for
+MySQL/MariaDB is the recommended DBMS. PostgreSQL or SQLite can also be used,
+but support for them is somewhat less mature. There is experimental support for
 Oracle and Microsoft SQL Server.
 
 The supported versions are:
@@ -209,20 +209,10 @@
 table, the schema update may take quite long (minutes on a medium sized site,
 many hours on a large site).
 
-If upgrading from before 1.11, and you are using a wiki as a commons
-repository, make sure that it is updated as well. Otherwise, errors may arise
-due to database schema changes.
-
-If upgrading from before 1.7, you may want to run refreshLinks.php to ensure
-new database fields are filled with data.
-
-If you are upgrading from MediaWiki 1.4.x or earlier, you should upgrade to
-1.5 first. The upgrade script maintenance/upgrade1_5.php has been removed
-with MediaWiki 1.21.
-
 Don't forget to always back up your database before upgrading!
 
-See the file UPGRADE for more detailed upgrade instructions.
+See the file UPGRADE for more detailed upgrade instructions, including
+important information when upgrading from versions prior to 1.11.
 
 For notes on 1.28.x and older releases, see HISTORY.
 
diff --git a/UPGRADE b/UPGRADE
index 3ec1a22..0e6ad9b 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -109,6 +109,12 @@
 script.  This will update the searchindex table for those pages that
 contain double-byte latin characters.
 
+== Upgrading from 1.10 or earlier ==
+
+If upgrading from before 1.11, and you are using a wiki as a commons
+repository, make sure that it is updated as well. Otherwise, errors may arise
+due to database schema changes.
+
 == Upgrading from 1.8 or earlier ==
 
 MediaWiki 1.9 and later no longer keep default localized message text
@@ -135,6 +141,9 @@
 
 $wgLocalTZoffset was in hours, it is now using minutes.
 
+If upgrading from before 1.7, you may want to run refreshLinks.php to ensure
+new database fields are filled with data.
+
 == Upgrading from 1.5 or earlier ==
 
 Major changes have been made to the schema from 1.4.x. The updater
@@ -149,7 +158,7 @@
 'upgrade1_5.php', can do this -- run it prior to 'update.php' or
 the web upgrader.
 
-NOTE that upgrade1_5.php does not work properly with recent version
+NOTE that upgrade1_5.php does not work properly with recent versions
 of MediaWiki. If upgrading a 1.4.x wiki, you should upgrade to 1.5
 first.  upgrade1_5.php has been removed from MediaWiki 1.21.
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia74974e3fec2b5df517ab81294eb06c75679e1cb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 
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]: Fix broken variable inclusions in API unblock parameter docu...

2017-01-16 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332234 )

Change subject: Fix broken variable inclusions in API unblock parameter 
documentation
..

Fix broken variable inclusions in API unblock parameter documentation

Change-Id: I06bf55b3f7f0e05e059f648d92c0cb2d54255d18
---
M includes/api/i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/332234/2

diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index b2cecc9..c1fefd6 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -1398,8 +1398,8 @@
"apihelp-tokens-example-emailmove": "Retrieve an email token and a move 
token.",
 
"apihelp-unblock-description": "Unblock a user.",
-   "apihelp-unblock-param-id": "ID of the block to unblock (obtained 
through list=blocks). Cannot be used together with $1user 
or $luserid.",
-   "apihelp-unblock-param-user": "Username, IP address or IP address range 
to unblock. Cannot be used together with $1id or 
$luserid.",
+   "apihelp-unblock-param-id": "ID of the block to unblock (obtained 
through list=blocks). Cannot be used together with $1user 
or $1userid.",
+   "apihelp-unblock-param-user": "Username, IP address or IP address range 
to unblock. Cannot be used together with $1id or 
$1userid.",
"apihelp-unblock-param-userid": "User ID to unblock. Cannot be used 
together with $1id or $1user.",
"apihelp-unblock-param-reason": "Reason for unblock.",
"apihelp-unblock-param-tags": "Change tags to apply to the entry in the 
block log.",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06bf55b3f7f0e05e059f648d92c0cb2d54255d18
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...UIFeedback[master]: Insert the description of the change.

2017-01-15 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332126 )

Change subject: Insert the description of the change.
..

Insert the description of the change.

Change-Id: I0bfd27071482f69fe3f8e850d1eb1100403c9f06
---
R UIFeedback.php
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UIFeedback 
refs/changes/26/332126/2

diff --git a/UiFeedback.php b/UIFeedback.php
similarity index 100%
rename from UiFeedback.php
rename to UIFeedback.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bfd27071482f69fe3f8e850d1eb1100403c9f06
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UIFeedback
Gerrit-Branch: master
Gerrit-Owner: TTO 
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]: [WIP] Skip over bot-flagged and minor edits in the old-style...

2017-01-14 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332119 )

Change subject: [WIP] Skip over bot-flagged and minor edits in the old-style 
watchlist
..

[WIP] Skip over bot-flagged and minor edits in the old-style watchlist

Change-Id: I2e12c0869d5a942b0cecc60cd4ce3987a33c1773
---
M includes/changetags/ChangeTags.php
M includes/specialpage/ChangesListSpecialPage.php
M includes/specials/SpecialWatchlist.php
3 files changed, 105 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/332119/1

diff --git a/includes/changetags/ChangeTags.php 
b/includes/changetags/ChangeTags.php
index bfabd51..5869088 100644
--- a/includes/changetags/ChangeTags.php
+++ b/includes/changetags/ChangeTags.php
@@ -628,7 +628,8 @@
 * @throws MWException When unable to determine appropriate JOIN 
condition for tagging
 */
public static function modifyDisplayQuery( &$tables, &$fields, &$conds,
-   
&$join_conds, &$options, $filter_tag = false ) {
+   &$join_conds, &$options, $filter_tag = false ) {
+
global $wgRequest, $wgUseTagFilter;
 
if ( $filter_tag === false ) {
@@ -636,18 +637,20 @@
}
 
// Figure out which conditions can be done.
-   if ( in_array( 'recentchanges', $tables ) ) {
-   $join_cond = 'ct_rc_id=rc_id';
-   } elseif ( in_array( 'logging', $tables ) ) {
-   $join_cond = 'ct_log_id=log_id';
-   } elseif ( in_array( 'revision', $tables ) ) {
-   $join_cond = 'ct_rev_id=rev_id';
-   } elseif ( in_array( 'archive', $tables ) ) {
-   $join_cond = 'ct_rev_id=ar_rev_id';
+   if ( ( $alias = array_search( 'recentchanges', $tables ) ) !== 
false ) {
+   $join_cond = 'ct_rc_id = ' . ( is_string( $alias ) ? 
"$alias.rc_id" : 'rc_id' );
+   } elseif ( ( $alias = array_search( 'logging', $tables ) ) !== 
false ) {
+   $join_cond = 'ct_log_id = ' . ( is_string( $alias ) ? 
"$alias.log_id" : 'log_id' );
+   } elseif ( ( $alias = array_search( 'revision', $tables ) ) !== 
false ) {
+   $join_cond = 'ct_rev_id = ' . ( is_string( $alias ) ? 
"$alias.rev_id" : 'rev_id' );
+   } elseif ( ( $alias = array_search( 'archive', $tables ) ) !== 
false ) {
+   $join_cond = 'ct_rev_id = ' . ( is_string( $alias ) ? 
"$alias.ar_rev_id" : 'ar_rev_id' );
} else {
throw new MWException( 'Unable to determine appropriate 
JOIN condition for tagging.' );
}
 
+   // @todo Why does this use a GROUP_CONCAT when we have the 
tag_summary table
+   // precisely to avoid this?
$fields['ts_tags'] = wfGetDB( DB_REPLICA 
)->buildGroupConcatField(
',', 'change_tag', 'ct_tag', $join_cond
);
diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index 00efeae..79457d0 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -215,12 +215,15 @@
 * Return an array of conditions depending of options set in $opts
 *
 * @param FormOptions $opts
+* @param string $tableAlias The alias to use for the recentchanges 
table
 * @return array
 */
-   public function buildMainQueryConds( FormOptions $opts ) {
+   public function buildMainQueryConds( FormOptions $opts, $tableAlias = 
null ) {
$dbr = $this->getDB();
$user = $this->getUser();
$conds = [];
+
+   $alias = ( $tableAlias ? "$tableAlias." : '' );
 
// It makes no sense to hide both anons and logged-in users. 
When this occurs, try a guess on
// what the user meant and either show only bots or force anons 
to be shown.
@@ -236,64 +239,64 @@
 
// Toggles
if ( $opts['hideminor'] ) {
-   $conds[] = 'rc_minor = 0';
+   $conds["{$alias}rc_minor"] = 0;
}
if ( $opts['hidemajor'] ) {
-   $conds[] = 'rc_minor = 1';
+   $conds[] = "{$alias}rc_minor = 1";
}
if ( $opts['hidebots'] ) {
-   $conds['rc_bot'] = 0;
+   $conds["{$alias}rc_bot"] = 0;
}
if ( $opts['hidehumans'] ) {
-   $conds[] = 'rc_bot = 1';
+   $conds[] = "{$alias}rc_bot = 1";
}
if ( $user->useRCPa

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow CJK languages to specify flag spacing for enhanced cha...

2017-01-14 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332031 )

Change subject: Allow CJK languages to specify flag spacing for enhanced change 
lists
..

Allow CJK languages to specify flag spacing for enhanced change lists

Even in a monospaced font, the width of a regular space (U+0020) is not the
same as the width of a CJK character. This causes enhanced changes lists,
like RecentChanges, to appear jagged/misaligned, because the different
flag markers at the beginning of each line do not align.

This change gives CJK languages the opportunity to specify a custom space
character to use for aligning the flags.

The $nothing parameter to ChangesList::recentChangesFlags is set to '' in
a few extensions, but other than that it is not used, so it is safe to
change it to a boolean.

Bug: T135575
Change-Id: I4ddc1499ee18320e645c935806b44e2226ef5ab4
---
M includes/DefaultSettings.php
M includes/changes/ChangesList.php
M includes/changes/OldChangesList.php
M languages/i18n/en.json
M languages/i18n/qqq.json
5 files changed, 40 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/31/332031/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 856a3f9..6193503 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6802,6 +6802,9 @@
  * $wgRecentChangesFlags['flag'] => [
  *   // message for the letter displayed next to rows on changes lists
  *   'letter' => 'letter-msg',
+ *   // message for the space displayed in the corresponding "column" in
+ *   // change rows which do not have this flag
+ *   'space' => 'space-msg',
  *   // message for the tooltip of the letter
  *   'title' => 'tooltip-msg',
  *   // optional (defaults to 'tooltip-msg'), message to use in the legend box
@@ -6820,12 +6823,14 @@
 $wgRecentChangesFlags = [
'newpage' => [
'letter' => 'newpageletter',
+   'space' => 'newpagespace',
'title' => 'recentchanges-label-newpage',
'legend' => 'recentchanges-legend-newpage',
'grouping' => 'any',
],
'minor' => [
'letter' => 'minoreditletter',
+   'space' => 'minoreditspace',
'title' => 'recentchanges-label-minor',
'legend' => 'recentchanges-legend-minor',
'class' => 'minoredit',
@@ -6833,6 +6838,7 @@
],
'bot' => [
'letter' => 'boteditletter',
+   'space' => 'boteditspace',
'title' => 'recentchanges-label-bot',
'legend' => 'recentchanges-legend-bot',
'class' => 'botedit',
@@ -6840,6 +6846,7 @@
],
'unpatrolled' => [
'letter' => 'unpatrolledletter',
+   'space' => 'unpatrolledspace',
'title' => 'recentchanges-label-unpatrolled',
'legend' => 'recentchanges-legend-unpatrolled',
'grouping' => 'any',
diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index 77038ed..6949b9b 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -132,16 +132,19 @@
 
/**
 * Returns the appropriate flags for new page, minor change and 
patrolling
+*
 * @param array $flags Associative array of 'flag' => Bool
-* @param string $nothing To use for empty space
+* @param bool $blanksAsSpaces Set to false for no blanks between 
flags. This
+*   parameter was a string before 1.29, so some callers set it to an 
empty
+*   string for the same effect as passing false.
 * @return string
 */
-   public function recentChangesFlags( $flags, $nothing = ' ' ) {
+   public function recentChangesFlags( $flags, $blanksAsSpaces = true ) {
$f = '';
foreach ( array_keys( $this->getConfig()->get( 
'RecentChangesFlags' ) ) as $flag ) {
-   $f .= isset( $flags[$flag] ) && $flags[$flag]
-   ? self::flag( $flag, $this->getContext() )
-   : $nothing;
+   if ( $blanksAsSpaces || ( isset( $flags[$flag] ) && 
$flags[$flag] ) ) {
+   $f .= self::flag( $flag, $this->getContext(), 
isset( $flags[$flag] ) && $flags[$flag] );
+   }
}
 
return $f;
@@ -176,14 +179,17 @@
}
 
/**
-* Make an "" element for a given change flag. The flag 
indicating a new page, minor edit,
-* bot edit, or unpatrolled edit. In English it typically contains "N", 
"m", "b", or "!".
+* Make an "" element for a given change. The flag indicating a 
new page,
+* minor edit, bot edit, or unpatrolled edit. In English it typically 
contains
+* "N", 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Increase $wgHTTPImportTimeout to 50 seconds

2017-01-12 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331946 )

Change subject: Increase $wgHTTPImportTimeout to 50 seconds
..

Increase $wgHTTPImportTimeout to 50 seconds

Double the existing value of 25 seconds (inherited from MediaWiki's
default settings).

Bug: T155209
Change-Id: Ibcf3544273b4d7968296bd5cd45c492260c7e85f
---
M wmf-config/CommonSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/46/331946/2

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index a00a871..fc7e0e0 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1288,6 +1288,7 @@
 
 // For transwiki import
 ini_set( 'user_agent', 'Wikimedia internal server fetcher (n...@wikimedia.org' 
);
+$wgHTTPImportTimeout = 50; // T155209
 
 // CentralAuth
 if ( $wmgUseCentralAuth ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcf3544273b4d7968296bd5cd45c492260c7e85f
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO 
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]: Improved HTTP error reporting for the import process

2017-01-12 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331945 )

Change subject: Improved HTTP error reporting for the import process
..

Improved HTTP error reporting for the import process

Currently, whenever any kind of HTTP failure occurs, the message displayed
is "Could not open import file". This change gives users more information
about why the import failed, such as timed out, 403 error, host
unreachable, etc.

Bug: T155210
Change-Id: I2a18a4642769f0a7eb313c5c64ff298bd0b2b235
---
M includes/api/ApiImport.php
M includes/import/ImportStreamSource.php
M includes/specials/SpecialImport.php
M languages/i18n/en.json
M languages/i18n/qqq.json
5 files changed, 44 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/331945/1

diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index dffd6b2..539e789 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -61,6 +61,10 @@
$source = ImportStreamSource::newFromUpload( 'xml' );
}
if ( !$source->isOK() ) {
+   // transform HTTP errors and the like into 
'cantopenfile'
+   if ( $source->hasMessage( 'importcantdownload' ) ) {
+   $this->dieWithError( 
$source->value->getMessage(), 'cantopenfile' );
+   }
$this->dieStatus( $source );
}
 
diff --git a/includes/import/ImportStreamSource.php 
b/includes/import/ImportStreamSource.php
index 8034400..03b1779 100644
--- a/includes/import/ImportStreamSource.php
+++ b/includes/import/ImportStreamSource.php
@@ -24,6 +24,7 @@
  * @ingroup SpecialPage
  */
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Logger\LoggerFactory;
 
 /**
  * Imports a XML dump from a file (either from file upload, files on disk, or 
HTTP)
@@ -106,29 +107,41 @@
 */
static function newFromURL( $url, $method = 'GET' ) {
global $wgHTTPImportTimeout;
+
wfDebug( __METHOD__ . ": opening $url\n" );
-   # Use the standard HTTP fetch function; it times out
-   # quicker and sorts out user-agent problems which might
-   # otherwise prevent importing from large sites, such
-   # as the Wikimedia cluster, etc.
-   $data = Http::request(
-   $method,
+
+   // Use the standard HTTP request class; it times out quicker 
and sorts out
+   // user-agent problems which might otherwise prevent importing 
from large
+   // sites, such as the Wikimedia cluster.
+   $req = MWHttpRequest::factory(
$url,
[
+   'method' => $method,
'followRedirects' => true,
-   'timeout' => $wgHTTPImportTimeout
+   'timeout' => $wgHTTPImportTimeout,
+   'connectTimeout' => 'default'
],
-   __METHOD__
-   );
-   if ( $data !== false ) {
-   $file = tmpfile();
-   fwrite( $file, $data );
-   fflush( $file );
-   fseek( $file, 0 );
-   return Status::newGood( new ImportStreamSource( $file ) 
);
-   } else {
-   return Status::newFatal( 'importcantopen' );
+   __METHOD__ );
+   $status = $req->execute();
+
+   if ( !$status->isOK() ) {
+   $errors = $status->getErrorsByType( 'error' );
+
+   // Log the errors to the HTTP debug log
+   $logger = LoggerFactory::getInstance( 'http' );
+   $logger->warning( Status::wrap( $status )->getWikiText( 
false, false, 'en' ),
+   [ 'error' => $errors, 'caller' => __METHOD__, 
'content' => $req->getContent() ] );
+
+   $result = Status::newFatal( 'importcantdownload' );
+   $result->value = $status;
+   return $result;
}
+
+   $file = tmpfile();
+   fwrite( $file, $req->getContent() );
+   fflush( $file );
+   fseek( $file, 0 );
+   return Status::newGood( new ImportStreamSource( $file ) );
}
 
/**
diff --git a/includes/specials/SpecialImport.php 
b/includes/specials/SpecialImport.php
index ce88624..60ead6f 100644
--- a/includes/specials/SpecialImport.php
+++ b/includes/specials/SpecialImport.php
@@ -176,8 +176,12 @@
 
$out = $this->getOutput();
if ( !$source->isGood() ) {
+   // Display the m

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix wrong syntax in release notes

2017-01-10 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331469 )

Change subject: Fix wrong syntax in release notes
..

Fix wrong syntax in release notes

Change-Id: I1ab89c7c8ddfe61287fc6d71698cdb4957cc0b04
---
M RELEASE-NOTES-1.29
1 file changed, 16 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/331469/2

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 8b10207..5824909 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -6,8 +6,8 @@
 production.
 
 === Configuration changes in 1.29 ===
-* Default cookie expiration time has been reduced to 30 days. Login cookie 
expiration time is
-  kept at 180 days.
+* Default cookie expiration time has been reduced to 30 days. Login cookie
+  expiration time is kept at 180 days.
 * A new configuration variable has been added: $wgCookieSetOnAutoblock. This
   determines whether to set a cookie when a user is autoblocked. Doing so means
   that a blocked user, even after logging out and moving to a new IP address,
@@ -22,15 +22,16 @@
   code for ApiBase::parseMsg() will no longer work.
 * ApiBase::$messageMap is no longer public. Code attempting to access it will
   result in a PHP fatal error.
-* $wgUserEmailUseReplyTo is now true by default to work around restrictive 
DMARC policies.
+* $wgUserEmailUseReplyTo is now true by default to work around restrictive 
DMARC
+  policies.
 * Subpages are now enabled by default in the Template namespace. Set
   $wgNamespacesWithSubpages[NS_TEMPLATE] to false to keep the old behavior.
 * $wgRunJobsAsync is now false by default (T142751). This change only affects
   wikis with $wgJobRunRate > 0.
 
 === New features in 1.29 ===
-* (T5233) A cookie can now be set when a user is autoblocked, to track that 
user if
-  they move to a new IP address. This is disabled by default.
+* (T5233) A cookie can now be set when a user is autoblocked, to track that 
user
+  if they move to a new IP address. This is disabled by default.
 * Added ILocalizedException interface to standardize the use of localized
   exceptions, largely so the API can handle them more sensibly.
 * Blocks created automatically by MediaWiki, such as for configured proxies or
@@ -143,7 +144,7 @@
 * Xml::escapeJsString() (deprecated in 1.21) was removed.
 * Article::getText() and Article::prepareTextForEdit() (deprecated in 1.21)
   were removed.
-* Article::getAutosummary() and WikiPage::getAutosummary (deprecated in 1.21)
+* Article::getAutosummary() and WikiPage::getAutosummary() (deprecated in 1.21)
   were removed.
 * Hooks ArticleViewCustom, EditPageGetDiffText and ShowRawCssJs (deprecated in 
1.21)
   were removed.
@@ -154,19 +155,19 @@
 * User::getPassword() (deprecated in 1.27) was removed.
 * User::getTemporaryPassword() (deprecated in 1.27) was removed.
 * User::isPasswordReminderThrottled() (deprecated in 1.27) was removed.
-* FSRepo (deprecated in 1.19) was removed.
+* Class FSRepo (deprecated in 1.19) was removed.
 * WebRequest::checkSessionCookie() (deprecated in 1.27) was removed. Use
-\MediaWiki\Session\SessionManager::singleton()->getPersistedSessionId() 
instead.
+  \MediaWiki\Session\SessionManager::singleton()->getPersistedSessionId() 
instead.
 * Class ImageGallery (deprecated in 1.22) was removed.
   Use ImageGalleryBase::factory instead.
 * Title::moveNoAuth() (deprecated in 1.25) was removed. Use MovePage class 
instead.
-* Hook UnknownAction (deprecated in 1.19) was actually deprecated (it will now 
emit warnings).
-  Create a subclass of Action, and add it to $wgActions instead.
-* WikiRevision:getText() (deprecated since 1.21) is no longer marked 
deprecated.
-* Linker:getInterwikiLinkAttributes (deprecated since 1.25) was removed.
-* Linker:getInternalLinkAttributes (deprecated since 1.25) was removed.
-* Linker:getInternalLinkAttributesObj (deprecated since 1.25) was removed.
-* Linker:getLinkAttributesInternal (deprecated since 1.25) was removed.
+* Hook UnknownAction (deprecated in 1.19) was actually deprecated (it will now
+  emit warnings). Create a subclass of Action and add it to $wgActions instead.
+* WikiRevision::getText() (deprecated since 1.21) is no longer marked 
deprecated.
+* Linker::getInterwikiLinkAttributes() (deprecated since 1.25) was removed.
+* Linker::getInternalLinkAttributes() (deprecated since 1.25) was removed.
+* Linker::getInternalLinkAttributesObj() (deprecated since 1.25) was removed.
+* Linker::getLinkAttributesInternal() (deprecated since 1.25) was removed.
 
 == Compatibility ==
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ab89c7c8ddfe61287fc6d71698cdb4957cc0b04
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 

___
MediaWiki-commits mai

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Arrange Special:Version/credits into columns and remove spac...

2017-01-10 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331468 )

Change subject: Arrange Special:Version/credits into columns and remove space 
at top
..

Arrange Special:Version/credits into columns and remove space at top

Make the long list of names more manageable and readable. Obviously some
browsers won't support unprefixed CSS column-width, but for a non-critical
feature on a low-importance page, I don't think it is a big deal.

Change-Id: I3bb5da73ecf0c46b77a675324dcd62c9c4ea60da
---
M CREDITS
M includes/specials/SpecialVersion.php
2 files changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/331468/1

diff --git a/CREDITS b/CREDITS
index d9ff970..b37edf2 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1,10 +1,9 @@
-{{int:version-credits-summary}}
-
-
+
+The following list can be found parsed under Special:Version/Credits -->
 
 == Contributors ==
 
diff --git a/includes/specials/SpecialVersion.php 
b/includes/specials/SpecialVersion.php
index 272f074..a70aa9b 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -81,6 +81,11 @@
$wikiText = '{{int:version-credits-not-found}}';
if ( $extName === 'MediaWiki' ) {
$wikiText = file_get_contents( $IP . 
'/CREDITS' );
+   // Put the contributor list into columns
+   $wikiText = str_replace(
+   [ '', '' ],
+   [ '', '' ],
+   $wikiText );
} elseif ( ( $extNode !== null ) && isset( 
$extNode['path'] ) ) {
$file = $this->getExtAuthorsFileName( 
dirname( $extNode['path'] ) );
if ( $file ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove cols and rows preferences

2017-01-09 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331245 )

Change subject: Remove cols and rows preferences
..

Remove cols and rows preferences

In https://gerrit.wikimedia.org/r/80061/, Chad was convinced this
preference is barely used and mostly set to weird values by people
who don't understand what they're doing.

He made some quick stats: http://p.defau.lt/?fgGU0StB4J9l0LC5GZq8AA

Used defaults of 80 columns and 25 rows in places that still
were asking for it. The old default values are left in
$wgDefaultUserOptions for now, since various extensions are
using them.

The 'rows' and 'columns' messages don't appear to be in use in
any extensions in Git, so I killed those as well.

(This is the same as I642188c74d929a586b1882a1cf8656056c4fcf5a.)

Bug: T26430
Change-Id: I6c9802bc4f9cf32fb75c3dd7b9e2dc18f271eedf
---
M includes/DefaultSettings.php
M includes/EditPage.php
M includes/Preferences.php
M includes/specials/SpecialUndelete.php
M includes/specials/SpecialUpload.php
M languages/i18n/en.json
M languages/i18n/qqq.json
M tests/phpunit/includes/user/UserTest.php
8 files changed, 13 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/331245/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index ffa5c21..856a3f9 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -4788,7 +4788,7 @@
  */
 $wgDefaultUserOptions = [
'ccmeonemails' => 0,
-   'cols' => 80,
+   'cols' => 80, // @deprecated since 1.29 No longer used in core
'date' => 'default',
'diffonly' => 0,
'disablemail' => 0,
@@ -4818,7 +4818,7 @@
'rcdays' => 7,
'rcenhancedfilters' => 0,
'rclimit' => 50,
-   'rows' => 25,
+   'rows' => 25, // @deprecated since 1.29 No longer used in core
'showhiddencats' => 0,
'shownumberswatching' => 1,
'showtoolbar' => 1,
diff --git a/includes/EditPage.php b/includes/EditPage.php
index acbd130..05fa366 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -4441,8 +4441,8 @@
$attribs = $customAttribs + [
'accesskey' => ',',
'id' => $name,
-   'cols' => $user->getIntOption( 'cols' ),
-   'rows' => $user->getIntOption( 'rows' ),
+   'cols' => 80,
+   'rows' => 25,
// Avoid PHP notices when appending preferences
// (appending allows customAttribs['style'] to 
still work).
'style' => ''
diff --git a/includes/Preferences.php b/includes/Preferences.php
index 263ff5b..89982a6 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -55,8 +55,6 @@
/** @var array */
protected static $saveFilters = [
'timecorrection' => [ 'Preferences', 'filterTimezoneInput' ],
-   'cols' => [ 'Preferences', 'filterIntval' ],
-   'rows' => [ 'Preferences', 'filterIntval' ],
'rclimit' => [ 'Preferences', 'filterIntval' ],
'wllimit' => [ 'Preferences', 'filterIntval' ],
'searchlimit' => [ 'Preferences', 'filterIntval' ],
@@ -817,20 +815,7 @@
]
];
}
-   $defaultPreferences['cols'] = [
-   'type' => 'int',
-   'label-message' => 'columns',
-   'section' => 'editing/editor',
-   'min' => 4,
-   'max' => 1000,
-   ];
-   $defaultPreferences['rows'] = [
-   'type' => 'int',
-   'label-message' => 'rows',
-   'section' => 'editing/editor',
-   'min' => 4,
-   'max' => 1000,
-   ];
+
if ( $user->isAllowed( 'minoredit' ) ) {
$defaultPreferences['minordefault'] = [
'type' => 'toggle',
@@ -838,6 +823,7 @@
'label-message' => 'tog-minordefault',
];
}
+
$defaultPreferences['forceeditsummary'] = [
'type' => 'toggle',
'section' => 'editing/editor',
diff --git a/includes/specials/SpecialUndelete.php 
b/includes/specials/SpecialUndelete.php
index 3d51842..4c6a593 100644
--- a/includes/specials/SpecialUndelete.php
+++ b/includes/specials/SpecialUndelete.php
@@ -1141,8 +1141,8 @@
'textarea',
[
'readonly' => 'readonly',
-  

[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: ApiReview: Make generic error conditionals actually reachable

2017-01-08 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331212 )

Change subject: ApiReview: Make generic error conditionals actually reachable
..

ApiReview: Make generic error conditionals actually reachable

These errors can be generated when approving and when unapproving, so
it didn't make sense to have them in an else block at the bottom where
they couldn't be reached.

Bug: T56817
Change-Id: I889011deef5686be1fd8bc132a49b75162ed1400
---
M api/actions/ApiReview.php
1 file changed, 13 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs 
refs/changes/12/331212/1

diff --git a/api/actions/ApiReview.php b/api/actions/ApiReview.php
index 6f3aa71..ad3b35c 100644
--- a/api/actions/ApiReview.php
+++ b/api/actions/ApiReview.php
@@ -113,6 +113,19 @@
if ( $status === true ) {
$this->getResult()->addValue(
null, $this->getModuleName(), array( 'result' 
=> 'Success' ) );
+   # Generic failures
+   } elseif ( $status === 'review_page_notexists' ) {
+   if ( is_callable( array( $this, 'dieWithError' ) ) ) {
+   $this->dieWithError( 
'apierror-flaggedrevs-pagedoesnotexist', 'notarget' );
+   } else {
+   $this->dieUsage( "Provided page does not 
exist.", 'notarget' );
+   }
+   } elseif ( $status === 'review_page_unreviewable' ) {
+   if ( is_callable( array( $this, 'dieWithError' ) ) ) {
+   $this->dieWithError( 
'apierror-flaggedrevs-notreviewable', 'notreviewable' );
+   } else {
+   $this->dieUsage( "Provided page is not 
reviewable.", 'notreviewable' );
+   }
# Approve-specific failures
} elseif ( $form->getAction() === 'approve' ) {
if ( $status === 'review_denied' ) {
@@ -177,21 +190,6 @@
$this->dieWithError( array( 
'apierror-unknownerror-nocode' ), 'unknownerror' );
} else {
$this->dieUsageMsg( array( 
'unknownerror', '' ) );
-   }
-   }
-   # Generic failures
-   } else {
-   if ( $status === 'review_page_unreviewable' ) {
-   if ( is_callable( array( $this, 'dieWithError' 
) ) ) {
-   $this->dieWithError( 
'apierror-flaggedrevs-notreviewable', 'notreviewable' );
-   } else {
-   $this->dieUsage( "Provided page is not 
reviewable.", 'notreviewable' );
-   }
-   } elseif ( $status === 'review_page_notexists' ) {
-   if ( is_callable( array( $this, 'dieWithError' 
) ) ) {
-   $this->dieWithError( 
'apierror-flaggedrevs-pagedoesnotexist', 'notarget' );
-   } else {
-   $this->dieUsage( "Provided page does 
not exist.", 'notarget' );
}
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I889011deef5686be1fd8bc132a49b75162ed1400
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update .mailmap for the generation of CREDITS

2017-01-07 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331209 )

Change subject: Update .mailmap for the generation of CREDITS
..

Update .mailmap for the generation of CREDITS

- Add current and former WMF/WMDE employees under their full names
- Assign email aliases to one person, to remove duplicate entries in
  CREDITS
- Replace the Active Directory user name "U-REDMOND\emadelw" with the
  user's Gerrit username, "Emadelwany"
- Add some Google Code-In students

Change-Id: I99a2d3047b5c8021b0be3af33f07dcffb59bdf7d
---
M .mailmap
1 file changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/331209/1

diff --git a/.mailmap b/.mailmap
index dd968e8..76ec5e8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -93,6 +93,7 @@
 Chad Horohoe  
 Charles Melbye  
 Chiefwei 
+Chris Koerner 
 Chris McMahon 
 Chris Steipp 
 Christian Aistleitner 
@@ -100,6 +101,8 @@
 Christian Williams 
 Christian Williams  
 Christian Williams  
+Christoph Jauera 
+Christoph Jauera  

 Christopher Johnson 
 church of emacs 
 Cindy Cicalese 
@@ -115,12 +118,14 @@
 Daniel Friesen  
 Daniel Kinzler 
 Daniel Kinzler  
+Daniel Renfro  
 Danny B. 
 Danny B.  
 Danny B.  
 Danny B.  
 Darian Anthony Patrick 
 Darkdragon09 
+David Causse 
 David Chan 
 Dereckson 
 Derk-Jan Hartman 
@@ -134,6 +139,7 @@
 Ed Sanders 
 Elliott Eggleston 
 Elliott Eggleston  
+Emadelwany 
 Emmanuel Engelhart  
 Emufarmers 
 Emufarmers  
@@ -201,6 +207,7 @@
 Jason Richey  
 Jeff Hall 
 Jeff Hall  
+Jeff Hobson 
 Jeff Janes 
 Jeremy Postlethwaite  

 Jeroen De Dauw 
@@ -208,6 +215,7 @@
 Jesús Martínez Novo 
 Jiabao 
 Jimmy Collins  
+Joel Sahleen 
 John Du Hart  
 Jon Harald Søby  
 Jon Robson 
@@ -217,6 +225,8 @@
 JuneHyeon Bae 
 Jure Kajzer 
 Jure Kajzer  
+Justin Du 
+Kai Nissen 
 Karun Dambiec 
 Katie Filbert 
 Katie Filbert  
@@ -236,6 +246,7 @@
 Lisa Ridley  
 Ljudusika 
 Luis Felipe Schenone 
+Luke Welling 
 Lupo 
 m4tx 
 Madman 
@@ -281,11 +292,14 @@
 MZMcBride 
 nadeesha  
 Namit 
+Nathan Larson 
+Nathan Larson  
 Nathaniel Herman  
 Neil Kandalgaonkar  
 Nemo bis 
 nephele  
 Nick Jenkins  
+Niharika Kohli 
 Nik Everett 
 Niklas Laxström 
 Niklas Laxström  
@@ -406,7 +420,6 @@
 Timo Tijhof  
 Timo Tijhof  
 Tina Johnson 
-Tisane 
 Tjones 
 Tom Maaswinkel  
 Tomasz Finc  
@@ -438,6 +451,7 @@
 Yuri Astrakhan 
 Yuri Astrakhan  
 Yuri Astrakhan  
+Yuriy Shnitkovskiy 
 Yusuke Matsubara 
 Yuvi Panda 
 Zak Greant  

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move deprecated language codes to their own array

2017-01-07 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331208 )

Change subject: Move deprecated language codes to their own array
..

Move deprecated language codes to their own array

Some extensions require access to the list of deprecated/legacy/fake
language codes that was formerly available in $wgDummyLanguageCodes,
without including the aliases

The code bh and no are retained in wgDummyLanguageCodes, since they are
legitimate langauge codes (for language families) in their own right. The
code simple is also retained, as it is not deprecated nor is it an exact
alias for en.

Change-Id: If73c74ee87d8235381449cab7dcd9f46b0f23590
---
M includes/DefaultSettings.php
M includes/Setup.php
M languages/Language.php
3 files changed, 38 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/08/331208/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 77061df..c40da45 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2808,8 +2808,9 @@
  * MediaWiki out of the box. Not all languages listed there have translations,
  * see languages/messages/ for the list of languages with some localisation.
  *
- * Warning: Don't use language codes listed in $wgDummyLanguageCodes like "no"
- * for Norwegian (use "nb" instead), or things will break unexpectedly.
+ * Warning: Don't use any of MediaWiki's deprecated language codes listed in
+ * Language::getDeprecatedCodeMapping or $wgDummyLanguageCodes, like "no"
+ * for Norwegian (use "nb" instead). If you do, things will break unexpectedly.
  *
  * This defines the default interface language for all users, but users can
  * change it in their preferences.
@@ -2869,24 +2870,17 @@
 
 /**
  * List of language codes that don't correspond to an actual language.
- * These codes are mostly left-offs from renames, or other legacy things.
  * This array makes them not appear as a selectable language on the installer,
  * and excludes them when running the transstat.php script.
+ *
+ * In Setup.php, these codes are combined with a list of "deprecated" codes,
+ * which are mostly left-offs from renames, or other legacy things, as well as
+ * the internal codes 'qqq' and 'qqx'.
  */
 $wgDummyLanguageCodes = [
-   'als' => 'gsw',
-   'bat-smg' => 'sgs',
-   'be-x-old' => 'be-tarask',
'bh' => 'bho',
-   'fiu-vro' => 'vro',
'no' => 'nb',
-   'qqq' => 'qqq', # Used for message documentation.
-   'qqx' => 'qqx', # Used for viewing message keys.
-   'roa-rup' => 'rup',
'simple' => 'en',
-   'zh-classical' => 'lzh',
-   'zh-min-nan' => 'nan',
-   'zh-yue' => 'yue',
 ];
 
 /**
diff --git a/includes/Setup.php b/includes/Setup.php
index f6631ea..07de81e 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -403,6 +403,9 @@
$wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + 
$wgExtraNamespaces;
 }
 
+// Merge in the nasty legacy language codes, unless overridden in the config
+$wgDummyLanguageCodes = $wgDummyLanguageCodes + 
Language::getDeprecatedCodeMapping();
+
 // These are now the same, always
 // To determine the user language, use $wgLang->getCode()
 $wgContLanguageCode = $wgLanguageCode;
diff --git a/languages/Language.php b/languages/Language.php
index 5bce76b..cae939e 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -399,6 +399,34 @@
}
 
/**
+* Returns a mapping of deprecated language codes that were used in 
previous
+* versions of MediaWiki to up-to-date, current language codes. This 
mapping
+* also includes the fake language codes 'qqq' and 'qqx', which are used
+* internally by MediaWiki's localisation system.
+*
+* This array is merged into $wgDummyLanguageCodes in Setup.php.
+*
+* @since 1.29
+* @return array
+*/
+   public static function getDeprecatedCodeMapping() {
+   return [
+   // Note that als is actually a valid ISO 639 code (Tosk 
Albanian), but it
+   // was previously used in MediaWiki for Alsatian, which 
comes under gsw
+   'als' => 'gsw',
+   'bat-smg' => 'sgs',
+   'be-x-old' => 'be-tarask',
+   'fiu-vro' => 'vro',
+   'qqq' => 'qqq', // Used for message documentation
+   'qqx' => 'qqx', // Used for viewing message keys
+   'roa-rup' => 'rup',
+   'zh-classical' => 'lzh',
+   'zh-min-nan' => 'nan',
+   'zh-yue' => 'yue',
+   ];
+   }
+
+   /**
 * Get the LocalisationCache instance
 *
 * @return LocalisationCache

-- 
To view, visit https://gerrit.wikimedia.org/r/331208
To unsubscr

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Additional test for {{PAGELANGUAGE}} magic word

2017-01-06 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331106 )

Change subject: Additional test for {{PAGELANGUAGE}} magic word
..

Additional test for {{PAGELANGUAGE}} magic word

Make sure it returns the default content language on pages where the
language is not explicitly set.

Bug: T59603
Change-Id: I7b1437bf1650166c8be77e5bd84181c577961f27
---
M tests/parser/parserTests.txt
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/331106/3

diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 16d724d..3853a12 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -10301,6 +10301,15 @@
 !! end
 
 !! test
+Magic Word: {{PAGELANGUAGE}} on a page with no explicitly set language
+!! wikitext
+{{PAGELANGUAGE}}
+!! html
+en
+
+!! end
+
+!! test
 Case-sensitive magic words, when cased differently, should just be template 
transclusions
 !! wikitext
 {{CurrentMonth}}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b1437bf1650166c8be77e5bd84181c577961f27
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 
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]: Fix parsing of tags generated by extension tag hooks

2017-01-06 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330896 )

Change subject: Fix parsing of  tags generated by extension tag hooks
..

Fix parsing of  tags generated by extension tag hooks

When this part of BlockLevelPass::execute() encounters a block-level tag,
such as , one of $openMatch or $closeMatch will be truthy.

Without this patch, $this->closeParagraph() is unconditionally called in
this situation, which sets $this->inPre = false. If we're already inside a
 tag, this makes the parser think we're no longer in a 
environment, so it starts wrapping the  tag's content in  tags as
if it was processing regular content.

We should only call $this->closeParagraph() in the case that (a) we are not
inside a  tag, or (b) the block-level tag that is being opened is
itself a  tag (in which case $preOpenMatch will be truthy, and
$this->inPre will have already been set to true).

This doesn't affect the parsing of  tags that are written in wikitext,
since their content isn't parsed. It only affects hooks and the like that
return  tags.

This doesn't solve the task T7718 that is mentioned in the code comment,
but if the testwiki test cases linked there are anything to go by, it
doesn't make the problem worse in any way.

This is required for Poem change I754f2e84f7d6efc0829765c82297f2de5f9ca149.

Change-Id: I469e633fc41d8ca73653c7e982c591092dcb1708
---
M includes/parser/BlockLevelPass.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/330896/1

diff --git a/includes/parser/BlockLevelPass.php 
b/includes/parser/BlockLevelPass.php
index cbacd34..cc95f3b 100644
--- a/includes/parser/BlockLevelPass.php
+++ b/includes/parser/BlockLevelPass.php
@@ -298,8 +298,12 @@
 
if ( $openMatch || $closeMatch ) {
$pendingPTag = false;
-   # @todo bug 5718: paragraph closed
-   $output .= $this->closeParagraph();
+   // Only close the paragraph if we're 
not inside a  tag, or if
+   // that  tag has just been opened
+   if ( !$this->inPre || $preOpenMatch ) {
+   // @todo T7718: paragraph closed
+   $output .= 
$this->closeParagraph();
+   }
if ( $preOpenMatch && !$preCloseMatch ) 
{
$this->inPre = true;
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Release notes for un-deprecation of WikiRevision::getText

2017-01-03 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330346 )

Change subject: Release notes for un-deprecation of WikiRevision::getText
..

Release notes for un-deprecation of WikiRevision::getText

This function was un-deprecated in
I3f0e0f7fe38bd4e2001efbe17cdba6bcc90b036f, mainly to stop Google
Code-In students from continually trying to remove the function before
we have decided what to do with it (see T152282).

Change-Id: I460c76f2dea89646545a969c3637433070059b1c
---
M RELEASE-NOTES-1.29
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/330346/2

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index c26a8be..72c82de 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -156,6 +156,7 @@
 * Title::moveNoAuth() (deprecated in 1.25) was removed. Use MovePage class 
instead.
 * Hook UnknownAction (deprecated in 1.19) was actually deprecated (it will now 
emit warnings).
   Create a subclass of Action, and add it to $wgActions instead.
+* WikiRevision:getText() (deprecated since 1.21) is no longer marked 
deprecated.
 
 == Compatibility ==
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I460c76f2dea89646545a969c3637433070059b1c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 
Gerrit-Reviewer: Jforrester 

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Fix failing tests after adding tags parameter to core ApiUse...

2017-01-02 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330186 )

Change subject: Fix failing tests after adding tags parameter to core 
ApiUserrights
..

Fix failing tests after adding tags parameter to core ApiUserrights

Broken after I4f6dacd0ddf7b45d62aff6f85c329bc15be27daf. Ideally the
parameter would be unset in an overridden getAllowedParams(), but that
would cause undefined variable errors.

Change-Id: I2761820a3f52061361a15bc9d9a5927620edb5d1
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/86/330186/1

diff --git a/i18n/en.json b/i18n/en.json
index 9d14736..9b6eb8e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -513,6 +513,7 @@
"apihelp-globaluserrights-param-add": "Add the user to these global 
groups.",
"apihelp-globaluserrights-param-remove": "Remove the user from these 
global groups.",
"apihelp-globaluserrights-param-reason": "Reason for the change.",
+   "apihelp-globaluserrights-param-tags": "This parameter is currently 
unused.",
"apihelp-globaluserrights-example-1": "Add user FooBot to global group 
\"bot\", and remove from global groups \"sysop\" and \"bureaucrat\"",
"apihelp-globaluserrights-example-2": "Add the global user with ID 123 
to global group \"bot\", and remove from global groups \"sysop\" and 
\"bureaucrat\"",
"apihelp-query+globalallusers-description": "Enumerate all global 
users.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 716a8d7..0c17fa1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -529,6 +529,7 @@
"apihelp-globaluserrights-param-add": 
"{{doc-apihelp-param|globaluserrights|add}}",
"apihelp-globaluserrights-param-remove": 
"{{doc-apihelp-param|globaluserrights|remove}}",
"apihelp-globaluserrights-param-reason": 
"{{doc-apihelp-param|globaluserrights|reason}}",
+   "apihelp-globaluserrights-param-tags": 
"{{doc-apihelp-param|globaluserrights|tags}}",
"apihelp-globaluserrights-example-1": 
"{{doc-apihelp-example|globaluserrights}}",
"apihelp-globaluserrights-example-2": 
"{{doc-apihelp-example|globaluserrights}}",
"apihelp-query+globalallusers-description": 
"{{doc-apihelp-description|query+globalallusers}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2761820a3f52061361a15bc9d9a5927620edb5d1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...Babel[master]: Add language name as second parameter to babel-portal message

2017-01-01 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330046 )

Change subject: Add language name as second parameter to babel-portal message
..

Add language name as second parameter to babel-portal message

Bug: T34398
Change-Id: I41ab415a589d97cf2d84bb9d195c0e54995595c1
---
M BabelBox/LanguageBabelBox.php
M i18n/qqq.json
2 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/46/330046/1

diff --git a/BabelBox/LanguageBabelBox.php b/BabelBox/LanguageBabelBox.php
index 9cd474f..d9873c0 100644
--- a/BabelBox/LanguageBabelBox.php
+++ b/BabelBox/LanguageBabelBox.php
@@ -69,18 +69,18 @@
 * @return string A babel box for the given language and level.
 */
public function render() {
-   $code = $this->code;
+   $originalCode = $this->code;
+   $name = BabelLanguageCodes::getName( $originalCode );
+   $code = BabelLanguageCodes::getCode( $originalCode );
 
-   $portal = wfMessage( 'babel-portal', $code 
)->inContentLanguage()->plain();
+   $portal = wfMessage( 'babel-portal', $code, $name 
)->inContentLanguage()->plain();
if ( $portal !== '' ) {
-   $portal = "[[$portal|$code]]";
+   $portal = "[[$portal|$originalCode]]";
} else {
-   $portal = $code;
+   $portal = $originalCode;
}
$header = "$portallevel}\">-{$this->level}";
 
-   $name = BabelLanguageCodes::getName( $code );
-   $code = BabelLanguageCodes::getCode( $code );
$text = self::getText( $this->title, $name, $code, $this->level 
);
 
$dir_current = Language::factory( $code )->getDir();
diff --git a/i18n/qqq.json b/i18n/qqq.json
index c2d6674..fc92b33 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -41,7 +41,7 @@
"babel-box-cellpadding": "{{notranslate}}\nInserted as the value of the 
cellpadding attribute in the HTML table of the outer box.",
"babel-cellspacing": "{{notranslate}}\nInserted as the value of the 
cellspacing attribute in the HTML tables of the inner boxes.",
"babel-cellpadding": "{{notranslate}}\nInserted as the value of the 
cellpadding attribute in the HTML tables of the inner boxes.",
-   "babel-portal": "{{notranslate}}",
+   "babel-portal": "{{notranslate}}\n\nParameters:\n* $1 - language 
code\n* $2 - language name",
"babel-template": "{{Optional}}{{doc-important|Do not translate 
\"Template:\".}}\nThis message contains the template schema for additional 
templates that can be used in Babel. Parameters:\n* $1 is the parameter value 
used in the #babel parser tag.",
"babel-footer": "This text is used in the last entry (footer) of the 
outer box. It is a link anchor, if {{msg-mw|babel-footer-url}} is not empty, 
otherwise, it is only text. No footer is generated, when this text is empty.",
"apihelp-query+babel-description": 
"{{doc-apihelp-description|query+babel}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41ab415a589d97cf2d84bb9d195c0e54995595c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...Babel[master]: Use content language for Babel AutoCreate's edit summaries

2017-01-01 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330044 )

Change subject: Use content language for Babel AutoCreate's edit summaries
..

Use content language for Babel AutoCreate's edit summaries

Doesn't make sense to use the user's UI language here.

Bug: T46223
Change-Id: I96d990de4d7a0ac46ad6d8416559c5b320efbc39
---
M BabelAutoCreate.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/44/330044/1

diff --git a/BabelAutoCreate.class.php b/BabelAutoCreate.class.php
index b696ed2..511c718 100644
--- a/BabelAutoCreate.class.php
+++ b/BabelAutoCreate.class.php
@@ -75,7 +75,7 @@
 
$article->doEditContent(
ContentHandler::makeContent( $text, $title ),
-   wfMessage( 'babel-autocreate-reason', $url )->text(),
+   wfMessage( 'babel-autocreate-reason', $url 
)->inContentLanguage()->text(),
EDIT_FORCE_BOT,
false,
$user

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96d990de4d7a0ac46ad6d8416559c5b320efbc39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...Babel[master]: Fix disappearing language names on Category: and File: pages

2017-01-01 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330043 )

Change subject: Fix disappearing language names on Category: and File: pages
..

Fix disappearing language names on Category: and File: pages

When $wgBabelMainCategory or one of the $wgBabelCategoryNames booleans is
false, the language name is hackishly made into a self-link (since the
localised message requires a link target). On category and file pages,
a self-link like [[Category:XYZ|English]] was being used, which has an
obvious problem.

Bug: T36507
Change-Id: I51c5d561312e255c686d7d18960f30ebd0fa7845
---
M BabelBox/LanguageBabelBox.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/43/330043/1

diff --git a/BabelBox/LanguageBabelBox.php b/BabelBox/LanguageBabelBox.php
index 9cd474f..d49e957 100644
--- a/BabelBox/LanguageBabelBox.php
+++ b/BabelBox/LanguageBabelBox.php
@@ -124,14 +124,14 @@
global $wgBabelMainCategory, $wgBabelCategoryNames;
 
if ( $wgBabelCategoryNames[$level] === false ) {
-   $categoryLevel = $title->getFullText();
+   $categoryLevel = ':' . $title->getFullText();
} else {
$categoryLevel = ':Category:' .
self::getCategoryName( 
$wgBabelCategoryNames[$level], $language );
}
 
if ( $wgBabelMainCategory === false ) {
-   $categoryMain = $title->getFullText();
+   $categoryMain = ':' . $title->getFullText();
} else {
$categoryMain = ':Category:' .
self::getCategoryName( $wgBabelMainCategory, 
$language );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51c5d561312e255c686d7d18960f30ebd0fa7845
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...Babel[master]: Map MediaWiki's fake language codes to real ones

2017-01-01 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330041 )

Change subject: Map MediaWiki's fake language codes to real ones
..

Map MediaWiki's fake language codes to real ones

'My understanding of the problem is that when someone uses
{{#babel:zh-classical}}, the extension puts the user into "Category:User
zh-classical" instead of into "Category:User lzh" even though they mean
the same thing. Instead, it should understand that zh-classical is a
legacy code and convert it to lzh, to avoid duplicate categories.'
-- Nikki at the phab task

Bug: T101086
Change-Id: I1ae053574805e4d118389f6bbf6dcf391fbed73b
---
M BabelLanguageCodes.class.php
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/41/330041/1

diff --git a/BabelLanguageCodes.class.php b/BabelLanguageCodes.class.php
index dfd2e73..82dc50c 100644
--- a/BabelLanguageCodes.class.php
+++ b/BabelLanguageCodes.class.php
@@ -13,6 +13,24 @@
  */
 class BabelLanguageCodes {
/**
+* @var array A list of MediaWiki fake/legacy language codes, and the 
ISO
+* codes they correspond to. This is almost the same as core's
+* $wgDummyLanguageCodes variable, except that a few things that aren't
+* strictly aliases ('no' => 'nb', 'simple' => 'en') are left out.
+*/
+   public static $fakeCodes = [
+   'als' => 'gsw',
+   'bat-smg' => 'sgs',
+   'be-x-old' => 'be-tarask',
+   'bh' => 'bho',
+   'fiu-vro' => 'vro',
+   'roa-rup' => 'rup',
+   'zh-classical' => 'lzh',
+   'zh-min-nan' => 'nan',
+   'zh-yue' => 'yue',
+   ];
+
+   /**
 * Takes a language code, and attempt to obtain a better variant of it,
 * checks the MediaWiki language codes for a match, otherwise checks the
 * Babel language codes CDB (preferring ISO 639-1 over ISO 639-3).
@@ -21,6 +39,11 @@
 * @return string|bool Language code, or false for invalid language 
code.
 */
public static function getCode( $code ) {
+   // map fake MediaWiki language codes to their real counterparts 
(T101086)
+   if ( isset( self::$fakeCodes[$code] ) ) {
+   $code = self::$fakeCodes[$code];
+   }
+
$mediawiki = Language::fetchLanguageName( $code );
if ( $mediawiki !== '' ) {
return $code;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ae053574805e4d118389f6bbf6dcf391fbed73b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace invalid UTF-8 sequences with U+FFFD in edit summaries

2016-12-31 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329814 )

Change subject: Replace invalid UTF-8 sequences with U+FFFD in edit summaries
..

Replace invalid UTF-8 sequences with U+FFFD in edit summaries

Change-Id: Ib22b563e7bc4022754752632f0eebfad00e8eb01
---
M includes/Sanitizer.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/329814/1

diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index 44e4e3e..409f9d45 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -1263,7 +1263,7 @@
$html = Sanitizer::decodeCharReferences( $html );
# It seems wise to escape ' as well as ", as a matter of 
course.  Can't
# hurt.
-   $html = htmlspecialchars( $html, ENT_QUOTES );
+   $html = htmlspecialchars( $html, ENT_QUOTES | ENT_SUBSTITUTE );
return $html;
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Babel[master]: Correct categorization of 'pt-br' and similar language codes

2016-12-30 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329733 )

Change subject: Correct categorization of 'pt-br' and similar language codes
..

Correct categorization of 'pt-br' and similar language codes

wfBCP47 can return language codes like 'pt-BR' and 'shi-Latn', whereas
MediaWiki uses only lowercase for its codes ('pt-br', 'shi-latn'). When
looking up the language names, we need to make sure we use normalized
lowercase codes.

Also avoid ever placing pages in illegally-titled categories, by using
Title::makeTitleSafe to ensure normalization of the category name.

Bug: T146778
Change-Id: I16059db9d1f2060a760223cc9c4488a988a04475
---
M BabelBox/LanguageBabelBox.php
M BabelLanguageCodes.class.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/33/329733/1

diff --git a/BabelBox/LanguageBabelBox.php b/BabelBox/LanguageBabelBox.php
index d2f5edc..bebf8f7 100644
--- a/BabelBox/LanguageBabelBox.php
+++ b/BabelBox/LanguageBabelBox.php
@@ -214,7 +214,7 @@
] );
 
// Normalize using Title
-   return Title::makeTitle( NS_CATEGORY, $category )->getDBkey();
+   return Title::makeTitleSafe( NS_CATEGORY, $category 
)->getDBkey();
}
 
 }
diff --git a/BabelLanguageCodes.class.php b/BabelLanguageCodes.class.php
index 9dffeaf..fcfb6c5 100644
--- a/BabelLanguageCodes.class.php
+++ b/BabelLanguageCodes.class.php
@@ -21,6 +21,8 @@
 * @return string|bool Language code, or false for invalid language 
code.
 */
public static function getCode( $code ) {
+   $code = strtolower( $code );
+
$mediawiki = Language::fetchLanguageName( $code );
if ( $mediawiki !== '' ) {
return $code;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16059db9d1f2060a760223cc9c4488a988a04475
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: TitleValue: Include the invalid DB key in the message when t...

2016-12-30 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329734 )

Change subject: TitleValue: Include the invalid DB key in the message when 
throwing
..

TitleValue: Include the invalid DB key in the message when throwing

The current output "Bad value for parameter $dbkey: invalid DB key" is
useless for actually working out which DB key is to blame.

Bug: T146778
Change-Id: Iaf57e25ab27b5065469c5dc5de0a1b881c48210c
---
M includes/title/TitleValue.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/329734/1

diff --git a/includes/title/TitleValue.php b/includes/title/TitleValue.php
index 597bf2f..7c370f1 100644
--- a/includes/title/TitleValue.php
+++ b/includes/title/TitleValue.php
@@ -78,7 +78,8 @@
Assert::parameterType( 'string', $interwiki, '$interwiki' );
 
// Sanity check, no full validation or normalization applied 
here!
-   Assert::parameter( !preg_match( '/^_|[ \r\n\t]|_$/', $dbkey ), 
'$dbkey', 'invalid DB key' );
+   Assert::parameter( !preg_match( '/^_|[ \r\n\t]|_$/', $dbkey ), 
'$dbkey',
+   "invalid DB key '$dbkey'" );
Assert::parameter( $dbkey !== '', '$dbkey', 'should not be 
empty' );
 
$this->namespace = $namespace;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve strings for the contentmodel log

2016-12-30 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329730 )

Change subject: Improve strings for the contentmodel log
..

Improve strings for the contentmodel log

Consistent terminology ("content model" not "contentmodel" or
"Contentmodel"; "change" not "modification"; "non-default" not
"non-standard") and clearer wording.

Change-Id: Ia24f30713588a35d077f52e6b25f59cd8b1c7c2f
---
M languages/i18n/en.json
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/329730/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 02831fc..2d7a53e 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2191,7 +2191,7 @@
"changecontentmodel-emptymodels-title": "No content models available",
"changecontentmodel-emptymodels-text": "The content on [[:$1]] cannot 
be converted to any type.",
"log-name-contentmodel": "Content model change log",
-   "log-description-contentmodel": "Events related to the content models 
of a page",
+   "log-description-contentmodel": "This page lists changes to the content 
model of pages, and pages that were created with a content model other than the 
default.",
"logentry-contentmodel-new": "$1 {{GENDER:$2|created}} the page $3 
using a non-default content model \"$5\"",
"logentry-contentmodel-change": "$1 {{GENDER:$2|changed}} the content 
model of the page $3 from \"$4\" to \"$5\"",
"logentry-contentmodel-change-revertlink": "revert",
@@ -4124,7 +4124,7 @@
"sessionprovider-nocookies": "Cookies may be disabled. Ensure you have 
cookies enabled and start again.",
"randomrootpage": "Random root page",
"log-action-filter-block": "Type of block:",
-   "log-action-filter-contentmodel": "Type of contentmodel modification:",
+   "log-action-filter-contentmodel": "Type of content model change:",
"log-action-filter-delete": "Type of deletion:",
"log-action-filter-import": "Type of import:",
"log-action-filter-managetags": "Type of tag management action:",
@@ -4139,8 +4139,8 @@
"log-action-filter-block-block": "Block",
"log-action-filter-block-reblock": "Block modification",
"log-action-filter-block-unblock": "Unblock",
-   "log-action-filter-contentmodel-change": "Change of Contentmodel",
-   "log-action-filter-contentmodel-new": "Creation of page with 
non-standard Contentmodel",
+   "log-action-filter-contentmodel-change": "Change of content model",
+   "log-action-filter-contentmodel-new": "Creation of page with 
non-default content model",
"log-action-filter-delete-delete": "Page deletion",
"log-action-filter-delete-delete_redir": "Redirect overwrite",
"log-action-filter-delete-restore": "Page undeletion",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Parser: Trim leading whitespace from links before checking f...

2016-12-26 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329321 )

Change subject: Parser: Trim leading whitespace from links before checking for 
leading :
..

Parser: Trim leading whitespace from links before checking for leading :

The leading spaces on the link only cause us problems, such as for the
$noforce check 20 lines later.

Bug: T129218
Change-Id: I93a8da1f73b38fa3da362f8f27479b3039ed3f13
---
M includes/parser/Parser.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/329321/1

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 1ca9dac..346d5ea 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -2199,7 +2199,7 @@
continue;
}
 
-   $origLink = $m[1];
+   $origLink = ltrim( $m[1], ' ' );
 
# Don't allow internal links to pages containing
# PROTO: where PROTO is a valid URL protocol; these

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Proper handling of invalid/unknown time zones

2016-12-24 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329039 )

Change subject: Proper handling of invalid/unknown time zones
..

Proper handling of invalid/unknown time zones

Currently, a user who has an invalid time zone stored in the database is
effectively locked out of their account on HHVM sites. This patch addresses
this by (1) preventing users from setting invalid time zones, and (2) not
throwing an unhandled exception if a user's TZ is unknown.

When the user saves their preferences, the code silently rewrites invalid
time zones to UTC. I think this is OK, since to cause this to happen you
have to manually muck around with the Preferences page DOM or submit the
form from a script.

Bug: T137182
Change-Id: I28c5e2ac9f2e681718c6080fb49b3b01e4af46dd
---
M includes/Preferences.php
M languages/Language.php
2 files changed, 37 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/329039/1

diff --git a/includes/Preferences.php b/includes/Preferences.php
index cf8e7b8..a4aff99 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -696,18 +696,22 @@
$tzOptions = self::getTimezoneOptions( $context );
 
$tzSetting = $tzOffset;
+   if ( count( $tz ) > 1 && $tz[0] == 'ZoneInfo' &&
+   !in_array( $tzOffset, HTMLFormField::flattenOptions( 
$tzOptions ) )
+   ) {
+   // Timezone offset can vary with DST
+   try {
+   $userTZ = new DateTimeZone( $tz[2] );
+   $minDiff = floor( timezone_offset_get( $userTZ, 
date_create( 'now' ) ) / 60 );
+   $tzSetting = "ZoneInfo|$minDiff|{$tz[2]}";
+   } catch ( Exception $e ) {
+   // User has an invalid time zone set. Fall back 
to just using the offset
+   $tz[0] = 'Offset';
+   }
+   }
if ( count( $tz ) > 1 && $tz[0] == 'Offset' ) {
$minDiff = $tz[1];
$tzSetting = sprintf( '%+03d:%02d', floor( $minDiff / 
60 ), abs( $minDiff ) % 60 );
-   } elseif ( count( $tz ) > 1 && $tz[0] == 'ZoneInfo' &&
-   !in_array( $tzOffset, HTMLFormField::flattenOptions( 
$tzOptions ) )
-   ) {
-   # Timezone offset can vary with DST
-   $userTZ = timezone_open( $tz[2] );
-   if ( $userTZ !== false ) {
-   $minDiff = floor( timezone_offset_get( $userTZ, 
date_create( 'now' ) ) / 60 );
-   $tzSetting = "ZoneInfo|$minDiff|{$tz[2]}";
-   }
}
 
$defaultPreferences['timecorrection'] = [
@@ -1391,6 +1395,25 @@
$data = explode( '|', $tz, 3 );
switch ( $data[0] ) {
case 'ZoneInfo':
+   $data = explode( '|', $tz, 3 );
+   $valid = false;
+
+   if ( count( $data ) === 3 ) {
+   // Make sure this timezone exists
+   try {
+   new DateTimeZone( $data[2] );
+   // If the constructor didn't 
throw, we know it's valid
+   $valid = true;
+   } catch ( Exception $e ) {
+   // Not a valid timezone
+   }
+   }
+
+   if ( !$valid ) {
+   // If the input is invalid, fall back 
to a safe default
+   return 'Offset|0';
+   }
+   return $tz;
case 'System':
return $tz;
default:
diff --git a/languages/Language.php b/languages/Language.php
index ac8d4cb..1afb6a7 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -2100,17 +2100,16 @@
$data = explode( '|', $tz, 3 );
 
if ( $data[0] == 'ZoneInfo' ) {
-   MediaWiki\suppressWarnings();
-   $userTZ = timezone_open( $data[2] );
-   MediaWiki\restoreWarnings();
-   if ( $userTZ !== false ) {
+   try {
+   $userTZ = new DateTimeZone( $data[2] );
$date = date_create( $ts, timezone_open( 'UTC' 
) );
date

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Reject times on 30 and 31 December 9999 as invalid

2016-12-23 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328893 )

Change subject: Reject times on 30 and 31 December  as invalid
..

Reject times on 30 and 31 December  as invalid

This is the very end of the "TS_MW calendar era", and trying to push these
times forward into the future (which occurs when users have timezone
settings ahead of UTC) causes various problems.

Bug: T136380
Change-Id: Ied09e98fe59d83016b6c6248ffe705234b10babb
---
M includes/libs/time/ConvertibleTimestamp.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/93/328893/1

diff --git a/includes/libs/time/ConvertibleTimestamp.php 
b/includes/libs/time/ConvertibleTimestamp.php
index c830b4e..4e4656c 100644
--- a/includes/libs/time/ConvertibleTimestamp.php
+++ b/includes/libs/time/ConvertibleTimestamp.php
@@ -208,7 +208,7 @@
$output .= ' GMT';
}
 
-   if ( $style == TS_MW && strlen( $output ) !== 14 ) {
+   if ( $style == TS_MW && ( strlen( $output ) !== 14 || $output > 
'1229235959' ) ) {
throw new TimestampException( __METHOD__ . ': The 
timestamp cannot be represented in ' .
'the specified format' );
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Poem[master]: Switch to output HTML instead of

2016-12-23 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328887 )

Change subject: Switch  to output HTML  instead of 
..

Switch  to output HTML  instead of 

Poems are in fact preformatted text, within which line breaks, multiple
consecutive spaces, and the like need to be preserved. So it makes good
sense to use the  tag as good semantic HTML practice. We do have to
apply some styles to suppress the gray box and monospace font.

From a styling perspective, it would be nicer to use a  with the
preformatting set in CSS, but unfortunately the unpleasant customer that
is the PHP parser insists on adding lots of  elements which get in the
way.

The arcane and useless "compact" attribute is removed in this change. Its
current behavior is broken, and no-one seemed to know what it was supposed
to do.

It is not anticipated that this patch causes anything other than minor
display changes (a couple of pixels of spacing here or there, for
instance).

Change-Id: I754f2e84f7d6efc0829765c82297f2de5f9ca149
---
M Poem.class.php
M extension.json
A modules/ext.Poem.css
M poemParserTests.txt
4 files changed, 222 insertions(+), 117 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Poem 
refs/changes/87/328887/1

diff --git a/Poem.class.php b/Poem.class.php
index 586750c..ff20a2d 100644
--- a/Poem.class.php
+++ b/Poem.class.php
@@ -5,80 +5,70 @@
  */
 class Poem {
/**
+* Add Poem styling to all pages.
+*
+* @param OutputPage $out
+* @param Skin $skin
+* @return bool true
+*/
+   public static function onBeforePageDisplay( OutputPage $out, Skin $skin 
) {
+   $out->addModuleStyles( 'ext.Poem' );
+   return true;
+   }
+
+   /**
 * Bind the renderPoem function to the  tag
+*
 * @param Parser $parser
 * @return bool true
 */
-   public static function init( &$parser ) {
+   public static function init( Parser $parser ) {
$parser->setHook( 'poem', array( 'Poem', 'renderPoem' ) );
return true;
}
 
/**
-* Parse the text into proper poem format
-* @param string $in The text inside the poem tag
-* @param array $param
+* Parser tag hook function for the  tag.
+*
+* Outputs text, maintaining line breaks and providing a smaller, 
line-based
+* indentation for line-initial colons instead of the default . 
Suitable
+* for line-based text such as poetry and similar content.
+*
+* @param string $content The text inside the  tag
+* @param array $param XML attributes on the  tag
 * @param Parser $parser
 * @param boolean $frame
 * @return string
 */
-   public static function renderPoem( $in, $param = array(), $parser = 
null, $frame = false ) {
-   // using newlines in the text will cause the parser to add  
tags,
-   // which may not be desired in some cases
-   $newline = isset( $param['compact'] ) ? '' : "\n";
-
-   $tag = $parser->insertStripItem( "", $parser->mStripState 
);
-
+   public static function renderPoem( $content, $param, Parser $parser, 
$frame = false ) {
// replace colons with indented spans
-   $text = preg_replace_callback( '/^(:+)(.+)$/m', array( 'Poem', 
'indentVerse' ), $in );
-
-   // replace newlines with  tags unless they are at the 
beginning or end
-   // of the poem
-   $text = preg_replace(
-   array( "/^\n/", "/\n$/D", "/\n/" ),
-   array( "", "", "$tag\n" ),
-   $text );
+   // $m[1] consists of 1 or more colons
+   // $m[2] consists of the text after the colons
+   $text = preg_replace_callback( '/^(:+)(.+)$/m', function( $m ) {
+   $attribs = array(
+   'class' => 'mw-poem-indented',
+   'style' => 'margin-left: ' . strlen( $m[1] ) . 
'em;'
+   );
+   return Html::rawElement( 'span', $attribs, $m[2] );
+   }, $content );
 
// replace spaces at the beginning of a line with non-breaking 
spaces
-   $text = preg_replace_callback( '/^( +)/m', array( 'Poem', 
'replaceSpaces' ), $text );
+   // $m[1] consists of 1 or more spaces
+   $text = preg_replace_callback( '/^( +)/m', function( $m ) {
+   return str_replace( ' ', ' ', $m[1] );
+   }, $text );
 
$text = $parser->recursiveTagParse( $text, $frame );
 
$attribs = Sanitizer::validateTagAttributes( $param, 'div' );
 
-   // Wrap output in a  with "poem" class.
+   // W

[MediaWiki-commits] [Gerrit] mediawiki...Poem[master]: Automatic line numbering functionality for

2016-12-23 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/32 )

Change subject: Automatic line numbering functionality for 
..

Automatic line numbering functionality for 

Poems can be numbered according to a range of flexible settings. These are
documented in a code comment in Poem.class.php, which is copied below:

 

 - number-start: The line number assigned to the first non-blank line of text,
   or the stanza number assigned to the first stanza. Integer >= 0, default 1.
 - number-step:
   - If an integer >= 1: Display line numbers every X lines (default 1)
   - first: Display a line number next to the first line of each stanza
   - last: Display a line number next to the last line of each stanza
   - stanza, stanza-first: Number stanzas (paragraphs) instead of lines,
 and number the first line of each stanza
   - stanza-last: Number stanzas instead of lines, and number the last
 line of each stanza
 - number-show-first: If set, show a line number on the first line when
   number-step > 1. For example,  gives 5, 10, 15...,
   while  goes 1, 6, 11, 16... .
   This attribute is ignored when number-step is not an integer > 1.
 - number-style: A custom CSS style to be applied to line numbers.

Bug: T15644
Change-Id: Ibe6752d1758830229757c63bdd946b581772ee67
---
M Poem.class.php
M modules/ext.Poem.css
M poemParserTests.txt
3 files changed, 700 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Poem 
refs/changes/88/32/1

diff --git a/Poem.class.php b/Poem.class.php
index ff20a2d..2e3bf2b 100644
--- a/Poem.class.php
+++ b/Poem.class.php
@@ -34,6 +34,31 @@
 * indentation for line-initial colons instead of the default . 
Suitable
 * for line-based text such as poetry and similar content.
 *
+* Valid attributes (in addition to the usual style=, class= etc):
+* 
+*
+* - number-start: The line number assigned to the first non-blank line 
of text,
+*   or the stanza number assigned to the first stanza. Integer >= 0, 
default 1.
+* - number-step:
+*   - If an integer >= 1: Display line numbers every X lines (default 
1)
+*   - first: Display a line number next to the first line of each 
stanza
+*   - last: Display a line number next to the last line of each stanza
+*   - stanza, stanza-first: Number stanzas (paragraphs) instead of 
lines,
+* and number the first line of each stanza
+*   - stanza-last: Number stanzas instead of lines, and number the last
+* line of each stanza
+* - number-show-first: If set, show a line number on the first line 
when
+*   number-step > 1. For example,  gives 5, 10, 
15...,
+*   while  goes 1, 6, 11, 16... .
+*   This attribute is ignored when number-step is not an integer > 1.
+* - number-style: A custom CSS style to be applied to line numbers.
+*
+* To enable line numbering, simply specify at least one of the 
attributes
+* with any valid value.
+*
 * @param string $content The text inside the  tag
 * @param array $param XML attributes on the  tag
 * @param Parser $parser
@@ -52,23 +77,199 @@
return Html::rawElement( 'span', $attribs, $m[2] );
}, $content );
 
+   // clear out lines containing whitespace only (needed to make 
line
+   // numbering work, but also good to keep the HTML output small)
+   $text = preg_replace( '/^[ \t\xC\xD\xA0]+$/mu', '', $text );
+
// replace spaces at the beginning of a line with non-breaking 
spaces
// $m[1] consists of 1 or more spaces
$text = preg_replace_callback( '/^( +)/m', function( $m ) {
return str_replace( ' ', ' ', $m[1] );
}, $text );
 
+   // parse the wikitext inside the tag
$text = $parser->recursiveTagParse( $text, $frame );
+
+   // add line numbers
+   $useNumbering = isset( $param['number-start'] ) ||
+   isset( $param['number-step'] ) ||
+   isset( $param['number-show-first'] ) ||
+   isset( $param['number-style'] );
+   if ( $useNumbering ) {
+   list( $text, $isWide ) = self::numberLines( $text, 
$param );
+   }
 
$attribs = Sanitizer::validateTagAttributes( $param, 'div' );
 
// Wrap output in a  with appropriate class names
-   if ( isset( $attribs['class'] ) ) {
-   $attribs['class'] = 'poem ' . $attribs['class'];
-   } else {
-   $attribs['class'] = 'poem';
+   $className = 'poem';
+   if ( $useNumbering ) {
+ 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add text/plain as a trusted MIME type

2016-12-22 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328852 )

Change subject: Add text/plain as a trusted MIME type
..

Add text/plain as a trusted MIME type

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/328852/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 3274480..1f7686a 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -948,6 +948,7 @@
MEDIATYPE_VIDEO, // all plain video formats
"image/svg+xml", // svg (only needed if inline rendering of svg is not 
supported)
"application/pdf", // PDF files
+   "text/plain", // can't go wrong with plain text!
# "application/x-shockwave-flash", //flash/shockwave movie
 ];
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Make CentralAuth work with expiring user groups in core

2016-12-22 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328662 )

Change subject: Make CentralAuth work with expiring user groups in core
..

Make CentralAuth work with expiring user groups in core

This doesn't give CentralAuth expiring user rights; it just keeps
everything working after the merge of the dependent patch in core.

Change-Id: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Depends-On: I93c955dc7a970f78e32aa503c01c67da30971d1a
---
M includes/CentralAuthGroupMembershipProxy.php
M includes/specials/SpecialGlobalGroupMembership.php
2 files changed, 23 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/62/328662/1

diff --git a/includes/CentralAuthGroupMembershipProxy.php 
b/includes/CentralAuthGroupMembershipProxy.php
index 65d86d3..1734b02 100644
--- a/includes/CentralAuthGroupMembershipProxy.php
+++ b/includes/CentralAuthGroupMembershipProxy.php
@@ -92,12 +92,27 @@
}
 
/**
+* Replaces User::getGroupMemberships()
+* @return array Associative array of (group name => 
UserGroupMembership object)
+*/
+   function getGroupMemberships() {
+   return array_map( function( $group ) {
+   return new UserGroupMembership( $this->getId(), $group 
);
+   }, $this->getGroups() );
+   }
+
+   /**
 * replaces addUserGroup
 * @param string[]|string $group
+* @param string|null $expiry
 *
 * @return bool
 */
-   function addGroup( $group ) {
+   function addGroup( $group, $expiry = null ) {
+   if ( $expiry !== null ) {
+   throw new InvalidArgumentException( __METHOD__ . ' 
cannot process expiries' );
+   }
+
$this->mGlobalUser->addToGlobalGroups( $group );
return true;
}
diff --git a/includes/specials/SpecialGlobalGroupMembership.php 
b/includes/specials/SpecialGlobalGroupMembership.php
index e173abd..d1dbfb3 100644
--- a/includes/specials/SpecialGlobalGroupMembership.php
+++ b/includes/specials/SpecialGlobalGroupMembership.php
@@ -25,6 +25,13 @@
}
 
/**
+* @return bool
+*/
+   protected function showExpiryUI() {
+   return false;
+   }
+
+   /**
 * Output a form to allow searching for a user
 */
function switchForm() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Disregard expired user_group rows in special page and API DB...

2016-12-21 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328491 )

Change subject: Disregard expired user_group rows in special page and API DB 
queries
..

Disregard expired user_group rows in special page and API DB queries

An essential follow-up to I93c955dc7a970f78e32aa503c01c67da30971d1a.

Bug: T12493
Change-Id: Icf78cce3f3e362677d10897b8d1103b3df91fa08
---
M includes/SiteStats.php
M includes/api/ApiQueryAllImages.php
M includes/api/ApiQueryAllUsers.php
M includes/api/ApiQueryContributors.php
M includes/api/ApiQueryUsers.php
M includes/specials/pagers/ActiveUsersPager.php
M includes/specials/pagers/ContribsPager.php
M includes/specials/pagers/NewFilesPager.php
M includes/specials/pagers/UsersPager.php
9 files changed, 48 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/328491/1

diff --git a/includes/SiteStats.php b/includes/SiteStats.php
index ff7875c..4b12715 100644
--- a/includes/SiteStats.php
+++ b/includes/SiteStats.php
@@ -193,7 +193,10 @@
return $dbr->selectField(
'user_groups',
'COUNT(*)',
-   [ 'ug_group' => $group ],
+   [
+   'ug_group' => $group,
+   'ug_expiry IS NULL OR ug_expiry 
> ' . $dbr->addQuotes( $dbr->timestamp() )
+   ],
__METHOD__
);
},
diff --git a/includes/api/ApiQueryAllImages.php 
b/includes/api/ApiQueryAllImages.php
index e3e5ed6..22561a9 100644
--- a/includes/api/ApiQueryAllImages.php
+++ b/includes/api/ApiQueryAllImages.php
@@ -197,7 +197,8 @@
'LEFT JOIN',
[
'ug_group' => 
User::getGroupsWithPermission( 'bot' ),
-   'ug_user = img_user'
+   'ug_user = img_user',
+   'ug_expiry IS NULL OR ug_expiry 
>=' . $db->addQuotes( $db->timestamp() )
]
] ] );
$groupCond = ( $params['filterbots'] == 
'nobots' ? 'NULL' : 'NOT NULL' );
diff --git a/includes/api/ApiQueryAllUsers.php 
b/includes/api/ApiQueryAllUsers.php
index 2e2ac32..3faccf9 100644
--- a/includes/api/ApiQueryAllUsers.php
+++ b/includes/api/ApiQueryAllUsers.php
@@ -116,8 +116,16 @@
// Filter only users that belong to a given group. This 
might
// produce as many rows-per-user as there are groups 
being checked.
$this->addTables( 'user_groups', 'ug1' );
-   $this->addJoinConds( [ 'ug1' => [ 'INNER JOIN', [ 
'ug1.ug_user=user_id',
-   'ug1.ug_group' => $params['group'] ] ] ] );
+   $this->addJoinConds( [
+   'ug1' => [
+   'INNER JOIN',
+   [
+   'ug1.ug_user=user_id',
+   'ug1.ug_group' => 
$params['group'],
+   'ug1.ug_expiry IS NULL OR 
ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+   ]
+   ]
+   ] );
$maxDuplicateRows *= count( $params['group'] );
}
 
@@ -135,7 +143,10 @@
) ];
}
$this->addJoinConds( [ 'ug1' => [ 'LEFT OUTER JOIN',
-   array_merge( [ 'ug1.ug_user=user_id' ], 
$exclude )
+   array_merge( [
+   'ug1.ug_user=user_id',
+   'ug1.ug_expiry IS NULL OR ug1.ug_expiry 
>= ' . $db->addQuotes( $db->timestamp() )
+   ], $exclude )
] ] );
$this->addWhere( 'ug1.ug_user IS NULL' );
}
@@ -148,7 +159,10 @@
 
if ( $fld_groups || $fld_rights ) {
$this->addFields( [ 'groups' =>
-   $db->buildGroupConcatField( '|', 'user_groups', 
'ug_group', 'ug_user=user_id' )
+   $db->buildGroupConcatField( '|', 'user_groups', 
'ug_group', [
+   'ug_user=user_id',
+   'ug_expiry IS NU

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Make CentralAuthGroupMembershipProxy implement UserGroupMember

2016-12-20 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328462 )

Change subject: Make CentralAuthGroupMembershipProxy implement UserGroupMember
..

Make CentralAuthGroupMembershipProxy implement UserGroupMember

See I705b7fe8755064b9ae85442b6949700c01736ea6 in core

Bug: T88510
Change-Id: I90894aa13a2af3c609d6c3a2a1f3d151fc44891c
---
M includes/CentralAuthGroupMembershipProxy.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/62/328462/1

diff --git a/includes/CentralAuthGroupMembershipProxy.php 
b/includes/CentralAuthGroupMembershipProxy.php
index 65d86d3..b48aecc 100644
--- a/includes/CentralAuthGroupMembershipProxy.php
+++ b/includes/CentralAuthGroupMembershipProxy.php
@@ -3,7 +3,7 @@
  * Cut-down copy of User interface for local-interwiki-database
  * user rights manipulation.
  */
-class CentralAuthGroupMembershipProxy {
+class CentralAuthGroupMembershipProxy implements UserGroupMember {
/**
 * @var string
 */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90894aa13a2af3c609d6c3a2a1f3d151fc44891c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Tests: Add users to DB when they are given advanced rights

2016-12-20 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328458 )

Change subject: Tests: Add users to DB when they are given advanced rights
..

Tests: Add users to DB when they are given advanced rights

In general, it doesn't make sense to assign user groups to users who
are not in the database, as it will create bogus database entries
(rows in the user_groups table with ug_user = 0). For tests, this is
not so much of an issue, as the database doesn't need to be
consistent. But I plan to start enforcing that the user ID > 0 when 
assigning users to a group (I93c955dc7a970f78e32aa503c01c67da30971d1a)
so all these tests would fail in that scenario without this change.

Change-Id: Ia9616e1e35184fed9058d2d39afbe1038f56d7fa
---
M repo/tests/phpunit/includes/Actions/ActionTestCase.php
M repo/tests/phpunit/includes/Content/EntityContentTest.php
M repo/tests/phpunit/includes/PermissionsHelper.php
3 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/58/328458/2

diff --git a/repo/tests/phpunit/includes/Actions/ActionTestCase.php 
b/repo/tests/phpunit/includes/Actions/ActionTestCase.php
index 34ff6d0..e13377d 100644
--- a/repo/tests/phpunit/includes/Actions/ActionTestCase.php
+++ b/repo/tests/phpunit/includes/Actions/ActionTestCase.php
@@ -72,8 +72,7 @@
$this->permissionsChanged = true;
 
// reset rights cache
-   $wgUser->addGroup( "dummy" );
-   $wgUser->removeGroup( "dummy" );
+   $wgUser->clearInstanceCache();
}
 
/**
diff --git a/repo/tests/phpunit/includes/Content/EntityContentTest.php 
b/repo/tests/phpunit/includes/Content/EntityContentTest.php
index c8b95cb..ee734ad 100644
--- a/repo/tests/phpunit/includes/Content/EntityContentTest.php
+++ b/repo/tests/phpunit/includes/Content/EntityContentTest.php
@@ -62,8 +62,7 @@
 
if ( $wgUser ) { // should not be null, but sometimes, it is
// reset rights cache
-   $wgUser->addGroup( "dummy" );
-   $wgUser->removeGroup( "dummy" );
+   $wgUser->clearInstanceCache();
}
 
parent::tearDown();
diff --git a/repo/tests/phpunit/includes/PermissionsHelper.php 
b/repo/tests/phpunit/includes/PermissionsHelper.php
index 2f0889b..46cefa4 100644
--- a/repo/tests/phpunit/includes/PermissionsHelper.php
+++ b/repo/tests/phpunit/includes/PermissionsHelper.php
@@ -29,6 +29,8 @@
return;
}
 
+   $wgUser->addToDatabase();
+
if ( is_array( $groups ) ) {
$oldGroups = $wgUser->getGroups();
foreach ( $oldGroups as $group ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9616e1e35184fed9058d2d39afbe1038f56d7fa
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: TTO 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Daniel Kinzler 
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]: [WIP] User group memberships that expire

2016-12-20 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328377 )

Change subject: [WIP] User group memberships that expire
..

[WIP] User group memberships that expire

This patch adds two columns to the user_groups table: ug_id, a primary key,
and ug_expiry, a timestamp giving a date when the user group expires. A new
UserGroupMembership class, based on the Block class, manages entries in
this table.

When the expiry date passes, the row in user_groups is ignored, and will
eventually be purged from the DB when UserGroupMembership::insert is next
called. Old, expired user group memberships are not kept; instead, the log
entries are available to find the history of these memberships, similar
to the way it has always worked for blocks and protections.

Anyone getting user group info through the User object will get correct
information. However, code that reads the user_groups table directly will
now need to skip over rows with ug_expiry < wfTimestampNow(). See
UsersPager for an example of how to do this.

NULL is used to represent infinite (no) expiry, rather than a string
'infinity' or similar (except in the API). This allows existing user group
assignments and log entries, which are all infinite in duration, to be
treated the same as new, infinite-length memberships, without special
casing everything.

There are a few very minor breaking changes: some protected functions in
UsersPager are altered or removed, and the UsersPagerDoBatchLookups hook
(unused in any Wikimedia Git-hosted extension) has a change of parameter.

Bits still to do:
* ApiUserrights - need to discuss with Anomie or someone else about how
  the input parameters should be structured
* What's going on in ContribsPager and NewFilesPager? Can't work it out
* Postgres DB stuff

Bug: T12493
Change-Id: I93c955dc7a970f78e32aa503c01c67da30971d1a
---
M autoload.php
M docs/hooks.txt
M includes/Preferences.php
M includes/api/ApiQueryUserInfo.php
M includes/api/ApiQueryUsers.php
M includes/api/ApiUserrights.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
M includes/installer/MysqlUpdater.php
M includes/installer/SqliteUpdater.php
M includes/logging/RightsLogFormatter.php
M includes/specials/SpecialUserrights.php
M includes/specials/pagers/ActiveUsersPager.php
M includes/specials/pagers/UsersPager.php
M includes/user/User.php
A includes/user/UserGroupMembership.php
M includes/user/UserRightsProxy.php
M languages/i18n/en.json
M languages/i18n/qqq.json
A maintenance/archives/patch-user_groups-id-expiry.sql
A maintenance/sqlite/archives/patch-user_groups-id-expiry.sql
M maintenance/tables.sql
M resources/Resources.php
A resources/src/mediawiki.special/mediawiki.special.userrights.css
M resources/src/mediawiki.special/mediawiki.special.userrights.js
25 files changed, 1,018 insertions(+), 185 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/77/328377/1

diff --git a/autoload.php b/autoload.php
index 941b335..0b9d353 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1514,6 +1514,7 @@
'UserBlockedError' => __DIR__ . 
'/includes/exception/UserBlockedError.php',
'UserCache' => __DIR__ . '/includes/cache/UserCache.php',
'UserDupes' => __DIR__ . '/maintenance/userDupes.inc',
+   'UserGroupMembership' => __DIR__ . 
'/includes/user/UserGroupMembership.php',
'UserMailer' => __DIR__ . '/includes/mail/UserMailer.php',
'UserNamePrefixSearch' => __DIR__ . 
'/includes/user/UserNamePrefixSearch.php',
'UserNotLoggedIn' => __DIR__ . 
'/includes/exception/UserNotLoggedIn.php',
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 1ecc1f8..17da819 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3745,7 +3745,8 @@
 displayed correctly in Special:ListUsers.
 $dbr: Read-only database handle
 $userIds: Array of user IDs whose groups we should look up
-&$cache: Array of user ID -> internal user group name (e.g. 'sysop') mappings
+&$cache: Array of user ID -> (array of internal group name (e.g. 'sysop') ->
+UserGroupMembership object)
 &$groups: Array of group name -> bool true mappings for members of a given user
 group
 
diff --git a/includes/Preferences.php b/includes/Preferences.php
index cf8e7b8..8ec1b39 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -224,24 +224,48 @@
'section' => 'personal/info',
];
 
+   $lang = $context->getLanguage();
+
# Get groups to which the user belongs
$userEffectiveGroups = $user->getEffectiveGroups();
-   $userGroups = $userMembers = [];
+   $userGroupMemberships = $user->getGroupMemberships();
+   $userGroups = $userMembers = $userTempGroups = $userTempMembers 
= [];
foreach ( $userEffectiveGroups as $ueg ) {
if ( $ueg == '*' ) {
// Skip the de

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable per-page language choice on wikis with Translate

2016-12-14 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327416 )

Change subject: Enable per-page language choice on wikis with Translate
..

Enable per-page language choice on wikis with Translate

Bug: T153209
Change-Id: I5b79dae7766b5a95951f14ab05058520ef43ffef
---
M wmf-config/CommonSettings.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index ca36b4e..702259e 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2403,12 +2403,16 @@
$wgGroupPermissions['translationadmin']['pagetranslation'] = true;
$wgGroupPermissions['translationadmin']['translate-manage'] = true;
$wgGroupPermissions['translationadmin']['translate-import'] = true; // 
T42341
+   $wgGroupPermissions['translationadmin']['pagelang'] = true; // T153209
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
+   $wgGroupPermissions['sysop']['pagelang'] = true; // T153209
 
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic 
content. Used for documenting messages
 
+   $wgPageLanguageUseDB = true; // T153209
+
// TODO: proper integration with new CirrusSearch config
$wgTranslateExtensionDefaultCluster = 'eqiad';
$wgTranslateTranslationServices = [];

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable per-page language choice on beta cluster

2016-12-14 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327413 )

Change subject: Enable per-page language choice on beta cluster
..

Enable per-page language choice on beta cluster

Bug: T153209
Change-Id: I4a12c4f83ca8cb4ca5fc3f97e5fd0f3edc7f3721
---
M wmf-config/CommonSettings-labs.php
1 file changed, 7 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 496152f..7f7bd07 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -335,6 +335,13 @@
wfLoadExtension( 'Linter' );
 }
 
+if ( $wmgUseTranslate ) {
+   // test of T153209
+   $wgGroupPermissions['translationadmin']['pagelang'] = true;
+   $wgGroupPermissions['sysop']['pagelang'] = true;
+   $wgPageLanguageUseDB = true;
+}
+
 $wgMessageCacheType = CACHE_ACCEL;
 
 // Let Beta Cluster Commons do upload-from-URL from production Commons.

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.util: Fix replacement of $ signs in mw.util.getUrl

2016-11-01 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: mediawiki.util: Fix replacement of $ signs in mw.util.getUrl
..

mediawiki.util: Fix replacement of $ signs in mw.util.getUrl

Bug: T149767
Change-Id: I91c1afa1f93966d1f01793d124fe8f2ae3dab0cf
---
M resources/src/mediawiki/mediawiki.util.js
M tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/319266/1

diff --git a/resources/src/mediawiki/mediawiki.util.js 
b/resources/src/mediawiki/mediawiki.util.js
index 866f213..654f232 100644
--- a/resources/src/mediawiki/mediawiki.util.js
+++ b/resources/src/mediawiki/mediawiki.util.js
@@ -128,7 +128,8 @@
? util.wikiScript() + '?title=' + 
util.wikiUrlencode( title ) + '&' + query
: util.wikiScript() + '?' + query;
} else {
-   url = mw.config.get( 'wgArticlePath' ).replace( 
'$1', util.wikiUrlencode( title ) );
+   url = mw.config.get( 'wgArticlePath' )
+   .replace( '$1', util.wikiUrlencode( 
title ).replace( /\$/g, '' ) );
}
 
// Append the encoded fragment
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
index 4eac362..a04d65a 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
@@ -150,6 +150,10 @@
href = mw.util.getUrl( 'Foo:Sandbox? 5+5=10! (test)/sub ' );
assert.equal( href, 
'/wiki/Foo:Sandbox%3F_5%2B5%3D10!_(test)/sub_', 'complex title' );
 
+   // T149767
+   href = mw.util.getUrl( 'My$$test$title' );
+   assert.equal( href, '/wiki/My$$test$title', 'title with 
multiple consecutive dollar signs' );
+
href = mw.util.getUrl();
assert.equal( href, '/wiki/Foobar', 'default title' );
 

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Don't prepend protocol in missing.php

2016-08-13 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Don't prepend protocol in missing.php
..

Don't prepend protocol in missing.php

WMF cluster interwiki URLs are no longer protocol relative.

Bug: T141208
Change-Id: Ief17e5c1a25765f3889690915823834f83092295
---
M wmf-config/missing.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wmf-config/missing.php b/wmf-config/missing.php
index 4fde31f..351f61d 100644
--- a/wmf-config/missing.php
+++ b/wmf-config/missing.php
@@ -96,7 +96,7 @@
if ( $iw_local ) {
# Redirect to the appropriate WMF wiki
# strtok gives us the remainder of the 
page title after the interwiki prefix
-   showRedirect( $protocol . ':' . 
str_replace( '$1', strtok( '' ), $iw_url ) );
+   showRedirect( str_replace( '$1', 
strtok( '' ), $iw_url ) );
return;
}
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix importation of weird file names in importTextFiles.php

2016-08-12 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Fix importation of weird file names in importTextFiles.php
..

Fix importation of weird file names in importTextFiles.php

When importing a file whose name starts with #, the script would call
Title::newFromText( '#foo' ), which succeeds (oddly enough) but causes
problems when trying to create the revision.

Also avoid fatals on actual invalid titles.

Bug: T142675
Change-Id: I6b4c8fd8dd09db14c0704c74137e112b292c964a
---
M maintenance/importTextFiles.php
1 file changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/304603/1

diff --git a/maintenance/importTextFiles.php b/maintenance/importTextFiles.php
index 5531ffc..95e458d 100644
--- a/maintenance/importTextFiles.php
+++ b/maintenance/importTextFiles.php
@@ -103,16 +103,15 @@
$timestamp = $useTimestamp ? wfTimestamp( TS_UNIX, 
filemtime( $file ) ) : wfTimestampNow();
 
$title = Title::newFromText( $pageName );
-   $exists = $title->exists();
-   $oldRevID = $title->getLatestRevID();
-   $oldRev = $oldRevID ? Revision::newFromId( $oldRevID ) 
: null;
-
-   if ( !$title ) {
+   if ( !$title || $title->getPrefixedText() === '' ) {
$this->error( "Invalid title $pageName. 
Skipping.\n" );
$skipCount++;
continue;
}
 
+   $exists = $title->exists();
+   $oldRevID = $title->getLatestRevID();
+   $oldRev = $oldRevID ? Revision::newFromId( $oldRevID ) 
: null;
$actualTitle = $title->getPrefixedText();
 
if ( $exists ) {

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

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

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


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

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

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

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, 106 insertions(+), 4 deletions(-)


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

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 719b66a..8ea40da 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -287,6 +287,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/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..aba520b 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' ],
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 +156,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/maintenance/archives/patch-change_tag-ct_id.sql 
b/maintenance/archives/patch-change_tag-ct_id.sql
new file mode 100644
index 000..7b986d6
--- /dev/null
+++ b/mai

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add GENDER support to email and user rights toolbox links

2016-08-06 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Add GENDER support to email and user rights toolbox links
..

Add GENDER support to email and user rights toolbox links

Also rephrasing the "User rights management" link to an action-based
phrase, using the more correct term "user groups" rather than "user
rights".

I filed T142322 about the inconsistent use of terminology in regards to
Special:UserRights.

Bug: T142316
Change-Id: I43c3fbe55e0065eee23294738745aa69d3f05202
---
M includes/skins/SkinTemplate.php
M languages/i18n/en.json
2 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/303406/1

diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index 69e2e8b..33c6eb1 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -1299,6 +1299,7 @@
 
if ( $this->showEmailUser( $user ) ) {
$nav_urls['emailuser'] = [
+   'text' => $this->msg( 
'tool-link-emailuser', $rootUser )->text(),
'href' => self::makeSpecialUrlSubpage( 
'Emailuser', $rootUser ),
'tooltip-params' => [ $rootUser ],
];
@@ -1309,6 +1310,7 @@
$sur->setContext( $this->getContext() );
if ( $sur->userCanExecute( $this->getUser() ) ) 
{
$nav_urls['userrights'] = [
+   'text' => $this->msg( 
'tool-link-userrights', $this->getUser()->getName() )->text(),
'href' => 
self::makeSpecialUrlSubpage( 'Userrights', $rootUser )
];
}
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index bc7d78d..9f7ec3e 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -205,6 +205,8 @@
"talk": "Discussion",
"views": "Views",
"toolbox": "Tools",
+   "tool-link-userrights": "Change {{GENDER:$1|user}} groups",
+   "tool-link-emailuser": "Email this {{GENDER:$1|user}}",
"userpage": "View user page",
"projectpage": "View project page",
"imagepage": "View file page",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix display of numeric tag names on Special:Tags

2016-08-06 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Fix display of numeric tag names on Special:Tags
..

Fix display of numeric tag names on Special:Tags

All tag names that were numbers (e.g. "123456") showed up as "0".

Change-Id: I8da326fa4dfa7e6556fb508c5e4b1f1573d1369b
---
M includes/specials/SpecialTags.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/303404/1

diff --git a/includes/specials/SpecialTags.php 
b/includes/specials/SpecialTags.php
index 2139949..3ebf5d0 100644
--- a/includes/specials/SpecialTags.php
+++ b/includes/specials/SpecialTags.php
@@ -128,8 +128,7 @@
ChangeTags::listExtensionDefinedTags(), true );
 
// List all defined tags, even if they were never applied
-   $definedTags = array_keys( array_merge(
-   $this->explicitlyDefinedTags, 
$this->extensionDefinedTags ) );
+   $definedTags = array_keys( $this->explicitlyDefinedTags + 
$this->extensionDefinedTags );
 
// Show header only if there exists atleast one tag
if ( !$tagStats && !$definedTags ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix display of action table cells on Special:Tags

2016-08-06 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Fix display of action table cells on Special:Tags
..

Fix display of action table cells on Special:Tags

Users with the managechangetags right but without the deletechangetags
right saw a jagged table, with cells missing from the Actions column.

Also, users with the deletechangetags right but without the
managechangetags didn't see a column header for the Actions column.

Change-Id: I66198cfb181ba8616a98b16f84eaa843f0352f70
---
M includes/specials/SpecialTags.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/303403/1

diff --git a/includes/specials/SpecialTags.php 
b/includes/specials/SpecialTags.php
index 2139949..3dac56b 100644
--- a/includes/specials/SpecialTags.php
+++ b/includes/specials/SpecialTags.php
@@ -143,7 +143,7 @@
Xml::tags( 'th', null, $this->msg( 'tags-source-header' 
)->parse() ) .
Xml::tags( 'th', null, $this->msg( 'tags-active-header' 
)->parse() ) .
Xml::tags( 'th', null, $this->msg( 
'tags-hitcount-header' )->parse() ) .
-   ( $userCanManage ?
+   ( ( $userCanManage || $userCanDelete ) ?
Xml::tags( 'th', [ 'class' => 'unsortable' ],
$this->msg( 'tags-actions-header' 
)->parse() ) :
'' )
@@ -261,7 +261,7 @@
 
}
 
-   if ( $actionLinks ) {
+   if ( $showDeleteActions || $showManageActions ) {
$newRow .= Xml::tags( 'td', null, 
$this->getLanguage()->pipeList( $actionLinks ) );
}
 

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

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

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


[MediaWiki-commits] [Gerrit] Make importTextFiles.php work with wildcards on the Windows ... - change (mediawiki/core)

2016-07-16 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Make importTextFiles.php work with wildcards on the Windows 
shell
..

Make importTextFiles.php work with wildcards on the Windows shell

The Windows command line doesn't automatically expand wildcards, unlike
Unix shells. So the script tried to run function calls like
file_get_contents( '*.txt' ), which do not work. This patch uses glob() to
simulate the behaviour of the Unix shell.

This was reported at https://www.mediawiki.org/wiki/Topic:T7hf8bz8u2p4ryol

Change-Id: I002344a19cb08cc8ac8ee75214339b2379b04dbe
---
M maintenance/importTextFiles.php
1 file changed, 10 insertions(+), 1 deletion(-)


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

diff --git a/maintenance/importTextFiles.php b/maintenance/importTextFiles.php
index 88ee9d7..5531ffc 100644
--- a/maintenance/importTextFiles.php
+++ b/maintenance/importTextFiles.php
@@ -63,7 +63,16 @@
if ( file_exists( $arg ) ) {
$files[$arg] = file_get_contents( $arg );
} else {
-   $this->error( "Fatal error: The file '$arg' 
does not exist!", 1 );
+   // use glob to support the Windows shell, which 
doesn't automatically
+   // expand wildcards
+   $found = false;
+   foreach ( glob( $arg ) as $filename ) {
+   $found = true;
+   $files[$filename] = file_get_contents( 
$filename );
+   }
+   if ( !$found ) {
+   $this->error( "Fatal error: The file 
'$arg' does not exist!", 1 );
+   }
}
};
 

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

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

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


[MediaWiki-commits] [Gerrit] Still allow HTTP interwiki URLs for the benefit of labs - change (mediawiki...WikimediaMaintenance)

2016-07-12 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Still allow HTTP interwiki URLs for the benefit of labs
..

Still allow HTTP interwiki URLs for the benefit of labs

We really need to fix HTTPS on labs...

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


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance 
refs/changes/95/298695/1

diff --git a/dumpInterwiki.php b/dumpInterwiki.php
index 1f3112e..d0b41a4 100644
--- a/dumpInterwiki.php
+++ b/dumpInterwiki.php
@@ -213,6 +213,7 @@
$this->addOption( 'dblist', 'File with one db per line', false, 
true );
$this->addOption( 'specialdbs', "File with one 'special' db per 
line", false, true );
$this->addOption( 'o', 'Cdb output file', false, true );
+   $this->addOption( 'insecure', 'Output wikimedia interwiki urls 
using HTTP instead of HTTPS', false, false );
 
global $wmfRealm;
if ( $wmfRealm === 'labs' ) {
@@ -248,8 +249,11 @@
$this->output( "return [\n" );
}
 
-   // everything is HTTPS nowadays
-   $this->urlprotocol = 'https:';
+   if ( $this->hasOption( 'insecure' ) ) {
+   $this->urlprotocol = 'http:';
+   } else {
+   $this->urlprotocol = 'https:';
+   }
 
$this->getRebuildInterwikiDump();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1457afee6950b60446a688571d91e3e852ef283
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] Force HTTPS for the interwiki map - change (mediawiki...WikimediaMaintenance)

2016-07-12 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Force HTTPS for the interwiki map
..

Force HTTPS for the interwiki map

Bug: T140206
Change-Id: I64a1ff4fcfe3b6130576c987ca78e8fa571c675c
---
M dumpInterwiki.php
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance 
refs/changes/93/298693/1

diff --git a/dumpInterwiki.php b/dumpInterwiki.php
index fb3c0bf..1f3112e 100644
--- a/dumpInterwiki.php
+++ b/dumpInterwiki.php
@@ -213,7 +213,6 @@
$this->addOption( 'dblist', 'File with one db per line', false, 
true );
$this->addOption( 'specialdbs', "File with one 'special' db per 
line", false, true );
$this->addOption( 'o', 'Cdb output file', false, true );
-   $this->addOption( 'protocolrelative', 'Output wikimedia 
interwiki urls as protocol relative', false, false );
 
global $wmfRealm;
if ( $wmfRealm === 'labs' ) {
@@ -249,11 +248,8 @@
$this->output( "return [\n" );
}
 
-   if ( $this->hasOption( 'protocolrelative' ) ) {
-   $this->urlprotocol = '';
-   } else {
-   $this->urlprotocol = 'http:';
-   }
+   // everything is HTTPS nowadays
+   $this->urlprotocol = 'https:';
 
$this->getRebuildInterwikiDump();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64a1ff4fcfe3b6130576c987ca78e8fa571c675c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] Linker: Avoid passing false to Title::newFromText - change (mediawiki/core)

2016-01-28 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Linker: Avoid passing false to Title::newFromText
..

Linker: Avoid passing false to Title::newFromText

This is needed because the call to substr() returns false when the string
is only 1 character long, which occurs when parsing degenerate links like
[[:]] and [[::|foo]].

The seemingly unnecessary test for $match[1] !== '' is for forwards
compatibility with PHP 7.

Bug: T116034
Change-Id: Icc19ee990d01958d64b938d298e9a7e1df7181b5
---
M includes/Linker.php
1 file changed, 23 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/267024/1

diff --git a/includes/Linker.php b/includes/Linker.php
index 4b9b963..75ba2ae 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -1445,31 +1445,34 @@
}
} else {
# Other kind of link
-   if ( preg_match( 
$wgContLang->linkTrail(), $match[3], $submatch ) ) {
-   $trail = $submatch[1];
-   } else {
-   $trail = "";
-   }
-   $linkRegexp = '/\[\[(.*?)\]\]' . 
preg_quote( $trail, '/' ) . '/';
+   # Make sure its target is non-empty
if ( isset( $match[1][0] ) && 
$match[1][0] == ':' ) {
$match[1] = substr( $match[1], 
1 );
}
-   list( $inside, $trail ) = 
Linker::splitTrail( $trail );
-
-   $linkText = $text;
-   $linkTarget = 
Linker::normalizeSubpageLink( $title, $match[1], $linkText );
-
-   $target = Title::newFromText( 
$linkTarget );
-   if ( $target ) {
-   if ( $target->getText() == '' 
&& !$target->isExternal()
-   && !$local && $title
-   ) {
-   $newTarget = clone 
$title;
-   
$newTarget->setFragment( '#' . $target->getFragment() );
-   $target = $newTarget;
+   if ( $match[1] !== false && $match[1] 
!== '' ) {
+   if ( preg_match( 
$wgContLang->linkTrail(), $match[3], $submatch ) ) {
+   $trail = $submatch[1];
+   } else {
+   $trail = "";
}
+   $linkRegexp = '/\[\[(.*?)\]\]' 
. preg_quote( $trail, '/' ) . '/';
+   list( $inside, $trail ) = 
Linker::splitTrail( $trail );
 
-   $thelink = 
Linker::makeCommentLink( $target, $linkText . $inside, $wikiId ) . $trail;
+   $linkText = $text;
+   $linkTarget = 
Linker::normalizeSubpageLink( $title, $match[1], $linkText );
+
+   $target = Title::newFromText( 
$linkTarget );
+   if ( $target ) {
+   if ( $target->getText() 
== '' && !$target->isExternal()
+   && !$local && 
$title
+   ) {
+   $newTarget = 
clone $title;
+   
$newTarget->setFragment( '#' . $target->getFragment() );
+   $target = 
$newTarget;
+   }
+
+   $thelink = 
Linker::makeCommentLink( $target, $linkText . $inside, $wikiId ) . $trail;
+   }
}
}
if ( $thelink ) {

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

Gerrit-MessageType: ne

[MediaWiki-commits] [Gerrit] Title::newFromText: Cast integers to strings - change (mediawiki/core)

2016-01-28 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Title::newFromText: Cast integers to strings
..

Title::newFromText: Cast integers to strings

This is the cause of the T76305 debug log entries relating to SpecialExport
and Echo.

Bug: T76305
Change-Id: I64d629d31be79c4b4702a4298bce68fd544df6e8
---
M includes/Title.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/267023/1

diff --git a/includes/Title.php b/includes/Title.php
index e549037..1d86178 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -259,6 +259,10 @@
if ( is_object( $text ) ) {
throw new InvalidArgumentException( '$text must be a 
string.' );
}
+   // DWIM: Integers can be passed in here when page titles are 
used as array keys.
+   if ( is_int( $text ) ) {
+   $text = "$text";
+   }
if ( $text !== null && !is_string( $text ) ) {
wfDebugLog( 'T76305', wfGetAllCallers( 5 ) );
return null;

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

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

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


[MediaWiki-commits] [Gerrit] Rephrase first sentence of cookie-policy-notification-message - change (mediawiki...CookiePolicy)

2016-01-17 Thread TTO (Code Review)
TTO has submitted this change and it was merged.

Change subject: Rephrase first sentence of cookie-policy-notification-message
..


Rephrase first sentence of cookie-policy-notification-message

Thread:
https://translatewiki.net/wiki/Thread:Translating_talk:MediaWiki/About_MediaWiki:Cookie-policy-notification-message/ksh

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

Approvals:
  TTO: Verified; Looks good to me, approved
  Florianschmidtwelzow: Looks good to me, approved
  Nemo bis: Looks good to me, but someone else must approve



diff --git a/i18n/en.json b/i18n/en.json
index e32301d..c6dea85 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -6,7 +6,7 @@
]
},
"cookie-policy-description": "In the EU, there is a law that users be 
notified of a web site's cookie usage upon arriving there for the first time. 
This extension allows {{int:cookie-policy-site-name}} to be in compliance with 
this law.",
-   "cookie-policy-notification-message": "{{int:cookie-policy-site-name}} 
uses cookies to give you the best experience on our websites. By continuing to 
use {{int:cookie-policy-site-name}}, we assume that you accept our use of 
cookies.",
+   "cookie-policy-notification-message": "By continuing to use 
{{int:cookie-policy-site-name}}, we assume that you accept our use of cookies 
to give you the best experience.",
"cookie-policy-read-more": "Read more about cookies",
"cookie-policy-link": 
"http://www.example.com/wiki/Privacy_policy#Cookies";,
"cookie-policy-site-name": "{{SITENAME}}"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3845be851bbbd173121a77f174598878afaf8432
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CookiePolicy
Gerrit-Branch: master
Gerrit-Owner: IoannisKydonis 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Nemo bis 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: TTO 
Gerrit-Reviewer: UltrasonicNXT 

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


[MediaWiki-commits] [Gerrit] Improve wording and tense in some "page language" strings - change (mediawiki/core)

2016-01-15 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Improve wording and tense in some "page language" strings
..

Improve wording and tense in some "page language" strings

The titles of "action" special pages are normally expressed as actions
("Move page", "Reset password", "Upload file"), and the names of
log types are normally nouns ("Deletion log", "Content model change log").

In any case, "Change language log" and "$1 changed page language for $3"
are not good English.

Log entries also do not end in full stops.

Change-Id: I1d2fed64549ce584418bb3b72d33bf5657c2681f
---
M languages/i18n/en.json
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/264443/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index b436f90..7742352f 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -3850,7 +3850,7 @@
"expand_templates_preview_fail_html": "Because {{SITENAME}} has raw 
HTML enabled and there was a loss of session data, the preview is hidden as a 
precaution against JavaScript attacks.\n\nIf this is a legitimate 
preview attempt, please try again.\nIf it still does not work, try 
[[Special:UserLogout|logging out]] and logging back in.",
"expand_templates_preview_fail_html_anon": "Because {{SITENAME}} 
has raw HTML enabled and you are not logged in, the preview is hidden as a 
precaution against JavaScript attacks.\n\nIf this is a legitimate 
preview attempt, please [[Special:UserLogin|log in]] and try again.",
"expand_templates_input_missing": "You need to provide at least some 
input text.",
-   "pagelanguage": "Page language selector",
+   "pagelanguage": "Change page language",
"pagelang-name": "Page",
"pagelang-language": "Language",
"pagelang-use-default": "Use default language",
@@ -3858,9 +3858,9 @@
"pagelang-submit": "Submit",
"right-pagelang": "Change page language",
"action-pagelang": "change the page language",
-   "log-name-pagelang": "Change language log",
+   "log-name-pagelang": "Language change log",
"log-description-pagelang": "This is a log of changes in page 
languages.",
-   "logentry-pagelang-pagelang": "$1 {{GENDER:$2|changed}} page language 
for $3 from $4 to $5.",
+   "logentry-pagelang-pagelang": "$1 {{GENDER:$2|changed}} the language of 
$3 from $4 to $5",
"default-skin-not-found": "Whoops! The default skin for your wiki, 
defined in $wgDefaultSkin as $1, is not 
available.\n\nYour installation seems to include the following 
{{PLURAL:$4|skin|skins}}. See 
[https://www.mediawiki.org/wiki/Manual:Skin_configuration Manual: Skin 
configuration] for information how to enable {{PLURAL:$4|it|them and choose the 
default}}.\n\n$2\n\n; If you have just installed MediaWiki:\n: You probably 
installed from git, or directly from the source code using some other method. 
This is expected. Try installing some skins from 
[https://www.mediawiki.org/wiki/Category:All_skins mediawiki.org's skin 
directory], by:\n:* Downloading the [https://www.mediawiki.org/wiki/Download 
tarball installer], which comes with several skins and extensions. You can copy 
and paste the skins/ directory from it.\n:* Downloading individual 
skin tarballs from [https://www.mediawiki.org/wiki/Special:SkinDistributor 
mediawiki.org].\n:* 
[https://www.mediawiki.org/wiki/Download_from_Git#Using_Git_to_download_MediaWiki_skins
 Using Git to download skins].\n: Doing this should not interfere with your git 
repository if you're a MediaWiki developer.\n\n; If you have just upgraded 
MediaWiki:\n: MediaWiki 1.24 and newer no longer automatically enables 
installed skins (see [https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery 
Manual: Skin autodiscovery]). You can paste the following 
{{PLURAL:$5|line|lines}} into LocalSettings.php to enable 
{{PLURAL:$5|the|all}} installed {{PLURAL:$5|skin|skins}}:\n\n$3\n\n; If you have just modified 
LocalSettings.php:\n: Double-check the skin names for typos.",
"default-skin-not-found-no-skins": "Whoops! The default skin for your 
wiki, defined in $wgDefaultSkin as $1, is not 
available.\n\nYou have no installed skins.\n\n; If you have just installed or 
upgraded MediaWiki:\n: You probably installed from git, or directly from the 
source code using some other method. This is expected. MediaWiki 1.24 and newer 
doesn't include any skins in the main repository. Try installing some skins 
from [https://www.mediawiki.org/wiki/Category:All_skins mediawiki.org's skin 
directory], by:\n:* Downloading the [https://www.mediawiki.org/wiki/Download 
tarball installer], which comes with several skins and extensions. You can copy 
and paste the skins/ directory from it.\n:* Downloading individual 
skin tarballs from [https://www.mediawiki.org/wiki/Special:SkinDistri

[MediaWiki-commits] [Gerrit] Prevent revisions with rev_page = 0 from being inserted into... - change (mediawiki/core)

2016-01-12 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Prevent revisions with rev_page = 0 from being inserted into 
the DB
..

Prevent revisions with rev_page = 0 from being inserted into the DB

There's no good reason to ever do this, or to write code that lets it
happen. The revisions are just going to sit around in the DB, not
connected to anything (except maybe in some page's page_latest field,
if you're lucky). Any operations that do this should fail fast instead
of spamming the DB and appearing to "succeed".

Change-Id: I8219153a09adb1c556d0159a4fb0799895370a94
---
M includes/Revision.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/263604/1

diff --git a/includes/Revision.php b/includes/Revision.php
index 1d7ac72..f94f51d 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -1366,6 +1366,11 @@
public function insertOn( $dbw ) {
global $wgDefaultExternalStore, $wgContentHandlerUseDB;
 
+   // Not allowed to have rev_page equal to 0, false, etc.
+   if ( !$this->mPage ) {
+   throw new MWException( "Cannot insert revision: page ID 
must be nonzero" );
+   }
+
$this->checkContentModel();
 
$data = $this->mText;

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

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

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


[MediaWiki-commits] [Gerrit] Update the WikiPage object with the new ID when undeleting - change (mediawiki/core)

2016-01-12 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Update the WikiPage object with the new ID when undeleting
..

Update the WikiPage object with the new ID when undeleting

Issue introduced by 0aa6486cbff1e0de05a91cb88158588595f4a872.

Change-Id: I2c4fde5e66f280a6bc2de1b13453f1c40385a20d
---
M includes/page/WikiPage.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/263603/1

diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index e3e6e15..7bd87f7 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1172,11 +1172,11 @@
 * @return bool|int The newly created page_id key; false if the title 
already existed
 */
public function insertOn( $dbw, $pageId = null ) {
-   $pageId = $pageId ?: $dbw->nextSequenceValue( 
'page_page_id_seq' );
+   $pageIdForInsert = $pageId ?: $dbw->nextSequenceValue( 
'page_page_id_seq' );
$dbw->insert(
'page',
array(
-   'page_id'   => $pageId,
+   'page_id'   => $pageIdForInsert,
'page_namespace'=> 
$this->mTitle->getNamespace(),
'page_title'=> 
$this->mTitle->getDBkey(),
'page_restrictions' => '',
@@ -1192,7 +1192,7 @@
);
 
if ( $dbw->affectedRows() > 0 ) {
-   $newid = $dbw->insertId();
+   $newid = $pageId ?: $dbw->insertId();
$this->mId = $newid;
$this->mTitle->resetArticleID( $newid );
 

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

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

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


[MediaWiki-commits] [Gerrit] Fix exception in Import, when import of a revision fails - change (mediawiki/core)

2016-01-09 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Fix exception in Import, when import of a revision fails
..

Fix exception in Import, when import of a revision fails

A 'notice' is thrown when an import fails, for some reason,
such as the user does not have permission, and the reason
is reported to the user.

In this case, $title is false and not a Title object,
as needed by the beforeImportPage callback (which calls
WikiPage::factory).  As well, $pageInfo['_title'] is undefined,
in pageOutCallback, which also calls WikiPage::factory via
finishImportPage.

Bug: T108544
Change-Id: I55042fdf305cd1198d3a4b28a0ebb5ce31b76a1f
(cherry picked from commit 9442adf96d61579a15821248fd0b7560bfadb77c)
---
M includes/Import.php
1 file changed, 13 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/263205/1

diff --git a/includes/Import.php b/includes/Import.php
index d31be43..31f783d 100644
--- a/includes/Import.php
+++ b/includes/Import.php
@@ -717,13 +717,14 @@
$title = $this->processTitle( 
$pageInfo['title'],
isset( $pageInfo['ns'] ) ? 
$pageInfo['ns'] : null );
 
-   if ( !$title ) {
+   // $title is either an array of two 
titles or false.
+   if ( is_array( $title ) ) {
+   $this->pageCallback( $title );
+   list( $pageInfo['_title'], 
$foreignTitle ) = $title;
+   } else {
$badTitle = true;
$skip = true;
}
-
-   $this->pageCallback( $title );
-   list( $pageInfo['_title'], 
$foreignTitle ) = $title;
}
 
if ( $title ) {
@@ -739,10 +740,17 @@
}
}
 
-   $this->pageOutCallback( $pageInfo['_title'], $foreignTitle,
+   // @note $pageInfo is only set if a valid $title is processed 
above with
+   //   no error. If we have a valid $title, then pageCallback 
is called
+   //   above, $pageInfo['title'] is set and we do 
pageOutCallback here.
+   //   If $pageInfo['_title'] is not set, then $foreignTitle 
is also not
+   //   set since they both come from $title above.
+   if ( array_key_exists( '_title', $pageInfo ) ) {
+   $this->pageOutCallback( $pageInfo['_title'], 
$foreignTitle,
$pageInfo['revisionCount'],
$pageInfo['successfulRevisionCount'],
$pageInfo );
+   }
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55042fdf305cd1198d3a4b28a0ebb5ce31b76a1f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_25
Gerrit-Owner: TTO 
Gerrit-Reviewer: Aude 

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


[MediaWiki-commits] [Gerrit] Fix exception in Import, when import of a revision fails - change (mediawiki/core)

2016-01-09 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Fix exception in Import, when import of a revision fails
..

Fix exception in Import, when import of a revision fails

A 'notice' is thrown when an import fails, for some reason,
such as the user does not have permission, and the reason
is reported to the user.

In this case, $title is false and not a Title object,
as needed by the beforeImportPage callback (which calls
WikiPage::factory).  As well, $pageInfo['_title'] is undefined,
in pageOutCallback, which also calls WikiPage::factory via
finishImportPage.

Bug: T108544
Change-Id: I55042fdf305cd1198d3a4b28a0ebb5ce31b76a1f
(cherry picked from commit 9442adf96d61579a15821248fd0b7560bfadb77c)
---
M includes/Import.php
1 file changed, 13 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/263202/1

diff --git a/includes/Import.php b/includes/Import.php
index 6a0bfd0..db4a6b2 100644
--- a/includes/Import.php
+++ b/includes/Import.php
@@ -728,13 +728,14 @@
$title = $this->processTitle( 
$pageInfo['title'],
isset( $pageInfo['ns'] ) ? 
$pageInfo['ns'] : null );
 
-   if ( !$title ) {
+   // $title is either an array of two 
titles or false.
+   if ( is_array( $title ) ) {
+   $this->pageCallback( $title );
+   list( $pageInfo['_title'], 
$foreignTitle ) = $title;
+   } else {
$badTitle = true;
$skip = true;
}
-
-   $this->pageCallback( $title );
-   list( $pageInfo['_title'], 
$foreignTitle ) = $title;
}
 
if ( $title ) {
@@ -750,10 +751,17 @@
}
}
 
-   $this->pageOutCallback( $pageInfo['_title'], $foreignTitle,
+   // @note $pageInfo is only set if a valid $title is processed 
above with
+   //   no error. If we have a valid $title, then pageCallback 
is called
+   //   above, $pageInfo['title'] is set and we do 
pageOutCallback here.
+   //   If $pageInfo['_title'] is not set, then $foreignTitle 
is also not
+   //   set since they both come from $title above.
+   if ( array_key_exists( '_title', $pageInfo ) ) {
+   $this->pageOutCallback( $pageInfo['_title'], 
$foreignTitle,
$pageInfo['revisionCount'],
$pageInfo['successfulRevisionCount'],
$pageInfo );
+   }
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55042fdf305cd1198d3a4b28a0ebb5ce31b76a1f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_26
Gerrit-Owner: TTO 
Gerrit-Reviewer: Aude 

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


[MediaWiki-commits] [Gerrit] Remove some uses of $wgTitle in core - change (mediawiki/core)

2016-01-07 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Remove some uses of $wgTitle in core
..

Remove some uses of $wgTitle in core

- EditPage no longer uses $wgTitle. It now always uses the $this->mTitle
  member variable.

  In core, the code that read $wgTitle was only used by action=edit itself.
  As far as I can tell, $wgTitle and $this->mTitle always point to the same
  title in this scenario.

  No extensions in Git are affected.

- Linker::makeExternalLink no longer uses $wgTitle. This means that if
  the optional $title parameter is not passed in, the value of
  $wgNoFollowNsExceptions will not be checked when deciding whether or not
  to add rel="nofollow" to the link. Arguably $title should be made a
  mandatory parameter, but its place in the argument list makes this
  problematic.

  Uses of this function in core are updated to take account of this change.

  Extensions using this function are doing so from a special page
  or other non-user-content context, so do not require any change.

- Parser::transformMsg no longer uses $wgTitle if the $title parameter is
  null, instead using the $mTitle member variable.

  This doesn't affect core, but does affect the SemanticForms and
  Intersection extensions. (SemanticForms is still using $wgParser, so I'm
  not going to bother patching it. They can figure it out themselves.)

  Patch for Intersection is I17cb16fc3f9912cff1832d7eec09c4d9048f146c

Bug: T25307
Change-Id: I69ae09dabfcadafc1f964e2770ee184e2b34116e
---
M RELEASE-NOTES-1.27
M includes/EditPage.php
M includes/Linker.php
M includes/api/ApiEditPage.php
M includes/api/ApiParse.php
M includes/parser/Parser.php
6 files changed, 36 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/263030/1

diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27
index 9b12b72..329db8e 100644
--- a/RELEASE-NOTES-1.27
+++ b/RELEASE-NOTES-1.27
@@ -61,6 +61,7 @@
   $wgSharedDB and $wgSharedTables are properly set even on the "central" wiki
   that all others are sharing from and that $wgLocalDatabases is set to the
   full list of sharing wikis on all those wikis.
+* Adding NS_SPECIAL (-1) to $wgNoFollowNsExceptions no longer has any effect.
 
 === New features in 1.27 ===
 * $wgDataCenterId and $wgDataCenterRoles where added, which will serve as
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 47912cb..c3c23b3 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -436,15 +436,12 @@
 
/**
 * Get the context title object.
-* If not set, $wgTitle will be returned. This behavior might change in
-* the future to return $this->mTitle instead.
 *
 * @return Title
 */
public function getContextTitle() {
if ( is_null( $this->mContextTitle ) ) {
-   global $wgTitle;
-   return $wgTitle;
+   return $this->mTitle;
} else {
return $this->mContextTitle;
}
diff --git a/includes/Linker.php b/includes/Linker.php
index 80e4c62..6df37c9 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -1038,13 +1038,14 @@
 * @param bool $escape Do we escape the link text?
 * @param string $linktype Type of external link. Gets added to the 
classes
 * @param array $attribs Array of extra attributes to 
-* @param Title|null $title Title object used for title specific link 
attributes
+* @param Title|null $title Title object used for title specific link
+* attributes. This parameter is only relevant when the external link is
+* in page content, and should be left null for links in the UI
 * @return string
 */
public static function makeExternalLink( $url, $text, $escape = true,
$linktype = '', $attribs = array(), $title = null
) {
-   global $wgTitle;
$class = "external";
if ( $linktype ) {
$class .= " $linktype";
@@ -1058,9 +1059,6 @@
$text = htmlspecialchars( $text );
}
 
-   if ( !$title ) {
-   $title = $wgTitle;
-   }
$attribs['rel'] = Parser::getExternalLinkRel( $url, $title );
$link = '';
$success = Hooks::run( 'LinkerMakeExternalLink',
@@ -1509,7 +1507,10 @@
$title->getFragment()
),
$text,
-   /* escape = */ false // Already escaped
+   /* escape = */ false, // Already escaped
+   /* linktype = */ '',
+   /* attribs = */ array(),
+

[MediaWiki-commits] [Gerrit] DynamicPageListHooks: Set parser context title - change (mediawiki...intersection)

2016-01-07 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: DynamicPageListHooks: Set parser context title
..

DynamicPageListHooks: Set parser context title

This avoids the use of $wgTitle inside the Parser class.

Bug: T25307
Change-Id: I17cb16fc3f9912cff1832d7eec09c4d9048f146c
---
M DynamicPageList.hooks.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/intersection 
refs/changes/29/263029/1

diff --git a/DynamicPageList.hooks.php b/DynamicPageList.hooks.php
index 7abe1ae..38bb697 100644
--- a/DynamicPageList.hooks.php
+++ b/DynamicPageList.hooks.php
@@ -69,6 +69,7 @@
$parameters = explode( "\n", $input );
 
$parser = new Parser;
+   $parser->setTitle( $mwParser->getTitle() );
$poptions = new ParserOptions;
 
foreach ( $parameters as $parameter ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17cb16fc3f9912cff1832d7eec09c4d9048f146c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/intersection
Gerrit-Branch: master
Gerrit-Owner: TTO 

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


[MediaWiki-commits] [Gerrit] Fix parserTests after f66ff602447c - change (mediawiki/core)

2016-01-06 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Fix parserTests after f66ff602447c
..

Fix parserTests after f66ff602447c

Change-Id: If3691cb022211e78093e1cbd36dbb76b6d5f674b
---
M tests/parser/parserTest.inc
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/262863/1

diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc
index b91a5bc..6a6d447 100644
--- a/tests/parser/parserTest.inc
+++ b/tests/parser/parserTest.inc
@@ -962,7 +962,7 @@
'protected_titles', 'revision', 'text', 'pagelinks', 
'imagelinks',
'categorylinks', 'templatelinks', 'externallinks', 
'langlinks', 'iwlinks',
'site_stats', 'ipblocks', 'image', 'oldimage',
-   'recentchanges', 'watchlist', 'interwiki', 'logging',
+   'recentchanges', 'watchlist', 'interwiki', 'logging', 
'log_search',
'querycache', 'objectcache', 'job', 'l10n_cache', 
'redirect', 'querycachetwo',
'archive', 'user_groups', 'page_props', 'category'
);

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

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

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


[MediaWiki-commits] [Gerrit] Refactor console reporting for importDump.php - change (mediawiki/core)

2016-01-03 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Refactor console reporting for importDump.php
..

Refactor console reporting for importDump.php

- Fix reporting interval parameter for log entries
- Count uploads
- More useful stats if importing a combined dump
- Output final status line at conclusion of import process

Bug: T121997
Change-Id: Ie03908e346269bc52847a80c76b42324af6aecdc
---
M maintenance/importDump.php
1 file changed, 36 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/262100/1

diff --git a/maintenance/importDump.php b/maintenance/importDump.php
index 5806ffc..80ffb10 100644
--- a/maintenance/importDump.php
+++ b/maintenance/importDump.php
@@ -35,6 +35,8 @@
public $reportingInterval = 100;
public $pageCount = 0;
public $revCount = 0;
+   public $logCount = 0;
+   public $uploadCount = 0;
public $dryRun = false;
public $uploads = false;
public $imageBasePath = false;
@@ -106,6 +108,7 @@
$this->importFromStdin();
}
 
+   $this->report( true );
$this->output( "Done!\n" );
$this->output( "You might want to run rebuildrecentchanges.php 
to regenerate RecentChanges\n" );
}
@@ -194,9 +197,10 @@
if ( $this->skippedNamespace( $revision ) ) {
return false;
}
-   $this->uploadCount++;
-   // $this->report();
+
$this->progress( "upload: " . $revision->getFilename() 
);
+   $this->uploadCount++;
+   $this->report();
 
if ( !$this->dryRun ) {
// bluuuh hack
@@ -214,7 +218,7 @@
if ( $this->skippedNamespace( $rev ) ) {
return;
}
-   $this->revCount++;
+   $this->logCount++;
$this->report();
 
if ( !$this->dryRun ) {
@@ -223,7 +227,8 @@
}
 
function report( $final = false ) {
-   if ( $final xor ( $this->pageCount % $this->reportingInterval 
== 0 ) ) {
+   $reportCount = $this->pageCount + $this->logCount;
+   if ( $final xor ( $reportCount % $this->reportingInterval == 0 
) ) {
$this->showReport();
}
}
@@ -233,17 +238,41 @@
$delta = microtime( true ) - $this->startTime;
if ( $delta ) {
$rate = sprintf( "%.2f", $this->pageCount / 
$delta );
-   $revrate = sprintf( "%.2f", $this->revCount / 
$delta );
+   // Consider log items as revisions for the rate 
stats (the user will
+   // figure it out fairly quickly)
+   $revrate = sprintf( "%.2f", ( $this->revCount + 
$this->logCount ) / $delta );
} else {
$rate = '-';
$revrate = '-';
}
+
+   $thingsToReport = array();
+   if ( $this->pageCount ) {
+   $thingsToReport[] = "$this->pageCount pages";
+   }
+   if ( $this->revCount ) {
+   $thingsToReport[] = "$this->revCount revs";
+   }
+   if ( $this->uploadCount ) {
+   $thingsToReport[] = "$this->uploadCount 
uploads";
+   }
+   if ( $this->logCount ) {
+   $thingsToReport[] = "$this->logCount logs";
+   }
+
+   if ( !$thingsToReport ) {
+   $output = 'Nothing imported';
+   } else {
+   $output = implode( ', ', $thingsToReport );
+   }
+
# Logs dumps don't have page tallies
if ( $this->pageCount ) {
-   $this->progress( "$this->pageCount ($rate 
pages/sec $revrate revs/sec)" );
+   $output .= " ($rate pages/sec $revrate 
revs/sec)";
} else {
-   $this->progress( "$this->revCount ($revrate 
revs/sec)" );
+   $output .= " ($revrate revs/sec)";
}
+   $this->progress( $output );
}
wfWaitForSlaves();
}

-- 
To view, visit https://gerrit.wikimedia.org/r/262100
To unsubscribe, visit https://gerr

[MediaWiki-commits] [Gerrit] Restore changes to WikiRevision that were lost in cdeba4cfc7c - change (mediawiki/core)

2016-01-03 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Restore changes to WikiRevision that were lost in cdeba4cfc7c
..

Restore changes to WikiRevision that were lost in cdeba4cfc7c

The commit cdeba4cfc7c unintentionally "reverted" part of commits
0623aeb922e and b14d581dab1.

Change-Id: I19334bd6b871ab0555c6db873a67e9350114
---
M includes/import/WikiRevision.php
1 file changed, 13 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/262099/1

diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php
index 6c238cf..7476636 100644
--- a/includes/import/WikiRevision.php
+++ b/includes/import/WikiRevision.php
@@ -490,7 +490,7 @@
$prevId = $dbw->selectField( 'revision', 'rev_id',
array(
'rev_page' => $pageId,
-   'rev_timestamp <= ' . $dbw->timestamp( 
$this->timestamp ),
+   'rev_timestamp <= ' . $dbw->addQuotes( 
$dbw->timestamp( $this->timestamp ) ),
),
__METHOD__,
array( 'ORDER BY' => array(
@@ -534,6 +534,16 @@
 
function importLogItem() {
$dbw = wfGetDB( DB_MASTER );
+
+   $user = User::newFromName( $this->getUser() );
+   if ( $user ) {
+   $userId = intval( $user->getId() );
+   $userText = $user->getName();
+   } else {
+   $userId = 0;
+   $userText = $this->getUser();
+   }
+
# @todo FIXME: This will not record autoblocks
if ( !$this->getTitle() ) {
wfDebug( __METHOD__ . ": skipping invalid 
{$this->type}/{$this->action} log time, timestamp " .
@@ -566,8 +576,8 @@
'log_type' => $this->type,
'log_action' => $this->action,
'log_timestamp' => $dbw->timestamp( $this->timestamp ),
-   'log_user' => User::idFromName( $this->user_text ),
-   # 'log_user_text' => $this->user_text,
+   'log_user' => $userId,
+   'log_user_text' => $userText,
'log_namespace' => $this->getTitle()->getNamespace(),
'log_title' => $this->getTitle()->getDBkey(),
'log_comment' => $this->getComment(),

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

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

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


[MediaWiki-commits] [Gerrit] Change methods in class AdminRights to be static - change (mediawiki...SpellingDictionary)

2016-01-03 Thread TTO (Code Review)
TTO has submitted this change and it was merged.

Change subject: Change methods in class AdminRights to be static
..


Change methods in class AdminRights to be static

Bug: T122761
Change-Id: I3ebac4563a015535f3ce5ac65863f9af11f6bc79
---
M includes/AdminRights.php
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  TTO: Verified; Looks good to me, approved



diff --git a/includes/AdminRights.php b/includes/AdminRights.php
index 1efed4c..b1594ab 100644
--- a/includes/AdminRights.php
+++ b/includes/AdminRights.php
@@ -3,7 +3,7 @@
 // namespace SpellingDictionary;
 
 class AdminRights {
-   public function displayAllWords() {
+   public static function displayAllWords() {
global $wgSpellingDictionaryDatabase;
$dbr = wfGetDB( DB_SLAVE, array(), 
$wgSpellingDictionaryDatabase );
$rows = $dbr->select(
@@ -22,7 +22,7 @@
return $words;
}
 
-   public function displayByLanguage( $language ) {
+   public static function displayByLanguage( $language ) {
global $wgSpellingDictionaryDatabase;
$dbr = wfGetDB( DB_SLAVE, array(), 
$wgSpellingDictionaryDatabase );
$rows = $dbr->select(
@@ -33,7 +33,6 @@
),
__METHOD__
);
-   $result = array();
$words = "";
foreach ( $rows as $row ) {
$words .= $row->sd_word . " of language " . 
$row->sd_language;
@@ -42,7 +41,7 @@
return $words;
}
 
-   public function deleteSpelling( $spelling ) {
+   public static function deleteSpelling( $spelling ) {
global $wgSpellingDictionaryDatabase;
$dbr = wfGetDB( DB_SLAVE, array(), 
$wgSpellingDictionaryDatabase );
$rows = $dbr->delete(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ebac4563a015535f3ce5ac65863f9af11f6bc79
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SpellingDictionary
Gerrit-Branch: master
Gerrit-Owner: Victorbarbu 
Gerrit-Reviewer: Ankitashukla 
Gerrit-Reviewer: TTO 

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


[MediaWiki-commits] [Gerrit] Replace language selection dropdown with ULS - change (mediawiki...SpellingDictionary)

2016-01-03 Thread TTO (Code Review)
TTO has submitted this change and it was merged.

Change subject: Replace language selection dropdown with ULS
..


Replace language selection dropdown with ULS

Replaced the language selection dropdown (present on
Special:SpellingDictionary and Special:ViewByLanguage)
with Universal Language Selector extension.

Bug: T87244
Change-Id: I828e1ef3085003844bbd1956b3325a7edf816db5
---
M Resources.php
M i18n/en.json
M i18n/qqq.json
A modules/ext.SpellingDictionary.styles.css
A modules/ext.SpellingDictionary.submitWord.js
A modules/ext.SpellingDictionary.viewByLanguage.js
M specials/SpecialSpellingDictionary.php
M specials/SpecialViewByLanguage.php
8 files changed, 233 insertions(+), 833 deletions(-)

Approvals:
  TTO: Verified; Looks good to me, approved



diff --git a/Resources.php b/Resources.php
index f99ca0a..4e1dc8d 100644
--- a/Resources.php
+++ b/Resources.php
@@ -6,9 +6,10 @@
  * @license GPL-2.0+
  */
 
-// Initialize an easy to use shortcut:
-$dir = dirname( __FILE__ );
-$dirbasename = basename( $dir );
+$resourcePaths = array(
+   'localBasePath' => __DIR__,
+   'remoteExtPath' => 'Spellingictionary/' . basename( __DIR__ )
+);
 
 // Register modules
 // See also http://www.mediawiki.org/wiki/Manual:$wgResourceModules
@@ -30,7 +31,41 @@
'mediawiki.Title',
'oojs-ui',
),
-
-   'localBasePath' => $dir,
-   'remoteExtPath' => 'SpellingDictionary/' . $dirbasename,
-);
\ No newline at end of file
+) + $resourcePaths;
+$wgResourceModules['ext.SpellingDictionary.styles'] = array(
+   'styles' => 'modules/ext.SpellingDictionary.styles.css',
+) + $resourcePaths;
+$wgResourceModules['ext.SpellingDictionary.viewByLanguage'] = array(
+   'scripts' => 'modules/ext.SpellingDictionary.viewByLanguage.js',
+   'messages' => array(
+   'sd-admin-select-language',
+   'view-by-lang-section-chooselanguage',
+   'sd-admin-view-selected-language',
+   'uls-select-language',
+   ),
+   'dependencies' => array(
+   'jquery.uls',
+   'oojs-ui',
+   'jquery.i18n',
+   'mediawiki.jqueryMsg',
+   'ext.uls.messages',
+   'ext.SpellingDictionary.styles',
+   ),
+) + $resourcePaths;
+$wgResourceModules['ext.SpellingDictionary.submitWord'] = array(
+   'scripts' => 'modules/ext.SpellingDictionary.submitWord.js',
+   'messages' => array(
+   'add-word-form-submit',
+   'add-word-section-addword',
+   'spell-dict-word',
+   'spell-dict-language',
+   ),
+   'dependencies' => array(
+   'jquery.uls',
+   'oojs-ui',
+   'jquery.i18n',
+   'mediawiki.jqueryMsg',
+   'ext.uls.messages',
+   'ext.SpellingDictionary.styles',
+   )
+) + $resourcePaths;
diff --git a/i18n/en.json b/i18n/en.json
index e8c4e06..00e7e7b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -26,5 +26,7 @@
"view-by-lang-intro": "View words sorted by language.",
"sd-admin-importexport": "Import and export",
"sd-admin-select-language": "Select language to view spellings",
-   "sd-admin-view-selected-language": "View spellings"
+   "sd-admin-view-selected-language": "View spellings",
+   "view-by-lang-section-chooselanguage": "Choose language",
+   "add-word-section-addword": "Add a new word"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3d70dd1..d5a8eba 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -9,5 +9,7 @@
"intro-paragraph-admin": "Intro paragraph shown on 
Special:SpellingDictionaryAdmin.",
"spell-dict-word": "Form label for word field to add word",
"spell-dict-lang": "Form label for language field to add word",
-   "add-word-form-submit": "Submit button of form"
+   "add-word-form-submit": "Submit button of form",
+   "-section-chooselanguage": "Title for the section for choosing the 
language",
+   "-section-addword": "Title for the section for adding a new word"
 }
\ No newline at end of file
diff --git a/modules/ext.SpellingDictionary.styles.css 
b/modules/ext.SpellingDictionary.styles.css
new file mode 100644
index 000..e22a088
--- /dev/null
+++ b/modules/ext.SpellingDictionary.styles.css
@@ -0,0 +1,8 @@
+.ext-spellingdictionary-fullwidth {
+   width: 100%;
+   text-align: left;
+}
+.ext-spellingdictionary-fullwidth > a {
+   width: 100%;
+   box-sizing: border-box;
+}
\ No newline at end of file
diff --git a/modules/ext.SpellingDictionary.submitWord.js 
b/modules/ext.SpellingDictionary.submitWord.js
new file mode 100644
index 000..3ab977a
--- /dev/null
+++ b/modules/ext.SpellingDictionary.submitWord.js
@@ -0,0 +1,75 @@
+(function( $, mw ) {
+   'use strict';
+
+   $( function() {
+
+   var $originalForm = $( '#addWordForm' );
+  

  1   2   3   4   >