Jeff Hall <jeffreyehall@gmail.com> <jhall@wikimedia.org>
Jeff Hobson <jhobson@wikimedia.org>
Jeff Janes <jeff.janes@gmail.com>
+Jeremy Baron <jeremy@tuxmachine.com>
Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> <jpostlethwaite@users.mediawiki.org>
Jeroen De Dauw <jeroendedauw@gmail.com>
Jeroen De Dauw <jeroendedauw@gmail.com> <jeroendedauw@users.mediawiki.org>
Jimmy Collins <jimmy.collins@web.de> <collinj@users.mediawiki.org>
Joel Sahleen <jsahleen@wikimedia.org>
John Du Hart <john@compwhizii.net> <johnduhart@users.mediawiki.org>
+John Erling Blad <john.blad@wikimedia.de>
Jon Harald Søby <jhsoby@gmail.com> <jhsoby@users.mediawiki.org>
Jon Robson <jrobson@wikimedia.org>
Jon Robson <jrobson@wikimedia.org> <jdlrobson@gmail.com>
Matt Johnston <mattj@emazestudios.com> <mattj@users.mediawiki.org>
Matthew Britton <hugglegurch@gmail.com> <gurch@users.mediawiki.org>
Matthew Flaschen <mflaschen@wikimedia.org>
+Matthew Walker <mwalker@wikimedia.org>
Matthias Mullie <git@mullie.eu>
Matthias Mullie <git@mullie.eu> <mmullie@wikimedia.org>
Matěj Grabovský <mgrabovsky@yahoo.com> <mgrabovsky@users.mediawiki.org>
MrBlueSky <mrbluesky@wikipedia.be>
MrBlueSky <mrbluesky@wikipedia.be> <mrbluesky@localhost>
Mukunda Modell <mmodell@wikimedia.org>
-Mwalker <mwalker@wikimedia.org>
MZMcBride <g@mzmcbride.com>
nadeesha <nadeesha@calcey.com> <nadeesha@users.mediawiki.org>
Namit <namit.ohri@gmail.com>
Owen Davis <owen@wikia-inc.com>
Owen Davis <owen@wikia-inc.com> <owen@users.mediawiki.org>
paladox <thomasmulhall410@yahoo.com>
+Patricio Molina <patriciomolina@gmail.com>
Patrick Reilly <preilly@wikimedia.org>
Patrick Reilly <preilly@wikimedia.org> <preilly@users.mediawiki.org>
Patrick Westerhoff <PatrickWesterhoff@gmail.com>
Paul Copperman <paul.copperman@gmail.com> <pcopp@users.mediawiki.org>
+Peter Coombe <pcoombe@wikimedia.org>
Peter Coti <petercoti@gmail.com>
Peter Potrowl <peter017@gmail.com> <peter17@users.mediawiki.org>
Petr Kadlec <mormegil@centrum.cz>
Stephen Liang <github@stephenliang.pw>
Steve Sanbeg <ffnaort@jro.qr> <sanbeg@users.mediawiki.org>
Steven Roddis <StevenRoddis@users.noreply.github.com>
+Steven Walling <swalling@wikimedia.org>
Subramanya Sastry <ssastry@wikimedia.org>
Sucheta Ghoshal <sghoshal@wikimedia.org>
Sumit Asthana <asthana.sumit23@gmail.com>
-Swalling <swalling@wikimedia.org>
Thalia Chan <thalia@cantorion.org>
Thiemo Mättig (WMDE) <thiemo.maettig@wikimedia.de>
Thiemo Mättig (WMDE) <thiemo.maettig@wikimedia.de> <mr.heat@gmx.de>
Timo Tijhof <krinklemail@gmail.com> <timo@wikimedia.org>
Timo Tijhof <krinklemail@gmail.com> <ttijhof@wikimedia.org>
Tina Johnson <tinajohnson.1234@gmail.com>
-Tjones <tjones@wikimedia.org>
Tom Maaswinkel <tom.maaswinkel@12wiki.eu> <thedevilonline@users.mediawiki.org>
Tomasz Finc <tfinc@wikimedia.org> <tomasz@users.mediawiki.org>
Tomasz W. Kozlowski <tomasz@twkozlowski.com>
Trevor Parscal <trevorparscal@gmail.com>
Trevor Parscal <trevorparscal@gmail.com> <tparscal@users.mediawiki.org>
Trevor Parscal <trevorparscal@gmail.com> <tparscal@wikimedia.org>
+Trey Jones <tjones@wikimedia.org>
Tyler Cipriani <tcipriani@wikimedia.org>
Tyler Romeo <tylerromeo@gmail.com>
Umherirrender <umherirrender_de.wp@web.de>
+Victor Barbu <victorbarbu08@gmail.com>
Victor Vasiliev <vasilvv@mit.edu>
Victor Vasiliev <vasilvv@mit.edu> <vasilievvv@users.mediawiki.org>
Victor Vasiliev <vasilvv@mit.edu> <vasilvv@gmail.com>
$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.
=== New features in 1.29 ===
* (T5233) A cookie can now be set when a user is autoblocked, to track that user
browsers had poor support for them, but modern browsers handle them fine.
This might affect some forms that used them and only worked because the
attributes were not actually being set.
+* Expiry times can now be specified when users are added to user groups.
=== External library changes in 1.29 ===
* Article::doEditContent() was marked as deprecated, to be removed in 1.30
or later.
* ContentHandler::runLegacyHooks() was removed.
+* refreshLinks.php now can be limited to a particular category with --category=...
+ or a tracking category with --tracking-category=...
+* User-like objects that are passed to SpecialUserRights and its subclasses are
+ now required to have a getGroupMemberships() method. See UserRightsProxy for
+ an example.
+* User::$mGroups (instance variable) was marked private. Use User::getGroups()
+ instead.
+* User::getGroupName(), User::getGroupMember(), User:getGroupPage(),
+ User::makeGroupLinkHTML(), and User::makeGroupLinkWiki() were deprecated.
+ Use equivalent methods on the UserGroupMembership class.
+* Maintenance scripts and tests that call User::addGroup() must now ensure that
+ User objects have been added to the database prior to calling addGroup().
+* Protected function UsersPager::getGroups() was removed, and protected function
+ UsersPager::buildGroupLink() was changed from a static to an instance method.
+* The third parameter ($cache) to the UsersPagerDoBatchLookups hook was changed;
+ see docs/hooks.txt.
== Compatibility ==
'TitlePrefixSearch' => __DIR__ . '/includes/PrefixSearch.php',
'TitleValue' => __DIR__ . '/includes/title/TitleValue.php',
'TrackBlobs' => __DIR__ . '/maintenance/storage/trackBlobs.php',
+ 'TrackingCategories' => __DIR__ . '/includes/TrackingCategories.php',
'TraditionalImageGallery' => __DIR__ . '/includes/gallery/TraditionalImageGallery.php',
'TransactionProfiler' => __DIR__ . '/includes/libs/rdbms/TransactionProfiler.php',
'TransformParameterError' => __DIR__ . '/includes/media/MediaTransformOutput.php',
'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',
'ViewCLI' => __DIR__ . '/maintenance/view.php',
'VirtualRESTService' => __DIR__ . '/includes/libs/virtualrest/VirtualRESTService.php',
'VirtualRESTServiceClient' => __DIR__ . '/includes/libs/virtualrest/VirtualRESTServiceClient.php',
+ 'WANCacheReapUpdate' => __DIR__ . '/includes/deferred/WANCacheReapUpdate.php',
'WANObjectCache' => __DIR__ . '/includes/libs/objectcache/WANObjectCache.php',
+ 'WANObjectCacheReaper' => __DIR__ . '/includes/libs/objectcache/WANObjectCacheReaper.php',
'WantedCategoriesPage' => __DIR__ . '/includes/specials/SpecialWantedcategories.php',
'WantedFilesPage' => __DIR__ . '/includes/specials/SpecialWantedfiles.php',
'WantedPagesPage' => __DIR__ . '/includes/specials/SpecialWantedpages.php',
&$ip: IP of the user who sent the message out
&$u: the account whose new password will be set
-'UserAddGroup': Called when adding a group; return false to override
-stock group addition.
+'UserAddGroup': Called when adding a group or changing a group's expiry; return
+false to override stock group addition.
$user: the user object that is to have a group added
-&$group: the group to add, can be modified
+&$group: the group to add; can be modified
+&$expiry: the expiry time in TS_MW format, or null if the group is not to
+expire; can be modified
'UserArrayFromResult': Called when creating an UserArray object from a database
result.
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
*/
];
+/**
+ * Verify and enforce WAN cache purges using reliable DB sources as streams.
+ *
+ * These secondary cache purges are de-duplicated via simple cache mutexes.
+ * This improves consistency when cache purges are lost, which becomes more likely
+ * as more cache servers are added or if there are multiple datacenters. Only keys
+ * related to important mutable content will be checked.
+ *
+ * @var bool
+ * @since 1.29
+ */
+$wgEnableWANCacheReaper = false;
+
/**
* Main object stash type. This should be a fast storage system for storing
* lightweight data like hit counters and user activity. Sites with multiple
*/
$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
/************************************************************************//**
'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 default * group, seems useless here
continue;
}
- $groupName = User::getGroupName( $ueg );
- $userGroups[] = User::makeGroupLinkHTML( $ueg, $groupName );
- $memberName = User::getGroupMember( $ueg, $userName );
- $userMembers[] = User::makeGroupLinkHTML( $ueg, $memberName );
- }
- asort( $userGroups );
- asort( $userMembers );
+ if ( isset( $userGroupMemberships[$ueg] ) ) {
+ $groupStringOrObject = $userGroupMemberships[$ueg];
+ } else {
+ $groupStringOrObject = $ueg;
+ }
- $lang = $context->getLanguage();
+ $userG = UserGroupMembership::getLink( $groupStringOrObject, $context, 'html' );
+ $userM = UserGroupMembership::getLink( $groupStringOrObject, $context, 'html',
+ $userName );
+
+ // Store expiring groups separately, so we can place them before non-expiring
+ // groups in the list. This is to avoid the ambiguity of something like
+ // "administrator, bureaucrat (until X date)" -- users might wonder whether the
+ // expiry date applies to both groups, or just the last one
+ if ( $groupStringOrObject instanceof UserGroupMembership &&
+ $groupStringOrObject->getExpiry()
+ ) {
+ $userTempGroups[] = $userG;
+ $userTempMembers[] = $userM;
+ } else {
+ $userGroups[] = $userG;
+ $userMembers[] = $userM;
+ }
+ }
+ sort( $userGroups );
+ sort( $userMembers );
+ sort( $userTempGroups );
+ sort( $userTempMembers );
+ $userGroups = array_merge( $userTempGroups, $userGroups );
+ $userMembers = array_merge( $userTempMembers, $userMembers );
$defaultPreferences['usergroups'] = [
'type' => 'info',
'>' => '>', // we've received invalid input
'"' => '"', // which should have been escaped.
'{' => '{',
+ '}' => '}', // prevent unpaired language conversion syntax
'[' => '[',
"''" => '''',
'ISBN' => 'ISBN',
'transformVia404' => true,
'fetchDescription' => true,
'descriptionCacheExpiry' => 43200,
- 'apiThumbCacheExpiry' => 86400,
+ 'apiThumbCacheExpiry' => 0,
];
}
/*
return $dbr->selectField(
'user_groups',
'COUNT(*)',
- [ 'ug_group' => $group ],
+ [
+ 'ug_group' => $group,
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
+ ],
__METHOD__
);
},
*
* @param string $action The action to check
* @param bool $short Short circuit on first error
- * @return array List of errors
+ * @return array Array containing an error message key and any parameters
*/
private function missingPermissionError( $action, $short ) {
// We avoid expensive display logic for quickUserCan's and such
return [ 'badaccess-group0' ];
}
- $groups = array_map( [ 'User', 'makeGroupLinkWiki' ],
- User::getGroupsWithPermission( $action ) );
-
- if ( count( $groups ) ) {
- global $wgLang;
- return [
- 'badaccess-groups',
- $wgLang->commaList( $groups ),
- count( $groups )
- ];
- } else {
- return [ 'badaccess-group0' ];
- }
+ return User::newFatalPermissionDeniedStatus( $action )->getErrorsArray()[0];
}
/**
--- /dev/null
+<?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Categories
+ */
+
+/**
+ * This class performs some operations related to tracking categories, such as creating
+ * a list of all such categories.
+ */
+class TrackingCategories {
+ /** @var Config */
+ private $config;
+
+ /**
+ * Tracking categories that exist in core
+ *
+ * @var array
+ */
+ private static $coreTrackingCategories = [
+ 'index-category',
+ 'noindex-category',
+ 'duplicate-args-category',
+ 'expensive-parserfunction-category',
+ 'post-expand-template-argument-category',
+ 'post-expand-template-inclusion-category',
+ 'hidden-category-category',
+ 'broken-file-category',
+ 'node-count-exceeded-category',
+ 'expansion-depth-exceeded-category',
+ 'restricted-displaytitle-ignored',
+ 'deprecated-self-close-category',
+ ];
+
+ /**
+ * @param Config $config
+ */
+ public function __construct( Config $config ) {
+ $this->config = $config;
+ }
+
+ /**
+ * Read the global and extract title objects from the corresponding messages
+ * @return array Array( 'msg' => Title, 'cats' => Title[] )
+ */
+ public function getTrackingCategories() {
+ $categories = array_merge(
+ self::$coreTrackingCategories,
+ ExtensionRegistry::getInstance()->getAttribute( 'TrackingCategories' ),
+ $this->config->get( 'TrackingCategories' ) // deprecated
+ );
+
+ // Only show magic link tracking categories if they are enabled
+ $enableMagicLinks = $this->config->get( 'EnableMagicLinks' );
+ if ( $enableMagicLinks['ISBN'] ) {
+ $categories[] = 'magiclink-tracking-isbn';
+ }
+ if ( $enableMagicLinks['RFC'] ) {
+ $categories[] = 'magiclink-tracking-rfc';
+ }
+ if ( $enableMagicLinks['PMID'] ) {
+ $categories[] = 'magiclink-tracking-pmid';
+ }
+
+ $trackingCategories = [];
+ foreach ( $categories as $catMsg ) {
+ /*
+ * Check if the tracking category varies by namespace
+ * Otherwise only pages in the current namespace will be displayed
+ * If it does vary, show pages considering all namespaces
+ */
+ $msgObj = wfMessage( $catMsg )->inContentLanguage();
+ $allCats = [];
+ $catMsgTitle = Title::makeTitleSafe( NS_MEDIAWIKI, $catMsg );
+ if ( !$catMsgTitle ) {
+ continue;
+ }
+
+ // Match things like {{NAMESPACE}} and {{NAMESPACENUMBER}}.
+ // False positives are ok, this is just an efficiency shortcut
+ if ( strpos( $msgObj->plain(), '{{' ) !== false ) {
+ $ns = MWNamespace::getValidNamespaces();
+ foreach ( $ns as $namesp ) {
+ $tempTitle = Title::makeTitleSafe( $namesp, $catMsg );
+ if ( !$tempTitle ) {
+ continue;
+ }
+ $catName = $msgObj->title( $tempTitle )->text();
+ # Allow tracking categories to be disabled by setting them to "-"
+ if ( $catName !== '-' ) {
+ $catTitle = Title::makeTitleSafe( NS_CATEGORY, $catName );
+ if ( $catTitle ) {
+ $allCats[] = $catTitle;
+ }
+ }
+ }
+ } else {
+ $catName = $msgObj->text();
+ # Allow tracking categories to be disabled by setting them to "-"
+ if ( $catName !== '-' ) {
+ $catTitle = Title::makeTitleSafe( NS_CATEGORY, $catName );
+ if ( $catTitle ) {
+ $allCats[] = $catTitle;
+ }
+ }
+ }
+ $trackingCategories[$catMsg] = [
+ 'cats' => $allCats,
+ 'msg' => $catMsgTitle,
+ ];
+ }
+
+ return $trackingCategories;
+ }
+}
'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' );
// 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'] );
}
) ];
}
$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' );
}
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 NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+ ] )
] );
}
$this->addTables( 'user_groups' );
$this->addJoinConds( [ 'user_groups' => [
$excludeGroups ? 'LEFT OUTER JOIN' : 'INNER JOIN',
- [ 'ug_user=rev_user', 'ug_group' => $limitGroups ]
+ [
+ 'ug_user=rev_user',
+ 'ug_group' => $limitGroups,
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+ ]
] ] );
$this->addWhereIf( 'ug_user IS NULL', $excludeGroups );
}
ApiResult::setIndexedTagName( $vals['groups'], 'g' ); // even if empty
}
+ if ( isset( $this->prop['groupmemberships'] ) ) {
+ $ugms = $user->getGroupMemberships();
+ $vals['groupmemberships'] = [];
+ foreach ( $ugms as $group => $ugm ) {
+ $vals['groupmemberships'][] = [
+ 'group' => $group,
+ 'expiry' => ApiResult::formatExpiry( $ugm->getExpiry() ),
+ ];
+ }
+ ApiResult::setArrayType( $vals['groupmemberships'], 'array' ); // even if empty
+ ApiResult::setIndexedTagName( $vals['groupmemberships'], 'groupmembership' ); // even if empty
+ }
+
if ( isset( $this->prop['implicitgroups'] ) ) {
$vals['implicitgroups'] = $user->getAutomaticGroups();
ApiResult::setArrayType( $vals['implicitgroups'], 'array' ); // even if empty
'blockinfo',
'hasmsg',
'groups',
+ 'groupmemberships',
'implicitgroups',
'rights',
'changeablegroups',
// everything except 'blockinfo' which might show hidden records if the user
// making the request has the appropriate permissions
'groups',
+ 'groupmemberships',
'implicitgroups',
'rights',
'editcount',
}
public function execute() {
+ $db = $this->getDB();
+
$params = $this->extractRequestParams();
$this->requireMaxOneParameter( $params, 'userids', 'users' );
$this->addTables( 'user_groups' );
$this->addJoinConds( [ 'user_groups' => [ 'INNER JOIN', 'ug_user=user_id' ] ] );
- $this->addFields( [ 'user_name', 'ug_group' ] );
+ $this->addFields( [ 'user_name' ] );
+ $this->addFields( UserGroupMembership::selectFields() );
+ $this->addWhere( 'ug_expiry IS NULL OR ug_expiry >= ' .
+ $db->addQuotes( $db->timestamp() ) );
$userGroupsRes = $this->select( __METHOD__ );
foreach ( $userGroupsRes as $row ) {
- $userGroups[$row->user_name][] = $row->ug_group;
+ $userGroups[$row->user_name][] = $row;
}
}
$data[$key]['groups'] = $user->getEffectiveGroups();
}
+ if ( isset( $this->prop['groupmemberships'] ) ) {
+ $data[$key]['groupmemberships'] = array_map( function( $ugm ) {
+ return [
+ 'group' => $ugm->getGroup(),
+ 'expiry' => ApiResult::formatExpiry( $ugm->getExpiry() ),
+ ];
+ }, $user->getGroupMemberships() );
+ }
+
if ( isset( $this->prop['implicitgroups'] ) ) {
$data[$key]['implicitgroups'] = $user->getAutomaticGroups();
}
ApiResult::setArrayType( $data[$u]['groups'], 'array' );
ApiResult::setIndexedTagName( $data[$u]['groups'], 'g' );
}
+ if ( isset( $this->prop['groupmemberships'] ) && isset( $data[$u]['groupmemberships'] ) ) {
+ ApiResult::setArrayType( $data[$u]['groupmemberships'], 'array' );
+ ApiResult::setIndexedTagName( $data[$u]['groupmemberships'], 'groupmembership' );
+ }
if ( isset( $this->prop['implicitgroups'] ) && isset( $data[$u]['implicitgroups'] ) ) {
ApiResult::setArrayType( $data[$u]['implicitgroups'], 'array' );
ApiResult::setIndexedTagName( $data[$u]['implicitgroups'], 'g' );
ApiBase::PARAM_TYPE => [
'blockinfo',
'groups',
+ 'groupmemberships',
'implicitgroups',
'rights',
'editcount',
$this->mParams['filekey'], $this->mParams['filename'], !$this->mParams['async']
);
} elseif ( isset( $this->mParams['file'] ) ) {
+ // Can't async upload directly from a POSTed file, we'd have to
+ // stash the file and then queue the publish job. The user should
+ // just submit the two API queries to perform those two steps.
+ if ( $this->mParams['async'] ) {
+ $this->dieWithError( 'apierror-cannot-async-upload-file' );
+ }
+
$this->mUpload = new UploadFromFile();
$this->mUpload->initialize(
$this->mParams['filename'],
<?php
/**
- *
- *
- * Created on Mar 24, 2009
+ * API userrights module
*
* Copyright © 2009 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
*
$params = $this->extractRequestParams();
+ // Figure out expiry times from the input
+ // @todo Remove this isset check when removing $wgDisableUserGroupExpiry
+ if ( isset( $params['expiry'] ) ) {
+ $expiry = (array)$params['expiry'];
+ } else {
+ $expiry = [ 'infinity' ];
+ }
+ if ( count( $expiry ) !== count( $params['add'] ) ) {
+ if ( count( $expiry ) === 1 ) {
+ $expiry = array_fill( 0, count( $params['add'] ), $expiry[0] );
+ } else {
+ $this->dieWithError( [
+ 'apierror-toofewexpiries',
+ count( $expiry ),
+ count( $params['add'] )
+ ] );
+ }
+ }
+
+ // Validate the expiries
+ $groupExpiries = [];
+ foreach ( $expiry as $index => $expiryValue ) {
+ $group = $params['add'][$index];
+ $groupExpiries[$group] = UserrightsPage::expiryToTimestamp( $expiryValue );
+
+ if ( $groupExpiries[$group] === false ) {
+ $this->dieWithError( [ 'apierror-invalidexpiry', wfEscapeWikiText( $expiryValue ) ] );
+ }
+
+ // not allowed to have things expiring in the past
+ if ( $groupExpiries[$group] && $groupExpiries[$group] < wfTimestampNow() ) {
+ $this->dieWithError( [ 'apierror-pastexpiry', wfEscapeWikiText( $expiryValue ) ] );
+ }
+ }
+
$user = $this->getUrUser( $params );
$tags = $params['tags'];
$r['user'] = $user->getName();
$r['userid'] = $user->getId();
list( $r['added'], $r['removed'] ) = $form->doSaveUserGroups(
- $user, (array)$params['add'],
- (array)$params['remove'], $params['reason'], $tags
+ $user, (array)$params['add'], (array)$params['remove'],
+ $params['reason'], $tags, $groupExpiries
);
$result = $this->getResult();
}
public function getAllowedParams() {
- return [
+ $a = [
'user' => [
ApiBase::PARAM_TYPE => 'user',
],
ApiBase::PARAM_TYPE => $this->getAllGroups(),
ApiBase::PARAM_ISMULTI => true
],
+ 'expiry' => [
+ ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_ALLOW_DUPLICATES => true,
+ ApiBase::PARAM_DFLT => 'infinite',
+ ],
'remove' => [
ApiBase::PARAM_TYPE => $this->getAllGroups(),
ApiBase::PARAM_ISMULTI => true
ApiBase::PARAM_ISMULTI => true
],
];
+ if ( !$this->getUserRightsPage()->canProcessExpiries() ) {
+ unset( $a['expiry'] );
+ }
+ return $a;
}
public function needsToken() {
}
protected function getExamplesMessages() {
- return [
+ $a = [
'action=userrights&user=FooBot&add=bot&remove=sysop|bureaucrat&token=123ABC'
=> 'apihelp-userrights-example-user',
'action=userrights&userid=123&add=bot&remove=sysop|bureaucrat&token=123ABC'
=> 'apihelp-userrights-example-userid',
];
+ if ( $this->getUserRightsPage()->canProcessExpiries() ) {
+ $a['action=userrights&user=SometimeSysop&add=sysop&expiry=1%20month&token=123ABC']
+ = 'apihelp-userrights-example-expiry';
+ }
+ return $a;
}
public function getHelpUrls() {
"apihelp-query+userinfo-paramvalue-prop-blockinfo": "Tags if the current user is blocked, by whom, and for what reason.",
"apihelp-query+userinfo-paramvalue-prop-hasmsg": "Adds a tag <samp>messages</samp> if the current user has pending messages.",
"apihelp-query+userinfo-paramvalue-prop-groups": "Lists all the groups the current user belongs to.",
+ "apihelp-query+userinfo-paramvalue-prop-groupmemberships": "Lists groups that the current user has been explicitly assigned to, including the expiry date of each group membership.",
"apihelp-query+userinfo-paramvalue-prop-implicitgroups": "Lists all the groups the current user is automatically a member of.",
"apihelp-query+userinfo-paramvalue-prop-rights": "Lists all the rights the current user has.",
"apihelp-query+userinfo-paramvalue-prop-changeablegroups": "Lists the groups the current user can add to and remove from.",
"apihelp-query+users-param-prop": "Which pieces of information to include:",
"apihelp-query+users-paramvalue-prop-blockinfo": "Tags if the user is blocked, by whom, and for what reason.",
"apihelp-query+users-paramvalue-prop-groups": "Lists all the groups each user belongs to.",
+ "apihelp-query+users-paramvalue-prop-groupmemberships": "Lists groups that each user has been explicitly assigned to, including the expiry date of each group membership.",
"apihelp-query+users-paramvalue-prop-implicitgroups": "Lists all the groups a user is automatically a member of.",
"apihelp-query+users-paramvalue-prop-rights": "Lists all the rights each user has.",
"apihelp-query+users-paramvalue-prop-editcount": "Adds the user's edit count.",
"apihelp-userrights-description": "Change a user's group membership.",
"apihelp-userrights-param-user": "User name.",
"apihelp-userrights-param-userid": "User ID.",
- "apihelp-userrights-param-add": "Add the user to these groups.",
+ "apihelp-userrights-param-add": "Add the user to these groups, or if they are already a member, update the expiry of their membership in that group.",
+ "apihelp-userrights-param-expiry": "Expiry timestamps. May be relative (e.g. <kbd>5 months</kbd> or <kbd>2 weeks</kbd>) or absolute (e.g. <kbd>2014-09-18T12:34:56Z</kbd>). If only one timestamp is set, it will be used for all groups passed to the <var>$1add</var> parameter. Use <kbd>infinite</kbd>, <kbd>indefinite</kbd>, <kbd>infinity</kbd>, or <kbd>never</kbd> for a never-expiring user group.",
"apihelp-userrights-param-remove": "Remove the user from these groups.",
"apihelp-userrights-param-reason": "Reason for the change.",
"apihelp-userrights-param-tags": "Change tags to apply to the entry in the user rights log.",
"apihelp-userrights-example-user": "Add user <kbd>FooBot</kbd> to group <kbd>bot</kbd>, and remove from groups <kbd>sysop</kbd> and <kbd>bureaucrat</kbd>.",
"apihelp-userrights-example-userid": "Add the user with ID <kbd>123</kbd> to group <kbd>bot</kbd>, and remove from groups <kbd>sysop</kbd> and <kbd>bureaucrat</kbd>.",
+ "apihelp-userrights-example-expiry": "Add user <kbd>SometimeSysop</kbd> to group <kbd>sysop</kbd> for 1 month.",
"apihelp-validatepassword-description": "Validate a password against the wiki's password policies.\n\nValidity is reported as <samp>Good</samp> if the password is acceptable, <samp>Change</samp> if the password may be used for login but must be changed, or <samp>Invalid</samp> if the password is not usable.",
"apihelp-validatepassword-param-password": "Password to validate.",
"apierror-blockedfrommail": "You have been blocked from sending email.",
"apierror-blocked": "You have been blocked from editing.",
"apierror-botsnotsupported": "This interface is not supported for bots.",
+ "apierror-cannot-async-upload-file": "The parameters <var>async</var> and <var>file</var> cannot be combined. If you want asynchronous processing of your uploaded file, first upload it to stash (using the <var>stash</var> parameter) and then publish the stashed file asynchronously (using <var>filekey</var> and <var>async</var>).",
"apierror-cannotreauthenticate": "This action is not available as your identity cannot be verified.",
"apierror-cannotviewtitle": "You are not allowed to view $1.",
"apierror-cantblock-email": "You don't have permission to block users from sending email through the wiki.",
"apihelp-query+userinfo-paramvalue-prop-blockinfo": "{{doc-apihelp-paramvalue|query+userinfo|prop|blockinfo}}",
"apihelp-query+userinfo-paramvalue-prop-hasmsg": "{{doc-apihelp-paramvalue|query+userinfo|prop|hasmsg}}",
"apihelp-query+userinfo-paramvalue-prop-groups": "{{doc-apihelp-paramvalue|query+userinfo|prop|groups}}",
+ "apihelp-query+userinfo-paramvalue-prop-groupmemberships": "{{doc-apihelp-paramvalue|query+userinfo|prop|groupmemberships}}",
"apihelp-query+userinfo-paramvalue-prop-implicitgroups": "{{doc-apihelp-paramvalue|query+userinfo|prop|implicitgroups}}",
"apihelp-query+userinfo-paramvalue-prop-rights": "{{doc-apihelp-paramvalue|query+userinfo|prop|rights}}",
"apihelp-query+userinfo-paramvalue-prop-changeablegroups": "{{doc-apihelp-paramvalue|query+userinfo|prop|changeablegroups}}",
"apihelp-query+users-param-prop": "{{doc-apihelp-param|query+users|prop|paramvalues=1}}",
"apihelp-query+users-paramvalue-prop-blockinfo": "{{doc-apihelp-paramvalue|query+users|prop|blockinfo}}",
"apihelp-query+users-paramvalue-prop-groups": "{{doc-apihelp-paramvalue|query+users|prop|groups}}",
+ "apihelp-query+users-paramvalue-prop-groupmemberships": "{{doc-apihelp-paramvalue|query+allusers|prop|groupmemberships}}",
"apihelp-query+users-paramvalue-prop-implicitgroups": "{{doc-apihelp-paramvalue|query+users|prop|implicitgroups}}",
"apihelp-query+users-paramvalue-prop-rights": "{{doc-apihelp-paramvalue|query+users|prop|rights}}",
"apihelp-query+users-paramvalue-prop-editcount": "{{doc-apihelp-paramvalue|query+users|prop|editcount}}",
"apihelp-userrights-param-user": "{{doc-apihelp-param|userrights|user}}\n{{Identical|Username}}",
"apihelp-userrights-param-userid": "{{doc-apihelp-param|userrights|userid}}\n{{Identical|User ID}}",
"apihelp-userrights-param-add": "{{doc-apihelp-param|userrights|add}}",
+ "apihelp-userrights-param-expiry": "{{doc-apihelp-param|userrights|expiry}}",
"apihelp-userrights-param-remove": "{{doc-apihelp-param|userrights|remove}}",
"apihelp-userrights-param-reason": "{{doc-apihelp-param|userrights|reason}}",
"apihelp-userrights-param-tags": "{{doc-apihelp-param|userrights|tags}}",
"apihelp-userrights-example-user": "{{doc-apihelp-example|userrights}}",
"apihelp-userrights-example-userid": "{{doc-apihelp-example|userrights}}",
+ "apihelp-userrights-example-expiry": "{{doc-apihelp-example|userrights}}",
"apihelp-validatepassword-description": "{{doc-apihelp-description|validatepassword}}",
"apihelp-validatepassword-param-password": "{{doc-apihelp-param|validatepassword|password}}",
"apihelp-validatepassword-param-user": "{{doc-apihelp-param|validatepassword|user}}",
"apierror-blockedfrommail": "{{doc-apierror}}",
"apierror-blocked": "{{doc-apierror}}",
"apierror-botsnotsupported": "{{doc-apierror}}",
+ "apierror-cannot-async-upload-file": "{{doc-apierror}}",
"apierror-cannotreauthenticate": "{{doc-apierror}}",
"apierror-cannotviewtitle": "{{doc-apierror}}\n\nParameters:\n* $1 - Title.",
"apierror-cantblock-email": "{{doc-apierror}}",
return $id;
}
+ /**
+ * @param WANObjectCache $cache
+ * @param TitleValue $t
+ * @return string[]
+ * @since 1.28
+ */
+ public function getMutableCacheKeys( WANObjectCache $cache, TitleValue $t ) {
+ if ( $this->isCacheable( $t ) ) {
+ return [ $cache->makeKey( 'page', $t->getNamespace(), sha1( $t->getDBkey() ) ) ];
+ }
+
+ return [];
+ }
+
private function isCacheable( LinkTarget $title ) {
return ( $title->inNamespace( NS_TEMPLATE ) || $title->inNamespace( NS_FILE ) );
}
*/
protected $mInParser = false;
- /** @var BagOStuff */
- protected $mMemc;
/** @var WANObjectCache */
protected $wanCache;
+ /** @var BagOStuff */
+ protected $clusterCache;
+ /** @var BagOStuff */
+ protected $srvCache;
/**
* Singleton instance
*/
public static function singleton() {
if ( self::$instance === null ) {
- global $wgUseDatabaseMessages, $wgMsgCacheExpiry;
+ global $wgUseDatabaseMessages, $wgMsgCacheExpiry, $wgUseLocalMessageCache;
self::$instance = new self(
+ MediaWikiServices::getInstance()->getMainWANObjectCache(),
wfGetMessageCacheStorage(),
+ $wgUseLocalMessageCache
+ ? MediaWikiServices::getInstance()->getLocalServerObjectCache()
+ : new EmptyBagOStuff(),
$wgUseDatabaseMessages,
$wgMsgCacheExpiry
);
}
/**
- * @param BagOStuff $memCached A cache instance. If none, fall back to CACHE_NONE.
- * @param bool $useDB
+ * @param WANObjectCache $wanCache WAN cache instance
+ * @param BagOStuff $clusterCache Cluster cache instance
+ * @param BagOStuff $srvCache Server cache instance
+ * @param bool $useDB Whether to look for message overrides (e.g. MediaWiki: pages)
* @param int $expiry Lifetime for cache. @see $mExpiry.
*/
- function __construct( BagOStuff $memCached, $useDB, $expiry ) {
- global $wgUseLocalMessageCache;
+ public function __construct(
+ WANObjectCache $wanCache,
+ BagOStuff $clusterCache,
+ BagOStuff $srvCache,
+ $useDB,
+ $expiry
+ ) {
+ $this->wanCache = $wanCache;
+ $this->clusterCache = $clusterCache;
+ $this->srvCache = $srvCache;
- $this->mMemc = $memCached;
$this->mDisable = !$useDB;
$this->mExpiry = $expiry;
-
- if ( $wgUseLocalMessageCache ) {
- $this->localCache = MediaWikiServices::getInstance()->getLocalServerObjectCache();
- } else {
- $this->localCache = new EmptyBagOStuff();
- }
-
- $this->wanCache = ObjectCache::getMainWANInstance();
}
/**
protected function getLocalCache( $code ) {
$cacheKey = wfMemcKey( __CLASS__, $code );
- return $this->localCache->get( $cacheKey );
+ return $this->srvCache->get( $cacheKey );
}
/**
*/
protected function saveToLocalCache( $code, $cache ) {
$cacheKey = wfMemcKey( __CLASS__, $code );
- $this->localCache->set( $cacheKey, $cache );
+ $this->srvCache->set( $cacheKey, $cache );
}
/**
# below, and use the local stale value if it was not acquired.
$where[] = 'global cache is presumed expired';
} else {
- $cache = $this->mMemc->get( $cacheKey );
+ $cache = $this->clusterCache->get( $cacheKey );
if ( !$cache ) {
$where[] = 'global cache is empty';
} elseif ( $this->isCacheExpired( $cache ) ) {
* @return bool|string True on success or one of ("cantacquire", "disabled")
*/
protected function loadFromDBWithLock( $code, array &$where, $mode = null ) {
- global $wgUseLocalMessageCache;
-
# If cache updates on all levels fail, give up on message overrides.
# This is to avoid easy site outages; see $saveSuccess comments below.
$statusKey = wfMemcKey( 'messages', $code, 'status' );
- $status = $this->mMemc->get( $statusKey );
+ $status = $this->clusterCache->get( $statusKey );
if ( $status === 'error' ) {
$where[] = "could not load; method is still globally disabled";
return 'disabled';
* incurring a loadFromDB() overhead on every request, and thus saves the
* wiki from complete downtime under moderate traffic conditions.
*/
- if ( !$wgUseLocalMessageCache ) {
- $this->mMemc->set( $statusKey, 'error', 60 * 5 );
+ if ( $this->srvCache instanceof EmptyBagOStuff ) {
+ $this->clusterCache->set( $statusKey, 'error', 60 * 5 );
$where[] = 'could not save cache, disabled globally for 5 minutes';
} else {
$where[] = "could not save global cache";
* @param integer $mode Use MessageCache::FOR_UPDATE to skip process cache
* @return array Loaded messages for storing in caches
*/
- function loadFromDB( $code, $mode = null ) {
+ protected function loadFromDB( $code, $mode = null ) {
global $wgMaxMsgCacheEntrySize, $wgLanguageCode, $wgAdaptiveMessageCache;
$dbr = wfGetDB( ( $mode == self::FOR_UPDATE ) ? DB_MASTER : DB_REPLICA );
wfDebugLog(
'MessageCache',
__METHOD__
- . ": failed to load message page text for {$row->page_title} ($code)"
+ . ": failed to load message page text for {$row->page_title} ($code)"
);
} else {
$entry = ' ' . $text;
/**
* Updates cache as necessary when message page is changed
*
- * @param string|bool $title Name of the page changed (false if deleted)
+ * @param string $title Message cache key with initial uppercase letter.
* @param string|bool $text New contents of the page (false if deleted)
*/
public function replace( $title, $text ) {
- global $wgMaxMsgCacheEntrySize, $wgContLang, $wgLanguageCode;
+ global $wgLanguageCode;
if ( $this->mDisable ) {
return;
return;
}
- // Note that if the cache is volatile, load() may trigger a DB fetch.
- // In that case we reenter/reuse the existing cache key lock to avoid
- // a self-deadlock. This is safe as no reads happen *directly* in this
- // method between getReentrantScopedLock() and load() below. There is
- // no risk of data "changing under our feet" for replace().
- $scopedLock = $this->getReentrantScopedLock( wfMemcKey( 'messages', $code ) );
- // Load the messages from the master DB to avoid race conditions
- $this->load( $code, self::FOR_UPDATE );
-
- // Load the new value into the process cache...
+ // (a) Update the process cache with the new message text
if ( $text === false ) {
+ // Page deleted
$this->mCache[$code][$title] = '!NONEXISTENT';
- } elseif ( strlen( $text ) > $wgMaxMsgCacheEntrySize ) {
- $this->mCache[$code][$title] = '!TOO BIG';
- // Pre-fill the individual key cache with the known latest message text
- $key = $this->wanCache->makeKey( 'messages-big', $this->mCache[$code]['HASH'], $title );
- $this->wanCache->set( $key, " $text", $this->mExpiry );
} else {
+ // Ignore $wgMaxMsgCacheEntrySize so the process cache is up to date
$this->mCache[$code][$title] = ' ' . $text;
}
- // Mark this cache as definitely being "latest" (non-volatile) so
- // load() calls do not try to refresh the cache with replica DB data
- $this->mCache[$code]['LATEST'] = time();
- // Update caches if the lock was acquired
- if ( $scopedLock ) {
- $this->saveToCaches( $this->mCache[$code], 'all', $code );
- } else {
- LoggerFactory::getInstance( 'MessageCache' )->error(
- __METHOD__ . ': could not acquire lock to update {title} ({code})',
- [ 'title' => $title, 'code' => $code ] );
- }
-
- ScopedCallback::consume( $scopedLock );
- // Relay the purge. Touching this check key expires cache contents
- // and local cache (APC) validation hash across all datacenters.
- $this->wanCache->touchCheckKey( wfMemcKey( 'messages', $code ) );
-
- // Also delete cached sidebar... just in case it is affected
- $codes = [ $code ];
- if ( $code === 'en' ) {
- // Delete all sidebars, like for example on action=purge on the
- // sidebar messages
- $codes = array_keys( Language::fetchLanguageNames() );
- }
-
- foreach ( $codes as $code ) {
- $sidebarKey = wfMemcKey( 'sidebar', $code );
- $this->wanCache->delete( $sidebarKey );
- }
+ // (b) Update the shared caches in a deferred update with a fresh DB snapshot
+ DeferredUpdates::addCallableUpdate(
+ function () use ( $title, $msg, $code ) {
+ global $wgContLang, $wgMaxMsgCacheEntrySize;
+ // Allow one caller at a time to avoid race conditions
+ $scopedLock = $this->getReentrantScopedLock( wfMemcKey( 'messages', $code ) );
+ if ( !$scopedLock ) {
+ LoggerFactory::getInstance( 'MessageCache' )->error(
+ __METHOD__ . ': could not acquire lock to update {title} ({code})',
+ [ 'title' => $title, 'code' => $code ] );
+ return;
+ }
+ // Load the messages from the master DB to avoid race conditions
+ $this->loadFromDB( $code, self::FOR_UPDATE );
+ // Load the process cache values and set the per-title cache keys
+ $page = WikiPage::factory( Title::makeTitle( NS_MEDIAWIKI, $title ) );
+ $page->loadPageData( $page::READ_LATEST );
+ $text = $this->getMessageTextFromContent( $page->getContent() );
+ // Check if an individual cache key should exist and update cache accordingly
+ $titleKey = $this->wanCache->makeKey(
+ 'messages-big', $this->mCache[$code]['HASH'], $title );
+ if ( is_string( $text ) && strlen( $text ) > $wgMaxMsgCacheEntrySize ) {
+ $this->wanCache->set( $titleKey, ' ' . $text, $this->mExpiry );
+ }
+ // Mark this cache as definitely being "latest" (non-volatile) so
+ // load() calls do try to refresh the cache with replica DB data
+ $this->mCache[$code]['LATEST'] = time();
+ // Pre-emptively update the local datacenter cache so things like edit filter and
+ // blacklist changes are reflect immediately, as these often use MediaWiki: pages.
+ // The datacenter handling replace() calls should be the same one handling edits
+ // as they require HTTP POST.
+ $this->saveToCaches( $this->mCache[$code], 'all', $code );
+ // Release the lock now that the cache is saved
+ ScopedCallback::consume( $scopedLock );
+
+ // Relay the purge. Touching this check key expires cache contents
+ // and local cache (APC) validation hash across all datacenters.
+ $this->wanCache->touchCheckKey( wfMemcKey( 'messages', $code ) );
+ // Also delete cached sidebar... just in case it is affected
+ // @TODO: shouldn't this be $code === $wgLanguageCode?
+ if ( $code === 'en' ) {
+ // Purge all language sidebars, e.g. on ?action=purge to the sidebar messages
+ $codes = array_keys( Language::fetchLanguageNames() );
+ } else {
+ // Purge only the sidebar for this language
+ $codes = [ $code ];
+ }
+ foreach ( $codes as $code ) {
+ $this->wanCache->delete( wfMemcKey( 'sidebar', $code ) );
+ }
- // Update the message in the message blob store
- $resourceloader = RequestContext::getMain()->getOutput()->getResourceLoader();
- $blobStore = $resourceloader->getMessageBlobStore();
- $blobStore->updateMessage( $wgContLang->lcfirst( $msg ) );
+ // Purge the message in the message blob store
+ $resourceloader = RequestContext::getMain()->getOutput()->getResourceLoader();
+ $blobStore = $resourceloader->getMessageBlobStore();
+ $blobStore->updateMessage( $wgContLang->lcfirst( $msg ) );
- Hooks::run( 'MessageCacheReplace', [ $title, $text ] );
+ Hooks::run( 'MessageCacheReplace', [ $title, $text ] );
+ },
+ DeferredUpdates::PRESEND
+ );
}
/**
protected function saveToCaches( array $cache, $dest, $code = false ) {
if ( $dest === 'all' ) {
$cacheKey = wfMemcKey( 'messages', $code );
- $success = $this->mMemc->set( $cacheKey, $cache );
+ $success = $this->clusterCache->set( $cacheKey, $cache );
$this->setValidationHash( $code, $cache );
} else {
$success = true;
* @return null|ScopedCallback
*/
protected function getReentrantScopedLock( $key, $timeout = self::WAIT_SEC ) {
- return $this->mMemc->getScopedLock( $key, $timeout, self::LOCK_TTL, __METHOD__ );
+ return $this->clusterCache->getScopedLock( $key, $timeout, self::LOCK_TTL, __METHOD__ );
}
/**
$alreadyTried = [];
- // First try the requested language.
+ // First try the requested language.
$message = $this->getMessageForLang( $lang, $lckey, $useDB, $alreadyTried );
if ( $message !== false ) {
return $message;
*/
public function getMsgFromNamespace( $title, $code ) {
$this->load( $code );
+
if ( isset( $this->mCache[$code][$title] ) ) {
$entry = $this->mCache[$code][$title];
if ( substr( $entry, 0, 1 ) === ' ' ) {
throw new MWException( __FUNCTION__ . ": Unknown stream logger URI scheme: $scheme" );
}
+ if ( defined( 'MW_PHPUNIT_TEST' ) && is_object( $wgRCEngines[$scheme] ) ) {
+ return $wgRCEngines[$scheme];
+ }
return new $wgRCEngines[$scheme];
}
'category',
SearchIndexField::INDEX_TYPE_TEXT
);
-
$fields['category']->setFlag( SearchIndexField::FLAG_CASEFOLD );
$fields['external_link'] = $engine->makeSearchFieldMapping(
'template',
SearchIndexField::INDEX_TYPE_KEYWORD
);
-
$fields['template']->setFlag( SearchIndexField::FLAG_CASEFOLD );
+ $fields['content_model'] = $engine->makeSearchFieldMapping(
+ 'content_model',
+ SearchIndexField::INDEX_TYPE_KEYWORD
+ );
+
return $fields;
}
$fieldData['text'] = $text;
$fieldData['source_text'] = $text;
$fieldData['text_bytes'] = $content->getSize();
+ $fieldData['content_model'] = $content->getModel();
}
Hooks::run( 'SearchDataForIndex', [ &$fieldData, $this, $page, $output, $engine ] );
}
// Decide which auth scenerio to use
- // if we are using Windows auth, don't add credentials to $connectionInfo
+ // if we are using Windows auth, then don't add credentials to $connectionInfo
if ( !$wgDBWindowsAuthentication ) {
$connectionInfo['UID'] = $user;
$connectionInfo['PWD'] = $password;
$this->offset = 0;
// several extensions seem to think that all databases support limits
- // via LIMIT N after the WHERE clause well, MSSQL uses SELECT TOP N,
+ // via LIMIT N after the WHERE clause, but MSSQL uses SELECT TOP N,
// so to catch any of those extensions we'll do a quick check for a
// LIMIT clause and pass $sql through $this->LimitToTopN() which parses
- // the limit clause and passes the result to $this->limitResult();
+ // the LIMIT clause and passes the result to $this->limitResult();
if ( preg_match( '/\bLIMIT\s*/i', $sql ) ) {
// massage LIMIT -> TopN
$sql = $this->LimitToTopN( $sql );
$success = (bool)$stmt;
}
- // make a copy so that anything we add below does not get reflected in future queries
+ // Make a copy to ensure what we add below does not get reflected in future queries
$ignoreErrors = $this->mIgnoreErrors;
if ( $this->mIgnoreDupKeyErrors ) {
public function indexInfo( $table, $index, $fname = __METHOD__ ) {
# This does not return the same info as MYSQL would, but that's OK
# because MediaWiki never uses the returned value except to check for
- # the existance of indexes.
+ # the existence of indexes.
$sql = "sp_helpindex '" . $this->tableName( $table ) . "'";
$res = $this->query( $sql, $fname );
foreach ( $arrToInsert as $a ) {
// start out with empty identity column, this is so we can return
- // it as a result of the insert logic
+ // it as a result of the INSERT logic
$sqlPre = '';
$sqlPost = '';
$identityClause = '';
--- /dev/null
+<?php
+
+use Psr\Log\LoggerInterface;
+
+/**
+ * Class for fixing stale WANObjectCache keys using a purge event source
+ *
+ * This is useful for expiring keys that missed fire-and-forget purges. This uses the
+ * recentchanges table as a reliable stream to make certain keys reach consistency
+ * as soon as the underlying replica database catches up. These means that critical
+ * keys will not escape getting purged simply due to brief hiccups in the network,
+ * which are more prone to happen accross datacenters.
+ *
+ * ----
+ * "I was trying to cheat death. I was only trying to surmount for a little while the
+ * darkness that all my life I surely knew was going to come rolling in on me some day
+ * and obliterate me. I was only to stay alive a little brief while longer, after I was
+ * already gone. To stay in the light, to be with the living, a little while past my time."
+ * -- Notes for "Blues of a Lifetime", by [[Cornell Woolrich]]
+ *
+ * @since 1.28
+ */
+class WANCacheReapUpdate implements DeferrableUpdate {
+ /** @var IDatabase */
+ private $db;
+ /** @var LoggerInterface */
+ private $logger;
+
+ /**
+ * @param IDatabase $db
+ * @param LoggerInterface $logger
+ */
+ public function __construct( IDatabase $db, LoggerInterface $logger ) {
+ $this->db = $db;
+ $this->logger = $logger;
+ }
+
+ function doUpdate() {
+ $reaper = new WANObjectCacheReaper(
+ ObjectCache::getMainWANInstance(),
+ ObjectCache::getLocalClusterInstance(),
+ [ $this, 'getTitleChangeEvents' ],
+ [ $this, 'getEventAffectedKeys' ],
+ [
+ 'channel' => 'table:recentchanges:' . $this->db->getWikiID(),
+ 'logger' => $this->logger
+ ]
+ );
+
+ $reaper->invoke( 100 );
+ }
+
+ /**
+ * @see WANObjectCacheRepear
+ *
+ * @param int $start
+ * @param int $id
+ * @param int $end
+ * @param int $limit
+ * @return TitleValue[]
+ */
+ public function getTitleChangeEvents( $start, $id, $end, $limit ) {
+ $db = $this->db;
+ $encStart = $db->addQuotes( $db->timestamp( $start ) );
+ $encEnd = $db->addQuotes( $db->timestamp( $end ) );
+ $id = (int)$id; // cast NULL => 0 since rc_id is an integer
+
+ $res = $db->select(
+ 'recentchanges',
+ [ 'rc_namespace', 'rc_title', 'rc_timestamp', 'rc_id' ],
+ [
+ $db->makeList( [
+ "rc_timestamp > $encStart",
+ "rc_timestamp = $encStart AND rc_id > " . $db->addQuotes( $id )
+ ], LIST_OR ),
+ "rc_timestamp < $encEnd"
+ ],
+ __METHOD__,
+ [ 'ORDER BY' => 'rc_timestamp ASC, rc_id ASC', 'LIMIT' => $limit ]
+ );
+
+ $events = [];
+ foreach ( $res as $row ) {
+ $events[] = [
+ 'id' => (int)$row->rc_id,
+ 'pos' => (int)wfTimestamp( TS_UNIX, $row->rc_timestamp ),
+ 'item' => new TitleValue( (int)$row->rc_namespace, $row->rc_title )
+ ];
+ }
+
+ return $events;
+ }
+
+ /**
+ * Gets a list of important cache keys associated with a title
+ *
+ * @see WANObjectCacheRepear
+ * @param WANObjectCache $cache
+ * @param TitleValue $t
+ * @returns string[]
+ */
+ public function getEventAffectedKeys( WANObjectCache $cache, TitleValue $t ) {
+ /** @var WikiPage[]|LocalFile[]|User[] $entities */
+ $entities = [];
+
+ $entities[] = WikiPage::factory( Title::newFromTitleValue( $t ) );
+ if ( $t->inNamespace( NS_FILE ) ) {
+ $entities[] = wfLocalFile( $t->getText() );
+ }
+ if ( $t->inNamespace( NS_USER ) ) {
+ $entities[] = User::newFromName( $t->getText(), false );
+ }
+
+ $keys = [];
+ foreach ( $entities as $entity ) {
+ if ( $entity ) {
+ $keys = array_merge( $keys, $entity->getMutableCacheKeys( $cache ) );
+ }
+ }
+ if ( $keys ) {
+ $this->logger->debug( __CLASS__ . ': got key(s) ' . implode( ', ', $keys ) );
+ }
+
+ return $keys;
+ }
+}
$this->permission = $permission;
if ( !count( $errors ) ) {
- $groups = array_map(
- [ 'User', 'makeGroupLinkWiki' ],
- User::getGroupsWithPermission( $this->permission )
- );
+ $groups = [];
+ foreach ( User::getGroupsWithPermission( $this->permission ) as $group ) {
+ $groups[] = UserGroupMembership::getLink( $group, RequestContext::getMain(), 'wiki' );
+ }
if ( $groups ) {
$errors[] = [ 'badaccess-groups', $wgLang->commaList( $groups ), count( $groups ) ];
return $this->repo->getSharedCacheKey( 'file', sha1( $this->getName() ) );
}
+ /**
+ * @param WANObjectCache $cache
+ * @return string[]
+ * @since 1.28
+ */
+ public function getMutableCacheKeys( WANObjectCache $cache ) {
+ return [ $this->getCacheKey() ];
+ }
+
/**
* Try to load file metadata from memcached, falling back to the database
*/
*/
protected function createMainpage( DatabaseInstaller $installer ) {
$status = Status::newGood();
+ $title = Title::newMainPage();
+ if ( $title->exists() ) {
+ $status->warning( 'config-install-mainpage-exists' );
+ return $status;
+ }
try {
- $page = WikiPage::factory( Title::newMainPage() );
+ $page = WikiPage::factory( $title );
$content = new WikitextContent(
wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text()
// 1.29
[ 'addField', 'externallinks', 'el_index_60', 'patch-externallinks-el_index_60.sql' ],
+ [ 'addField', 'user_groups', 'ug_expiry', 'patch-user_groups-ug_expiry.sql' ],
];
}
// 1.29
[ 'addField', 'externallinks', 'el_index_60', 'patch-externallinks-el_index_60.sql' ],
+ [ 'addField', 'user_groups', 'ug_expiry', 'patch-user_groups-ug_expiry.sql' ],
// KEEP THIS AT THE BOTTOM!!
[ 'doRebuildDuplicateFunction' ],
[ 'addPgField', 'externallinks', 'el_index_60', "BYTEA NOT NULL DEFAULT ''" ],
[ 'addPgIndex', 'externallinks', 'el_index_60', '( el_index_60, el_id )' ],
[ 'addPgIndex', 'externallinks', 'el_from_index_60', '( el_from, el_index_60, el_id )' ],
+ [ 'addPgField', 'user_groups', 'ug_expiry', "TIMESTAMPTZ NULL" ],
+ [ 'addPgIndex', 'user_groups', 'user_groups_expiry', '( ug_expiry )' ],
];
}
// 1.29
[ 'addField', 'externallinks', 'el_index_60', 'patch-externallinks-el_index_60.sql' ],
+ [ 'addField', 'user_groups', 'ug_expiry', 'patch-user_groups-ug_expiry.sql' ],
];
}
"config-install-subscribe-fail": "Unable to subscribe to mediawiki-announce: $1",
"config-install-subscribe-notpossible": "cURL is not installed and <code>allow_url_fopen</code> is not available.",
"config-install-mainpage": "Creating main page with default content",
+ "config-install-mainpage-exists": "Main page already exists, skipping",
"config-install-extension-tables": "Creating tables for enabled extensions",
"config-install-mainpage-failed": "Could not insert main page: $1",
"config-install-done": "<strong>Congratulations!</strong>\nYou have installed MediaWiki.\n\nThe installer has generated a <code>LocalSettings.php</code> file.\nIt contains all your configuration.\n\nYou will need to download it and put it in the base of your wiki installation (the same directory as index.php). The download should have started automatically.\n\nIf the download was not offered, or if you cancelled it, you can restart the download by clicking the link below:\n\n$3\n\n<strong>Note:</strong> If you do not do this now, this generated configuration file will not be available to you later if you exit the installation without downloading it.\n\nWhen that has been done, you can <strong>[$2 enter your wiki]</strong>.",
"config-install-subscribe-fail": "{{doc-important|\"[[m:mail:mediawiki-announce|mediawiki-announce]]\" is the name of a mailing list and should not be translated.}}\nA message displayed if the MediaWiki installer encounters an error making a request to lists.wikimedia.org which hosts the mailing list.\n* $1 - the HTTP error encountered, reproduced as is (English string)",
"config-install-subscribe-notpossible": "Error shown when automatically subscribing to the MediaWiki announcements mailing list fails.",
"config-install-mainpage": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
+ "config-install-mainpage-exists": "Warning shown when installer attempts to create main page but it already exists.",
"config-install-extension-tables": "Notice shown to the user during the install about progress.",
"config-install-mainpage-failed": "Used as error message. Parameters:\n* $1 - detailed error message",
"config-install-done": "Parameters:\n* $1 is the URL to LocalSettings download\n* $2 is a link to the wiki.\n* $3 is a download link with attached download icon. The config-download-localsettings message will be used as the link text.",
return $values;
}
+ /**
+ * Locally set a key to expire soon if it is stale based on $purgeTimestamp
+ *
+ * This sets stale keys' time-to-live at HOLDOFF_TTL seconds, which both avoids
+ * broadcasting in mcrouter setups and also avoids races with new tombstones.
+ *
+ * @param string $key Cache key
+ * @param int $purgeTimestamp UNIX timestamp of purge
+ * @param bool &$isStale Whether the key is stale
+ * @return bool Success
+ * @since 1.28
+ */
+ public function reap( $key, $purgeTimestamp, &$isStale = false ) {
+ $minAsOf = $purgeTimestamp + self::HOLDOFF_TTL;
+ $wrapped = $this->cache->get( self::VALUE_KEY_PREFIX . $key );
+ if ( is_array( $wrapped ) && $wrapped[self::FLD_TIME] < $minAsOf ) {
+ $isStale = true;
+ $this->logger->warning( "Reaping stale value key '$key'." );
+ $ttlReap = self::HOLDOFF_TTL; // avoids races with tombstone creation
+ $ok = $this->cache->changeTTL( self::VALUE_KEY_PREFIX . $key, $ttlReap );
+ if ( !$ok ) {
+ $this->logger->error( "Could not complete reap of key '$key'." );
+ }
+
+ return $ok;
+ }
+
+ $isStale = false;
+
+ return true;
+ }
+
+ /**
+ * Locally set a "check" key to expire soon if it is stale based on $purgeTimestamp
+ *
+ * @param string $key Cache key
+ * @param int $purgeTimestamp UNIX timestamp of purge
+ * @param bool &$isStale Whether the key is stale
+ * @return bool Success
+ * @since 1.28
+ */
+ public function reapCheckKey( $key, $purgeTimestamp, &$isStale = false ) {
+ $purge = $this->parsePurgeValue( $this->cache->get( self::TIME_KEY_PREFIX . $key ) );
+ if ( $purge && $purge[self::FLD_TIME] < $purgeTimestamp ) {
+ $isStale = true;
+ $this->logger->warning( "Reaping stale check key '$key'." );
+ $ok = $this->cache->changeTTL( self::TIME_KEY_PREFIX . $key, 1 );
+ if ( !$ok ) {
+ $this->logger->error( "Could not complete reap of check key '$key'." );
+ }
+
+ return $ok;
+ }
+
+ $isStale = false;
+
+ return false;
+ }
+
/**
* @see BagOStuff::makeKey()
* @param string ... Key component
--- /dev/null
+<?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Cache
+ * @author Aaron Schulz
+ */
+
+use Psr\Log\LoggerAwareInterface;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+
+/**
+ * Class for scanning through chronological, log-structured data or change logs
+ * and locally purging cache keys related to entities that appear in this data.
+ *
+ * This is useful for repairing cache when purges are missed by using a reliable
+ * stream, such as Kafka or a replicated MySQL table. Purge loss between datacenters
+ * is expected to be more common than within them.
+ *
+ * @since 1.28
+ */
+class WANObjectCacheReaper implements LoggerAwareInterface {
+ /** @var WANObjectCache */
+ protected $cache;
+ /** @var BagOStuff */
+ protected $store;
+ /** @var callable */
+ protected $logChunkCallback;
+ /** @var callable */
+ protected $keyListCallback;
+ /** @var LoggerInterface */
+ protected $logger;
+
+ /** @var string */
+ protected $channel;
+ /** @var integer */
+ protected $initialStartWindow;
+
+ /**
+ * @param WANObjectCache $cache Cache to reap bad keys from
+ * @param BagOStuff $store Cache to store positions use for locking
+ * @param callable $logCallback Callback taking arguments:
+ * - The starting position as a UNIX timestamp
+ * - The starting unique ID used for breaking timestamp collisions or null
+ * - The ending position as a UNIX timestamp
+ * - The maximum number of results to return
+ * It returns a list of maps of (key: cache key, pos: UNIX timestamp, id: unique ID)
+ * for each key affected, with the corrosponding event timestamp/ID information.
+ * The events should be in ascending order, by (timestamp,id).
+ * @param callable $keyCallback Callback taking arguments:
+ * - The WANObjectCache instance
+ * - An object from the event log
+ * It should return a list of WAN cache keys.
+ * The callback must fully duck-type test the object, since can be any model class.
+ * @param array $params Additional options:
+ * - channel: the name of the update event stream.
+ * Default: WANObjectCache::DEFAULT_PURGE_CHANNEL.
+ * - initialStartWindow: seconds back in time to start if the position is lost.
+ * Default: 1 hour.
+ * - logger: an SPL monolog instance [optional]
+ */
+ public function __construct(
+ WANObjectCache $cache,
+ BagOStuff $store,
+ callable $logCallback,
+ callable $keyCallback,
+ array $params
+ ) {
+ $this->cache = $cache;
+ $this->store = $store;
+
+ $this->logChunkCallback = $logCallback;
+ $this->keyListCallback = $keyCallback;
+ if ( isset( $params['channel'] ) ) {
+ $this->channel = $params['channel'];
+ } else {
+ throw new UnexpectedValueException( "No channel specified." );
+ }
+
+ $this->initialStartWindow = isset( $params['initialStartWindow'] )
+ ? $params['initialStartWindow']
+ : 3600;
+ $this->logger = isset( $params['logger'] )
+ ? $params['logger']
+ : new NullLogger();
+ }
+
+ public function setLogger( LoggerInterface $logger ) {
+ $this->logger = $logger;
+ }
+
+ /**
+ * Check and reap stale keys based on a chunk of events
+ *
+ * @param int $n Number of events
+ * @return int Number of keys checked
+ */
+ final public function invoke( $n = 100 ) {
+ $posKey = $this->store->makeGlobalKey( 'WANCache', 'reaper', $this->channel );
+ $scopeLock = $this->store->getScopedLock( "$posKey:busy", 0 );
+ if ( !$scopeLock ) {
+ return 0;
+ }
+
+ $now = time();
+ $status = $this->store->get( $posKey );
+ if ( !$status ) {
+ $status = [ 'pos' => $now - $this->initialStartWindow, 'id' => null ];
+ }
+
+ // Get events for entities who's keys tombstones/hold-off should have expired by now
+ $events = call_user_func_array(
+ $this->logChunkCallback,
+ [ $status['pos'], $status['id'], $now - WANObjectCache::HOLDOFF_TTL - 1, $n ]
+ );
+
+ $event = null;
+ $keyEvents = [];
+ foreach ( $events as $event ) {
+ $keys = call_user_func_array(
+ $this->keyListCallback,
+ [ $this->cache, $event['item'] ]
+ );
+ foreach ( $keys as $key ) {
+ unset( $keyEvents[$key] ); // use only the latest per key
+ $keyEvents[$key] = [
+ 'pos' => $event['pos'],
+ 'id' => $event['id']
+ ];
+ }
+ }
+
+ $purgeCount = 0;
+ $lastOkEvent = null;
+ foreach ( $keyEvents as $key => $keyEvent ) {
+ if ( !$this->cache->reap( $key, $keyEvent['pos'] ) ) {
+ break;
+ }
+ ++$purgeCount;
+ $lastOkEvent = $event;
+ }
+
+ if ( $lastOkEvent ) {
+ $ok = $this->store->merge(
+ $posKey,
+ function ( $bag, $key, $curValue ) use ( $lastOkEvent ) {
+ if ( !$curValue ) {
+ // Use new position
+ } else {
+ $curCoord = [ $curValue['pos'], $curValue['id'] ];
+ $newCoord = [ $lastOkEvent['pos'], $lastOkEvent['id'] ];
+ if ( $newCoord < $curCoord ) {
+ // Keep prior position instead of rolling it back
+ return $curValue;
+ }
+ }
+
+ return [
+ 'pos' => $lastOkEvent['pos'],
+ 'id' => $lastOkEvent['id'],
+ 'ctime' => $curValue ? $curValue['ctime'] : date( 'c' )
+ ];
+ },
+ IExpiringStore::TTL_INDEFINITE
+ );
+
+ $pos = $lastOkEvent['pos'];
+ $id = $lastOkEvent['id'];
+ if ( $ok ) {
+ $this->logger->info( "Updated cache reap position ($pos, $id)." );
+ } else {
+ $this->logger->error( "Could not update cache reap position ($pos, $id)." );
+ }
+ }
+
+ ScopedCallback::consume( $scopeLock );
+
+ return $purgeCount;
+ }
+
+ /**
+ * @return array|bool Returns (pos, id) map or false if not set
+ */
+ public function getState() {
+ $posKey = $this->store->makeGlobalKey( 'WANCache', 'reaper', $this->channel );
+
+ return $this->store->get( $posKey );
+ }
+}
protected function getMessageParameters() {
$params = parent::getMessageParameters();
- // Really old entries
+ // Really old entries that lack old/new groups
if ( !isset( $params[3] ) && !isset( $params[4] ) ) {
return $params;
}
$userName = $this->entry->getTarget()->getText();
if ( !$this->plaintext && count( $oldGroups ) ) {
foreach ( $oldGroups as &$group ) {
- $group = User::getGroupMember( $group, $userName );
+ $group = UserGroupMembership::getGroupMemberName( $group, $userName );
}
}
if ( !$this->plaintext && count( $newGroups ) ) {
foreach ( $newGroups as &$group ) {
- $group = User::getGroupMember( $group, $userName );
+ $group = UserGroupMembership::getGroupMemberName( $group, $userName );
}
}
- $lang = $this->context->getLanguage();
+ // fetch the metadata about each group membership
+ $allParams = $this->entry->getParameters();
+
if ( count( $oldGroups ) ) {
- $params[3] = $lang->listToText( $oldGroups );
+ $params[3] = [ 'raw' => $this->formatRightsList( $oldGroups,
+ isset( $allParams['oldmetadata'] ) ? $allParams['oldmetadata'] : [] ) ];
} else {
$params[3] = $this->msg( 'rightsnone' )->text();
}
if ( count( $newGroups ) ) {
// Array_values is used here because of T44211
// see use of array_unique in UserrightsPage::doSaveUserGroups on $newGroups.
- $params[4] = $lang->listToText( array_values( $newGroups ) );
+ $params[4] = [ 'raw' => $this->formatRightsList( array_values( $newGroups ),
+ isset( $allParams['newmetadata'] ) ? $allParams['newmetadata'] : [] ) ];
} else {
$params[4] = $this->msg( 'rightsnone' )->text();
}
return $params;
}
+ protected function formatRightsList( $groups, $serializedUGMs = [] ) {
+ $uiLanguage = $this->context->getLanguage();
+ $uiUser = $this->context->getUser();
+ // separate arrays of temporary and permanent memberships
+ $tempList = $permList = [];
+
+ reset( $groups );
+ reset( $serializedUGMs );
+ while ( current( $groups ) ) {
+ $group = current( $groups );
+
+ if ( current( $serializedUGMs ) &&
+ isset( current( $serializedUGMs )['expiry'] ) &&
+ current( $serializedUGMs )['expiry']
+ ) {
+ // there is an expiry date; format the group and expiry into a friendly string
+ $expiry = current( $serializedUGMs )['expiry'];
+ $expiryFormatted = $uiLanguage->userTimeAndDate( $expiry, $uiUser );
+ $expiryFormattedD = $uiLanguage->userDate( $expiry, $uiUser );
+ $expiryFormattedT = $uiLanguage->userTime( $expiry, $uiUser );
+ $tempList[] = $this->msg( 'rightslogentry-temporary-group' )->params( $group,
+ $expiryFormatted, $expiryFormattedD, $expiryFormattedT )->parse();
+ } else {
+ // the right does not expire; just insert the group name
+ $permList[] = $group;
+ }
+
+ next( $groups );
+ next( $serializedUGMs );
+ }
+
+ // place all temporary memberships first, to avoid the ambiguity of
+ // "adinistrator, bureaucrat and importer (temporary, until X time)"
+ return $uiLanguage->listToText( array_merge( $tempList, $permList ) );
+ }
+
protected function getParametersForApi() {
$entry = $this->entry;
$params = $entry->getParameters();
}
}
- // Really old entries does not have log params
+ // Really old entries do not have log params, so form them from whatever info
+ // we have.
+ // Also walk through the parallel arrays of groups and metadata, combining each
+ // metadata array with the name of the group it pertains to
if ( isset( $params['4:array:oldgroups'] ) ) {
$params['4:array:oldgroups'] = $this->makeGroupArray( $params['4:array:oldgroups'] );
+
+ $oldmetadata =& $params['oldmetadata'];
+ // unset old metadata entry to ensure metadata goes at the end of the params array
+ unset( $params['oldmetadata'] );
+ $params['oldmetadata'] = array_map( function( $index ) use ( $params, $oldmetadata ) {
+ $result = [ 'group' => $params['4:array:oldgroups'][$index] ];
+ if ( isset( $oldmetadata[$index] ) ) {
+ $result += $oldmetadata[$index];
+ }
+ $result['expiry'] = ApiResult::formatExpiry( isset( $result['expiry'] ) ?
+ $result['expiry'] : null );
+
+ return $result;
+ }, array_keys( $params['4:array:oldgroups'] ) );
}
+
if ( isset( $params['5:array:newgroups'] ) ) {
$params['5:array:newgroups'] = $this->makeGroupArray( $params['5:array:newgroups'] );
+
+ $newmetadata =& $params['newmetadata'];
+ // unset old metadata entry to ensure metadata goes at the end of the params array
+ unset( $params['newmetadata'] );
+ $params['newmetadata'] = array_map( function( $index ) use ( $params, $newmetadata ) {
+ $result = [ 'group' => $params['5:array:newgroups'][$index] ];
+ if ( isset( $newmetadata[$index] ) ) {
+ $result += $newmetadata[$index];
+ }
+ $result['expiry'] = ApiResult::formatExpiry( isset( $result['expiry'] ) ?
+ $result['expiry'] : null );
+
+ return $result;
+ }, array_keys( $params['5:array:newgroups'] ) );
}
return $params;
if ( isset( $ret['newgroups'] ) ) {
ApiResult::setIndexedTagName( $ret['newgroups'], 'g' );
}
+ if ( isset( $ret['oldmetadata'] ) ) {
+ ApiResult::setArrayType( $ret['oldmetadata'], 'array' );
+ ApiResult::setIndexedTagName( $ret['oldmetadata'], 'g' );
+ }
+ if ( isset( $ret['newmetadata'] ) ) {
+ ApiResult::setArrayType( $ret['newmetadata'], 'array' );
+ ApiResult::setIndexedTagName( $ret['newmetadata'], 'g' );
+ }
return $ret;
}
);
} else {
// Try to avoid a second parse if {{REVISIONID}} is used
- $edit->popts->setSpeculativeRevIdCallback( function () {
- return 1 + (int)wfGetDB( DB_MASTER )->selectField(
+ $dbIndex = ( $this->mDataLoadedFrom & self::READ_LATEST ) === self::READ_LATEST
+ ? DB_MASTER // use the best possible guess
+ : DB_REPLICA; // T154554
+
+ $edit->popts->setSpeculativeRevIdCallback( function () use ( $dbIndex ) {
+ return 1 + (int)wfGetDB( $dbIndex )->selectField(
'revision',
'MAX(rev_id)',
[],
public function getSourceURL() {
return $this->getTitle()->getCanonicalURL();
}
+
+ /*
+ * @param WANObjectCache $cache
+ * @return string[]
+ * @since 1.28
+ */
+ public function getMutableCacheKeys( WANObjectCache $cache ) {
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
+
+ return $linkCache->getMutableCacheKeys( $cache, $this->getTitle()->getTitleValue() );
+ }
}
* to SpecialTrackingCategories::$coreTrackingCategories, and extensions
* should add to "TrackingCategories" in their extension.json.
*
+ * @todo Migrate some code to TrackingCategories
+ *
* @param string $msg Message key
* @param Title $title title of the page which is being tracked
* @return bool Whether the addition was successful
$this->features[$feature] = $data;
}
+ /**
+ * Way to retrieve custom data set by setFeatureData
+ * or by the engine itself.
+ * @since 1.29
+ * @param string $feature feature name
+ * @return mixed the feature value or null if unset
+ */
+ public function getFeatureData( $feature ) {
+ if ( isset ( $this->features[$feature] ) ) {
+ return $this->features[$feature];
+ }
+ return null;
+ }
+
/**
* When overridden in derived class, performs database-specific conversions
* on text to be used for searching or updating search index.
'href' => $this->getTitle()->getLocalURL( "action=info" )
];
- if ( $this->getTitle()->exists() ) {
+ if ( $this->getTitle()->exists() || $this->getTitle()->inNamespace( NS_CATEGORY ) ) {
$nav_urls['recentchangeslinked'] = [
'href' => SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage )->getLocalURL()
];
if ( !$user->isAnon() ) {
$sur = new UserrightsPage;
$sur->setContext( $this->getContext() );
- $canChange = $sur->userCanChangeRights( $this->getUser(), false );
+ $canChange = $sur->userCanChangeRights( $user );
$nav_urls['userrights'] = [
'text' => $this->msg(
$canChange ? 'tool-link-userrights' : 'tool-link-userrights-readonly',
* @file
* @ingroup SpecialPage
*/
+use MediaWiki\Logger\LoggerFactory;
/**
* Special page which uses a ChangesList to show query results.
$this->webOutput( $rows, $opts );
$rows->free();
+
+ if ( $this->getConfig()->get( 'EnableWANCacheReaper' ) ) {
+ // Clean up any bad page entries for titles showing up in RC
+ DeferredUpdates::addUpdate( new WANCacheReapUpdate(
+ $this->getDB(),
+ LoggerFactory::getInstance( 'objectcache' )
+ ) );
+ }
}
/**
$groups = User::getAllGroups();
foreach ( $groups as $group ) {
- $msg = htmlspecialchars( User::getGroupName( $group ) );
+ $msg = htmlspecialchars( UserGroupMembership::getGroupName( $group ) );
$options[$msg] = $group;
}
} elseif ( is_array( $changeGroup ) ) {
$changeGroup = array_intersect( array_values( array_unique( $changeGroup ) ), $allGroups );
if ( count( $changeGroup ) ) {
+ $groupLinks = [];
+ foreach ( $changeGroup as $group ) {
+ $groupLinks[] = UserGroupMembership::getLink( $group, $this->getContext(), 'wiki' );
+ }
// For grep: listgrouprights-addgroup, listgrouprights-removegroup,
// listgrouprights-addgroup-self, listgrouprights-removegroup-self
$r[] = $this->msg( 'listgrouprights-' . $messageKey,
- $lang->listToText( array_map( [ 'User', 'makeGroupLinkWiki' ], $changeGroup ) ),
- count( $changeGroup )
- )->parse();
+ $lang->listToText( $groupLinks ), count( $changeGroup ) )->parse();
}
}
}
parent::__construct( 'TrackingCategories' );
}
- /**
- * Tracking categories that exist in core
- *
- * @var array
- */
- private static $coreTrackingCategories = [
- 'index-category',
- 'noindex-category',
- 'duplicate-args-category',
- 'expensive-parserfunction-category',
- 'post-expand-template-argument-category',
- 'post-expand-template-inclusion-category',
- 'hidden-category-category',
- 'broken-file-category',
- 'node-count-exceeded-category',
- 'expansion-depth-exceeded-category',
- 'restricted-displaytitle-ignored',
- 'deprecated-self-close-category',
- ];
-
function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
</tr></thead>"
);
- $trackingCategories = $this->prepareTrackingCategoriesData();
+ $trackingCategories = new TrackingCategories( $this->getConfig() );
+ $categoryList = $trackingCategories->getTrackingCategories();
$batch = new LinkBatch();
- foreach ( $trackingCategories as $catMsg => $data ) {
+ foreach ( $categoryList as $catMsg => $data ) {
$batch->addObj( $data['msg'] );
foreach ( $data['cats'] as $catTitle ) {
$batch->addObj( $catTitle );
}
$batch->execute();
- Hooks::run( 'SpecialTrackingCategories::preprocess', [ $this, $trackingCategories ] );
+ Hooks::run( 'SpecialTrackingCategories::preprocess', [ $this, $categoryList ] );
$linkRenderer = $this->getLinkRenderer();
- foreach ( $trackingCategories as $catMsg => $data ) {
+ foreach ( $categoryList as $catMsg => $data ) {
$allMsgs = [];
$catDesc = $catMsg . '-desc';
$this->getOutput()->addHTML( Html::closeElement( 'table' ) );
}
- /**
- * Read the global and extract title objects from the corresponding messages
- * @return array Array( 'msg' => Title, 'cats' => Title[] )
- */
- private function prepareTrackingCategoriesData() {
- $categories = array_merge(
- self::$coreTrackingCategories,
- ExtensionRegistry::getInstance()->getAttribute( 'TrackingCategories' ),
- $this->getConfig()->get( 'TrackingCategories' ) // deprecated
- );
-
- // Only show magic link tracking categories if they are enabled
- $enableMagicLinks = $this->getConfig()->get( 'EnableMagicLinks' );
- if ( $enableMagicLinks['ISBN'] ) {
- $categories[] = 'magiclink-tracking-isbn';
- }
- if ( $enableMagicLinks['RFC'] ) {
- $categories[] = 'magiclink-tracking-rfc';
- }
- if ( $enableMagicLinks['PMID'] ) {
- $categories[] = 'magiclink-tracking-pmid';
- }
-
- $trackingCategories = [];
- foreach ( $categories as $catMsg ) {
- /*
- * Check if the tracking category varies by namespace
- * Otherwise only pages in the current namespace will be displayed
- * If it does vary, show pages considering all namespaces
- */
- $msgObj = $this->msg( $catMsg )->inContentLanguage();
- $allCats = [];
- $catMsgTitle = Title::makeTitleSafe( NS_MEDIAWIKI, $catMsg );
- if ( !$catMsgTitle ) {
- continue;
- }
-
- // Match things like {{NAMESPACE}} and {{NAMESPACENUMBER}}.
- // False positives are ok, this is just an efficiency shortcut
- if ( strpos( $msgObj->plain(), '{{' ) !== false ) {
- $ns = MWNamespace::getValidNamespaces();
- foreach ( $ns as $namesp ) {
- $tempTitle = Title::makeTitleSafe( $namesp, $catMsg );
- if ( !$tempTitle ) {
- continue;
- }
- $catName = $msgObj->title( $tempTitle )->text();
- # Allow tracking categories to be disabled by setting them to "-"
- if ( $catName !== '-' ) {
- $catTitle = Title::makeTitleSafe( NS_CATEGORY, $catName );
- if ( $catTitle ) {
- $allCats[] = $catTitle;
- }
- }
- }
- } else {
- $catName = $msgObj->text();
- # Allow tracking categories to be disabled by setting them to "-"
- if ( $catName !== '-' ) {
- $catTitle = Title::makeTitleSafe( NS_CATEGORY, $catName );
- if ( $catTitle ) {
- $allCats[] = $catTitle;
- }
- }
- }
- $trackingCategories[$catMsg] = [
- 'cats' => $allCats,
- 'msg' => $catMsgTitle,
- ];
- }
-
- return $trackingCategories;
- }
-
protected function getGroupName() {
return 'pages';
}
}
/**
- * @param User $user
- * @param bool $checkIfSelf
+ * Check whether the current user (from context) can change the target user's rights.
+ *
+ * @param User $targetUser User whose rights are being changed
+ * @param bool $checkIfSelf If false, assume that the current user can add/remove groups defined
+ * in $wgGroupsAddToSelf / $wgGroupsRemoveFromSelf, without checking if it's the same as target
+ * user
* @return bool
*/
- public function userCanChangeRights( $user, $checkIfSelf = true ) {
+ public function userCanChangeRights( $targetUser, $checkIfSelf = true ) {
+ $isself = $this->getUser()->equals( $targetUser );
+
$available = $this->changeableGroups();
- if ( $user->getId() == 0 ) {
+ if ( $targetUser->getId() == 0 ) {
return false;
}
return !empty( $available['add'] )
|| !empty( $available['remove'] )
- || ( ( $this->isself || !$checkIfSelf ) &&
+ || ( ( $isself || !$checkIfSelf ) &&
( !empty( $available['add-self'] )
|| !empty( $available['remove-self'] ) ) );
}
$session = $request->getSession();
$out = $this->getOutput();
+ $out->addModules( [ 'mediawiki.special.userrights' ] );
+
if ( $par !== null ) {
$this->mTarget = $par;
} else {
// Remove session data for the success message
$session->remove( 'specialUserrightsSaveSuccess' );
- $out->addModules( [ 'mediawiki.special.userrights' ] );
$out->addModuleStyles( 'mediawiki.notification.convertmessagebox.styles' );
$out->addHTML(
Html::rawElement(
) {
$out->addWikiMsg( 'userrights-conflict' );
} else {
- $this->saveUserGroups(
+ $status = $this->saveUserGroups(
$this->mTarget,
$request->getVal( 'user-reason' ),
$targetUser
);
- // Set session data for the success message
- $session->set( 'specialUserrightsSaveSuccess', 1 );
+ if ( $status->isOK() ) {
+ // Set session data for the success message
+ $session->set( 'specialUserrightsSaveSuccess', 1 );
- $out->redirect( $this->getSuccessURL() );
-
- return;
+ $out->redirect( $this->getSuccessURL() );
+ return;
+ } else {
+ // Print an error message and redisplay the form
+ $out->addWikiText( '<div class="error">' . $status->getWikiText() . '</div>' );
+ }
}
}
return $this->getPageTitle( $this->mTarget )->getFullURL();
}
+ /**
+ * Returns true if this user rights form can set and change user group expiries.
+ * Subclasses may wish to override this to return false.
+ *
+ * @return bool
+ */
+ public function canProcessExpiries() {
+ return !$this->getConfig()->get( 'DisableUserGroupExpiry' );
+ }
+
+ /**
+ * Converts a user group membership expiry string into a timestamp. Words like
+ * 'existing' or 'other' should have been filtered out before calling this
+ * function.
+ *
+ * @param string $expiry
+ * @return string|null|false A string containing a valid timestamp, or null
+ * if the expiry is infinite, or false if the timestamp is not valid
+ */
+ public static function expiryToTimestamp( $expiry ) {
+ if ( wfIsInfinity( $expiry ) ) {
+ return null;
+ }
+
+ $unix = strtotime( $expiry );
+
+ if ( !$unix || $unix === -1 ) {
+ return false;
+ }
+
+ // @todo FIXME: Non-qualified absolute times are not in users specified timezone
+ // and there isn't notice about it in the ui (see ProtectionForm::getExpiry)
+ return wfTimestamp( TS_MW, $unix );
+ }
+
/**
* Save user groups changes in the database.
* Data comes from the editUserGroupsForm() form function
* @param string $username Username to apply changes to.
* @param string $reason Reason for group change
* @param User|UserRightsProxy $user Target user object.
- * @return null
+ * @return Status
*/
- function saveUserGroups( $username, $reason, $user ) {
+ protected function saveUserGroups( $username, $reason, $user ) {
$allgroups = $this->getAllGroups();
$addgroup = [];
+ $groupExpiries = []; // associative array of (group name => expiry)
$removegroup = [];
// This could possibly create a highly unlikely race condition if permissions are changed between
// Later on, this gets filtered for what can actually be removed
if ( $this->getRequest()->getCheck( "wpGroup-$group" ) ) {
$addgroup[] = $group;
+
+ if ( $this->canProcessExpiries() ) {
+ // read the expiry information from the request
+ $expiryDropdown = $this->getRequest()->getVal( "wpExpiry-$group" );
+ if ( $expiryDropdown === 'other' ) {
+ $expiryValue = $this->getRequest()->getVal( "wpExpiry-$group-other" );
+ } elseif ( $expiryDropdown !== 'existing' ) {
+ $expiryValue = $expiryDropdown;
+ } else {
+ continue;
+ }
+
+ // validate the expiry
+ $groupExpiries[$group] = self::expiryToTimestamp( $expiryValue );
+
+ if ( $groupExpiries[$group] === false ) {
+ return Status::newFatal( 'userrights-invalid-expiry', $group );
+ }
+
+ // not allowed to have things expiring in the past
+ if ( $groupExpiries[$group] && $groupExpiries[$group] < wfTimestampNow() ) {
+ return Status::newFatal( 'userrights-expiry-in-past', $group );
+ }
+ }
} else {
$removegroup[] = $group;
}
}
- $this->doSaveUserGroups( $user, $addgroup, $removegroup, $reason );
+ $this->doSaveUserGroups( $user, $addgroup, $removegroup, $reason, [], $groupExpiries );
+
+ return Status::newGood();
}
/**
* @param array $remove Array of groups to remove
* @param string $reason Reason for group change
* @param array $tags Array of change tags to add to the log entry
+ * @param array $groupExpiries Associative array of (group name => expiry),
+ * containing only those groups that are to have new expiry values set
* @return array Tuple of added, then removed groups
*/
- function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [] ) {
+ function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [],
+ $groupExpiries = [] ) {
+
// Validate input set...
$isself = $user->getName() == $this->getUser()->getName();
$groups = $user->getGroups();
$remove = array_unique(
array_intersect( (array)$remove, $removable, $groups ) );
- $add = array_unique( array_diff(
- array_intersect( (array)$add, $addable ),
- $groups )
- );
+ $add = array_intersect( (array)$add, $addable );
+
+ // add only groups that are not already present or that need their expiry updated
+ $add = array_filter( $add,
+ function( $group ) use ( $groups, $groupExpiries ) {
+ return !in_array( $group, $groups ) || array_key_exists( $group, $groupExpiries );
+ } );
Hooks::run( 'ChangeUserGroups', [ $this->getUser(), $user, &$add, &$remove ] );
- $oldGroups = $user->getGroups();
+ $oldGroups = $groups;
+ $oldUGMs = $user->getGroupMemberships();
$newGroups = $oldGroups;
- // Remove then add groups
+ // Remove groups, then add new ones/update expiries of existing ones
if ( $remove ) {
foreach ( $remove as $index => $group ) {
if ( !$user->removeGroup( $group ) ) {
}
if ( $add ) {
foreach ( $add as $index => $group ) {
- if ( !$user->addGroup( $group ) ) {
+ $expiry = isset( $groupExpiries[$group] ) ? $groupExpiries[$group] : null;
+ if ( !$user->addGroup( $group, $expiry ) ) {
unset( $add[$index] );
}
}
$newGroups = array_merge( $newGroups, $add );
}
$newGroups = array_unique( $newGroups );
+ $newUGMs = $user->getGroupMemberships();
// Ensure that caches are cleared
$user->invalidateCache();
wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) . "\n" );
wfDebug( 'newGroups: ' . print_r( $newGroups, true ) . "\n" );
+ wfDebug( 'oldUGMs: ' . print_r( $oldUGMs, true ) . "\n" );
+ wfDebug( 'newUGMs: ' . print_r( $newUGMs, true ) . "\n" );
// Deprecated in favor of UserGroupsChanged hook
Hooks::run( 'UserRights', [ &$user, $add, $remove ], '1.26' );
- if ( $newGroups != $oldGroups ) {
- $this->addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags );
+ // Only add a log entry if something actually changed
+ if ( $newGroups != $oldGroups || $newUGMs != $oldUGMs ) {
+ $this->addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, $oldUGMs, $newUGMs );
}
return [ $add, $remove ];
}
+ /**
+ * Serialise a UserGroupMembership object for storage in the log_params section
+ * of the logging table. Only keeps essential data, removing redundant fields.
+ *
+ * @param UserGroupMembership|null $ugm May be null if things get borked
+ * @return array
+ */
+ protected static function serialiseUgmForLog( $ugm ) {
+ if ( !$ugm instanceof UserGroupMembership ) {
+ return null;
+ }
+ return [ 'expiry' => $ugm->getExpiry() ];
+ }
+
/**
* Add a rights log entry for an action.
- * @param User $user
+ * @param User|UserRightsProxy $user
* @param array $oldGroups
* @param array $newGroups
* @param array $reason
- * @param array $tags
+ * @param array $tags Change tags for the log entry
+ * @param array $oldUGMs Associative array of (group name => UserGroupMembership)
+ * @param array $newUGMs Associative array of (group name => UserGroupMembership)
*/
- function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags ) {
+ protected function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags,
+ $oldUGMs, $newUGMs ) {
+
+ // make sure $oldUGMs and $newUGMs are in the same order, and serialise
+ // each UGM object to a simplified array
+ $oldUGMs = array_map( function( $group ) use ( $oldUGMs ) {
+ return isset( $oldUGMs[$group] ) ?
+ self::serialiseUgmForLog( $oldUGMs[$group] ) :
+ null;
+ }, $oldGroups );
+ $newUGMs = array_map( function( $group ) use ( $newUGMs ) {
+ return isset( $newUGMs[$group] ) ?
+ self::serialiseUgmForLog( $newUGMs[$group] ) :
+ null;
+ }, $newGroups );
+
$logEntry = new ManualLogEntry( 'rights', 'rights' );
$logEntry->setPerformer( $this->getUser() );
$logEntry->setTarget( $user->getUserPage() );
$logEntry->setParameters( [
'4::oldgroups' => $oldGroups,
'5::newgroups' => $newGroups,
+ 'oldmetadata' => $oldUGMs,
+ 'newmetadata' => $newUGMs,
] );
$logid = $logEntry->insert();
if ( count( $tags ) ) {
}
$groups = $user->getGroups();
-
- $this->showEditUserGroupsForm( $user, $groups );
+ $groupMemberships = $user->getGroupMemberships();
+ $this->showEditUserGroupsForm( $user, $groups, $groupMemberships );
// This isn't really ideal logging behavior, but let's not hide the
// interwiki logs if we're using them as is.
);
}
- /**
- * Go through used and available groups and return the ones that this
- * form will be able to manipulate based on the current user's system
- * permissions.
- *
- * @param array $groups List of groups the given user is in
- * @return array Tuple of addable, then removable groups
- */
- protected function splitGroups( $groups ) {
- list( $addable, $removable, $addself, $removeself ) = array_values( $this->changeableGroups() );
-
- $removable = array_intersect(
- array_merge( $this->isself ? $removeself : [], $removable ),
- $groups
- ); // Can't remove groups the user doesn't have
- $addable = array_diff(
- array_merge( $this->isself ? $addself : [], $addable ),
- $groups
- ); // Can't add groups the user does have
-
- return [ $addable, $removable ];
- }
-
/**
* Show the form to edit group memberships.
*
* @param User|UserRightsProxy $user User or UserRightsProxy you're editing
- * @param array $groups Array of groups the user is in
+ * @param array $groups Array of groups the user is in. Not used by this implementation
+ * anymore, but kept for backward compatibility with subclasses
+ * @param array $groupMemberships Associative array of (group name => UserGroupMembership
+ * object) containing the groups the user is in
*/
- protected function showEditUserGroupsForm( $user, $groups ) {
- $list = [];
- $membersList = [];
- foreach ( $groups as $group ) {
- $list[] = self::buildGroupLink( $group );
- $membersList[] = self::buildGroupMemberLink( $group );
+ protected function showEditUserGroupsForm( $user, $groups, $groupMemberships ) {
+ $list = $membersList = $tempList = $tempMembersList = [];
+ foreach ( $groupMemberships as $ugm ) {
+ $linkG = UserGroupMembership::getLink( $ugm, $this->getContext(), 'html' );
+ $linkM = UserGroupMembership::getLink( $ugm, $this->getContext(), 'html',
+ $user->getName() );
+ if ( $ugm->getExpiry() ) {
+ $tempList[] = $linkG;
+ $tempMembersList[] = $linkM;
+ } else {
+ $list[] = $linkG;
+ $membersList[] = $linkM;
+
+ }
}
$autoList = [];
$autoMembersList = [];
if ( $user instanceof User ) {
foreach ( Autopromote::getAutopromoteGroups( $user ) as $group ) {
- $autoList[] = self::buildGroupLink( $group );
- $autoMembersList[] = self::buildGroupMemberLink( $group );
+ $autoList[] = UserGroupMembership::getLink( $group, $this->getContext(), 'html' );
+ $autoMembersList[] = UserGroupMembership::getLink( $group, $this->getContext(),
+ 'html', $user->getName() );
}
}
$language = $this->getLanguage();
$displayedList = $this->msg( 'userrights-groupsmember-type' )
->rawParams(
- $language->listToText( $list ),
- $language->listToText( $membersList )
+ $language->commaList( array_merge( $tempList, $list ) ),
+ $language->commaList( array_merge( $tempMembersList, $membersList ) )
)->escaped();
$displayedAutolist = $this->msg( 'userrights-groupsmember-type' )
->rawParams(
- $language->listToText( $autoList ),
- $language->listToText( $autoMembersList )
+ $language->commaList( $autoList ),
+ $language->commaList( $autoMembersList )
)->escaped();
$grouplist = '';
Linker::TOOL_LINKS_EMAIL /* Add "send e-mail" link */
);
- list( $groupCheckboxes, $canChangeAny ) = $this->groupCheckboxes( $groups, $user );
+ list( $groupCheckboxes, $canChangeAny ) =
+ $this->groupCheckboxes( $groupMemberships, $user );
$this->getOutput()->addHTML(
Xml::openElement(
'form',
);
}
- /**
- * Format a link to a group description page
- *
- * @param string $group
- * @return string
- */
- private static function buildGroupLink( $group ) {
- return User::makeGroupLinkHTML( $group, User::getGroupName( $group ) );
- }
-
- /**
- * Format a link to a group member description page
- *
- * @param string $group
- * @return string
- */
- private static function buildGroupMemberLink( $group ) {
- return User::makeGroupLinkHTML( $group, User::getGroupMember( $group ) );
- }
-
/**
* Returns an array of all groups that may be edited
* @return array Array of groups that may be edited.
/**
* Adds a table with checkboxes where you can select what groups to add/remove
*
- * @todo Just pass the username string?
- * @param array $usergroups Groups the user belongs to
+ * @param array $usergroups Associative array of (group name as string =>
+ * UserGroupMembership object) for groups the user belongs to
* @param User $user
* @return Array with 2 elements: the XHTML table element with checkxboes, and
* whether any groups are changeable
$allgroups = $this->getAllGroups();
$ret = '';
+ // Get the list of preset expiry times from the system message
+ $expiryOptionsMsg = $this->msg( 'userrights-expiry-options' )->inContentLanguage();
+ $expiryOptions = $expiryOptionsMsg->isDisabled() ?
+ [] :
+ explode( ',', $expiryOptionsMsg->text() );
+
// Put all column info into an associative array so that extensions can
// more easily manage it.
$columns = [ 'unchangeable' => [], 'changeable' => [] ];
foreach ( $allgroups as $group ) {
- $set = in_array( $group, $usergroups );
+ $set = isset( $usergroups[$group] );
// Should the checkbox be disabled?
$disabled = !(
( $set && $this->canRemove( $group ) ) ||
foreach ( $column as $group => $checkbox ) {
$attr = $checkbox['disabled'] ? [ 'disabled' => 'disabled' ] : [];
- $member = User::getGroupMember( $group, $user->getName() );
+ $member = UserGroupMembership::getGroupMemberName( $group, $user->getName() );
if ( $checkbox['irreversible'] ) {
$text = $this->msg( 'userrights-irreversible-marker', $member )->text();
} else {
$checkboxHtml = Xml::checkLabel( $text, "wpGroup-" . $group,
"wpGroup-" . $group, $checkbox['set'], $attr );
$ret .= "\t\t" . ( $checkbox['disabled']
- ? Xml::tags( 'span', [ 'class' => 'mw-userrights-disabled' ], $checkboxHtml )
- : $checkboxHtml
- ) . "<br />\n";
+ ? Xml::tags( 'div', [ 'class' => 'mw-userrights-disabled' ], $checkboxHtml )
+ : Xml::tags( 'div', [], $checkboxHtml )
+ ) . "\n";
+
+ if ( $this->canProcessExpiries() ) {
+ $uiUser = $this->getUser();
+ $uiLanguage = $this->getLanguage();
+
+ $currentExpiry = isset( $usergroups[$group] ) ?
+ $usergroups[$group]->getExpiry() :
+ null;
+
+ // If the user can't uncheck this checkbox, print the current expiry below
+ // it in plain text. Otherwise provide UI to set/change the expiry
+ if ( $checkbox['set'] && ( $checkbox['irreversible'] || $checkbox['disabled'] ) ) {
+ if ( $currentExpiry ) {
+ $expiryFormatted = $uiLanguage->userTimeAndDate( $currentExpiry, $uiUser );
+ $expiryFormattedD = $uiLanguage->userDate( $currentExpiry, $uiUser );
+ $expiryFormattedT = $uiLanguage->userTime( $currentExpiry, $uiUser );
+ $expiryHtml = $this->msg( 'userrights-expiry-current' )->params(
+ $expiryFormatted, $expiryFormattedD, $expiryFormattedT )->text();
+ } else {
+ $expiryHtml = $this->msg( 'userrights-expiry-none' )->text();
+ }
+ $expiryHtml .= "<br />\n";
+ } else {
+ $expiryHtml = Xml::element( 'span', null,
+ $this->msg( 'userrights-expiry' )->text() );
+ $expiryHtml .= Xml::openElement( 'span' );
+
+ // add a form element to set the expiry date
+ $expiryFormOptions = new XmlSelect(
+ "wpExpiry-$group",
+ "mw-input-wpExpiry-$group", // forward compatibility with HTMLForm
+ $currentExpiry ? 'existing' : 'infinite'
+ );
+ if ( $checkbox['disabled'] ) {
+ $expiryFormOptions->setAttribute( 'disabled', 'disabled' );
+ }
+
+ if ( $currentExpiry ) {
+ $timestamp = $uiLanguage->userTimeAndDate( $currentExpiry, $uiUser );
+ $d = $uiLanguage->userDate( $currentExpiry, $uiUser );
+ $t = $uiLanguage->userTime( $currentExpiry, $uiUser );
+ $existingExpiryMessage = $this->msg( 'userrights-expiry-existing',
+ $timestamp, $d, $t );
+ $expiryFormOptions->addOption( $existingExpiryMessage->text(), 'existing' );
+ }
+
+ $expiryFormOptions->addOption(
+ $this->msg( 'userrights-expiry-none' )->text(),
+ 'infinite'
+ );
+ $expiryFormOptions->addOption(
+ $this->msg( 'userrights-expiry-othertime' )->text(),
+ 'other'
+ );
+ foreach ( $expiryOptions as $option ) {
+ if ( strpos( $option, ":" ) === false ) {
+ $displayText = $value = $option;
+ } else {
+ list( $displayText, $value ) = explode( ":", $option );
+ }
+ $expiryFormOptions->addOption( $displayText, htmlspecialchars( $value ) );
+ }
+
+ // Add expiry dropdown
+ $expiryHtml .= $expiryFormOptions->getHTML() . '<br />';
+
+ // Add custom expiry field
+ $attribs = [ 'id' => "mw-input-wpExpiry-$group-other" ];
+ if ( $checkbox['disabled'] ) {
+ $attribs['disabled'] = 'disabled';
+ }
+ $expiryHtml .= Xml::input( "wpExpiry-$group-other", 30, '', $attribs );
+
+ $expiryHtml .= Xml::closeElement( 'span' );
+ }
+
+ $divAttribs = [
+ 'id' => "mw-userrights-nested-wpGroup-$group",
+ 'class' => 'mw-userrights-nested',
+ ];
+ $ret .= "\t\t\t" . Xml::tags( 'div', $divAttribs, $expiryHtml ) . "\n";
+ }
}
$ret .= "\t</td>\n";
}
$tables[] = 'user_groups';
$conds[] = 'ug_user = user_id';
$conds['ug_group'] = $this->groups;
+ $conds[] = 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() );
}
if ( $this->excludegroups !== [] ) {
foreach ( $this->excludegroups as $group ) {
$conds[] = 'NOT EXISTS (' . $dbr->selectSQLText(
- 'user_groups', '1', [ 'ug_user = user_id', 'ug_group' => $group ]
- ) . ')';
+ 'user_groups', '1', [
+ 'ug_user = user_id',
+ 'ug_group' => $group,
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
+ ]
+ ) . ')';
}
}
if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
$list = [];
$user = User::newFromId( $row->user_id );
- $groups_list = self::getGroups( intval( $row->user_id ), $this->userGroupCache );
- foreach ( $groups_list as $group ) {
- $list[] = self::buildGroupLink( $group, $userName );
+ $ugms = self::getGroupMemberships( intval( $row->user_id ), $this->userGroupCache );
+ foreach ( $ugms as $ugm ) {
+ $list[] = $this->buildGroupLink( $ugm, $userName );
}
$groups = $lang->commaList( $list );
$join_conds['user_groups'] = [
'LEFT JOIN', [
'ug_user = rev_user',
- 'ug_group' => $groupsWithBotPermission
+ 'ug_group' => $groupsWithBotPermission,
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $this->mDb->addQuotes( $this->mDb->timestamp() )
]
];
}
$groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
if ( count( $groupsWithBotPermission ) ) {
+ $dbr = wfGetDB( DB_REPLICA );
$tables[] = 'user_groups';
$conds[] = 'ug_group IS NULL';
$jconds['user_groups'] = [
'LEFT JOIN',
[
'ug_group' => $groupsWithBotPermission,
- 'ug_user = img_user'
+ 'ug_user = img_user',
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
]
];
}
if ( $this->requestedGroup != '' ) {
$conds['ug_group'] = $this->requestedGroup;
+ $conds[] = 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() );
}
if ( $this->requestedUser != '' ) {
$lang = $this->getLanguage();
$groups = '';
- $groups_list = self::getGroups( intval( $row->user_id ), $this->userGroupCache );
+ $ugms = self::getGroupMemberships( intval( $row->user_id ), $this->userGroupCache );
- if ( !$this->including && count( $groups_list ) > 0 ) {
+ if ( !$this->including && count( $ugms ) > 0 ) {
$list = [];
- foreach ( $groups_list as $group ) {
- $list[] = self::buildGroupLink( $group, $userName );
+ foreach ( $ugms as $ugm ) {
+ $list[] = $this->buildGroupLink( $ugm, $userName );
}
$groups = $lang->commaList( $list );
}
$dbr = wfGetDB( DB_REPLICA );
$groupRes = $dbr->select(
'user_groups',
- [ 'ug_user', 'ug_group' ],
+ UserGroupMembership::selectFields(),
[ 'ug_user' => $userIds ],
__METHOD__
);
$cache = [];
$groups = [];
foreach ( $groupRes as $row ) {
- $cache[intval( $row->ug_user )][] = $row->ug_group;
- $groups[$row->ug_group] = true;
+ $ugm = UserGroupMembership::newFromRow( $row );
+ if ( !$ugm->isExpired() ) {
+ $cache[$row->ug_user][$row->ug_group] = $ugm;
+ $groups[$row->ug_group] = true;
+ }
}
// Give extensions a chance to add things like global user group data
// Add page of groups to link batch
foreach ( $groups as $group => $unused ) {
- $groupPage = User::getGroupPage( $group );
+ $groupPage = UserGroupMembership::getGroupPage( $group );
if ( $groupPage ) {
$batch->addObj( $groupPage );
}
function getAllGroups() {
$result = [];
foreach ( User::getAllGroups() as $group ) {
- $result[$group] = User::getGroupName( $group );
+ $result[$group] = UserGroupMembership::getGroupName( $group );
}
asort( $result );
}
/**
- * Get a list of groups the specified user belongs to
+ * Get an associative array containing groups the specified user belongs to,
+ * and the relevant UserGroupMembership objects
*
* @param int $uid User id
* @param array|null $cache
- * @return array
+ * @return array (group name => UserGroupMembership object)
*/
- protected static function getGroups( $uid, $cache = null ) {
+ protected static function getGroupMemberships( $uid, $cache = null ) {
if ( $cache === null ) {
$user = User::newFromId( $uid );
- $effectiveGroups = $user->getEffectiveGroups();
+ return $user->getGroupMemberships();
} else {
- $effectiveGroups = isset( $cache[$uid] ) ? $cache[$uid] : [];
+ return isset( $cache[$uid] ) ? $cache[$uid] : [];
}
- $groups = array_diff( $effectiveGroups, User::getImplicitGroups() );
-
- return $groups;
}
/**
* Format a link to a group description page
*
- * @param string $group Group name
+ * @param string|UserGroupMembership $group Group name or UserGroupMembership object
* @param string $username Username
* @return string
*/
- protected static function buildGroupLink( $group, $username ) {
- return User::makeGroupLinkHTML(
- $group,
- User::getGroupMember( $group, $username )
- );
+ protected function buildGroupLink( $group, $username ) {
+ return UserGroupMembership::getLink( $group, $this->getContext(), 'html', $username );
}
-
}
'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'http://www.w3.org/2000/svg',
'http://www.w3.org/tr/rec-rdf-syntax/',
+ 'http://www.w3.org/2000/01/rdf-schema#',
];
// Inkscape mangles namespace definitions created by Adobe Illustrator.
/**
* @const int Serialized record version.
*/
- const VERSION = 10;
+ const VERSION = 11;
/**
* Exclude user options that are set to their default value.
'mRegistration',
'mEditCount',
// user_groups table
- 'mGroups',
+ 'mGroupMemberships',
// user_properties table
'mOptionOverrides',
];
protected $mRegistration;
/** @var int */
protected $mEditCount;
- /** @var array */
- public $mGroups;
+ /**
+ * @var array No longer used since 1.29; use User::getGroups() instead
+ * @deprecated since 1.29
+ */
+ private $mGroups;
+ /** @var array Associative array of (group name => UserGroupMembership object) */
+ protected $mGroupMemberships;
/** @var array */
protected $mOptionOverrides;
// @}
/** @var array */
public $mOptions;
- /**
- * @var WebRequest
- */
+ /** @var WebRequest */
private $mRequest;
/** @var Block */
return $cache->makeGlobalKey( 'user', 'id', wfWikiID(), $this->mId );
}
+ /**
+ * @param WANObjectCache $cache
+ * @return string[]
+ * @since 1.28
+ */
+ public function getMutableCacheKeys( WANObjectCache $cache ) {
+ $id = $this->getId();
+
+ return $id ? [ $this->getCacheKey( $cache ) ] : [];
+ }
+
/**
* Load user data from shared cache, given mId has already been set.
*
$this->mEmailToken = '';
$this->mEmailTokenExpires = null;
$this->mRegistration = wfTimestamp( TS_MW );
- $this->mGroups = [];
+ $this->mGroupMemberships = [];
Hooks::run( 'UserLoadDefaults', [ $this, $name ] );
}
if ( $s !== false ) {
// Initialise user table data
$this->loadFromRow( $s );
- $this->mGroups = null; // deferred
+ $this->mGroupMemberships = null; // deferred
$this->getEditCount(); // revalidation for nulls
return true;
} else {
* @param stdClass $row Row from the user table to load.
* @param array $data Further user data to load into the object
*
- * user_groups Array with groups out of the user_groups table
- * user_properties Array with properties out of the user_properties table
+ * user_groups Array of arrays or stdClass result rows out of the user_groups
+ * table. Previously you were supposed to pass an array of strings
+ * here, but we also need expiry info nowadays, so an array of
+ * strings is ignored.
+ * user_properties Array with properties out of the user_properties table
*/
protected function loadFromRow( $row, $data = null ) {
$all = true;
- $this->mGroups = null; // deferred
+ $this->mGroupMemberships = null; // deferred
if ( isset( $row->user_name ) ) {
$this->mName = $row->user_name;
if ( is_array( $data ) ) {
if ( isset( $data['user_groups'] ) && is_array( $data['user_groups'] ) ) {
- $this->mGroups = $data['user_groups'];
+ if ( !count( $data['user_groups'] ) ) {
+ $this->mGroupMemberships = [];
+ } else {
+ $firstGroup = reset( $data['user_groups'] );
+ if ( is_array( $firstGroup ) || is_object( $firstGroup ) ) {
+ $this->mGroupMemberships = [];
+ foreach ( $data['user_groups'] as $row ) {
+ $ugm = UserGroupMembership::newFromRow( (object)$row );
+ $this->mGroupMemberships[$ugm->getGroup()] = $ugm;
+ }
+ }
+ }
}
if ( isset( $data['user_properties'] ) && is_array( $data['user_properties'] ) ) {
$this->loadOptions( $data['user_properties'] );
* Load the groups from the database if they aren't already loaded.
*/
private function loadGroups() {
- if ( is_null( $this->mGroups ) ) {
+ if ( is_null( $this->mGroupMemberships ) ) {
$db = ( $this->queryFlagsUsed & self::READ_LATEST )
? wfGetDB( DB_MASTER )
: wfGetDB( DB_REPLICA );
- $res = $db->select( 'user_groups',
- [ 'ug_group' ],
- [ 'ug_user' => $this->mId ],
- __METHOD__ );
- $this->mGroups = [];
- foreach ( $res as $row ) {
- $this->mGroups[] = $row->ug_group;
- }
+ $this->mGroupMemberships = UserGroupMembership::getMembershipsForUser(
+ $this->mId, $db );
}
}
$this->mRights = null;
$this->mEffectiveGroups = null;
$this->mImplicitGroups = null;
- $this->mGroups = null;
+ $this->mGroupMemberships = null;
$this->mOptions = null;
$this->mOptionsLoaded = false;
$this->mEditCount = null;
public function getGroups() {
$this->load();
$this->loadGroups();
- return $this->mGroups;
+ return array_keys( $this->mGroupMemberships );
+ }
+
+ /**
+ * Get the list of explicit group memberships this user has, stored as
+ * UserGroupMembership objects. Implicit groups are not included.
+ *
+ * @return array Associative array of (group name as string => UserGroupMembership object)
+ * @since 1.29
+ */
+ public function getGroupMemberships() {
+ $this->load();
+ $this->loadGroups();
+ return $this->mGroupMemberships;
}
/**
}
/**
- * Add the user to the given group.
- * This takes immediate effect.
+ * Add the user to the given group. This takes immediate effect.
+ * If the user is already in the group, the expiry time will be updated to the new
+ * expiry time. (If $expiry is omitted or null, the membership will be altered to
+ * never expire.)
+ *
* @param string $group Name of the group to add
+ * @param string $expiry Optional expiry timestamp in any format acceptable to
+ * wfTimestamp(), or null if the group assignment should not expire
* @return bool
*/
- public function addGroup( $group ) {
+ public function addGroup( $group, $expiry = null ) {
$this->load();
+ $this->loadGroups();
- if ( !Hooks::run( 'UserAddGroup', [ $this, &$group ] ) ) {
+ if ( $expiry ) {
+ $expiry = wfTimestamp( TS_MW, $expiry );
+ }
+
+ if ( !Hooks::run( 'UserAddGroup', [ $this, &$group, &$expiry ] ) ) {
return false;
}
- $dbw = wfGetDB( DB_MASTER );
- if ( $this->getId() ) {
- $dbw->insert( 'user_groups',
- [
- 'ug_user' => $this->getId(),
- 'ug_group' => $group,
- ],
- __METHOD__,
- [ 'IGNORE' ] );
+ // create the new UserGroupMembership and put it in the DB
+ $ugm = new UserGroupMembership( $this->mId, $group, $expiry );
+ if ( !$ugm->insert( true ) ) {
+ return false;
}
- $this->loadGroups();
- $this->mGroups[] = $group;
- // In case loadGroups was not called before, we now have the right twice.
- // Get rid of the duplicate.
- $this->mGroups = array_unique( $this->mGroups );
+ $this->mGroupMemberships[$group] = $ugm;
// Refresh the groups caches, and clear the rights cache so it will be
// refreshed on the next call to $this->getRights().
*/
public function removeGroup( $group ) {
$this->load();
+
if ( !Hooks::run( 'UserRemoveGroup', [ $this, &$group ] ) ) {
return false;
}
- $dbw = wfGetDB( DB_MASTER );
- $dbw->delete( 'user_groups',
- [
- 'ug_user' => $this->getId(),
- 'ug_group' => $group,
- ], __METHOD__
- );
- // Remember that the user was in this group
- $dbw->insert( 'user_former_groups',
- [
- 'ufg_user' => $this->getId(),
- 'ufg_group' => $group,
- ],
- __METHOD__,
- [ 'IGNORE' ]
- );
+ $ugm = UserGroupMembership::getMembership( $this->mId, $group );
+ // delete the membership entry
+ if ( !$ugm || !$ugm->delete() ) {
+ return false;
+ }
$this->loadGroups();
- $this->mGroups = array_diff( $this->mGroups, [ $group ] );
+ unset( $this->mGroupMemberships[$group] );
// Refresh the groups caches, and clear the rights cache so it will be
// refreshed on the next call to $this->getRights().
/**
* Get the localized descriptive name for a group, if it exists
+ * @deprecated since 1.29 Use UserGroupMembership::getGroupName instead
*
* @param string $group Internal group name
* @return string Localized descriptive group name
*/
public static function getGroupName( $group ) {
- $msg = wfMessage( "group-$group" );
- return $msg->isBlank() ? $group : $msg->text();
+ wfDeprecated( __METHOD__, '1.29' );
+ return UserGroupMembership::getGroupName( $group );
}
/**
* Get the localized descriptive name for a member of a group, if it exists
+ * @deprecated since 1.29 Use UserGroupMembership::getGroupMemberName instead
*
* @param string $group Internal group name
* @param string $username Username for gender (since 1.19)
* @return string Localized name for group member
*/
public static function getGroupMember( $group, $username = '#' ) {
- $msg = wfMessage( "group-$group-member", $username );
- return $msg->isBlank() ? $group : $msg->text();
+ wfDeprecated( __METHOD__, '1.29' );
+ return UserGroupMembership::getGroupMemberName( $group, $username );
}
/**
/**
* Get the title of a page describing a particular group
+ * @deprecated since 1.29 Use UserGroupMembership::getGroupPage instead
*
* @param string $group Internal group name
* @return Title|bool Title of the page if it exists, false otherwise
*/
public static function getGroupPage( $group ) {
- $msg = wfMessage( 'grouppage-' . $group )->inContentLanguage();
- if ( $msg->exists() ) {
- $title = Title::newFromText( $msg->text() );
- if ( is_object( $title ) ) {
- return $title;
- }
- }
- return false;
+ wfDeprecated( __METHOD__, '1.29' );
+ return UserGroupMembership::getGroupPage( $group );
}
/**
* Create a link to the group in HTML, if available;
* else return the group name.
+ * @deprecated since 1.29 Use UserGroupMembership::getLink instead, or
+ * make the link yourself if you need custom text
*
* @param string $group Internal name of the group
* @param string $text The text of the link
* @return string HTML link to the group
*/
public static function makeGroupLinkHTML( $group, $text = '' ) {
+ wfDeprecated( __METHOD__, '1.29' );
+
if ( $text == '' ) {
- $text = self::getGroupName( $group );
+ $text = UserGroupMembership::getGroupName( $group );
}
- $title = self::getGroupPage( $group );
+ $title = UserGroupMembership::getGroupPage( $group );
if ( $title ) {
return Linker::link( $title, htmlspecialchars( $text ) );
} else {
/**
* Create a link to the group in Wikitext, if available;
* else return the group name.
+ * @deprecated since 1.29 Use UserGroupMembership::getLink instead, or
+ * make the link yourself if you need custom text
*
* @param string $group Internal name of the group
* @param string $text The text of the link
* @return string Wikilink to the group
*/
public static function makeGroupLinkWiki( $group, $text = '' ) {
+ wfDeprecated( __METHOD__, '1.29' );
+
if ( $text == '' ) {
- $text = self::getGroupName( $group );
+ $text = UserGroupMembership::getGroupName( $group );
}
- $title = self::getGroupPage( $group );
+ $title = UserGroupMembership::getGroupPage( $group );
if ( $title ) {
$page = $title->getFullText();
return "[[$page|$text]]";
static function newFatalPermissionDeniedStatus( $permission ) {
global $wgLang;
- $groups = array_map(
- [ 'User', 'makeGroupLinkWiki' ],
- User::getGroupsWithPermission( $permission )
- );
+ $groups = [];
+ foreach ( User::getGroupsWithPermission( $permission ) as $group ) {
+ $groups[] = UserGroupMembership::getLink( $group, RequestContext::getMain(), 'wiki' );
+ }
if ( $groups ) {
return Status::newFatal( 'badaccess-groups', $wgLang->commaList( $groups ), count( $groups ) );
--- /dev/null
+<?php
+/**
+ * Represents the membership of a user to a user group.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * Represents a "user group membership" -- a specific instance of a user belonging
+ * to a group. For example, the fact that user Mary belongs to the sysop group is a
+ * user group membership.
+ *
+ * The class encapsulates rows in the user_groups table. The logic is low-level and
+ * doesn't run any hooks. Often, you will want to call User::addGroup() or
+ * User::removeGroup() instead.
+ *
+ * @since 1.29
+ */
+class UserGroupMembership {
+ /** @var int The ID of the user who belongs to the group */
+ private $userId;
+
+ /** @var string */
+ private $group;
+
+ /** @var string|null Timestamp of expiry in TS_MW format, or null if no expiry */
+ private $expiry;
+
+ /**
+ * @param int $userId The ID of the user who belongs to the group
+ * @param string $group The internal group name
+ * @param string|null $expiry Timestamp of expiry in TS_MW format, or null if no expiry
+ */
+ public function __construct( $userId = 0, $group = null, $expiry = null ) {
+ global $wgDisableUserGroupExpiry;
+ if ( $wgDisableUserGroupExpiry ) {
+ $expiry = null;
+ }
+
+ $this->userId = (int)$userId;
+ $this->group = $group; // TODO throw on invalid group?
+ $this->expiry = $expiry ?: null;
+ }
+
+ /**
+ * @return int
+ */
+ public function getUserId() {
+ return $this->userId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getGroup() {
+ return $this->group;
+ }
+
+ /**
+ * @return string|null Timestamp of expiry in TS_MW format, or null if no expiry
+ */
+ public function getExpiry() {
+ global $wgDisableUserGroupExpiry;
+ if ( $wgDisableUserGroupExpiry ) {
+ return null;
+ }
+
+ return $this->expiry;
+ }
+
+ protected function initFromRow( $row ) {
+ global $wgDisableUserGroupExpiry;
+
+ $this->userId = (int)$row->ug_user;
+ $this->group = $row->ug_group;
+ if ( $wgDisableUserGroupExpiry ) {
+ $this->expiry = null;
+ } else {
+ $this->expiry = $row->ug_expiry === null ?
+ null :
+ wfTimestamp( TS_MW, $row->ug_expiry );
+ }
+ }
+
+ /**
+ * Creates a new UserGroupMembership object from a database row.
+ *
+ * @param stdClass $row The row from the user_groups table
+ * @return UserGroupMembership
+ */
+ public static function newFromRow( $row ) {
+ $ugm = new self;
+ $ugm->initFromRow( $row );
+ return $ugm;
+ }
+
+ /**
+ * Returns the list of user_groups fields that should be selected to create
+ * a new user group membership.
+ * @return array
+ */
+ public static function selectFields() {
+ global $wgDisableUserGroupExpiry;
+ if ( $wgDisableUserGroupExpiry ) {
+ return [
+ 'ug_user',
+ 'ug_group',
+ ];
+ } else {
+ return [
+ 'ug_user',
+ 'ug_group',
+ 'ug_expiry',
+ ];
+ }
+ }
+
+ /**
+ * Delete the row from the user_groups table.
+ *
+ * @throws MWException
+ * @param IDatabase|null $dbw Optional master database connection to use
+ * @return bool Whether or not anything was deleted
+ */
+ public function delete( IDatabase $dbw = null ) {
+ global $wgDisableUserGroupExpiry;
+ if ( wfReadOnly() ) {
+ return false;
+ }
+
+ if ( $dbw === null ) {
+ $dbw = wfGetDB( DB_MASTER );
+ }
+
+ if ( $wgDisableUserGroupExpiry ) {
+ $dbw->delete( 'user_groups', $this->getDatabaseArray( $dbw ), __METHOD__ );
+ } else {
+ $dbw->delete(
+ 'user_groups',
+ [ 'ug_user' => $this->userId, 'ug_group' => $this->group ],
+ __METHOD__ );
+ }
+ if ( !$dbw->affectedRows() ) {
+ return false;
+ }
+
+ // Remember that the user was in this group
+ $dbw->insert(
+ 'user_former_groups',
+ [ 'ufg_user' => $this->userId, 'ufg_group' => $this->group ],
+ __METHOD__,
+ [ 'IGNORE' ] );
+
+ return true;
+ }
+
+ /**
+ * Insert a user right membership into the database. When $allowUpdate is false,
+ * the function fails if there is a conflicting membership entry (same user and
+ * group) already in the table.
+ *
+ * @throws MWException
+ * @param bool $allowUpdate Whether to perform "upsert" instead of INSERT
+ * @param IDatabase|null $dbw If you have one available
+ * @return bool Whether or not anything was inserted
+ */
+ public function insert( $allowUpdate = false, IDatabase $dbw = null ) {
+ global $wgDisableUserGroupExpiry;
+ if ( $dbw === null ) {
+ $dbw = wfGetDB( DB_MASTER );
+ }
+
+ // Purge old, expired memberships from the DB
+ self::purgeExpired( $dbw );
+
+ // Check that the values make sense
+ if ( $this->group === null ) {
+ throw new UnexpectedValueException(
+ 'Don\'t try inserting an uninitialized UserGroupMembership object' );
+ } elseif ( $this->userId <= 0 ) {
+ throw new UnexpectedValueException(
+ 'UserGroupMembership::insert() needs a positive user ID. ' .
+ 'Did you forget to add your User object to the database before calling addGroup()?' );
+ }
+
+ $row = $this->getDatabaseArray( $dbw );
+ $dbw->insert( 'user_groups', $row, __METHOD__, [ 'IGNORE' ] );
+ $affected = $dbw->affectedRows();
+
+ // Don't collide with expired user group memberships
+ // Do this after trying to insert, in order to avoid locking
+ if ( !$wgDisableUserGroupExpiry && !$affected ) {
+ $conds = [
+ 'ug_user' => $row['ug_user'],
+ 'ug_group' => $row['ug_group'],
+ ];
+ // if we're unconditionally updating, check that the expiry is not already the
+ // same as what we are trying to update it to; otherwise, only update if
+ // the expiry date is in the past
+ if ( $allowUpdate ) {
+ if ( $this->expiry ) {
+ $conds[] = 'ug_expiry IS NULL OR ug_expiry != ' .
+ $dbw->addQuotes( $dbw->timestamp( $this->expiry ) );
+ } else {
+ $conds[] = 'ug_expiry IS NOT NULL';
+ }
+ } else {
+ $conds[] = 'ug_expiry < ' . $dbw->addQuotes( $dbw->timestamp() );
+ }
+
+ $row = $dbw->selectRow( 'user_groups', $this::selectFields(), $conds, __METHOD__ );
+ if ( $row ) {
+ $dbw->update(
+ 'user_groups',
+ [ 'ug_expiry' => $this->expiry ? $dbw->timestamp( $this->expiry ) : null ],
+ [ 'ug_user' => $row->ug_user, 'ug_group' => $row->ug_group ],
+ __METHOD__ );
+ $affected = $dbw->affectedRows();
+ }
+ }
+
+ return $affected > 0;
+ }
+
+ /**
+ * Get an array suitable for passing to $dbw->insert() or $dbw->update()
+ * @param IDatabase $db
+ * @return array
+ */
+ protected function getDatabaseArray( IDatabase $db ) {
+ global $wgDisableUserGroupExpiry;
+
+ $a = [
+ 'ug_user' => $this->userId,
+ 'ug_group' => $this->group,
+ ];
+ if ( !$wgDisableUserGroupExpiry ) {
+ $a['ug_expiry'] = $this->expiry ? $db->timestamp( $this->expiry ) : null;
+ }
+ return $a;
+ }
+
+ /**
+ * Has the membership expired?
+ * @return bool
+ */
+ public function isExpired() {
+ global $wgDisableUserGroupExpiry;
+ if ( $wgDisableUserGroupExpiry || !$this->expiry ) {
+ return false;
+ } else {
+ return wfTimestampNow() > $this->expiry;
+ }
+ }
+
+ /**
+ * Purge expired memberships from the user_groups table
+ *
+ * @param IDatabase|null $dbw
+ */
+ public static function purgeExpired( IDatabase $dbw = null ) {
+ global $wgDisableUserGroupExpiry;
+ if ( $wgDisableUserGroupExpiry || wfReadOnly() ) {
+ return;
+ }
+
+ if ( $dbw === null ) {
+ $dbw = wfGetDB( DB_MASTER );
+ }
+
+ DeferredUpdates::addUpdate( new AtomicSectionUpdate(
+ $dbw,
+ __METHOD__,
+ function ( IDatabase $dbw, $fname ) {
+ $expiryCond = [ 'ug_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ];
+ $res = $dbw->select( 'user_groups', self::selectFields(), $expiryCond, $fname );
+
+ // save an array of users/groups to insert to user_former_groups
+ $usersAndGroups = [];
+ foreach ( $res as $row ) {
+ $usersAndGroups[] = [ 'ufg_user' => $row->ug_user, 'ufg_group' => $row->ug_group ];
+ }
+
+ // delete 'em all
+ $dbw->delete( 'user_groups', $expiryCond, $fname );
+
+ // and push the groups to user_former_groups
+ $dbw->insert( 'user_former_groups', $usersAndGroups, __METHOD__, [ 'IGNORE' ] );
+ }
+ ) );
+ }
+
+ /**
+ * Returns UserGroupMembership objects for all the groups a user currently
+ * belongs to.
+ *
+ * @param int $userId ID of the user to search for
+ * @param IDatabase|null $db Optional database connection
+ * @return array Associative array of (group name => UserGroupMembership object)
+ */
+ public static function getMembershipsForUser( $userId, $db = null ) {
+ if ( !$db ) {
+ $db = wfGetDB( DB_REPLICA );
+ }
+
+ $res = $db->select( 'user_groups',
+ self::selectFields(),
+ [ 'ug_user' => $userId ],
+ __METHOD__ );
+
+ $ugms = [];
+ foreach ( $res as $row ) {
+ $ugm = self::newFromRow( $row );
+ if ( !$ugm->isExpired() ) {
+ $ugms[$ugm->group] = $ugm;
+ }
+ }
+
+ return $ugms;
+ }
+
+ /**
+ * Returns a UserGroupMembership object that pertains to the given user and group,
+ * or false if the user does not belong to that group (or the assignment has
+ * expired).
+ *
+ * @param int $userId ID of the user to search for
+ * @param string $group User group name
+ * @param IDatabase|null $db Optional database connection
+ * @return UserGroupMembership|false
+ */
+ public static function getMembership( $userId, $group, IDatabase $db = null ) {
+ if ( !$db ) {
+ $db = wfGetDB( DB_REPLICA );
+ }
+
+ $row = $db->selectRow( 'user_groups',
+ self::selectFields(),
+ [ 'ug_user' => $userId, 'ug_group' => $group ],
+ __METHOD__ );
+ if ( !$row ) {
+ return false;
+ }
+
+ $ugm = self::newFromRow( $row );
+ if ( !$ugm->isExpired() ) {
+ return $ugm;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Gets a link for a user group, possibly including the expiry date if relevant.
+ *
+ * @param string|UserGroupMembership $ugm Either a group name as a string, or
+ * a UserGroupMembership object
+ * @param IContextSource $context
+ * @param string $format Either 'wiki' or 'html'
+ * @param string|null $userName If you want to use the group member message
+ * ("administrator"), pass the name of the user who belongs to the group; it
+ * is used for GENDER of the group member message. If you instead want the
+ * group name message ("Administrators"), omit this parameter.
+ * @return string
+ */
+ public static function getLink( $ugm, IContextSource $context, $format,
+ $userName = null ) {
+
+ if ( $format !== 'wiki' && $format !== 'html' ) {
+ throw new MWException( 'UserGroupMembership::getLink() $format parameter should be ' .
+ "'wiki' or 'html'" );
+ }
+
+ if ( $ugm instanceof UserGroupMembership ) {
+ $expiry = $ugm->getExpiry();
+ $group = $ugm->getGroup();
+ } else {
+ $expiry = null;
+ $group = $ugm;
+ }
+
+ if ( $userName !== null ) {
+ $groupName = self::getGroupMemberName( $group, $userName );
+ } else {
+ $groupName = self::getGroupName( $group );
+ }
+
+ // link to the group description page, if it exists
+ $linkTitle = self::getGroupPage( $group );
+ if ( $linkTitle ) {
+ if ( $format === 'wiki' ) {
+ $linkPage = $linkTitle->getFullText();
+ $groupLink = "[[$linkPage|$groupName]]";
+ } else {
+ $groupLink = Linker::link( $linkTitle, htmlspecialchars( $groupName ) );
+ }
+ } else {
+ $groupLink = htmlspecialchars( $groupName );
+ }
+
+ if ( $expiry ) {
+ // format the expiry to a nice string
+ $uiLanguage = $context->getLanguage();
+ $uiUser = $context->getUser();
+ $expiryDT = $uiLanguage->userTimeAndDate( $expiry, $uiUser );
+ $expiryD = $uiLanguage->userDate( $expiry, $uiUser );
+ $expiryT = $uiLanguage->userTime( $expiry, $uiUser );
+ if ( $format === 'html' ) {
+ $groupLink = Message::rawParam( $groupLink );
+ }
+ return $context->msg( 'group-membership-link-with-expiry' )
+ ->params( $groupLink, $expiryDT, $expiryD, $expiryT )->text();
+ } else {
+ return $groupLink;
+ }
+ }
+
+ /**
+ * Gets the localized friendly name for a group, if it exists. For example,
+ * "Administrators" or "Bureaucrats"
+ *
+ * @param string $group Internal group name
+ * @return string Localized friendly group name
+ */
+ public static function getGroupName( $group ) {
+ $msg = wfMessage( "group-$group" );
+ return $msg->isBlank() ? $group : $msg->text();
+ }
+
+ /**
+ * Gets the localized name for a member of a group, if it exists. For example,
+ * "administrator" or "bureaucrat"
+ *
+ * @param string $group Internal group name
+ * @param string $username Username for gender
+ * @return string Localized name for group member
+ */
+ public static function getGroupMemberName( $group, $username ) {
+ $msg = wfMessage( "group-$group-member", $username );
+ return $msg->isBlank() ? $group : $msg->text();
+ }
+
+ /**
+ * Gets the title of a page describing a particular user group. When the name
+ * of the group appears in the UI, it can link to this page.
+ *
+ * @param string $group Internal group name
+ * @return Title|bool Title of the page if it exists, false otherwise
+ */
+ public static function getGroupPage( $group ) {
+ $msg = wfMessage( "grouppage-$group" )->inContentLanguage();
+ if ( $msg->exists() ) {
+ $title = Title::newFromText( $msg->text() );
+ if ( is_object( $title ) ) {
+ return $title;
+ }
+ }
+ return false;
+ }
+}
}
/**
- * Replaces User::addUserGroup()
- * @param string $group
+ * Replaces User::getGroupMemberships()
+ *
+ * @return array
+ * @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;
+ }
+
+ /**
+ * Replaces User::addGroup()
*
+ * @param string $group
+ * @param string|null $expiry
* @return bool
*/
- function addGroup( $group ) {
- $this->db->insert( 'user_groups',
- [
- 'ug_user' => $this->id,
- 'ug_group' => $group,
- ],
- __METHOD__,
- [ 'IGNORE' ] );
+ function addGroup( $group, $expiry = null ) {
+ if ( $expiry ) {
+ $expiry = wfTimestamp( TS_MW, $expiry );
+ }
- return true;
+ $ugm = new UserGroupMembership( $this->id, $group, $expiry );
+ return $ugm->insert( true, $this->db );
}
/**
- * Replaces User::removeUserGroup()
- * @param string $group
+ * Replaces User::removeGroup()
*
+ * @param string $group
* @return bool
*/
function removeGroup( $group ) {
- $this->db->delete( 'user_groups',
- [
- 'ug_user' => $this->id,
- 'ug_group' => $group,
- ],
- __METHOD__ );
-
- return true;
+ $ugm = UserGroupMembership::getMembership( $this->id, $group, $this->db );
+ if ( !$ugm ) {
+ return false;
+ }
+ return $ugm->delete( $this->db );
}
/**
if ( $time === false ) { // Unknown format. Return it as-is in case.
return $str;
} elseif ( $time !== strtotime( $str, $now + 1 ) ) { // It's a relative timestamp.
- // The result differs based on current time, so it's a duration length.
- return $this->formatDuration( $time );
+ // The result differs based on current time, so the difference
+ // is a fixed duration length.
+ return $this->formatDuration( $time - $now );
} else { // It's an absolute timestamp.
if ( $time === 0 ) {
// wfTimestamp() handles 0 as current time instead of epoch.
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (راجع أيضا [[Special:NewPages|قائمة الصفحات الجديدة]])",
"recentchanges-submit": "أظهر",
"rcfilters-activefilters": "المرشحات النشطة",
+ "rcfilters-restore-default-filters": "استرجاع المرشحات الافتراضية",
+ "rcfilters-clear-all-filters": "مسح كل المرشحات",
"rcfilters-search-placeholder": "رشح أحدث التغييرات (تصفح أو ابدأ الكتابة)",
"rcfilters-invalid-filter": "مرشح غير صحيح",
+ "rcfilters-empty-filter": "لا مرشحات فعالة. كل المساهمات معروضة.",
"rcfilters-filterlist-title": "مرشحات",
"rcfilters-filterlist-noresults": "لم يتم العثور على مرشحات",
+ "rcfilters-filtergroup-registration": "تسجيل المستخدم",
+ "rcfilters-filter-registered-label": "مسجل",
+ "rcfilters-filter-registered-description": "المحررون مسجلو الدخول.",
+ "rcfilters-filter-unregistered-label": "غير مسجل",
+ "rcfilters-filter-unregistered-description": "المحررون غير مسجلي الدخول.",
"rcfilters-filtergroup-authorship": "ملكية التعديلات",
"rcfilters-filter-editsbyself-label": "تعديلاتك الشخصية",
"rcfilters-filter-editsbyself-description": "التعديلات بواسطتك.",
"rcfilters-filter-editsbyother-label": "التعديلات بواسطة الآخرين",
- "rcfilters-filter-editsbyother-description": "التعديلات المنشأة بواسطة المستخدمين الآخرين (ليس أنت.)",
- "rcfilters-filtergroup-userExpLevel": "Ù\85ستÙ\88Ù\89 خبرة اÙ\84Ù\85ستخدÙ\85",
+ "rcfilters-filter-editsbyother-description": "التعديلات المنشأة بواسطة المستخدمين الآخرين (ليس أنت).",
+ "rcfilters-filtergroup-userExpLevel": "Ù\85ستÙ\88Ù\89 اÙ\84خبرة (Ù\84Ù\84Ù\85ستخدÙ\85Ù\8aÙ\86 اÙ\84Ù\85سجÙ\84Ù\8aÙ\86 Ù\81Ù\82Ø·)",
"rcfilters-filter-userExpLevel-newcomer-label": "القادمون الجدد",
- "rcfilters-filter-userExpLevel-newcomer-description": "اÙ\84Ù\85ستخدÙ\85Ù\88Ù\86 اÙ\84جدد جدا: Ø£Ù\82Ù\84 Ù\85Ù\86 10 تعدÙ\8aÙ\84ات Ù\884 Ø£Ù\8aاÙ\85 Ù\85Ù\86 اÙ\84Ù\86شاط.",
+ "rcfilters-filter-userExpLevel-newcomer-description": "أقل من 10 تعديلات و4 أيام من النشاط.",
"rcfilters-filter-userExpLevel-learner-label": "المتعلمون",
- "rcfilters-filter-userExpLevel-learner-description": "المزيد من أيام النشاط والتعديلات أكثر من 'القادمين الجدد' ولكن أقل من 'المستخدمين ذوي الخبرة.'",
+ "rcfilters-filter-userExpLevel-learner-description": "المزيد من أيام النشاط والتعديلات أكثر من \"القادمين الجدد\" ولكن أقل من \"المستخدمين ذوي الخبرة\".",
"rcfilters-filter-userExpLevel-experienced-label": "المستخدمون ذوو الخبرة",
"rcfilters-filter-userExpLevel-experienced-description": "أكثر من 30 يوما من النشاط و500 تعديل.",
+ "rcfilters-filtergroup-automated": "المساهمات الأوتوماتيكية",
+ "rcfilters-filter-bots-label": "بوت",
+ "rcfilters-filter-bots-description": "التعديلات بواسطة الأدوات الأوتوماتيكية.",
+ "rcfilters-filter-humans-label": "بشري (ليس بوت)",
+ "rcfilters-filter-humans-description": "التعديلات بواسطة المحررين البشريين.",
+ "rcfilters-filtergroup-significance": "الأهمية",
+ "rcfilters-filter-minor-label": "تعديلات طفيفة",
+ "rcfilters-filter-minor-description": "التعديلات التي علم عليها المستخدم كطفيفة.",
+ "rcfilters-filter-major-label": "التعديلات غير الطفيفة",
+ "rcfilters-filter-major-description": "التعديلات غير المعلم عليها كطفيفة.",
+ "rcfilters-filtergroup-changetype": "نوع التغيير",
+ "rcfilters-filter-pageedits-label": "تعديلات الصفحة",
+ "rcfilters-filter-pageedits-description": "التعديلات لمحتوى الويكي، النقاشات، وصوفات التصنيفات....",
+ "rcfilters-filter-newpages-label": "إنشاء الصفحات",
+ "rcfilters-filter-newpages-description": "التعديلات التي تصنع صفحات جديدة.",
+ "rcfilters-filter-categorization-label": "تغييرات التصنيفات",
+ "rcfilters-filter-categorization-description": "سجلات إضافة أو إزالة الصفحات من التصنيفات.",
+ "rcfilters-filter-logactions-label": "الأفعال المسجلة",
+ "rcfilters-filter-logactions-description": "الأفعال الإدارية، إنشاء الحسابات، حذف الصفحات، عمليات الرفع....",
"rcnotefrom": "بالأسفل {{PLURAL:$5|التغيير|التغييرات}} منذ <strong>$2</strong> (إلى <strong>$1</strong> معروضة).",
"rclistfrom": "أظهر التغييرات بدء من $3 $2",
"rcshowhideminor": "$1 التعديلات الطفيفة",
"apisandbox-sending-request": "إرسال طلب API ...",
"apisandbox-loading-results": "استقبال طلبات API ...",
"apisandbox-results-error": "حدث خطأ أثناء تحميل رد استعدلام الAPI: $1.",
- "apisandbox-request-params-json": "معاملات JSON:",
"apisandbox-request-url-label": "مسار الطلب:",
"apisandbox-request-time": "وقت الطلب: {{PLURAL:$1|$1 ms}}",
"apisandbox-results-fixtoken": "رمز الصحيح وإعادة الموافقة",
"usercssispublic": "من فضل لاحظ: صفحات الCSS الفرعية لا ينبغي أن تحتوي على بيانات سرية بما أنها يمكن رؤيتها بواسطة المستخدمين الآخرين.",
"restrictionsfield-badip": "عنوان أيبي أو نطاق غير صحيح: $1",
"restrictionsfield-label": "نطاقات الأيبي المسموح بها:",
- "restrictionsfield-help": "عنوان أيبي أو نطاق CIDR واحد لكل سطر. لتفعيل كل شيء، استخدم<br><code>0.0.0.0/0</code><br><code>::/0</code>",
+ "restrictionsfield-help": "عنوان أيبي أو نطاق CIDR واحد لكل سطر. لتفعيل كل شيء، استخدم:\n<pre>0.0.0.0/0\n::/0</pre>",
"revid": "المراجعة $1",
"pageid": "معرف الصفحة $1"
}
"undo-norev": "Рэдагаваньне ня можа быць адмененае, таму што яно не існуе альбо было выдаленае.",
"undo-nochange": "Выглядае, што праўка ўжо была адмененая.",
"undo-summary": "Скасаваньне праўкі $1 {{GENDER:$2|удзельніка|удзельніцы}} [[Special:Contributions/$2|$2]] ([[User talk:$2|гутаркі]])",
- "undo-summary-username-hidden": "Ð\92Ñ\8dÑ\80Ñ\81Ñ\96Ñ\8f $1 Ñ\81каÑ\81аванаÑ\8f Ñ\81Ñ\85аванÑ\8bм Ñ\83дзелÑ\8cнÑ\96кам",
+ "undo-summary-username-hidden": "СкаÑ\81аванÑ\8cне вÑ\8dÑ\80Ñ\81Ñ\96Ñ\96 $1 Ñ\81Ñ\85аванага Ñ\9eдзелÑ\8cнÑ\96ка",
"cantcreateaccount-text": "Стварэньне рахункаў з гэтага IP-адрасу ('''$1''') было заблякаванае [[User:$3|$3]].\n\nПрычына блякаваньня пададзеная $3: ''$2''",
"cantcreateaccount-range-text": "Стварэньне рахункаў з IP-адрасоў у дыяпазоне <strong>$1</strong>, у які ўваходзіць ваш IP-адрас (<strong>$4</strong>), было забароненае {{GENDER:$3|ўдзельнікам|ўдзельніцай}} [[User:$3|$3]].\n\n{{GENDER:$3|Удзельнікам|Удзельніцай}} $3 была пададзеная наступная прычына: <em>$2</em>.",
"viewpagelogs": "Паказаць журналы падзеяў для гэтай старонкі",
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (глядзіце таксама [[Special:NewPages|сьпіс новых старонак]])",
"recentchanges-submit": "Паказаць",
"rcfilters-activefilters": "Актыўныя фільтры",
+ "rcfilters-restore-default-filters": "Аднавіць фільтры па змоўчаньні",
+ "rcfilters-clear-all-filters": "Ачысьціць усе фільтры",
"rcfilters-search-placeholder": "Фільтар апошніх зьменаў (праглядзець або пачніце друкаваць)",
"rcfilters-invalid-filter": "Няслушны фільтар",
+ "rcfilters-empty-filter": "Няма актыўных фільтраў. Паказаны ўвесь унёсак.",
"rcfilters-filterlist-title": "Фільтры",
"rcfilters-filterlist-noresults": "Фільтры ня знойдзеныя",
"rcfilters-filtergroup-registration": "Рэгістрацыя ўдзельнікаў",
"rcfilters-filter-userExpLevel-experienced-description": "Больш за 30 дзён актыўнасьці і 500 правак.",
"rcfilters-filtergroup-automated": "Аўтаматычны ўнёсак",
"rcfilters-filter-bots-label": "Робат",
+ "rcfilters-filter-bots-description": "Праўкі, зробленыя з дапамогай аўтаматызаваных інструмэнтаў.",
+ "rcfilters-filter-humans-label": "Чалавек (ня робат)",
+ "rcfilters-filter-humans-description": "Праўкі, зробленыя людзьмі.",
+ "rcfilters-filtergroup-significance": "Значэньне",
"rcnotefrom": "Ніжэй {{PLURAL:$5|знаходзіцца зьмена|знаходзяцца зьмены}} з <strong>$4 $3</strong> (да <strong>$1</strong> на старонку).",
"rclistfrom": "Паказаць зьмены з $2 $3",
"rcshowhideminor": "$1 дробныя праўкі",
"emailccsubject": "Копія Вашага ліста да $1: $2",
"emailsent": "Ліст адасланы",
"emailsenttext": "Ваш ліст быў адасланы.",
- "emailuserfooter": "Гэты ліст быў дасланы {{GENDER:$1|ўдзельнікам|ўдзельніцай}} $1 да {{GENDER:$2|ўдзельніка|ўдзельніцы}} $2 з дапамогай функцыі «{{int:emailuser}}» {{GRAMMAR:родны|{{SITENAME}}}}. {{GENDER:$2|Ваш}} ліст у адказ будзе дасланы {{GENDER:$1|адпраўніку|адпраўніцы}}, і {{GENDER:$1|яму|ёй}} будзе бачны {{GENDER:$2|ваш}} адрас электроннай пошты.",
+ "emailuserfooter": "Гэты ліст быў дасланы {{GENDER:$1|ўдзельнікам|ўдзельніцай}} $1 да {{GENDER:$2|ўдзельніка|ўдзельніцы}} $2 з дапамогай функцыі «{{int:emailuser}}» {{GRAMMAR:родны|{{SITENAME}}}}. Калі вы адкажаце на гэты ліст, {{GENDER:$2|ваш}} ліст у адказ будзе дасланы непасрэдна {{GENDER:$1|адпраўніку|адпраўніцы}}, і {{GENDER:$1|яму|ёй}} будзе бачны {{GENDER:$2|ваш}} адрас электроннай пошты.",
"usermessage-summary": "Паведамленьне пра выхад з сыстэмы.",
"usermessage-editor": "Дастаўка сыстэмных паведамленьняў",
"watchlist": "Сьпіс назіраньня",
"Matma Rex",
"আজিজ",
"Kayser Ahmad",
- "NahidSultan"
+ "NahidSultan",
+ "Elias Ahmmad"
]
},
"tog-underline": "সংযোগগুলির নিচে দাগ দেখানো হোক:",
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (আরও দেখুন [[Special:NewPages|নতুন পাতার তালিকা]])",
"recentchanges-legend-plusminus": "(''±১২৩'')",
"recentchanges-submit": "দেখাও",
+ "rcfilters-activefilters": "সক্রিয় ফিল্টার",
+ "rcfilters-restore-default-filters": "ডিফল্ট ফিল্টার পুনরুদ্ধার",
+ "rcfilters-clear-all-filters": "সমস্ত ফিল্টার অপসারণ",
+ "rcfilters-search-placeholder": "ফিল্টারে সাম্প্রতিক পরিবর্তনসমূহ (ব্রাউজ বা টাইপ করা শুরু করুন)",
+ "rcfilters-invalid-filter": "অকার্যকর ফিল্টার",
+ "rcfilters-empty-filter": "কোনো সক্রিয় ফিল্টার নেই। সমস্ত অবদান দেখানো হয়েছে।",
+ "rcfilters-filterlist-title": "ছাকনী",
+ "rcfilters-filterlist-noresults": "কোনও ফিল্টার পাওয়া যায়নি",
+ "rcfilters-filtergroup-authorship": "কৃতি সম্পাদনা",
"rcfilters-filter-editsbyself-label": "আপনার নিজস্ব সম্পাদনা",
"rcfilters-filter-editsbyself-description": "আপনার দ্বারা সম্পাদনা।",
"rcfilters-filter-editsbyother-label": "অন্যদের দ্বারা সম্পাদনা",
"rcfilters-filter-editsbyother-description": "অন্য ব্যবহারকারীদের দ্বারা করা সম্পাদনা (আপনার না)।",
- "rcfilters-filtergroup-userExpLevel": "বà§\8dযবহারà¦\95ারà§\80র à¦\85à¦à¦¿à¦\9cà§\8dà¦\9eতা সà§\8dতর",
+ "rcfilters-filtergroup-userExpLevel": "à¦\85à¦à¦¿à¦\9cà§\8dà¦\9eতার সà§\8dতর (শà§\81ধà§\81 মাতà§\8dর নিবনà§\8dধিত বà§\8dযবহারà¦\95ারà§\80র à¦\9cনà§\8dয)",
"rcfilters-filter-userExpLevel-newcomer-label": "নতুন আগত",
"rcfilters-filter-userExpLevel-learner-label": "শিক্ষার্থী",
"rcfilters-filter-userExpLevel-experienced-label": "অভিজ্ঞ ব্যবহারকারী",
"apisandbox-results": "ফলাফল",
"apisandbox-sending-request": "API অনুরোধ পাঠানো হচ্ছে...",
"apisandbox-loading-results": "API ফলাফল গ্রহণ করা হচ্ছে...",
- "apisandbox-request-params-json": "JSON প্যারামিটার:",
+ "apisandbox-request-selectformat-label": "অনুরোধ ডেটা দেখান যেভাবে:",
+ "apisandbox-request-format-url-label": "URL কোয়েরি স্ট্রিং",
"apisandbox-request-url-label": "অনুরোধের URL:",
+ "apisandbox-request-json-label": "অনুরোধ JSON:",
"apisandbox-request-time": "অনুরোধের সময়: {{PLURAL:$1|$1 মি.সে.}}",
"apisandbox-results-fixtoken": "টোকেন সংশোধন ও পুনরায় জমা",
"apisandbox-alert-page": "এই পাতার ঘরগুলো বৈধ নয়।",
"emailccsubject": "আপনার বার্তার অনুলিপি $1-কে: $2",
"emailsent": "ই-মেইল প্রেরণ করা হয়েছে",
"emailsenttext": "আপনার ই-মেইল বার্তা প্রেরণ করা হয়েছে।",
- "emailuserfooter": "এই ইমেইলটি {{SITENAME}} সাইটের \"{{int:emailuser}}\" সুবিধা ব্যবহার করে $1-এর পক্ষ থেকে {{GENDER:$2|$2}}-এর নিকট {{GENDER:$1|পাঠানো হয়েছে}}। {{GENDER:$2|আপনার}} উত্তরের ইমেইলটি সরাসরি {{GENDER:$1|মূল প্রেরকের}} কাছে পাঠানো হবে, সেই সাথে {{GENDER:$2|আপনার}} ইমেল ঠিকানা {{GENDER:$1|তাঁর}} কাছে প্রকাশ করা হবে।",
+ "emailuserfooter": "এই ইমেইলটি {{SITENAME}} সাইটের \"{{int:emailuser}}\" সুবিধা ব্যবহার করে $1-এর পক্ষ থেকে {{GENDER:$2|$2}}-এর নিকট {{GENDER:$1|পাঠানো হয়েছে}}। যদি {{GENDER:$2|আপনি}} এই ইমেইলটির উত্তর দেন, তাহলে {{GENDER:$2|আপনার}} উত্তরের ইমেইলটি সরাসরি {{GENDER:$1|মূল প্রেরকের}} কাছে পাঠানো হবে, সেই সাথে {{GENDER:$2|আপনার}} ইমেল ঠিকানা {{GENDER:$1|তাঁর}} কাছে প্রকাশ করা হবে।",
"usermessage-summary": "বাদবাকি সিস্টেম বার্তা",
"usermessage-editor": "সিস্টেম ম্যাসেঞ্জার",
"usermessage-template": "MediaWiki:ব্যবহারকারী বার্তা",
"pagelang-select-lang": "ভাষা নির্বাচন করুন",
"pagelang-reason": "কারণ",
"pagelang-submit": "জমা দাও",
+ "pagelang-db-failed": "ডাটাবেস পৃষ্ঠার ভাষা পরিবর্তন করতে ব্যর্থ হয়েছে।",
"right-pagelang": "পাতার ভাষা পরিবর্তন করুন",
"action-pagelang": "পাতার ভাষা পরিবর্তন করুন",
"log-name-pagelang": "ভাষা পরিবর্তন লগ",
"usercssispublic": "অনুগ্রহ করে লক্ষ্য করুন: সিএসএসের উপপাতাগুলিতে গোপনীয় তথ্য থাকা উচিত নয় যেহেতু অন্যান্য ব্যবহারকারীও এগুলি দেখতে পান।",
"restrictionsfield-badip": "আইপি ঠিকানা অথবা পরিসীমা অবৈধ: $1",
"restrictionsfield-label": "অনুমোদিত আইপি পরিসীমা:",
- "restrictionsfield-help": "লাইন প্রতি একটি আইপি ঠিকানা বা CIDR পরিসীমা। সবকিছু সক্রিয় করতে<br><code>0.0.0.0/0</code><br><code>::/0</code><br>ব্যবহার করুন",
+ "restrictionsfield-help": "লাইন প্রতি একটি আইপি ঠিকানা বা CIDR পরিসীমা। সবকিছু সক্রিয় করতে, <pre>0.0.0.0/0::/0</pre> ব্যবহার করুন",
"revid": "সংশোধন $1",
"pageid": "পাতার আইডি $1"
}
"right-override-export-depth": "Ezporzhiañ ar pajennoù en ur lakaat e-barzh ar pajennoù liammet betek un donder a 5 live",
"right-sendemail": "Kas ur postel d'an implijerien all",
"grant-group-email": "Kas ur postel",
+ "grant-group-other": "Obererezh liesseurt",
"grant-blockusers": "Stankañ ha distankañ implijerien",
"grant-createaccount": "Krouiñ kontoù",
"grant-createeditmovepage": "Krouiñ, aozañ ha dilec'hiañ pajennoù",
+ "grant-delete": "Diverkañ ar pajennoù, an adweladennoù hag an enmontoù er marilh",
+ "grant-editinterface": "Kemmañ esaouenn anvioù MediaWiki hag ar CSS/JavaScript implijer",
+ "grant-editmycssjs": "Kemmañ ho CSS/JavaScript implijer",
"grant-editmyoptions": "Kemmañ ho penndibaboù implijer.",
"grant-editmywatchlist": "Kemmañ ho roll evezhiañ",
"grant-editpage": "Kemmañ pajennoù a zo anezho c'hoazh",
"grant-editprotected": "Kemmañ pajennoù gwarezet",
+ "grant-highvolume": "Kemmañ kementadoù bras",
+ "grant-oversight": "Kuzhat an implijerien ha diverkañ an adweladennoù",
+ "grant-patrol": "Gwiriañ ar c'hemmoù graet d'ar pajennoù",
+ "grant-privateinfo": "Gwelet an titouroù prevez",
"grant-protect": "Gwareziñ ha diwareziñ pajennoù",
"grant-rollback": "Distreiñ war ar c'hemmoù er pajennoù",
"grant-sendemail": "Kas ur postel d'an implijerien all",
+ "grant-uploadeditmovefile": "Enporzhiañ, erlec'hiañ hag adenvel restroù",
"grant-uploadfile": "Enporzhiañ restroù nevez",
"grant-basic": "Gwirioù diazez",
"grant-viewdeleted": "Gwelet ar restroù ha pajennoù dilamet",
"grant-viewmywatchlist": "Gwelet ho roll evezhiañ",
+ "grant-viewrestrictedlogs": "Diskouez an enmontoù marilh kuzh",
"newuserlogpage": "Marilh ar c'hontoù krouet",
"newuserlogpagetext": "Marilh krouiñ ar c'hontoù implijer.",
"rightslog": "Marilh statud an implijerien",
"action-read": "lenn ar bajenn-mañ",
"action-edit": "kemmañ ar bajenn-mañ",
"action-createpage": "krouiñ ar bajenn-mañ",
- "action-createtalk": "krouiñ pajennoù kaozeal",
+ "action-createtalk": "krouiñ ar bajenn-gaozeal-mañ",
"action-createaccount": "krouiñ ar gont implijer-mañ",
+ "action-autocreateaccount": "Krouiñ ent emgefre ar gont implijer diavaez-mañ",
"action-history": "gwelet istor ar bajenn-mañ",
"action-minoredit": "merkañ ar c'hemm-mañ evel dister",
"action-move": "dilec'hiañ ar bajenn-mañ",
"action-upload_by_url": "pellgargañ ar restr-mañ adal ur chomlec'h URL",
"action-writeapi": "Ober gant an API skrivañ",
"action-delete": "diverkañ ar bajenn-mañ",
- "action-deleterevision": "diverkañ ar stumm-mañ",
+ "action-deleterevision": "diverkañ adweladennoù",
"action-deletedhistory": "Gwelet istor diverket ar bajenn-mañ",
"action-browsearchive": "Klask pajennoù bet diverket",
- "action-undelete": "diziverkañ ar bajenn-mañ",
- "action-suppressrevision": "gwelet hag assevel ar stumm diverket-mañ",
+ "action-undelete": "diziverkañ pajennoù",
+ "action-suppressrevision": "gwiriañ hag assevel an adweladennoù kuzh",
"action-suppressionlog": "gwelet ar marilh prevez-mañ",
"action-block": "mirout ouzh an impplijer-mañ da zegas kemmoù",
"action-protect": "kemmañ liveoù gwareziñ ar bajenn-mañ",
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (gwelet ivez [[Special:NewPages|roll ar pajennoù nevez]])",
"recentchanges-submit": "Diskouez",
"rcfilters-activefilters": "Siloù oberiant",
+ "rcfilters-clear-all-filters": "Riñsañ an holl siloù",
"rcfilters-invalid-filter": "Sil direizh",
"rcfilters-filterlist-title": "Siloù",
"rcfilters-filterlist-noresults": "N'eus bet kavet sil ebet",
"rcfilters-filter-humans-label": "Den (ket ur robot)",
"rcfilters-filter-minor-label": "Kemmoù dister",
"rcfilters-filtergroup-changetype": "Seurt kemm",
+ "rcfilters-filter-pageedits-label": "Kemmoù pajennoù",
+ "rcfilters-filter-newpages-label": "Krouidigezhioù pajennoù",
"rcfilters-filter-categorization-label": "Kemmoù rummad",
"rcnotefrom": "Setu aze {{PLURAL:$5|ar c'hemm|ar c'hemmoù}} c'hoarvezet abaoe an <strong>$3, $4</strong> (<strong>$1</strong> d'ar muiañ).",
"rclistfrom": "Diskouez ar c'hemmoù diwezhañ abaoe an/ar $3 $2",
"recentchangeslinked-to": "Diskouez ar c'hemmoù war-du ar pajennoù liammet kentoc'h eget re ar bajenn lakaet",
"recentchanges-page-added-to-category": "[[:$1]] ouzhpennet d'ar rummad",
"recentchanges-page-removed-from-category": "Diverket eo bet [[$1]] diouzh ar rummad",
+ "autochange-username": "Kemm emgefre gant MediaWiki",
"upload": "Kargañ war ar servijer",
"uploadbtn": "Kargañ ur restr",
"reuploaddesc": "Distreiñ d'ar furmskrid.",
"uploadstash-badtoken": "N'haller ket kas an ober-mañ da benn vat, marteze a-walc'h abalamour m'eo aet d'o zermen an titouroù kred ho poa roet. Klaskit en-dro.",
"uploadstash-errclear": "N'eus ket bet gallet riñsañ ar restroù.",
"uploadstash-refresh": "Freskaat roll ar restroù",
+ "uploadstash-thumbnail": "gwelet ar munud",
"invalid-chunk-offset": "Direizh eo offset ar rannad",
"img-auth-accessdenied": "Moned nac'het",
"img-auth-nopathinfo": "Mankout a ra ar PATH_INFO.\nN'eo ket kefluniet ho servijer evit reiñ an titour-mañ.\nMarteze eo diazezet war CGI ha n'hall ket skorañ img_auth.\nGwelet https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization",
"apisandbox-request-time": "Pad ar goulenn: $1",
"apisandbox-continue": "Kenderc'hel",
"apisandbox-continue-clear": "Riñsañ",
+ "apisandbox-multivalue-all-namespaces": "$1 (An holl esaouennoù anv)",
"apisandbox-multivalue-all-values": "$1 (An holl dalvoudoù)",
"booksources": "Oberennoù dave",
"booksources-search-legend": "Klask en oberennoù dave",
"tags-activate-submit": "Gweredekaat",
"tags-deactivate-reason": "Abeg :",
"tags-deactivate-submit": "Diweredekaat",
- "tags-edit-existing-tags-none": "''Hini ebet''",
+ "tags-edit-existing-tags": "Tikedennoù zo anezho :",
+ "tags-edit-existing-tags-none": "<em>Hini ebet</em>",
"tags-edit-new-tags": "Tikedennoù nevez :",
"tags-edit-add": "Ouzhpennañ an tikedennoù-mañ :",
"tags-edit-remove": "Dilemel an tikedennoù-mañ :",
"badsig": "Loš sirovi potpis.\nProvjerite HTML tagove.",
"badsiglength": "Vaš potpis je predug.\nMora biti manji od $1 {{PLURAL:$1|znaka|znaka|znakova}}.",
"yourgender": "Kako želite da se predstavite?",
- "gender-unknown": "Kad vas spominje, softver će pokušati koristiti srednji rod kad god je to moguće",
+ "gender-unknown": "Kad Vas spominje, softver će pokušati izbjegavati rod kad god je to moguće",
"gender-male": "On uređuje wiki stranice",
"gender-female": "Ona uređuje wiki stranice",
"prefs-help-gender": "Postavljanje ovih podešavanja nije obavezno.\nSoftver koristi ove vrijednosti za vaše naslovljanje i ispravke gramatičkog roda u porukama softvera. Ova će informacija biti javna.",
"changecontentmodel-title-label": "Naslov stranice",
"changecontentmodel-model-label": "Novi model sadržaja",
"changecontentmodel-reason-label": "Razlog:",
+ "changecontentmodel-submit": "Promijeni",
"changecontentmodel-success-title": "Model sadržaja je promijenjen",
"changecontentmodel-success-text": "Model sadržaja stranice [[:$1]] je promijenjen.",
"changecontentmodel-cannot-convert": "Model sadržaja stranice [[:$1]] se ne može pretvoriti u vrstu $2.",
"expand_templates_preview": "Pregled",
"expand_templates_preview_fail_html": "<em>Pošto stranica {{SITENAME}} ima uključen sirov HTML prikaz, te je bilo gubitka u podacima sesije, pregled je sakriven kao mjera predostrožnosti protiv JavaScript napada.</em>\n\n<strong>Ako je ovo ispravan pokušaj pretpregleda, molim da ponovo pokušate.</strong>\nAko i dalje ne bude radilo, pokušajte se [[Special:UserLogout|odjaviti]], pa ponovo prijaviti.",
"expand_templates_preview_fail_html_anon": "<em>Pošto stranica {{SITENAME}} ima uključen sirov HTML prikaz, a vi se niste prijavili, pregled je sakriven kao mjera predostrožnosti protiv JavaScript napada.</em>\n\n<strong>Ako je ovo ispravan pokušaj pretpregleda, molim da se [[Special:UserLogin|prijavite]] i pokušate ponovo.</strong>",
- "pagelanguage": "Odabir jezika stranice",
+ "pagelanguage": "Promijeni jezik stranice",
"pagelang-name": "Stranica",
"pagelang-language": "Jezik",
"pagelang-use-default": "Koristi podrazumijevani jezik",
"uncategorizedcategories": "Nekategorizované kategorie",
"uncategorizedimages": "Nekategorizované soubory",
"uncategorizedtemplates": "Nekategorizované šablony",
+ "uncategorized-categories-exceptionlist": " # Obsahuje seznam kategorií, které se nemají objevovat na Speciální:Nekategorizované kategorie. Jedna kategorie na každém řádku, uvozená pomocí „*“. Řádky začínající jiným znakem (včetně bílých znaků) se ignorují. Komentáře vkládejte za „#“.",
"unusedcategories": "Nepoužívané kategorie",
"unusedimages": "Nepoužívané soubory",
"wantedcategories": "Chybějící kategorie",
"apisandbox-sending-request": "Odesílá se API požadavek…",
"apisandbox-loading-results": "Přijímají se API výsledky…",
"apisandbox-results-error": "Došlo k chybě při načítání odpovědi na API dotaz: $1.",
- "apisandbox-request-params-json": "Parametry v JSON:",
"apisandbox-request-url-label": "URL požadavku:",
"apisandbox-request-time": "Trvání požadavku: {{PLURAL:$1|$1 ms}}",
"apisandbox-results-fixtoken": "Opravit token a znovu odeslat",
"emailccsubject": "Kopie Vaší zprávy pro uživatele $1: $2",
"emailsent": "E-mail odeslán",
"emailsenttext": "Váš e-mail byl odeslán.",
- "emailuserfooter": "Tento e-mail byl odeslán z {{grammar:2sg|{{SITENAME}}}} pomocí funkce „{{int:emailuser}}“; {{GENDER:$1|odeslal ho uživatel|odeslala ho uživatelka}} $1 {{GENDER:$2|uživateli|uživatelce}} $2. Váš e-mail bude odeslán přímo {{GENDER:$1|původnímu odesílateli, čímž mu|původní odesílatelce, čímž jí}} prozradíte svou e-mailovou adresu.",
+ "emailuserfooter": "Tento e-mail byl odeslán z {{grammar:2sg|{{SITENAME}}}} pomocí funkce „{{int:emailuser}}“; {{GENDER:$1|odeslal ho uživatel|odeslala ho uživatelka}} $1 {{GENDER:$2|uživateli|uživatelce}} $2. Pokud na něj odpovíte, bude váš e-mail odeslán přímo {{GENDER:$1|původnímu odesílateli, čímž mu|původní odesílatelce, čímž jí}} prozradíte svou e-mailovou adresu.",
"usermessage-summary": "Doručena zpráva od systému.",
"usermessage-editor": "Systémový poslíček",
"watchlist": "Sledované stránky",
"usercssispublic": "Uvědomte si prosím, že podstránky s CSS by neměly obsahovat tajné údaje, protože jsou viditelné ostatním uživatelům.",
"restrictionsfield-badip": "Neplatná IP adresa nebo rozsah: $1",
"restrictionsfield-label": "Povolené rozsahy IP adres:",
- "restrictionsfield-help": "Jedna IP adresa nebo CIDR rozsah na řádek. Všechno povolíte pomocí<br><code>0.0.0.0/0</code><br><code>::/0</code>",
+ "restrictionsfield-help": "Jedna IP adresa nebo CIDR rozsah na řádek. Všechno povolíte pomocí:<pre>0.0.0.0/0\n::/0</pre>",
"revid": "revize $1",
"pageid": "Stránka s ID $1"
}
"patrol-log-header": "Patruljerede versioner.",
"log-show-hide-patrol": "$1 patruljeringslog",
"confirm-markpatrolled-button": "OK",
+ "confirm-markpatrolled-top": "Marker version $3 af $2 som patruljeret?",
"deletedrevision": "Slettede gammel version $1",
"filedeleteerror-short": "Fejl under sletning af fil: $1",
"filedeleteerror-long": "Der opstod en fejl under sletningen af filen:\n\n$1",
"recentchanges-legend-plusminus": "''(±123)''",
"recentchanges-submit": "Anzeigen",
"rcfilters-activefilters": "Aktive Filter",
+ "rcfilters-restore-default-filters": "Standardfilter wiederherstellen",
+ "rcfilters-clear-all-filters": "Alle Filter löschen",
"rcfilters-search-placeholder": "Letzte Änderungen filtern (durchsuchen oder beginne mit der Eingabe)",
"rcfilters-invalid-filter": "Ungültiger Filter",
+ "rcfilters-empty-filter": "Keine aktiven Filter. Es werden alle Beiträge angezeigt.",
"rcfilters-filterlist-title": "Filter",
"rcfilters-filterlist-noresults": "Keine Filter gefunden",
"rcfilters-filtergroup-registration": "Benutzerregistrierung",
"apisandbox-sending-request": "Sende API-Anfrage …",
"apisandbox-loading-results": "Rufe API-Ergebnisse ab …",
"apisandbox-results-error": "Beim Laden der API-Anfragenantwort ist ein Fehler aufgetreten: $1.",
+ "apisandbox-request-selectformat-label": "Anfragedaten anzeigen als:",
+ "apisandbox-request-format-url-label": "URL-Abfrage-Zeichenfolge",
"apisandbox-request-url-label": "Anforderungs-URL:",
+ "apisandbox-request-json-label": "Anfragen-JSON:",
"apisandbox-request-time": "Dauer der Anfrage: {{PLURAL:$1|Eine Millisekunde|$1 Millisekunden}}",
"apisandbox-results-fixtoken": "Token korrigieren und erneut übertragen",
"apisandbox-results-fixtoken-fail": "Der „$1“-Token konnte nicht abgerufen werden.",
"emailccsubject": "Kopie deiner Nachricht an $1: $2",
"emailsent": "E-Mail verschickt",
"emailsenttext": "Deine E-Mail wurde verschickt.",
- "emailuserfooter": "Diese E-Mail wurde von „$1“ an „{{GENDER:$2|$2}}“ durch die Funktion „{{int:emailuser}}“ bei {{SITENAME}} {{GENDER:$1|gesendet}}. {{GENDER:$2|Deine}} E-Mail wird direkt an {{GENDER:$1|den Originalabsender|die Originalabsenderin}} gesendet mit der Preisgabe {{GENDER:$2|deiner}} E-Mail-Adresse an {{GENDER:$1|ihn|sie}}.",
+ "emailuserfooter": "Diese E-Mail wurde von „$1“ an „{{GENDER:$2|$2}}“ durch die Funktion „{{int:emailuser}}“ bei {{SITENAME}} {{GENDER:$1|gesendet}}. Falls {{GENDER:$2|du}} auf diese E-Mail antwortest, wird sie direkt an {{GENDER:$1|den Originalabsender|die Originalabsenderin}} gesendet. Dabei erfährt {{GENDER:$1|er|sie}} {{GENDER:$2|deine}} E-Mail-Adresse.",
"usermessage-summary": "Systemnachricht gespeichert.",
"usermessage-editor": "System-Messenger",
"usermessage-template": "MediaWiki:Benutzernachricht",
"preview": "Προεπισκόπηση",
"showpreview": "Εμφάνιση προεπισκόπησης",
"showdiff": "Εμφάνιση αλλαγών",
- "blankarticle": "<strong>Προειδοποίηση:</strong> Η σελίδα που δημιουργείτε είναι κενή.\nΕάν κάνετε κλικ στο κουμπί \"{{int:savearticle}}\" και πάλι, η σελίδα θα δημιουργηθεί χωρίς κανένα περιεχόμενο.",
+ "blankarticle": "<strong>Προειδοποίηση:</strong> Η σελίδα που πάτε να δημιουργήσετε είναι κενή.\nΕάν ξανακάνετε κλικ στο κουμπί «{{int:savearticle}}» η σελίδα θα δημιουργηθεί χωρίς περιεχόμενο.",
"anoneditwarning": "<strong>Προειδοποίηση:</strong> Δεν έχετε συνδεθεί. Η διεύθυνση IP σας θα είναι ορατή δημόσια αν κάνετε κάποια επεξεργασία. Αν <strong>[$1 συνδεθείτε]</strong> ή <strong>[$2 δημιουργήσετε λογαριασμό]</strong>, οι επεξεργασίες σας θα αποδοθούν στο όνομά χρήστη σας, μαζί με άλλα οφέλη.",
"anonpreviewwarning": "''Δεν έχετε συνδεθεί. Η αποθήκευση θα καταγράψει την διεύθυνσή IP σας στο ιστορικό επεξεργασίας αυτής της σελίδας.''",
"missingsummary": "'''Υπενθύμιση:''' Δεν έχετε συμπληρώσει τη σύνοψη επεξεργασίας. Αν κάνετε κλικ στο κουμπί Αποθήκευση πάλι, η επεξεργασία σας θα αποθηκευτεί χωρίς σύνοψη.",
"protect-legend": "Επιβεβαίωση κλειδώματος",
"protectcomment": "Αιτία:",
"protectexpiry": "Λήξη",
- "protect_expiry_invalid": "Î\9f Ï\87Ï\81Ï\8cνοÏ\82 λήξηÏ\82 είναι άκυρος.",
+ "protect_expiry_invalid": "Î\9f Ï\87Ï\81Ï\8cνοÏ\82 λήξηÏ\82 δεν είναι Îγκυρος.",
"protect_expiry_old": "Ο χρόνος λήξης αναφέρεται στο παρελθόν.",
"protect-unchain-permissions": "Ξεκλείδωμα περαιτέρω επιλογών προστασίας",
"protect-text": "Μπορείτε να δείτε και να αλλάξετε το επίπεδο προστασίας εδώ για τη σελίδα '''$1'''.",
"block-log-flags-angry-autoblock": "ενισχυμένος αυτόματος αποκλεισμός ενεργοποιημένος",
"block-log-flags-hiddenname": "όνομα χρήστη κρυμμένο",
"range_block_disabled": "Η δυνατότητα του διαχειριστή να δημιουργεί περιοχές φραγής είναι απενεργοποιημένη.",
- "ipb_expiry_invalid": "Î\86κυρος χρόνος λήξης",
+ "ipb_expiry_invalid": "Î\9cη Îγκυρος χρόνος λήξης",
"ipb_expiry_old": "Ο χρόνος λήξης αναφέρεται στο παρελθόν.",
"ipb_expiry_temp": "Οι κρυμμένες φραγές ονομάτων χρηστών πρέπει να είναι μόνιμες.",
"ipb_hide_invalid": "Μη εφικτή καταστολή αυτού του λογαριασμού. Μπορεί να έχει περισσότερες από {{PLURAL:$1|μια επεξεργασία|$1 επεξεργασίες}}.",
"username": "{{GENDER:$1|Username}}:",
"prefs-memberingroups": "{{GENDER:$2|Member}} of {{PLURAL:$1|group|groups}}:",
"prefs-memberingroups-type": "$1",
+ "group-membership-link-with-expiry": "$1 (until $2)",
"prefs-registration": "Registration time:",
"prefs-registration-date-time": "$1",
"yourrealname": "Real name:",
"userrights-changeable-col": "Groups you can change",
"userrights-unchangeable-col": "Groups you cannot change",
"userrights-irreversible-marker": "$1*",
+ "userrights-expiry-current": "Expires $1",
+ "userrights-expiry-none": "Does not expire",
+ "userrights-expiry": "Expires:",
+ "userrights-expiry-existing": "Existing expiration time: $3, $2",
+ "userrights-expiry-othertime": "Other time:",
+ "userrights-expiry-options": "1 day:1 day,1 week:1 week,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year",
+ "userrights-invalid-expiry": "The expiry time for group \"$1\" is invalid.",
+ "userrights-expiry-in-past": "The expiry time for group \"$1\" is in the past.",
"userrights-conflict": "Conflict of user rights changes! Please review and confirm your changes.",
"group": "Group:",
"group-user": "Users",
"recentchanges-legend-plusminus": "(<em>±123</em>)",
"recentchanges-submit": "Show",
"rcfilters-activefilters": "Active filters",
+ "rcfilters-restore-default-filters": "Restore default filters",
+ "rcfilters-clear-all-filters": "Clear all filters",
"rcfilters-search-placeholder": "Filter recent changes (browse or start typing)",
"rcfilters-invalid-filter": "Invalid filter",
+ "rcfilters-empty-filter": "No active filters. All contributions are shown.",
"rcfilters-filterlist-title": "Filters",
"rcfilters-filterlist-noresults": "No filters found",
"rcfilters-filtergroup-registration": "User registration",
"apisandbox-sending-request": "Sending API request...",
"apisandbox-loading-results": "Receiving API results...",
"apisandbox-results-error": "An error occurred while loading the API query response: $1.",
+ "apisandbox-request-selectformat-label": "Show request data as:",
+ "apisandbox-request-format-url-label": "URL query string",
"apisandbox-request-url-label": "Request URL:",
+ "apisandbox-request-format-json-label": "JSON",
+ "apisandbox-request-json-label": "Request JSON:",
"apisandbox-request-time": "Request time: {{PLURAL:$1|$1 ms}}",
"apisandbox-results-fixtoken": "Correct token and resubmit",
"apisandbox-results-fixtoken-fail": "Failed to fetch \"$1\" token.",
"emailccsubject": "Copy of your message to $1: $2",
"emailsent": "Email sent",
"emailsenttext": "Your email message has been sent.",
- "emailuserfooter": "This email was {{GENDER:$1|sent}} by $1 to {{GENDER:$2|$2}} by the \"{{int:emailuser}}\" function at {{SITENAME}}. {{GENDER:$2|Your}} email will be sent directly to the {{GENDER:$1|original sender}}, revealing {{GENDER:$2|your}} email address to {{GENDER:$1|them}}.",
+ "emailuserfooter": "This email was {{GENDER:$1|sent}} by $1 to {{GENDER:$2|$2}} by the \"{{int:emailuser}}\" function at {{SITENAME}}. If {{GENDER:$2|you}} reply to this email, {{GENDER:$2|your}} email will be sent directly to the {{GENDER:$1|original sender}}, revealing {{GENDER:$2|your}} email address to {{GENDER:$1|them}}.",
"usermessage-summary": "Leaving system message.",
"usermessage-editor": "System messenger",
"usermessage-template": "MediaWiki:UserMessage",
"newuserlog-autocreate-entry": "Account created automatically",
"rightslogentry": "changed group membership for $1 from $2 to $3",
"rightslogentry-autopromote": "was automatically promoted from $2 to $3",
+ "rightslogentry-temporary-group": "$1 (temporary, until $2)",
"feedback-adding": "Adding feedback to page...",
"feedback-back": "Back",
"feedback-bugcheck": "Great! Just check that it is not already one of the [$1 known bugs].",
"Orikrin1998",
"Gamliel Fishkin",
"Kastanoto",
- "Rafaneta"
+ "Rafaneta",
+ "NMaia"
]
},
"tog-underline": "Substrekado de ligiloj:",
"botpasswords-label-delete": "Forigi",
"botpasswords-label-resetpassword": "Rekomencigi la pasvorton",
"botpasswords-label-grants": "Uzeblaj permesdonoj:",
- "botpasswords-help-grants": "Rajtigiloj permesas aliron al rajtoj jam provizita al via uzantkonto. Ebligi rajtigilojn ĉi tie ne provizas aliron al ajnaj rajtoj ke via uzantkonto ne alie havus. Vidu la [[Special:MyLanguage/Special:ListGrants|tablo de rajtigiloj]] por pli da informo.",
+ "botpasswords-help-grants": "Rajtigiloj permesas aliron al rajtoj jam provizita al via uzantkonto. Ebligi rajtigilojn ĉi tie ne provizas aliron al ajnaj rajtoj ke via uzantkonto ne alie havus. Vidu la [[Special:ListGrants|tablo de rajtigiloj]] por pli da informo.",
"botpasswords-label-grants-column": "Permeso donita",
"botpasswords-bad-appid": "La robota nomo \"$1\" estas malvalida.",
"botpasswords-insert-failed": "Aldono de la robota nomo \"$1\" ne sukcesis. Ĉu ĝi jam estis aldonita?",
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (vidu ankaŭ [[Special:NewPages|liston de novaj paĝoj]])",
"recentchanges-submit": "Montri",
"rcfilters-activefilters": "Aktivaj filtriloj",
+ "rcfilters-restore-default-filters": "Restarigi defaŭltajn filtrilojn",
+ "rcfilters-clear-all-filters": "Nuligi ĉiujn filtrilojn",
"rcfilters-search-placeholder": "Filtri lastajn ŝanĝojn (vi povas elekti aŭ ekskribi)",
"rcfilters-invalid-filter": "Nevalida filtrilo",
+ "rcfilters-empty-filter": "Ekzistas neniuj aktivaj filtriloj. Ĉiuj kontribuaĵoj estas montritaj.",
"rcfilters-filterlist-title": "Filtriloj",
"rcfilters-filterlist-noresults": "Neniuj filtriloj troviĝis",
"rcfilters-filtergroup-registration": "Registrado de uzanto",
"rcfilters-filter-bots-description": "Redaktoj farita de aŭtomatigitaj iloj.",
"rcfilters-filter-humans-label": "Homa (ne robota)",
"rcfilters-filter-humans-description": "Redaktoj farita de homaj redaktantoj.",
+ "rcfilters-filtergroup-significance": "Signifo",
+ "rcfilters-filter-minor-label": "Etaj redaktoj",
+ "rcfilters-filter-minor-description": "Redaktoj kiujn la aŭtoro markis kiel \"redakteto\".",
+ "rcfilters-filter-major-label": "Redaktoj kiujn la aŭtoro ne markis kiel \"redakteto\".",
+ "rcfilters-filter-major-description": "Redaktoj kiujn la aŭtoro ne markis kiel \"redakteto\".",
+ "rcfilters-filtergroup-changetype": "Tipo de ŝanĝo",
+ "rcfilters-filter-pageedits-label": "Redaktoj de paĝoj",
+ "rcfilters-filter-pageedits-description": "Redaktoj al vikia enhavo, diskutoj, kategoriaj priskriboj...",
+ "rcfilters-filter-newpages-label": "Kreaĵoj de paĝo",
+ "rcfilters-filter-newpages-description": "Redaktoj kiuj faras novajn paĝojn.",
+ "rcfilters-filter-categorization-label": "Ŝanĝoj de kategorioj",
+ "rcfilters-filter-categorization-description": "Registroj de paĝoj aldonitaj aŭ forigitaj de kategorioj",
+ "rcfilters-filter-logactions-label": "Registritaj agoj",
+ "rcfilters-filter-logactions-description": "Administraciaj agoj, kontaj kreoj, paĝaj forigoj, alŝutoj....",
"rcnotefrom": "Malsupre estas la {{PLURAL:$5|ŝanĝo|ŝanĝoj}} ekde <strong>$3, $4</strong> (montrante ĝis <strong>$1</strong>).",
"rclistfrom": "Montri novajn ŝanĝojn ekde \"$3 $2\"",
"rcshowhideminor": "$1 etajn redaktojn",
"uncategorizedcategories": "Neenkategoriitaj kategorioj",
"uncategorizedimages": "Neenkategoriigitaj dosieroj",
"uncategorizedtemplates": "Neenkategoriigitaj ŝablonoj",
+ "uncategorized-categories-exceptionlist": "# Enhavas liston de kategorioj, kiuj ne devus esti menciitaj en Specialaĵo:UncategorizedCategories. Unu po linio, komencante per \"*\". Linioj komencantaj kun alia karaktero (inkluzivante blankspaco) estas ignorata. Uzu \"#\" por rimarkoj.",
"unusedcategories": "Neuzitaj kategorioj",
"unusedimages": "Neuzataj bildoj",
"wantedcategories": "Dezirataj kategorioj",
"emailccsubject": "Kopio de via mesaĝo al $1: $2",
"emailsent": "Retmesaĝo sendita",
"emailsenttext": "Via retmesaĝo estas sendita.",
- "emailuserfooter": "Ĉi tiu retpoŝtmesaĝo estis {{GENDER:$1|sendita}} de $1 al {{GENDER:$2|$2}} per la funkcio \"{{int:emailuser}}\" ĉe {{SITENAME}}. {{GENDER:$2|Via}} retpoŝto estos sendita rekte al la {{{{GENDER:$1|}}|originala sendinto}}, rivelanta {{GENDER:$2|via}} retpoŝta adreso al {{GENDER:$1|ili}}.",
+ "emailuserfooter": "Ĉi tiu retpoŝtmesaĝo estis {{GENDER:$1|sendita}} de $1 al {{GENDER:$2|$2}} per la funkcio \"{{int:emailuser}}\" ĉe {{SITENAME}}. Se {{GENDER:$2|vi}} respondas al ĉi tiu retpoŝto, {{GENDER:$2|via}} retpoŝto estos sendita rekte al la {{{{GENDER:$1|}}|originala sendinto}}, rivelanta {{GENDER:$2|via}} retpoŝta adreso al {{GENDER:$1|ili}}.",
"usermessage-summary": "Lasanta sisteman mesaĝon.",
"usermessage-editor": "Mesaĝanto de sistemo",
"watchlist": "Mia atentaro",
"usercssispublic": "Bonvolu noti: subpaĝoj en CSS ne enhavu konfidenciajn datumojn ĉar ili estas videblaj por aliaj uzantoj.",
"restrictionsfield-badip": "Malvalida IP-adreso de la intervalo: $1",
"restrictionsfield-label": "Permesita IP-intervalo:",
- "restrictionsfield-help": "Unu IP-adreso aŭ CIDR-intervalo per linio. Por permesigi ĉion, uzu<br><code>0.0.0.0/0</code><br><code>::/0</code>",
+ "restrictionsfield-help": "Unu IP-adreso aŭ CIDR-intervalo per linio. Por permesigi ĉion, uzu:<pre>0.0.0.0/0</code>\n<code>::/0</pre>",
"revid": "revizio $1",
"pageid": "Identigilo de paĝo $1"
}
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (véase también la [[Special:NewPages|lista de páginas nuevas]])",
"recentchanges-submit": "Mostrar",
"rcfilters-activefilters": "Filtros activos",
+ "rcfilters-restore-default-filters": "Restaurar filtros predeterminados",
+ "rcfilters-clear-all-filters": "Borrar todos los filtros",
"rcfilters-search-placeholder": "Filtrar cambios recientes (navega o empieza a escribir)",
"rcfilters-invalid-filter": "Filtro no válido",
+ "rcfilters-empty-filter": "No hay filtros activos. Se muestran todas las contribuciones.",
"rcfilters-filterlist-title": "Filtros",
"rcfilters-filterlist-noresults": "No se encontraron filtros",
"rcfilters-filtergroup-registration": "Registro de usuario",
"emailccsubject": "Copia de tu mensaje a $1: $2",
"emailsent": "Correo electrónico enviado",
"emailsenttext": "Se ha enviado tu mensaje de correo electrónico.",
- "emailuserfooter": "Este correo electrónico fue {{GENDER:$1|enviado}} por $1 a {{GENDER:$2|$2}} a través de la función «{{int:emailuser}}» en {{SITENAME}}. {{GENDER:$2|Tu}} correo electrónico se enviará directamente {{GENDER:$1|al emisor|a la emisora}} original, y {{GENDER:$1|le}} revelará {{GENDER:$2|tu}} dirección de correo electrónico.",
+ "emailuserfooter": "Este correo electrónico fue {{GENDER:$1|enviado}} por $1 a {{GENDER:$2|$2}} a través de la función «{{int:emailuser}}» en {{SITENAME}}. Si {{GENDER:$2|respondes}}, tu correo electrónico se enviará directamente {{GENDER:$1|al emisor|a la emisora}} original, y {{GENDER:$1|le}} revelará {{GENDER:$2|tu}} dirección de correo electrónico.",
"usermessage-summary": "Dejando un mensaje de sistema.",
"usermessage-editor": "Mensajero del sistema",
"watchlist": "Lista de seguimiento",
"right-applychangetags": "Rakendada [[Special:Tags|märgiseid]] enda muudatuste suhtes",
"right-changetags": "Lisada ja eemaldada käsitsi rakendatavaid [[Special:Tags|märgiseid]] üksikute redaktsioonide ja logisissekannete juures",
"right-deletechangetags": "Kustutada andmebaasist [[Special:Tags|märgiseid]]",
+ "grant-generic": "Volituse \"$1\" õiguste komplekt",
"grant-group-page-interaction": "Interaktsioon lehekülgedega",
"grant-group-file-interaction": "Interaktsioon meediafailidega",
"grant-group-watchlist-interaction": "Interaktsioon sinu jälgimisloendiga",
"grant-group-high-volume": "Suuremahuline tegevus",
"grant-group-customization": "Kohandamine ja eelistused",
"grant-group-administration": "Administraatori toimingud",
+ "grant-group-private-information": "Juurdepääs enda eraandmetele",
"grant-group-other": "Mitmesugused toimingud",
"grant-blockusers": "Kasutajate blokeerimine ja blokeeringute eemaldamine",
"grant-createaccount": "Kontode loomine",
"grant-highvolume": "Suuremahuline redigeerimine",
"grant-oversight": "Kasutajate peitmine ja redaktsioonide varjamine",
"grant-patrol": "Lehekülgede muudatuste kontroll",
+ "grant-privateinfo": "Juurdepääs erateabele",
"grant-protect": "Lehekülgede kaitsmine ja kaitse eemaldamine",
"grant-rollback": "Lehekülgede muudatuste tühistamine",
"grant-sendemail": "Kasutajatele e-kirjade saatmine",
"grant-basic": "Põhiõigused",
"grant-viewdeleted": "Kustutatud failide ja lehekülgede vaatamine",
"grant-viewmywatchlist": "Oma jälgimisloendi vaatamine",
+ "grant-viewrestrictedlogs": "Pääsupiiranguga andmete vaatamine",
"newuserlogpage": "Konto loomise logi",
"newuserlogpagetext": "Siin on logitud kasutajate registreerimine.",
"rightslog": "Kasutajaõiguste logi",
"subcategories": "Azpikategoriak",
"category-media-header": "Media \"$1\" kategorian",
"category-empty": "''Kategoria honek ez dauka artikulurik uneotan.''",
- "hidden-categories": "{{PLURAL:$1|Izkutuko kategoria|Izkutuko kategoriak}}",
+ "hidden-categories": "{{PLURAL:$1|Ezkutuko kategoria|Ezkutuko kategoriak}}",
"hidden-category-category": "Kategoria ezkutuak",
"category-subcat-count": "{{PLURAL:$2|Kategoria honek beste honako azpikategoria baino ez du.|Kategoria honek honako {{PLURAL:$1|azpikategoria du|$1 azpikategoriak ditu}}, guztira dauden $2tik.}}",
"category-subcat-count-limited": "Kategoria honek {{PLURAL:$1|azpikategoria hau du|$1 azpikategoria hauek ditu}}.",
"prefs-help-recentchangescount": "Honek azken aldaketak, orrialdeen historiak eta logak barne-biltzen ditu.",
"prefs-help-watchlist-token2": "Hau da zure jarraipen zerrendako web jarioaren giltza sekretua.\nEzagutzen duen orok zure jarraipen zerrenda irakurtzeko aukera izango du, ez partekatu.\n[[Special:ResetTokens|Klik egin hemen berrezarri behar baduzu]]",
"savedprefs": "Zure hobespenak gorde egin dira.",
- "savedrights": "{{GENDER:$1|$1}} erabiltzailearen eskubideak gorde dira.",
+ "savedrights": "{{GENDER:$1|$1}} erabiltzailearen taldeak gorde dira.",
"timezonelegend": "Ordu-eremua:",
"localtime": "Ordu lokala:",
"timezoneuseserverdefault": "Erabili lehenetsitako wikia ($1)",
"recentchanges-legend-heading": "<strong>Azalpenak:</strong>",
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (ikus, gainera, [[Special:NewPages|orri berrien zerrenda]])",
"recentchanges-submit": "Erakutsi",
+ "rcfilters-filterlist-title": "Iragazkiak",
+ "rcfilters-filtergroup-authorship": "Edizioaren egiletza",
+ "rcfilters-filter-bots-label": "Bot",
+ "rcfilters-filter-minor-label": "Aldaketa txikiak",
"rcnotefrom": "Jarraian azaltzen diren aldaketak data honetatik aurrerakoak dira: <b>$2</b> (gehienez <b>$1</b> erakusten dira).",
"rclistfrom": "Erakutsi $3 $2 ondorengo aldaketa berriak",
"rcshowhideminor": "$1 aldaketa txikiak",
"apisandbox-dynamic-parameters-add-placeholder": "Parametroaren izena",
"apisandbox-dynamic-error-exists": "$1 parametro izena dagoeneko existitzen da",
"apisandbox-results": "Emaitzak",
+ "apisandbox-continue": "Jarraitu",
+ "apisandbox-continue-clear": "Garbitu",
"booksources": "Iturri liburuak",
"booksources-search-legend": "Liburuen bilaketa",
"booksources-search": "Bilatu",
"recentchanges-legend-plusminus": "(''±123'')",
"recentchanges-submit": "Lister",
"rcfilters-activefilters": "Filtres actifs",
+ "rcfilters-restore-default-filters": "Rétablir les filtres par défaut",
+ "rcfilters-clear-all-filters": "Effacer tous les filtres",
"rcfilters-search-placeholder": "Modifications récentes de filtres (naviguer ou commencer à saisir)",
"rcfilters-invalid-filter": "Filtre non valide",
+ "rcfilters-empty-filter": "Aucun filtre actif. Toutes les contributions sont affichées.",
"rcfilters-filterlist-title": "Filtres",
"rcfilters-filterlist-noresults": "Aucun filtre trouvé",
"rcfilters-filtergroup-registration": "Inscription de l’utilisateur",
"apisandbox-sending-request": "Envoi de la requête à l'API...",
"apisandbox-loading-results": "Réception des résultats de l'API...",
"apisandbox-results-error": "Une erreur s'est produite lors du chargement de la réponse à la requête de l'API: $1.",
+ "apisandbox-request-selectformat-label": "Afficher les données de la requête comme :",
+ "apisandbox-request-format-url-label": "Chaîne de requête de l’URL",
"apisandbox-request-url-label": "Requête URL :",
+ "apisandbox-request-json-label": "Demander du JSON :",
"apisandbox-request-time": "Durée de la demande: {{PLURAL:$1|$1 ms}}",
"apisandbox-results-fixtoken": "Corrigez le jeton et renvoyez",
"apisandbox-results-fixtoken-fail": "Impossible de récupérer le jeton \"$1\"",
"emailccsubject": "Copie de votre message à $1 : $2",
"emailsent": "Courriel envoyé",
"emailsenttext": "Votre message a été envoyé par courriel.",
- "emailuserfooter": "Ce courriel a été {{GENDER:$1|envoyé}} par « $1 » à « {{GENDER:$2|$2}} » par la fonction « {{int:emailuser}} » de {{SITENAME}}. {{GENDER:$2|Votre}} courriel sera envoyé directement à l'{{GENDER:$1|émetteur initial}}, en {{GENDER:$1|lui}} mentionnant {{GENDER:$2|votre}} adresse courriel .",
+ "emailuserfooter": "Ce courriel a été {{GENDER:$1|envoyé}} par « $1 » à « {{GENDER:$2|$2}} » par la fonction « {{int:emailuser}} » de {{SITENAME}}. Si {{GENDER:$2|vous}} répondez à ce courriel, {{GENDER:$2|votre}} courriel sera envoyé directement à l’{{GENDER:$1|émetteur initial}}, en {{GENDER:$1|lui}} mentionnant {{GENDER:$2|votre}} adresse courriel .",
"usermessage-summary": "Laisser un message système.",
"usermessage-editor": "Messager du système",
"watchlist": "Liste de suivi",
"recentchanges-legend-plusminus": "(<em>±123</em>)",
"recentchanges-submit": "הצגה",
"rcfilters-activefilters": "מסננים פעילים",
+ "rcfilters-restore-default-filters": "שחזור למסנני ברירת המחדל",
+ "rcfilters-clear-all-filters": "מחיקת כל המסננים",
"rcfilters-search-placeholder": "סינון שינויים אחרונים (עיינו או התחילו להקליד)",
"rcfilters-invalid-filter": "מסנן בלתי־תקין",
+ "rcfilters-empty-filter": "אין מסננים פעילים. כל התרומות מוצגות.",
"rcfilters-filterlist-title": "מסננים",
"rcfilters-filterlist-noresults": "לא נמצאו מסננים",
"rcfilters-filtergroup-registration": "רישום העורכים",
"emailccsubject": "העתק של הודעתך למשתמש $1: $2",
"emailsent": "הדואר נשלח",
"emailsenttext": "הודעת הדואר האלקטרוני שלך נשלחה.",
- "emailuserfooter": "$1 {{GENDER:$1|שלח|שלחה}} את הדוא\"ל הזה ל{{GENDER:$2|משתמש|משתמשת}} $2 באמצעות התכונה \"{{int:emailuser}}\" באתר {{SITENAME}}. התשובה שלך תישלח ישירות {{GENDER:$1|לשולח המקורי|לשולחת המקורית}}, והיא תחשוף {{GENDER:$1|בפניו|בפניה}} את כתובת הדוא\"ל שלך.",
+ "emailuserfooter": "$1 {{GENDER:$1|ש×\9c×\97|ש×\9c×\97×\94}} ×\90ת ×\94×\93×\95×\90\"×\9c ×\94×\96×\94 ×\9c{{GENDER:$2|×\9eשת×\9eש|×\9eשת×\9eשת}} $2 ×\91×\90×\9eצע×\95ת ×\94ת×\9b×\95× ×\94 \"{{int:emailuser}}\" ×\91×\90תר {{SITENAME}}. ×\90×\9d {{GENDER:$2|ת×\92×\99×\91|ת×\92×\99×\91×\99}} ×\9c×\93×\95×\90\"×\9c ×\94×\96×\94, ×\94תש×\95×\91×\94 ש×\9c×\9a ת×\99ש×\9c×\97 ×\99ש×\99ר×\95ת {{GENDER:$1|×\9cש×\95×\9c×\97 ×\94×\9eק×\95ר×\99|×\9cש×\95×\9c×\97ת ×\94×\9eק×\95ר×\99ת}}, ×\95×\94×\99×\90 ת×\97ש×\95×£ {{GENDER:$1|×\91×¤× ×\99×\95|×\91×¤× ×\99×\94}} ×\90ת ×\9bת×\95×\91ת ×\94×\93×\95×\90\"×\9c ש×\9c×\9a.",
"usermessage-summary": "השארת הודעת מערכת.",
"usermessage-editor": "שולח הודעות המערכת",
"watchlist": "רשימת המעקב",
"searcharticle": "Kreni",
"history": "Stare izmjene",
"history_short": "Stare izmjene",
+ "history_small": "stare izmjene",
"updatedmarker": "obnovljeno od posljednjeg posjeta",
"printableversion": "Inačica za ispis",
"permalink": "Trajna poveznica",
"views": "Pogledi",
"toolbox": "Pomagala",
"tool-link-userrights": "Promijeni {{GENDER:$1|suradnikove|suradničine}} grupe",
+ "tool-link-userrights-readonly": "Vidi {{GENDER:$1|suradnikovu|suradničinu|suradničku}} pripadnost skupinama",
"tool-link-emailuser": "Pošalji e-poštu {{GENDER:$1|suradniku|suradnici}}",
"userpage": "Vidi suradnikovu stranicu",
"projectpage": "Vidi stranicu o projektu",
"eauthentsent": "Na navedenu adresu poslana je e-poruka s potvrdom.\nPrije nego što pošaljemo daljnje poruke, molimo Vas otvorite e-poruku i slijedite u njemu sadržana uputstva kako biste potvrdili da je adresa e-pošte zaista Vaša.",
"throttled-mailpassword": "Već Vam je poslan e-mail za promjenu zaporke, u {{PLURAL:$1|posljednjih sat vremena|posljednja $1 sata|posljednjih $1 sati}}.\nDa bi spriječili zloupotrebu, moguće je poslati samo jedan e-mail za promjenu zaporke {{PLURAL:$1|svakih sat vremena|svaka $1 sata|svakih $1 sati}}.",
"mailerror": "Pogrješka pri slanju e-pošte: $1",
- "acct_creation_throttle_hit": "Posjetitelji ovog wikija koji rabe Vašu IP adresu napravili su {{PLURAL:$1|1 račun|$1 računa}} u posljednjem danu, što je najveći dopušteni broj u tom vremenskom razdoblju.\nZbog toga posjetitelji s ove IP adrese trenutačno ne mogu otvoriti nove suradničke račune.",
+ "acct_creation_throttle_hit": "Posjetitelji ovog wikija koji rabe Vašu IP adresu napravili su {{PLURAL:$1|1 račun|$1 računa}} u posljednjih $2, što je najveći dopušteni broj u tom vremenskom razdoblju.\nZbog toga posjetitelji s ove IP adrese trenutačno ne mogu otvoriti nove suradničke račune.",
"emailauthenticated": "Vaša adresa e-pošte potvrđena je $2 u $3.",
"emailnotauthenticated": "Vaša adresa e-pošte još nije potvrđena.\nNe možemo poslati e-poruku ni u jednoj od sljedećih naredbi.",
"noemailprefs": "Nije navedena adresa elektroničke pošte, stoga sljedeće naredbe ne će raditi.",
"createacct-another-realname-tip": "Pravo ime nije obvezno. \nAko ga navedete, bit će korišteno za pripisivanje Vaših doprinosa.",
"pt-login": "Prijavi se",
"pt-login-button": "Prijavi se",
+ "pt-login-continue-button": "Nastavi prijavu",
"pt-createaccount": "Otvori novi suradnički račun",
"pt-userlogout": "Odjavi se",
"php-mail-error-unknown": "Nepoznata pogrješka u funkciji PHP-poruke()",
"botpasswords-bad-appid": "Ime bota \"$1\" nije valjano.",
"botpasswords-insert-failed": "Nije moguće dodavanje imena bota \"$1\". Možda je već dodano?",
"botpasswords-update-failed": "Nije moguće ažurirati bot s imenom \"$1\". Možda je izbrisan?",
+ "botpasswords-created-title": "Stvorena bot zaporka",
"resetpass_forbidden": "Zaporka ne može biti promijenjena",
"resetpass-no-info": "Morate biti prijavljeni da biste izravno pristupili ovoj stranici.",
"resetpass-submit-loggedin": "Promijeni zaporku",
"passwordreset-emailtext-user": "Suradnik $1 na {{SITENAME}} zatražio je podsjetnik o pojedinostima vašeg računa za {{SITENAME}}\n($4). Sljedeći {{PLURAL:$3|račun suradnika je|računi suradnika su}} povezani s ovom e-mail adresom:\n\n$2\n\n{{PLURAL:$3|Ova privremena zaporka|Ove privremene zaporke}} će isteći u {{PLURAL:$5|jedan dan|$5 dana}}.\nTrebate se prijaviti i odabrati novu zaporku. Ukoliko je netko drugi napravio ovaj\nzahtjev, ili ako ste se sjetili Vaše izvorne zaporke, a više je ne želite promijeniti, \nmožete zanemariti ovu poruku i nastavite koristiti staru zaporku.",
"passwordreset-emailelement": "Suradničko ime: \n$1\n\nPrivremena zaporka: \n$2",
"passwordreset-emailsentemail": "Ako je ova adresa povezana s Vašim suradničkim računom, na nju će biti poslan podsjetnik na zaporku.",
+ "passwordreset-invalidemail": "Nevaljala adresa e-pošte",
"changeemail": "Promijeni ili izbriši e-mail adresu",
"changeemail-header": "Promijeni adresu e-pošte računa",
"changeemail-no-info": "Morate biti prijavljeni da biste izravno pristupili ovoj stranici.",
"statistics-users": "Prijavljeni [[Special:ListUsers|suradnici]]",
"statistics-users-active": "Aktivni suradnici",
"statistics-users-active-desc": "Suradnici koji su napravili neku od radnji u posljednjih {{PLURAL:$1|dan|$1 dana}}",
- "pageswithprop": "Stranice sa osobinom stranice",
- "pageswithprop-legend": "Stranice sa osobinom stranice",
+ "pageswithprop": "Stranice s određenim osobinama",
+ "pageswithprop-legend": "Stranice s određenim osobinama",
+ "pageswithprop-text": "Ovo je popis stranica koje koriste određene osobine stranica.",
"pageswithprop-prop": "Ime osobine:",
"pageswithprop-submit": "Idi",
"doubleredirects": "Dvostruka preusmjeravanja",
"booksources-search": "Traži",
"booksources-text": "Ovdje je popis vanjskih poveznica na internetskim stranicama koje prodaju nove i rabljene knjige, ali mogu sadržavati i ostale podatke o knjigama koje tražite:",
"booksources-invalid-isbn": "Čini se da dani ISBN nije valjan; provjerite greške kopirajući iz izvornika.",
+ "magiclink-tracking-rfc": "Stranice s čarobnim RFC poveznicama",
+ "magiclink-tracking-rfc-desc": "Ova stranica rabi čarobne RFC poveznice. Za njihovu migraciju vidi [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org].",
+ "magiclink-tracking-pmid": "Stranice s čarobnim PMID poveznicama",
+ "magiclink-tracking-pmid-desc": "Ova stranica rabi čarobne PMID poveznice. Za njihovu migraciju vidi [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org].",
"magiclink-tracking-isbn": "Stranice s čarobnim ISBN poveznicama",
"magiclink-tracking-isbn-desc": "Ova stranica rabi čarobne ISBN poveznice. Za njihovu migraciju vidi [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org].",
"specialloguserlabel": "Suradnik:",
"listgrants-summary": "Slijedi popis dozvola s pridruženim pristupom suradničkim pravima. Suradnici mogu omogućiti aplikacijama uporabu svojih računa, ali s ograničenim ovlastima na temelju dozvola koje je suradnik dodijelio aplikaciji. Aplikacija koja djeluje u ime suradnika međutim ne može rabiti prava koje suradnik nema.\nMoguće su [[{{MediaWiki:Listgrouprights-helppage}}|dodatne informacije]] o pojedinim pravima.",
"listgrants-grant": "Dozvola",
"listgrants-rights": "Prava",
+ "trackingcategories": "Kategorije za praćenje",
+ "trackingcategories-msg": "Praćene kategorije",
+ "trackingcategories-name": "Naziv poruke",
+ "trackingcategories-desc": "Kriteriji za uključenje u kategoriju",
"restricted-displaytitle-ignored": "Stranice sa zanemarenim naslovima za prikaz",
+ "restricted-displaytitle-ignored-desc": "Na stranici je zanemaren <code><nowiki>{{DISPLAYTITLE}}</nowiki></code> jer ne odgovara trenutačnom naslovu stranice.",
"trackingcategories-nodesc": "Opis nije dostupan.",
+ "trackingcategories-disabled": "Kategorija onemogućena",
"mailnologin": "Nema adrese pošiljatelja",
"mailnologintext": "Morate biti [[Special:UserLogin|prijavljeni]]\ni imati valjanu adresu e-pošte u svojim [[Special:Preferences|postavkama]]\nda bi mogli slati poštu drugim suradnicima.",
"emailuser": "Pošalji mu e-poruku",
"tog-prefershttps": "Sempre uzar sekura konekto kande facar log in",
"underline-always": "Sempre",
"underline-never": "Nulatempe",
+ "underline-default": "Pre-ajustaji pri sub-strekizar ligili",
"editfont-style": "Stilo di fonto uzata por editar la texto:",
+ "editfont-default": "Preajustaji di navigilo",
"editfont-monospace": "Tipo por redaktar kun singla spaco",
"editfont-sansserif": "tipo Sans-serif",
"editfont-serif": "tipo di fonto Serif",
"restorelink": "{{PLURAL:$1|1 redakto efacita|$1 redakti efacita}}",
"feedlinks": "Fonto RSS:",
"feed-invalid": "Tipo di fonto RSS nevalida",
+ "feed-unavailable": "Abonata publikaji ne esas disponebla",
"site-rss-feed": "$1 RSS Provizajo",
"site-atom-feed": "$1 Atom Provizajo",
"page-rss-feed": "\"$1\" RSS Provizajo",
"resetpass-recycled": "Voluntez chanjar vua pasovorto ad ulo diferanta de vua aktuala pasovorto.",
"resetpass-temp-emailed": "Vu eniris uzante provizora pasovorto.\nPor parkompletigar enirado, vu mustas krear nova pasovorto hike:",
"resetpass-temp-password": "Provizora pasovorto:",
+ "passwordreset": "Sendez nova pasovorto per e-posto",
"passwordreset-username": "Uzantonomo:",
"passwordreset-invalidemail": "Ne-valida e-posto-adreso",
"passwordreset-nodata": "Nek uzeronomo nek e-posto-adreso esis provizita",
"accmailtext": "Hazarde genitita pasovorto por [[User talk:$1|$1]] sendesis ad $2.\n\nLa pasovorto por ica nova konto povas chanjesar che la ''[[Special:ChangePassword|chanjar pasovorto]]'' pagino pos on eniras.",
"newarticle": "(nova)",
"newarticletext": "Vu sequis ligilo a pagino qua ne existas ankore.\nPor krear ica pagino, voluntez startar skribar en la infra buxo.\n(regardez la [$1 helpo] por plusa informo).\nSe vu esas hike erore, kliktez sur la butono por retrovenar en vua navigilo.",
- "noarticletext": "Prezente, ne esas texto en ica pagino.\nVu povas [[Special:Search/{{PAGENAME}}|serchar ica titulo]] en altra pagini,\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} serchar en la relata registri],\no [{{fullurl:{{FULLPAGENAME}}|action=edit}} redaktar ica pagino]</span>.",
+ "noarticletext": "Til nun ne existas texto en ica pagino.\nVu povas [[Specala:Search/{{PAGENAME}}|serchar ica titulo]] en altra pagini,\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} serchar en la relata registri],\no [{{fullurl:{{FULLPAGENAME}}|action=edit}} redaktar ica pagino]</span>.",
"userpage-userdoesnotexist": "Uzeronomo \"$1\" no registragesis.\nVoluntez konfirmez se vu volas krear/redaktar ica pagino.",
"userpage-userdoesnotexist-view": "Uzeronomo \"$1\" no registragesis.",
"clearyourcache": "'''Atencez: Pos registragar, vu probable mustas renovigar la tempala-magazino di vua navigilo por vidar la chanji.'''\n'''Mozilla / Firefox / Safari:''' tenez ''Shift'' kliktante ''Reload'', o presez sive ''Ctrl-F5'' sive ''Ctrl-R'' (''Command-R'' ye Mac);\n'''Konqueror''': kliktez ''Reload'' o presez ''F5'';\n'''Opera:''' vakuigez la tempala-magazino en ''Tools → Preferences'';\n'''Internet Explorer:''' tenez ''Ctrl'' kliktante ''Refresh,'' o presez ''Ctrl-F5''.",
"mergehistory-reason": "Motivo:",
"revertmerge": "Desmixar",
"history-title": "Version-historio di \"$1\"",
+ "difference-title": "Diferi inter la revizi di $1",
"lineno": "Lineo $1:",
"compareselectedversions": "Komparar selektita versioni",
"editundo": "des-facez",
+ "diff-multi-sameuser": "(ne montresas {{PLURAL:$1|1 meza revizo|$1 meza revizi}} facita da la sama uzero)",
"searchresults": "Rezultaji dil sercho",
"searchresults-title": "Sercho-rezultaji por \"$1\"",
"titlematches": "Koincidi de titulo di artiklo",
"searchprofile-articles-tooltip": "Serchez en $1",
"searchprofile-images-tooltip": "Serchez arkivi",
"search-result-size": "$1 ({{PLURAL:$2|1 vorto|$2 vorti}})",
- "search-redirect": "(ridirektilo $1)",
+ "search-redirect": "(Ridirektita de $1)",
"search-section": "(seciono $1)",
"search-suggest": "Ka vu volis dicar: $1",
"search-interwiki-caption": "Altra projekti",
"search-interwiki-more": "(plusa)",
"searchall": "omna",
"showingresults": "Montrante infre {{PLURAL:$1|'''1''' rezulto|'''$1''' rezulti}}, qui komencas kun numero #'''$2'''.",
+ "search-nonefound": "Nula rezulto trovesis por lua serchado.",
"powersearch-legend": "Avancita sercho",
"powersearch-ns": "Serchez en nomari:",
"powersearch-toggleall": "Omna",
"action-upload": "adkargar ca arkivo",
"action-browsearchive": "serchar pagini efacita",
"nchanges": "$1 {{PLURAL:$1|chanjo|chanji}}",
+ "enhancedrc-history": "Versionaro",
"recentchanges": "Recenta chanji",
"recentchanges-legend": "Recenta chanji preferaji",
"recentchanges-summary": "Regardez la maxim recenta chanji en Wiki per ica pagino.",
"recentchanges-label-newpage": "Ca redaktajo kreis nova pagino",
"recentchanges-label-minor": "Ica es mikra redaktajo",
"recentchanges-label-bot": "Ta chanjo facita da bot",
+ "recentchanges-label-unpatrolled": "Ica modifiko ne patroliesas ankore.",
+ "recentchanges-label-plusminus": "La pagino modifikesis segun ica quanto di *bicoki",
"recentchanges-legend-newpage": "$1 - nova pagino",
"rcfilters-filter-userExpLevel-experienced-description": "Plu kam 30 dii di agemeso e 500 redakti.",
"rcnotefrom": "Infre esas la lasta chanji depos '''$2''' (montrita til '''$1''').",
"rclistfrom": "Montrar nova chanji startante de $3 $2",
"rcshowhideminor": "$1 mikra redakti",
+ "rcshowhideminor-show": "Montrar",
+ "rcshowhideminor-hide": "Celar",
"rcshowhidebots": "$1 roboti",
+ "rcshowhidebots-show": "Montrar",
+ "rcshowhidebots-hide": "Celar",
"rcshowhideliu": "$1 enrejistrita uzeri",
+ "rcshowhideliu-hide": "Celar",
"rcshowhideanons": "$1 anonima uzanti",
+ "rcshowhideanons-show": "Montrar",
+ "rcshowhideanons-hide": "Celar",
"rcshowhidemine": "$1 mea redakti",
+ "rcshowhidemine-show": "Montrar",
+ "rcshowhidemine-hide": "Celar",
"rclinks": "Montrar la lasta $1 chanji dum la lasta $2 dii<br />$3",
"diff": "dif",
"hist": "vers",
"newpageletter": "N",
"boteditletter": "r",
"rc_categories_any": "Irga selektita",
+ "rc-change-size-new": "$1 {{PLURAL:$1|bicoko|bicoki}} pos la modifiki",
"newsectionsummary": "/* $1 */ nova seciono",
"rc-enhanced-expand": "Montrez detali",
"rc-enhanced-hide": "Celar detali",
"linkstoimage": "La {{PLURAL:$1|pagino|$1 pagini}} infre ligas a ca arkivo:",
"nolinkstoimage": "Nula pagino ligas a ca pagino.",
"sharedupload": "Ca arkivo esas de $1 e posible esas uzata da altra projekti.",
+ "sharedupload-desc-here": "Ca arkivo jacas en $1, e povas uzesar en altra projeti.\nLa deskriptado en lua [$2 pagino di deskriptado] montresas infre.",
"uploadnewversion-linktext": "Adkargez nova versiono dil arkivo",
"shared-repo-from": "ek $1",
+ "upload-disallowed-here": "Vu ne povas modifikar ica arkivo.",
"filerevert-comment": "Motivo:",
"filedelete": "Efacar $1",
"filedelete-legend": "Efacar arkivo",
"apisandbox-loading": "Charjas informo pri modulo « $1 » di API...",
"booksources": "Fonti di libri",
"booksources-search-legend": "Serchez librala fonti",
+ "booksources-search": "Serchar",
"specialloguserlabel": "Agero:",
"speciallogtitlelabel": "Skopo (titulo od {{ns:user}}:uzernomo por uzero):",
"log": "Registrari",
"deletereason-dropdown": "*Ordinara motivi por efacado\n** \"Spam\" nedezirata mesaji\n** Vandalismo\n** Kopiyuro Violaco\n** Demandita da autoro\n** Nefuncionanta ligilo",
"rollback": "Retrorulez redakti",
"rollbacklink": "retrorulez",
+ "rollbacklinkcount": "nuligar $1 {{PLURAL:$1|modifiko|modifiki}}",
"rollbackfailed": "Retrorular ne sucesis",
"cantrollback": "Ne esas posibla retrorular. La lasta kontributanto esas la nura autoro di ica pagino.",
"alreadyrolled": "Vu ne povas retrorular la lasta chanjo di [[:$1]] da [[User:$2|$2]] ([[User talk:$2|Diskutez]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]);\nulu pluse ja redaktis o retrorulis ica pagino.\n\nLa lasta chanjo a la pagino esis da [[User:$3|$3]] ([[User talk:$3|Diskutez]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).",
"contributions": "Kontributadi dil {{GENDER:$1|uzero}}",
"contributions-title": "Uzero-kontributadi di $1",
"mycontris": "Kontributadi",
+ "anoncontribs": "Kontributadi",
"contribsub2": "Pro $1 ($2)",
"nocontribs": "Ne trovesis chanji qui fitez ita kriterii.",
"uctop": "(aktuala)",
"tooltip-pt-mycontris": "Listo di {{GENDER:|vua}} kontributaji",
"tooltip-pt-login": "Vu darfas enirar uzante vua pas-vorto, ma lo ne esas preskriptata.",
"tooltip-pt-logout": "Ekirar",
+ "tooltip-pt-createaccount": "Vu stimulesas a krear konto e facar \"log in\". Tamen, to ne esas obliganta",
"tooltip-ca-talk": "Diskuto pri la pagino di kontenajo",
"tooltip-ca-edit": "Redaktar ita pagino",
"tooltip-ca-addsection": "Komencar nova seciono",
"others": "altra",
"siteusers": "{{PLURAL:$2|{{GENDER:$1|uzero}}|uzeri}} $1 di {{SITENAME}}",
"spamprotectiontitle": "Filtrilo kontre spamo",
+ "simpleantispam-label": "Surveyo kontre \"spam\".\n<strong>NE SKRIBEZ</strong> hike!",
"pageinfo-toolboxlink": "Informo di ca pagino",
"previousdiff": "← Plu anciena versiono",
"nextdiff": "Plu recenta versiono →",
"widthheightpage": "$1 × $2, $3 {{PLURAL:$3|pagino|pagini}}",
"file-nohires": "Ne existas grandeso plu granda.",
+ "svg-long-desc": "arkivo SVG, nominale $1 x $2 \"pixels\", kun $3",
"show-big-image": "Arkivo originala",
+ "show-big-image-size": "$1 x $2 pixels",
"newimages": "Galerio di nova arkivi",
"imagelisttext": "Infre esas listo di '''$1''' {{PLURAL:$1|arkivo|arkivi}} rangizita $2.",
"newimages-legend": "Filtrilo",
"ilsubmit": "Serchar",
"bydate": "per dato",
"metadata": "Metadonaji",
+ "metadata-help": "Ca arkivo kontenas plusa informo, probable furnisita per la kamero elektronikala o per la \"scanner\" uzata por krear o kopiar l'imajo.\nSe l'arkivo modifikesos de lua originala stando, kelka detali povos ne reprezentar exakte l'arkivo modifikata.",
+ "metadata-fields": "Image metadata fields listed in this message will be included on image page display when the metadata table is collapsed.\nOthers will be hidden by default.\n* make\n* model\n* datetimeoriginal\n* exposuretime\n* fnumber\n* isospeedratings\n* focallength\n* artist\n* copyright\n* imagedescription\n* gpslatitude\n* gpslongitude\n* gpsaltitude",
"exif-imagewidth": "Larjeso",
"exif-imagelength": "Alteso",
+ "exif-orientation": "Orientizo",
+ "exif-xresolution": "Horizontala distingivo",
+ "exif-yresolution": "Vertikala distingivo",
+ "exif-datetime": "Dio e horo di la modifiko dil arkivo",
+ "exif-make": "Fabrikanto di la fotografilo",
+ "exif-model": "Fotografilo uzita",
+ "exif-software": "*Komputeroprogramo uzata",
"exif-artist": "Autoro",
+ "exif-exifversion": "versiono Exif",
+ "exif-datetimeoriginal": "Dio e horo di produktado di la datumaro",
+ "exif-datetimedigitized": "Dio e horo di la kopio kun \"scanner\"",
"exif-exposuretime-format": "$1 sek ($2)",
"exif-gpslatitude": "Latitudo",
"exif-gpslongitude": "Longitudo",
"watchlisttools-view": "Vidar relatanta chanji",
"watchlisttools-edit": "Vidar e redaktar surveyo-listo",
"watchlisttools-raw": "Redaktar texto di surveyo-listo",
+ "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|diskuto]])",
"version": "Versiono",
"version-specialpages": "Specala pagini",
"version-other": "Altra",
"specialpages-group-redirects": "Specala pagini di ridirektili",
"blankpage": "Pagino sen-skribura",
"tag-filter-submit": "Filtrez",
+ "tag-list-wrapper": "([[Special:Tags|{{PLURAL:$1|Etikedo|Etikedi}}]]: $2)",
"tags-edit": "redaktar",
"tags-hitcount": "$1 {{PLURAL:$1|chanjo|chanji}}",
"htmlform-reset": "Desfacar chanji",
"htmlform-selectorother-other": "Altra",
"htmlform-cloner-create": "Adjuntar plue",
+ "logentry-move-move": "$1 {{GENDER:$2|movis}} la pagino $3 a $4",
+ "logentry-newusers-create": "La konto dil uzero $1 kreesis.",
+ "logentry-upload-upload": "$1 {{GENDER:$2|uploaded}} $3",
"rightsnone": "(nula)",
"revdelete-summary": "redakto-rezumo",
"searchsuggest-search": "Serchez en {{SITENAME}}",
"recentchanges-legend-plusminus": "(''±123'')",
"recentchanges-submit": "Mostra",
"rcfilters-activefilters": "Filtri attivi",
+ "rcfilters-restore-default-filters": "Ripristina i filtri predefiniti",
+ "rcfilters-clear-all-filters": "Pulisci tutti i filtri",
"rcfilters-search-placeholder": "Filtra le ultime modifiche (naviga o inizia a digitare)",
"rcfilters-invalid-filter": "Filtro non valido",
+ "rcfilters-empty-filter": "Nessun filtro attivo. Sono mostrati tutti i contributi.",
"rcfilters-filterlist-title": "Filtri",
"rcfilters-filterlist-noresults": "Nessun filtro trovato",
"rcfilters-filtergroup-registration": "Registrazione utente",
"apisandbox-sending-request": "Invio richiesta di API...",
"apisandbox-loading-results": "Ricezione dei risultati di API in corso...",
"apisandbox-results-error": "Si è verificato un errore durante il caricamento della risposta all'interrogazione API: $1",
+ "apisandbox-request-selectformat-label": "Mostra i dati richiesti come:",
"apisandbox-request-url-label": "URL di richiesta:",
"apisandbox-request-time": "Tempo richiesto: {{PLURAL:$1|$1 ms}}",
"apisandbox-results-fixtoken": "Correggi token e reinvia",
"emailccsubject": "Copia del messaggio inviato a $1: $2",
"emailsent": "Messaggio inviato",
"emailsenttext": "Il messaggio e-mail è stato inviato.",
- "emailuserfooter": "Questa email è stata {{GENDER:$1|inviata}} da $1 a {{GENDER:$2|$2}} attraverso la funzione \"{{int:emailuser}}\" su {{SITENAME}}. La {{GENDER:$2|tua}} eventuale email di risposta sarà inviata direttamente al {{GENDER:$1|mittente originale}}, rivelando il {{GENDER:$2|tuo}} indirizzo di posta elettronica a {{GENDER:$1|lui|lei}}.",
+ "emailuserfooter": "Questa email è stata inviata da $1 a $2 attraverso la funzione \"{{int:emailuser}}\" su {{SITENAME}}. Se {{GENDER:$2|risponderai}}, la tua email di risposta sarà inviata direttamente {{GENDER:$1|al|alla}} mittente originale, rivelando{{GENDER:$1|gli|le}} il {{GENDER:$2|tuo}} indirizzo di posta elettronica.",
"usermessage-summary": "Messaggio di sistema",
"usermessage-editor": "Messaggero di sistema",
"usermessage-template": "MediaWiki:MessaggioUtente",
"recentchanges-legend-plusminus": "(<em>±123</em>)",
"recentchanges-submit": "보기",
"rcfilters-activefilters": "사용 중인 필터",
+ "rcfilters-restore-default-filters": "기본 필터 복구",
+ "rcfilters-clear-all-filters": "필터 모두 지우기",
"rcfilters-search-placeholder": "필터 최근 바뀜 (찾아보거나 입력을 시작하십시오)",
"rcfilters-invalid-filter": "유효하지 않은 필터",
+ "rcfilters-empty-filter": "활성화된 필터가 없습니다. 모든 기여가 표시됩니다.",
"rcfilters-filterlist-title": "필터",
"rcfilters-filterlist-noresults": "필터를 찾을 수 없습니다",
"rcfilters-filtergroup-registration": "사용자 등록",
+ "rcfilters-filter-registered-label": "등록됨",
+ "rcfilters-filter-registered-description": "로그인된 편집자.",
+ "rcfilters-filter-unregistered-label": "등록 안 됨",
+ "rcfilters-filter-unregistered-description": "로그인하지 않은 편집자.",
"rcfilters-filtergroup-authorship": "원작자 편집",
"rcfilters-filter-editsbyself-label": "자신의 편집",
"rcfilters-filter-editsbyself-description": "당신의 편집.",
"rcfilters-filter-editsbyother-label": "다른 사용자의 편집",
- "rcfilters-filter-editsbyother-description": "다른 사용자에 의한 편집. (당신의 편집이 아님)",
+ "rcfilters-filter-editsbyother-description": "다른 사용자에 의한 편집 (당신의 편집이 아님).",
"rcfilters-filtergroup-userExpLevel": "경험 수준 (등록된 사용자 전용)",
"rcfilters-filter-userExpLevel-newcomer-label": "신규 사용자",
- "rcfilters-filter-userExpLevel-newcomer-description": "신규 편집자: 10개 미만의 편집 및 4일 미만의 활동.",
+ "rcfilters-filter-userExpLevel-newcomer-description": "10회 미만의 편집 및 4일 미만의 활동.",
"rcfilters-filter-userExpLevel-learner-label": "학습자",
- "rcfilters-filter-userExpLevel-learner-description": "'신규 사용자' 보다 활동일 및 편집 수가 더 많지만 '능숙한 사용자' 보다는 적습니다.",
+ "rcfilters-filter-userExpLevel-learner-description": "\"신규 사용자\" 보다 활동일 및 편집 수가 더 많지만 \"능숙한 사용자\" 보다는 적습니다.",
"rcfilters-filter-userExpLevel-experienced-label": "능숙한 사용자",
"rcfilters-filter-userExpLevel-experienced-description": "30일 이상의 활동 및 500개 이상의 편집.",
+ "rcfilters-filtergroup-automated": "자동으로 된 기여",
"rcfilters-filter-bots-label": "봇",
+ "rcfilters-filter-bots-description": "자동 도구를 이용한 편집.",
"rcfilters-filter-humans-label": "사람 (봇이 아님)",
+ "rcfilters-filter-humans-description": "수동으로 한 편집.",
+ "rcfilters-filtergroup-significance": "의미",
"rcfilters-filter-minor-label": "사소한 편집",
"rcfilters-filter-major-label": "사소하지 않은 편집",
+ "rcfilters-filter-major-description": "사소한 편집으로 표시되지 않은 편집.",
+ "rcfilters-filtergroup-changetype": "차이 종류",
"rcfilters-filter-pageedits-label": "문서 편집",
+ "rcfilters-filter-newpages-label": "문서 생성",
+ "rcfilters-filter-newpages-description": "새 문서를 만드는 편집.",
+ "rcfilters-filter-categorization-label": "분류 차이",
+ "rcfilters-filter-categorization-description": "분류에서 추가되거나 제거되는 페이지의 기록.",
"rcnotefrom": "아래는 <strong>$3, $4</strong>부터 시작하는 {{PLURAL:$5|바뀜이 있습니다}}. (최대 <strong>$1</strong>개가 표시됨)",
"rclistfrom": "$3 $2부터 시작하는 새로 바뀐 문서 보기",
"rcshowhideminor": "사소한 편집 $1",
"protectedarticle": "parastî [[$1]]",
"modifiedarticleprotection": "parastina \"[[$1]]\" guherand",
"unprotectedarticle": "parastina \"[[$1]]\" rakir",
- "protect-title": "parastina \"$1\" biguherîne",
+ "protect-title": "Parastina \"$1\" biguherîne",
"prot_1movedto2": "Navê [[$1]] weke [[$2]] hate guhertin",
"protect-norestrictiontypes-title": "Rûpela neparastbar",
"protect-legend": "Parastinê bipesinîne",
"hours-ago": "berî $1 {{PLURAL:$1|demjimêr|demjimêran}}",
"variantname-ku-arab": "Tîpên erebî",
"variantname-ku-latn": "Tîpên latînî",
- "variantname-ku": "disable",
+ "variantname-ku": "Kurdî/کوردی",
"metadata": "Daneyên meta",
"metadata-expand": "Detayên dirêj nîşan bide",
"metadata-collapse": "Detayên dirêj veşêre",
"recentchanges-legend-plusminus": "''(±123)''",
"recentchanges-submit": "Weisen",
"rcfilters-activefilters": "Aktiv Filteren",
+ "rcfilters-restore-default-filters": "Standardfiltere restauréieren",
+ "rcfilters-clear-all-filters": "All Filteren eidelmaachen",
"rcfilters-search-placeholder": "Rezent Ännerunge filteren (duerchsichen oder ufänke mat tippen)",
"rcfilters-invalid-filter": "Net valabele Filter",
"rcfilters-filterlist-title": "Filteren",
"Reedy",
"Urhixidur",
"아라",
- "Katxis"
+ "Katxis",
+ "Chabi"
]
},
"tog-underline": "Sulinia lias:",
"disclaimers": "Negas de respondablia",
"disclaimerpage": "Project:Nega jeneral de respondablia",
"edithelp": "Aida con edita",
+ "helppage-top-gethelp": "Aida",
"mainpage": "Paje Prima",
"mainpage-description": "Paje Prima",
"policy-url": "Project:Politica",
"toc": "Contenida",
"showtoc": "mostra",
"hidetoc": "asconde",
+ "collapsible-collapse": "Colasa",
+ "collapsible-expand": "Estende",
+ "confirmable-confirm": "Esce {{GENDER:$1|tu}} es serta?",
+ "confirmable-yes": "Si",
+ "confirmable-no": "No",
"viewdeleted": "Vide $1?",
"feedlinks": "Flue:",
"site-rss-feed": "$1 RSS Flue",
"badtitletext": "La titulo de la paje tu ia desira ia es nonlegal, es vacua, o es un titulo intervici o interlingual no liada coreta. Es posable ce es un o plu simboles ce no pote es usada en titulos.",
"viewsource": "Vide la orijin",
"viewsourcetext": "Tu pote vide e copia la orijin de esta paje:",
+ "mycustomcssprotected": "Tu no ave permete per edita esta paje CSS.",
+ "mycustomjsprotected": "Tu no ave permete per edita esta paje JavaScript.",
+ "myprivateinfoprotected": "Tu no ave permete per edita tua informa privata.",
+ "mypreferencesprotected": "Tu no ave permete per edita tua preferes.",
+ "ns-specialprotected": "La pajes spesial no pote es editada.",
+ "welcomeuser": "Bonveni, $1!",
"yourname": "Nom de usor:",
"userlogin-yourname": "Nom de usor",
"userlogin-yourname-ph": "Entra tua nom de usor",
"gotaccountlink": "Sinia per entra",
"userlogin-resetpassword-link": "Tu ia oblida tua sinia secreta?",
"userlogin-helplink2": "Aida me per identifia me",
+ "createacct-emailrequired": "Adirije de e-posta",
"createacct-emailoptional": "Adirije de e-posta (elejable)",
"createacct-email-ph": "Entra tua adirije de e-posta",
+ "createacct-another-email-ph": "Entra tua adirije de e-posta",
+ "createaccountreason": "Razona:",
+ "createacct-reason": "Razona:",
"createacct-submit": "Crea tua conta",
+ "createacct-another-submit": "Crea un conta",
"createacct-benefit-heading": "{{SITENAME}} es fabricada par persones como tu.",
"createacct-benefit-body1": "{{PLURAL:$1|edita|editas}}",
"createacct-benefit-body2": "{{PLURAL:$1|paje|pajes}}",
"createacct-benefit-body3": "{{PLURAL:$1|contribuor|contribuores}}",
"loginerror": "Era de entra",
- "loginsuccesstitle": "Entra susedente",
+ "loginsuccesstitle": "Tu ia entra",
"loginsuccess": "'''Tu ia entrada aora a {{SITENAME}} como \"$1\".'''",
- "nosuchuser": "Es no usor con la nom \"$1\".\nEsamina la spele, o [[Special:CreateAccount|crea un conta nova]].",
+ "nosuchuser": "On no ave un usor con la nom \"$1\".\nOn distingui entre leteras major e minor per nomes de usores.\nEsamina la spele, o [[Special:CreateAccount|crea un conta nova]].",
"nosuchusershort": "Es no usor con esta nom \"$1\". Esamina la spele.",
"nouserspecified": "Tu debe indica un nom de usor.",
"wrongpassword": "La sinia de entra no es coreta. Per favore, atenta ancora.",
"wrongpasswordempty": "La sinia de entra es vacua. Per favore, atenta ancora.",
- "passwordtooshort": "Tu sinia secreta no es legal o es tro corta.\nEl debe ave a min {{PLURAL:$1|1 simbol|$1 simboles}} e debe difere de tu nom de usor.",
- "mailmypassword": "Envia la sinia secreta nova par eposta",
+ "passwordtooshort": "Sinias secreta debe ave minima {{PLURAL:$1|1 simbol|$1 simboles}}.",
+ "passwordtoolong": "Sinias secreta no pote ave plu ca {{PLURAL:$1|1 simbol|$1 simboles}}.",
+ "passwordtoopopular": "Sinias secreta comun debe no es usada. Per favore, eleje un sinia plu unica.",
+ "mailmypassword": "Cambia tua sinia secreta",
"passwordremindertitle": "Sinia secreta temporer nova per {{SITENAME}}",
- "passwordremindertext": "Algun (tu, probable, de adirije IP $1)\nia demanda ce nos envia a tu un sinia secreta nova per {{SITENAME}} ($4).\nLa sinia secreta per usor \"$2\" es aora \"$3\".\nTu debe sinia per entra e cambia tu sinia secreta aora.\n\nSi algun otra ce tu ia envia esta demanda a nos, o si tu ia recorda tu sinia secreta e no vole cambia el aora, tu pote iniora esta mesaje e continua usa tu sinia secreta vea.",
+ "passwordremindertext": "Algun (tu, probable, de adirije IP $1)\nia demanda un sinia secreta nova per {{SITENAME}} ($4).\nLa sinia secreta tempora per usor \"$2\" es aora \"$3\". Si esta ia es tua intende, tu debe identifia tu denova per entra e eleje tua sinia nova aora.\nTua sinia tempora va desvalidi en {{PLURAL:$5|un dia|$5 dias}}.\n\nSi algun otra ca tu ia envia esta demanda a nos, o si tu ia recorda tua sinia secreta e no vole cambia lo aora, tu pote iniora esta mesaje e continua usa tua sinia secreta vea.",
"noemail": "No es un adirije de eposta per usor \"$1\".",
"passwordsent": "Un sinia secreta ia es enviada a la adirije de eposta per \"$1\".\nPer favore, sinia per entra ancora pos tu ia reseta el.",
- "eauthentsent": "Un eposta de serti ia es enviada a la adirije de eposta proposada.\nAnte alga otra eposta es enviada a la conta, tu va nesesa segue la instruis en la eposta, per serti ce la conta es vera de tu.",
+ "eauthentsent": "Un eposta de serti ia es enviada a la adirije de eposta spesifada.\nAnte cualce otra epostas es enviada a tua conta, tu va nesesa segue la instruis en la eposta, per serti ce la conta es vera la tua.",
"emailconfirmlink": "Aproba tu adirije de eposta",
+ "accountcreated": "Conta es creada",
"loginlanguagelabel": "Lingua: $1",
"pt-login": "Identifia se",
"pt-login-button": "Identifia tua",
"resetpass-submit-loggedin": "Cambia la sinia secreta",
"resetpass-temp-password": "Sinia secreta tempora:",
"passwordreset": "Reinisia sinia secreta",
+ "passwordreset-username": "Nom de usor:",
+ "passwordreset-domain": "Domina:",
+ "passwordreset-email": "Adirije de e-posta",
+ "passwordreset-invalidemail": "Adirije de e-posta no es valida",
+ "changeemail-submit": "Cambia e-posta",
"bold_sample": "Testo en leteras forte",
"bold_tip": "Testo en leteras forte",
"italic_sample": "Testo en leteras italica",
"sig_tip": "Tu sinia con la primi de la ora",
"hr_tip": "Linia orizonal (usa nonfrecuente)",
"summary": "Soma:",
- "subject": "Sujeto/titulo:",
+ "subject": "Sujeto:",
"minoredit": "Esta es un cambia minor",
"watchthis": "Oserva esta paje",
"savearticle": "Fisa paje",
+ "publishpage": "Publici paje",
+ "publishchanges": "Publica la cambias",
"preview": "Previde",
"showpreview": "Mostra previde",
"showdiff": "Mostra diferes",
"summary-preview": "Previde soma:",
"blockedtitle": "Usor es impedida",
"blockedtext": "'''Tu nom de usor o adirije de IP ia es impedida.'''\n\nLa impedi ia es fada par $1.\nLa razon donada es ''$2''.\n\n* Comensa de impedi: $8\n* Fini de impedi: $6\n* Ci algun intende impedi: $7\n\nTu pote contata $1 o un otra [[{{MediaWiki:Grouppage-sysop}}|dirijor]] per discute esta impedi.\nTu no pote usa la 'envia un eposta a esta usor' sin un adirije de eposta legal es indicada en tu\n[[Special:Preferences|preferis de conta]] e tu no es impedida de usa el.\nTu adirije de IP es aora $3, e la identia de la impedi es #$5.\nPer favore inclui tota esta detales en tu demandas.",
+ "loginreqtitle": "Entra de identia nesesada",
"loginreqlink": "Identifia se",
"newarticle": "(Nova)",
"newarticletext": "Tu ia segue un lia a un paje ce no esista ja.\nPer crea la paje, comensa scrive en la caxa a su\n(vide la [$1 paje de aida] per plu).\nSi tu es asi par era, clica a la boton '''retro''' de tu surfador.",
"hiddencategories": "Esta paje es un membro de {{PLURAL:$1|1 categoria ascondeda|$1 categorias ascondeda}}:",
"nocreatetext": "{{SITENAME}} ave un restringe a la capas per crea pajes nova.\nTu pote vade a retro e edita un paje esistente, o [[Special:UserLogin|sinia per entra o crea un conta]].",
"permissionserrorstext-withaction": "Tua no es permeteda per $2, per la {{PLURAL:$1|razona|razonas}} seguente:",
- "recreate-moveddeleted-warn": "'''Avisa: Tu es recrea un paje ce ia es sutraed en la pasada.'''\nTu debe pensa ce es bon continua edita esta paje.\nLa arcivo de sutraes per esta paje es asi per conveni:",
+ "recreate-moveddeleted-warn": "<strong>Avisa: Tu es recreante un paje cual ia es sutraeda a ante.</strong>\nTu debe pensa si la continua de edita de esta paje conveni.\nLa arcivo de sutraes e moves per esta paje es asi per tua conveni:",
"moveddeleted-notice": "Esta paje ia es sutraeda.\nLa arcivo de sutraes e moves per la paje es furnida a su per refere.",
"viewpagelogs": "Vide la arcivo de esta paje",
"currentrev": "Cambia presente",
"page_last": "final",
"histlegend": "Diferente eleje: Marca la caxas de radio de esta varias per compare e clica entra o la boton a la funda.<br />\n(presente) = difere de la varia presente,\n(presedente) = difere con varia presedente, M = edita minor.",
"history-fieldset-title": "Surfa istoria",
- "histfirst": "Prima",
- "histlast": "Ultima",
+ "histfirst": "La plu vea",
+ "histlast": "La plu nova",
"historysize": "({{PLURAL:$1|1 otuple|$1 otuples}})",
"historyempty": "(vacua)",
"history-feed-title": "Istoria de revises",
"history-feed-item-nocomment": "$1 a $2",
"rev-delundel": "mostra/asconde",
+ "rev-showdeleted": "mostra",
+ "revdelete-show-file-submit": "Si",
+ "revdelete-radio-set": "Ascondeda",
+ "revdelete-radio-unset": "Vidable",
+ "pagehist": "Istoria de paje",
+ "deletedhist": "Istoria sutraeda",
"history-title": "Istoria de cambias de \"$1\"",
"difference-title": "Difere entre revisas de \"$1\"",
"lineno": "Linia $1:",
"searchall": "tota",
"search-showingresults": "{{PLURAL:$4|Resulta <strong>$1</strong> de <strong>$3</strong>|Resultas <strong>$1 - $2</strong> de <strong>$3</strong>}}",
"search-nonefound": "On ave no resultas cual conforma con la demanda.",
+ "powersearch-toggleall": "Tota",
+ "powersearch-togglenone": "Zero",
"preferences": "Preferis",
"mypreferences": "Preferis",
"skin-preview": "Previde",
"timezoneregion-pacific": "Mar Pasifica",
"prefs-files": "Fixes",
"youremail": "Eposta:",
- "username": "Nom de usor:",
- "prefs-memberingroups": "Membro de la {{PLURAL:$1|grupo|grupos}}:",
+ "username": "{{GENDER:$1|Nom de usor}}:",
+ "prefs-memberingroups": "{{GENDER:$2|Membro}} de {{PLURAL:$1|grupo|grupos}}:",
"yourrealname": "Nom vera:",
"yourlanguage": "Lingua:",
"yournick": "Suscrive:",
- "yourgender": "Seso:",
- "gender-male": "Mas",
- "gender-female": "Fema",
+ "yourgender": "Como tu prefere ce tu es descriveda?",
+ "gender-male": "El edita pajes de wiki",
+ "gender-female": "El edita pajes de wiki",
"email": "Eposta",
- "prefs-help-realname": "Tu nom vera no es obligada, ma si tu vole dona tu nom vera, el va es usada per onora tu per tu labora.",
+ "prefs-help-realname": "Tu nom vera no es obligada, ma si tu vole dona tu nom vera, el va es usada per onora tu per tu labora.\n\nTu no debe entra tua nom vera. Ma si tu entra tua noma vera, lo pote es usada per atribui tua laboras a tu.",
"prefs-signature": "Suscrive",
"userrights": "Dirije de la diretos de usores",
"saveusergroups": "Fisa la grupo de usores",
"group-user": "Usores",
"group-sysop": "Dirijores",
"group-all": "(tota)",
- "group-user-member": "Usor",
+ "group-user-member": "{{GENDER:$1|usor}}",
"grouppage-user": "{{ns:project}}:Usores",
"grouppage-sysop": "{{ns:project}}:Dirijores",
"right-writeapi": "Usa de la API de scrive",
"minoreditletter": "m",
"newpageletter": "N",
"boteditletter": "b",
- "rc_categories_any": "Cualce",
+ "rc_categories_any": "Cualce de la elejeda",
"rc-change-size-new": "$1 {{PLURAL:$1|bait|baites}} pos cambia",
"rc-enhanced-expand": "Mostra detalias",
"rc-enhanced-hide": "Asconde detalias",
"wantedpages": "Pajes desirada",
"mostlinked": "Pajes la plu liada",
"mostlinkedcategories": "Categorias a ce es la plu lias",
- "mostlinkedtemplates": "Modeles a ce es la plu lias",
+ "mostlinkedtemplates": "Pajes la plu liada",
"mostcategories": "Pajes con la plu categorias",
"mostimages": "Fixes a ce es la plu lias",
"mostrevisions": "Pajes con la plu revisas",
"longpages": "Pajes longa",
"deadendpages": "Pajes sin sorti",
"protectedpages": "Pajes protejeda",
+ "protectedpages-page": "Paje",
+ "protectedpages-expiry": "Desvalidi",
"listusers": "Lista de usores",
"newpages": "Pajes nova",
"ancientpages": "Pajes la plu vea",
"listgrouprights-group": "Grupo",
"listgrouprights-members": "(lista de membros)",
"emailuser": "Envia un eposta a esta usor",
- "emailfrom": "De",
- "emailto": "Per",
- "watchlist": "Pajes oservada",
+ "emailfrom": "De:",
+ "emailto": "A:",
+ "emailsubject": "Sujeto:",
+ "emailmessage": "Mesaje:",
+ "emailsend": "Envia",
+ "emailsent": "E-posta ia es enviada",
+ "watchlist": "Lista de pajes oservada",
"mywatchlist": "Lista de pajes oservada",
+ "watchlistfor2": "Per $1 $2",
"nowatchlist": "Tu ave no cosas en tu lista oservada",
"addedwatchtext": "La paje \"[[:$1]]\" ia es juntada a tu [[Special:Watchlist|lista de pajes oservada]].\nCambias future a esta paje e se paje de discutes va es listada ala, e la paje va apera en leteras '''forte''' en la [[Special:RecentChanges|lista de cambias resente]] per es plu fasil oservada.\n\nSi tu vole sutrae la paje de tu lista de pajes oservada en la futur, clica a \"no oserva\" en la bara a la lado.",
"removedwatchtext": "La paje \"[[:$1]]\" ia es sutraeda de [[Special:Watchlist|tu lista de pajes oservada]].",
"move-page-legend": "Move paje",
"movepagetext": "Usa la forma a su va cambia la nom de un paje, e va move tota se istoria a la nom nova.\nLa titulo vea va deveni un paje de redirije a la titulo nova.\nLias a la titulo de la paje vea no va es cambiada;\nTu debe vide serta ce es redirijes duple o rompeda.\nTu es respondable per es serta ce la lias va continua vade a la locas intendeda.\n\nNota ce la paje '''no''' va es moveda si es ja un paje a la titulo nova, sin el es vacua o un redirije e no ave un istoria de editas presedente.\nEsta sinifia ce tu pote cambia la nom de un paje a la loca presedente si tu era, e tu no pote scrive supra un paje ce esiste ja.\n\n'''AVISA!'''\nEsta pote es un cambia dramos e nonespetada per un paje poplal;\nper favore, es serta ce tu comprende la resulta de esta ata ante tu continua.",
"movepagetalktext": "La paje de discuta de esta paje va es moveda automatica con el '''eseta si:'''\n*Un paje de discuta ce no es vacua esiste ja su la nom nova, o\n*Tu cambia la indica en la caxa su.\n\nEn esta casos, tu va nesesa move o fusa la paje per mano, si desirada.",
- "newtitle": "A titulo nova:",
+ "newtitle": "Titulo nova:",
"move-watch": "Oserva esta paje",
"movepagebtn": "Move paje",
"pagemovedsub": "La move ia susede",
"recentchanges-legend-plusminus": "(''±123'')",
"recentchanges-submit": "Прикажи",
"rcfilters-activefilters": "Активни филтри",
+ "rcfilters-restore-default-filters": "Поврати основни филтри",
+ "rcfilters-clear-all-filters": "Тргни ги сите филтри",
"rcfilters-search-placeholder": "Филтрирај скорешни промени (прелстајте или почнете да пишувате)",
"rcfilters-invalid-filter": "Неважечки филтер",
+ "rcfilters-empty-filter": "Нема активни филтри. Прикажани се сите придонеси.",
"rcfilters-filterlist-title": "Филтри",
"rcfilters-filterlist-noresults": "Не пронајдов ниеден филтер",
"rcfilters-filtergroup-registration": "Регистрација на корисници",
"revdelete-unrestricted": "အက်ဒမင်များအတွက် ကန့်သတ်ချက်များကို ဖယ်ရှားရန်",
"logentry-suppress-block": "{{GENDER:$4|$3}} အား $5 ကြာအောင် $1 က {{GENDER:$2|ပိတ်ပင်ခဲ့သည်}} $6",
"logentry-move-move": "$3 စာမျက်နှာကို $4 သို့ $1က {{GENDER:$2|ရွှေ့ခဲ့သည်}}",
- "logentry-move-move-noredirect": "$3 á\80\99á\80¾ $4 á\80\9eá\80á\80¯á\80· á\80\85á\80¬á\80\99á\80»á\80\80á\80ºá\80\94á\80¾á\80¬á\80\80á\80á\80¯ á\80\95á\80¼á\80\94á\80ºá\80\8aá\80½á\80¾á\80\94á\80ºá\80¸á\80\81á\80»á\80\94á\80ºá\80\99á\80\91á\80¬á\80¸á\80\95ဲ $1 {{GENDER:$2|က ရွှေ့ခဲ့သည်}}",
+ "logentry-move-move-noredirect": "$3 á\80\99á\80¾ $4 á\80\9eá\80á\80¯á\80· á\80\85á\80¬á\80\99á\80»á\80\80á\80ºá\80\94á\80¾á\80¬á\80\80á\80á\80¯ á\80\95á\80¼á\80\94á\80ºá\80\8aá\80½á\80¾á\80\94á\80ºá\80¸á\80\81á\80»á\80\94á\80ºá\80\99á\80\91á\80¬á\80¸á\80\98ဲ $1 {{GENDER:$2|က ရွှေ့ခဲ့သည်}}",
"logentry-move-move_redir": "$3 စာမျက်နှာကို $4 သို့ ပြန်ညွှန်းပေါ်ထပ်၍ $1 က {{GENDER:$2|ရွှေ့ခဲ့သည်}}",
+ "logentry-move-move_redir-noredirect": "$3 မှ $4 သို့ ပြန်ညွှန်ပေါ်ထပ်အုပ်ကာ ပြန်ညွှန်းချန်မထားဘဲ $1 က {{GENDER:$2|ရွှေ့ခဲ့သည်}}",
"logentry-newusers-create": "အသုံးပြုသူအကောင့် $1 ကို {{GENDER:$2|ဖန်တီးခဲ့သည်}}",
"logentry-newusers-autocreate": "အသုံးပြုသူအကောင့် $1 ကို အလိုအလျောက် {{GENDER:$2|ဖန်တီးခဲ့သည်}}",
"logentry-upload-upload": "$1 သည် $3 ကို {{GENDER:$2|upload တင်ခဲ့သည်}}",
"username": "Username field in [[Special:Preferences]]. $1 is the current user name for GENDER distinction (depends on sex setting).\n\n{{Identical|Username}}",
"prefs-memberingroups": "This message is shown on [[Special:Preferences]], first tab.\n\nParameters:\n* $1 - number of user groups\n* $2 - the username for GENDER\nSee also:\n* {{msg-mw|Prefs-memberingroups-type}}",
"prefs-memberingroups-type": "{{optional}}\nParameters:\n* $1 - list of group names\n* $2 - list of group member names. Label for these is {{msg-mw|Prefs-memberingroups}}",
+ "group-membership-link-with-expiry": "Used as part of a list of user groups, to show the time and date when a user's membership of a group expires. That is, they are a member of that group \"until\" the specified date and time.\n\nParameters:\n* $1 - group name\n* $2 - time and date of expiry\n* $3 - date of expiry\n* $4 - time of expiry",
"prefs-registration": "Used in [[Special:Preferences]].",
"prefs-registration-date-time": "{{optional}}\nUsed in [[Special:Preferences]]. Parameters are:\n* $1 date and time of registration\n* $2 date of registration\n* $3 time of registration",
"yourrealname": "Used in [[Special:Preferences]], first tab.\n{{Identical|Real name}}",
"userrights-changeable-col": "Used when editing user groups in [[Special:Userrights]].\n\nThe message is the head of a column of group assignments.\n\nParameters:\n* $1 - (Optional) for PLURAL use, the number of items in the column following the message. Avoid PLURAL, if your language can do without.",
"userrights-unchangeable-col": "Used when editing user groups in [[Special:Userrights]]. The message is the head of a column of group assignments.\n\nParameters:\n* $1 - (Optional) for PLURAL use, the number of items in the column following the message. Avoid PLURAL, if your language allows that.",
"userrights-irreversible-marker": "{{optional}}\nParameters:\n* $1 - group member",
+ "userrights-expiry-current": "Indicates when a user's membership of a user group expires.\n\nParameters:\n* $1 - time and date of expiry\n* $2 - date of expiry\n* $3 - time of expiry",
+ "userrights-expiry-none": "Indicates that a user's membership of a user group lasts indefinitely, and does not expire.",
+ "userrights-expiry": "Used as a label for a form element which can be used to select an expiry date/time.",
+ "userrights-expiry-existing": "Shows the existing expiry time in the drop down menu underneath the individual user right on Special:UserRights.\n\nParameters:\n* $1 - Date and time of the existing expiry\n* $2 - date of the existing expiry\n* $3 - time of the existing expiry\n\nSee also:\n* {{msg-mw|protect-existing-expiry}}",
+ "userrights-expiry-othertime": "{{Identical|Other time}}",
+ "userrights-expiry-options": "{{doc-important|Be careful: '''1 translation:1 english''', so the first part is the translation and the second part should stay in English.}}\nOptions for the duration of the user group membership. Example: See e.g. [[MediaWiki:Userrights-expiry-options/nl]] if you still don't know how to do it.\n\nSee also {{msg-mw|protect-expiry-options}}.",
+ "userrights-invalid-expiry": "Error message on [[Special:UserRights]].\n\nParameters:\n* $1 - group name",
+ "userrights-expiry-in-past": "Error message on [[Special:UserRights]] when the user types an expiry date that has already passed.\n\nParameters:\n* $1 - group name",
"userrights-conflict": "Shown on [[Special:UserRights]] if the target's rights have been changed since the form was loaded.",
"group": "{{Identical|Group}}",
"group-user": "{{doc-group|user}}\n{{Identical|User}}",
"recentchanges-legend-plusminus": "{{optional}}\nA plus/minus sign with a number for the legend.",
"recentchanges-submit": "Label for submit button in [[Special:RecentChanges]]\n{{Identical|Show}}",
"rcfilters-activefilters": "Title for the filters selection showing the active filters.",
+ "rcfilters-restore-default-filters": "Label for the button that resets filters to defaults",
+ "rcfilters-clear-all-filters": "Title for the button that clears all filters",
"rcfilters-search-placeholder": "Placeholder for the filter search input.",
"rcfilters-invalid-filter": "A label for an invalid filter.",
+ "rcfilters-empty-filter": "Placeholder for the filter list when no filters were chosen.",
"rcfilters-filterlist-title": "Title for the filters list.\n{{Identical|Filter}}",
"rcfilters-filterlist-noresults": "Message showing no results found for searching a filter.",
"rcfilters-filtergroup-registration": "Title for the filter group for editor registration type.",
"rcfilters-filter-bots-label": "Label for the filter for showing edits made by automated tools.\n{{Identical|Bot}}",
"rcfilters-filter-bots-description": "Description for the filter for showing edits made by automated tools.",
"rcfilters-filter-humans-label": "Label for the filter for showing edits made by human editors.",
- "rcfilters-filter-humans-description": " Description for the filter for showing edits made by human editors.",
+ "rcfilters-filter-humans-description": "Description for the filter for showing edits made by human editors.",
"rcfilters-filtergroup-significance": "Title for the filter group for edit significance.\n{{Identical|Significance}}",
"rcfilters-filter-minor-label": "Label for the filter for showing edits marked as minor.",
"rcfilters-filter-minor-description": "Description for the filter for showing edits marked as minor.",
"apisandbox-sending-request": "JavaScript message displayed while the request is being sent.",
"apisandbox-loading-results": "JavaScript message displayed while the response is being read.",
"apisandbox-results-error": "Displayed as an error message from JavaScript when the request failed.\n\nParameters:\n* $1 - Error message",
- "apisandbox-request-url-label": "Label for the text field displaying the URL used to make this request.",
+ "apisandbox-request-selectformat-label": "Label for the format selector on the results page.",
+ "apisandbox-request-format-url-label": "Label for the menu item to select URL format.\n\nSee also:\n* {{msg-mw|apisandbox-request-selectformat-label}}\n* {{msg-mw|apisandbox-request-url-label}}",
+ "apisandbox-request-url-label": "Label for the text field displaying the URL used to make this request.\n\nSee also:\n* {{msg-mw|apisandbox-request-format-url-label}}",
+ "apisandbox-request-format-json-label": "Label for the menu item to select JSON format.\n\nSee also:\n* {{msg-mw|apisandbox-request-selectformat-label}}\n* {{msg-mw|apisandbox-request-json-label}}",
+ "apisandbox-request-json-label": "Label for text field display the request parameters as JSON.\n\nSee also:\n* {{msg-mw|apisandbox-request-format-json-label}}",
"apisandbox-request-time": "Label and value for displaying the time taken by the request.\n\nParameters:\n* $1 - Time taken in milliseconds",
"apisandbox-results-fixtoken": "JavaScript button label",
"apisandbox-results-fixtoken-fail": "Displayed as an error message from JavaScript when a CSRF token could not be fetched.\n\nParameters:\n* $1 - Token type",
"newuserlog-autocreate-entry": "This message is used in the [[:mw:Extension:Newuserlog|new user log]] to mark an account that was created by MediaWiki as part of a [[:mw:Extension:CentralAuth|CentralAuth]] global account.",
"rightslogentry": "This message is displayed in the [[Special:Log/rights|User Rights Log]] when a bureaucrat changes the user groups for a user.\n\nParameters:\n* $1 - the username\n* $2 - list of user groups or {{msg-mw|Rightsnone}}\n* $3 - list of user groups or {{msg-mw|Rightsnone}}\n\nThe name of the bureaucrat who did this task appears before this message.\n\nSimilar to {{msg-mw|Gur-rightslog-entry}}",
"rightslogentry-autopromote": "This message is displayed in the [[Special:Log/rights|User Rights Log]] when a user is automatically promoted to a user group.\n\nParameters:\n* $1 - (Unused)\n* $2 - a comma separated list of old user groups or {{msg-mw|Rightsnone}}\n* $3 - a comma separated list of new user groups",
+ "rightslogentry-temporary-group": "This message is displayed in the [[Special:Log/rights|User Rights Log]] to show that a user group has been allocated temporarily.\n\nParameters:\n* $1 - group name\n* $2 - date and time of expiry\n* $3 - date of expiry\n* $4 - time of expiry",
"feedback-adding": "Progress notice",
"feedback-back": "Button to go back to the previous action in the feedback dialog.\n{{Identical|Back}}",
"feedback-bugcheck": "Message that appears before the user submits a bug, reminding them to check for known bugs.\n\nParameters:\n* $1 - bug list page URL",
"recentchanges-legend-plusminus": "(''±123'')",
"recentchanges-submit": "Показать",
"rcfilters-activefilters": "Активные фильтры",
+ "rcfilters-restore-default-filters": "Восстановить фильтры по умолчанию",
+ "rcfilters-clear-all-filters": "Очистить все фильтры",
"rcfilters-search-placeholder": "Последние изменения фильтров (просмотрите или начните вводить)",
"rcfilters-invalid-filter": "Недопустимый фильтр",
+ "rcfilters-empty-filter": "Нет активных фильтров. Показываются все правки.",
"rcfilters-filterlist-title": "Фильтры",
"rcfilters-filterlist-noresults": "Фильтры не найдены",
"rcfilters-filtergroup-registration": "Регистрация участников",
"badsig": "Loš sirovi potpis.\nProvjerite HTML tagove.",
"badsiglength": "Vaš potpis je predug.\nMora biti manji od $1 {{PLURAL:$1|znaka|znaka|znakova}}.",
"yourgender": "Kako želite da se predstavite?",
- "gender-unknown": "Kad vas spominje, softver će pokušati koristiti srednji rod kad god je to moguće",
+ "gender-unknown": "Kad Vas spominje, softver će pokušati izbjegavati rod kad god je to moguće",
"gender-male": "On uređuje wiki stranice",
"gender-female": "Ona uređuje wiki stranice",
"prefs-help-gender": "Postavljanje ove preferencije nije obavezno.\nSoftver koristi ovu vrijednost kako bi vam se obratio i spomenuo vas drugima koristeći vaš gramatički rod.\nOva informacija će biti javna.",
"recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (glej tudi [[Special:NewPages|seznam novih strani]])",
"recentchanges-submit": "Prikaži",
"rcfilters-activefilters": "Dejavni filtri",
+ "rcfilters-restore-default-filters": "Obnovi privzete filtre",
+ "rcfilters-clear-all-filters": "Počisti vse filtre",
"rcfilters-search-placeholder": "Zadnje spremembe filtrov (prebrskajte ali začnite vnašati)",
"rcfilters-invalid-filter": "Neveljaven filter",
+ "rcfilters-empty-filter": "Ni dejavnih filtrov. Prikazani so vsi prispevki.",
"rcfilters-filterlist-title": "Filtri",
"rcfilters-filterlist-noresults": "Nismo našli nobenega filtra",
"rcfilters-filtergroup-registration": "Registracija uporabnika",
--- /dev/null
+-- 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);
--- /dev/null
+-- Primary key and expiry column in user_groups table
+
+DROP INDEX IF EXISTS /*i*/ug_user_group ON /*_*/user_groups;
+ALTER TABLE /*_*/tag_summary ADD CONSTRAINT pk_user_groups PRIMARY KEY(ug_user, ug_group);
+ALTER TABLE /*_*/tag_summary ADD ug_expiry varchar(14) DEFAULT NULL;
+CREATE INDEX /*i*/ug_expiry ON /*_*/user_groups(ug_expiry);
CREATE TABLE /*_*/user_groups (
ug_user INT NOT NULL REFERENCES /*_*/mwuser(user_id) ON DELETE CASCADE,
ug_group NVARCHAR(255) NOT NULL DEFAULT '',
+ ug_expiry varchar(14) DEFAULT NULL,
+ PRIMARY KEY(ug_user, ug_group)
);
-CREATE UNIQUE clustered INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user, ug_group);
CREATE INDEX /*i*/ug_group ON /*_*/user_groups(ug_group);
+CREATE INDEX /*i*/ug_expiry ON /*_*/user_groups(ug_expiry);
-- Stores the groups the user has once belonged to.
-- The user may still belong to these groups (check user_groups).
--- /dev/null
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.user_groups ADD (
+ug_expiry TIMESTAMP(6) WITH TIME ZONE NULL
+);
+DROP INDEX IF EXISTS &mw_prefix.user_groups_u01;
+ALTER TABLE &mw_prefix.user_groups ADD CONSTRAINT &mw_prefix.user_groups_pk PRIMARY KEY (ug_user,ug_group);
+CREATE INDEX &mw_prefix.user_groups_i02 ON &mw_prefix.user_groups (ug_expiry);
CREATE TABLE &mw_prefix.user_groups (
ug_user NUMBER DEFAULT 0 NOT NULL,
- ug_group VARCHAR2(255) NOT NULL
+ ug_group VARCHAR2(255) NOT NULL,
+ ug_expiry TIMESTAMP(6) WITH TIME ZONE NULL
);
+ALTER TABLE &mw_prefix.user_groups ADD CONSTRAINT &mw_prefix.user_groups_pk PRIMARY KEY (ug_user,ug_group);
ALTER TABLE &mw_prefix.user_groups ADD CONSTRAINT &mw_prefix.user_groups_fk1 FOREIGN KEY (ug_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-CREATE UNIQUE INDEX &mw_prefix.user_groups_u01 ON &mw_prefix.user_groups (ug_user,ug_group);
CREATE INDEX &mw_prefix.user_groups_i01 ON &mw_prefix.user_groups (ug_group);
+CREATE INDEX &mw_prefix.user_groups_i02 ON &mw_prefix.user_groups (ug_expiry);
CREATE TABLE &mw_prefix.user_former_groups (
ufg_user NUMBER DEFAULT 0 NOT NULL,
VALUES (DEFAULT,'Anonymous','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,now(),now());
CREATE TABLE user_groups (
- ug_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
- ug_group TEXT NOT NULL
+ ug_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ ug_group TEXT NOT NULL,
+ ug_expiry TIMESTAMPTZ NULL,
+ PRIMARY KEY(ug_user, ug_group)
);
-CREATE UNIQUE INDEX user_groups_unique ON user_groups (ug_user, ug_group);
+CREATE INDEX user_groups_group ON user_groups (ug_group);
+CREATE INDEX user_groups_expiry ON user_groups (ug_expiry);
CREATE TABLE user_former_groups (
ufg_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
* @ingroup Maintenance
*/
class RefreshLinks extends Maintenance {
+ const REPORTING_INTERVAL = 100;
+
/** @var int|bool */
protected $namespace = false;
$this->addOption( 'dfn-chunk-size', 'Maximum number of existent IDs to check per ' .
'query, default 100000', false, true );
$this->addOption( 'namespace', 'Only fix pages in this namespace', false, true );
+ $this->addOption( 'category', 'Only fix pages in this category', false, true );
+ $this->addOption( 'tracking-category', 'Only fix pages in this tracking category', false, true );
$this->addArg( 'start', 'Page_id to start from, default 1', false );
$this->setBatchSize( 100 );
}
} else {
$this->namespace = (int)$ns;
}
- if ( !$this->hasOption( 'dfn-only' ) ) {
+ if ( ( $category = $this->getOption( 'category', false ) ) !== false ) {
+ $title = Title::makeTitleSafe( NS_CATEGORY, $category );
+ if ( !$title ) {
+ $this->error( "'$category' is an invalid category name!\n", true );
+ }
+ $this->refreshCategory( $category );
+ } elseif ( ( $category = $this->getOption( 'tracking-category', false ) ) !== false ) {
+ $this->refreshTrackingCategory( $category );
+ } elseif ( !$this->hasOption( 'dfn-only' ) ) {
$new = $this->getOption( 'new-only', false );
$redir = $this->getOption( 'redirects-only', false );
$oldRedir = $this->getOption( 'old-redirects-only', false );
private function doRefreshLinks( $start, $newOnly = false,
$end = null, $redirectsOnly = false, $oldRedirectsOnly = false
) {
- $reportingInterval = 100;
$dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
if ( $start === null ) {
$i = 0;
foreach ( $res as $row ) {
- if ( !( ++$i % $reportingInterval ) ) {
+ if ( !( ++$i % self::REPORTING_INTERVAL ) ) {
$this->output( "$i\n" );
wfWaitForSlaves();
}
$i = 0;
foreach ( $res as $row ) {
- if ( !( ++$i % $reportingInterval ) ) {
+ if ( !( ++$i % self::REPORTING_INTERVAL ) ) {
$this->output( "$i\n" );
wfWaitForSlaves();
}
for ( $id = $start; $id <= $end; $id++ ) {
- if ( !( $id % $reportingInterval ) ) {
+ if ( !( $id % self::REPORTING_INTERVAL ) ) {
$this->output( "$id\n" );
wfWaitForSlaves();
}
for ( $id = $start; $id <= $end; $id++ ) {
- if ( !( $id % $reportingInterval ) ) {
+ if ( !( $id % self::REPORTING_INTERVAL ) ) {
$this->output( "$id\n" );
wfWaitForSlaves();
}
* @param string $var Field name
* @param mixed $start First value to include or null
* @param mixed $end Last value to include or null
+ * @return string
*/
private static function intervalCond( IDatabase $db, $var, $start, $end ) {
if ( $start === null && $end === null ) {
return "$var BETWEEN {$db->addQuotes( $start )} AND {$db->addQuotes( $end )}";
}
}
+
+ /**
+ * Refershes links for pages in a tracking category
+ *
+ * @param string $category Category key
+ */
+ private function refreshTrackingCategory( $category ) {
+ $cats = $this->getPossibleCategories( $category );
+
+ if ( !$cats ) {
+ $this->error( "Tracking category '$category' is disabled\n" );
+ // Output to stderr but don't bail out,
+ }
+
+ foreach ( $cats as $cat ) {
+ $this->refreshCategory( $cat );
+ }
+ }
+
+ /**
+ * Refreshes links to a category
+ *
+ * @param Title $category
+ */
+ private function refreshCategory( Title $category ) {
+ $this->output( "Refreshing pages in category '{$category->getText()}'...\n" );
+
+ $dbr = $this->getDB( DB_REPLICA );
+ $conds = [
+ 'page_id=cl_from',
+ 'cl_to' => $category->getDBkey(),
+ ];
+ if ( $this->namespace !== false ) {
+ $conds['page_namespace'] = $this->namespace;
+ }
+
+ $i = 0;
+ $timestamp = '';
+ $lastId = 0;
+ do {
+ $finalConds = $conds;
+ $timestamp = $dbr->addQuotes( $timestamp );
+ $finalConds []=
+ "(cl_timestamp > $timestamp OR (cl_timestamp = $timestamp AND cl_from > $lastId))";
+ $res = $dbr->select( [ 'page', 'categorylinks' ],
+ [ 'page_id', 'cl_timestamp' ],
+ $finalConds,
+ __METHOD__,
+ [
+ 'ORDER BY' => [ 'cl_timestamp', 'cl_from' ],
+ 'LIMIT' => $this->mBatchSize,
+ ]
+ );
+
+ foreach ( $res as $row ) {
+ if ( !( ++$i % self::REPORTING_INTERVAL ) ) {
+ $this->output( "$i\n" );
+ wfWaitForSlaves();
+ }
+ $lastId = $row->page_id;
+ $timestamp = $row->cl_timestamp;
+ self::fixLinksFromArticle( $row->page_id );
+ }
+
+ } while ( $res->numRows() == $this->mBatchSize );
+ }
+
+ /**
+ * Returns a list of possible categories for a given tracking category key
+ *
+ * @param string $categoryKey
+ * @return Title[]
+ */
+ private function getPossibleCategories( $categoryKey ) {
+ $trackingCategories = new TrackingCategories( $this->getConfig() );
+ $cats = $trackingCategories->getTrackingCategories();
+ if ( isset( $cats[$categoryKey] ) ) {
+ return $cats[$categoryKey]['cats'];
+ }
+ $this->error( "Unknown tracking category {$categoryKey}\n", true );
+ }
}
$maintClass = 'RefreshLinks';
--- /dev/null
+DROP TABLE IF EXISTS /*_*/user_groups_tmp;
+
+CREATE TABLE /*$wgDBprefix*/user_groups_tmp (
+ ug_user int unsigned NOT NULL default 0,
+ ug_group varbinary(255) NOT NULL default '',
+ ug_expiry varbinary(14) NULL default NULL,
+ PRIMARY KEY (ug_user, ug_group)
+);
+
+INSERT OR IGNORE INTO /*_*/user_groups_tmp (
+ ug_user, ug_group )
+ SELECT
+ ug_user, ug_group
+ FROM /*_*/user_groups;
+
+DROP TABLE /*_*/user_groups;
+
+ALTER TABLE /*_*/user_groups_tmp RENAME TO /*_*/user_groups;
+
+CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
+CREATE INDEX /*i*/ug_expiry ON /*_*/user_groups (ug_expiry);
-- with particular permissions. A user will have the combined
-- permissions of any group they're explicitly in, plus
-- the implicit '*' and 'user' groups.
- ug_group varbinary(255) NOT NULL default ''
+ ug_group varbinary(255) NOT NULL default '',
+
+ -- Time at which the user group membership will expire. Set to
+ -- NULL for a non-expiring (infinite) membership.
+ ug_expiry varbinary(14) NULL default NULL,
+
+ PRIMARY KEY (ug_user, ug_group)
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);
CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
+CREATE INDEX /*i*/ug_expiry ON /*_*/user_groups (ug_expiry);
-- Stores the groups the user has once belonged to.
-- The user may still belong to these groups (check user_groups).
'resources/src/mediawiki.rcfilters/mw.rcfilters.init.js',
],
'styles' => [
- 'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less',
'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterItemWidget.less',
'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterGroupWidget.less',
'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FiltersListWidget.less',
],
'messages' => [
'rcfilters-activefilters',
+ 'rcfilters-restore-default-filters',
+ 'rcfilters-clear-all-filters',
'rcfilters-search-placeholder',
'rcfilters-invalid-filter',
+ 'rcfilters-empty-filter',
'rcfilters-filterlist-title',
'rcfilters-filterlist-noresults',
'rcfilters-filtergroup-registration',
'dependencies' => [
'oojs-ui',
'mediawiki.Uri',
+ 'oojs-ui.styles.icons-moderation'
],
],
'mediawiki.special' => [
'apisandbox-sending-request',
'apisandbox-loading-results',
'apisandbox-results-error',
+ 'apisandbox-request-selectformat-label',
+ 'apisandbox-request-format-url-label',
'apisandbox-request-url-label',
+ 'apisandbox-request-format-json-label',
+ 'apisandbox-request-json-label',
'apisandbox-request-time',
'apisandbox-results-fixtoken',
'apisandbox-results-fixtoken-fail',
],
],
'mediawiki.special.userrights' => [
+ 'styles' => 'resources/src/mediawiki.special/mediawiki.special.userrights.css',
'scripts' => 'resources/src/mediawiki.special/mediawiki.special.userrights.js',
'dependencies' => [
'mediawiki.notification.convertmessagebox',
* @cfg {string} [group] The group this item belongs to
* @cfg {string} [label] The label for the filter
* @cfg {string} [description] The description of the filter
- * @cfg {boolean} [selected] Filter is selected
* @cfg {boolean} [active=true] The filter is active and affecting the result
* @cfg {string[]} [excludes=[]] A list of filter names this filter, if
* selected, makes inactive.
+ * @cfg {boolean} [default] The default state of this filter
*/
mw.rcfilters.dm.FilterItem = function MwRcfiltersDmFilterItem( name, config ) {
config = config || {};
this.group = config.group || '';
this.label = config.label || this.name;
this.description = config.description;
+ this.default = !!config.default;
- this.selected = !!config.selected;
this.active = config.active === undefined ? true : !!config.active;
this.excludes = config.excludes || [];
+ this.selected = this.default;
};
/* Initialization */
return this.description;
};
+ /**
+ * Get the default value of this filter
+ *
+ * @return {boolean} Filter default
+ */
+ mw.rcfilters.dm.FilterItem.prototype.getDefault = function () {
+ return this.default;
+ };
+
/**
* Get the selected state of this filter
*
this.groups = {};
this.excludedByMap = {};
+ this.defaultParams = {};
+ this.defaultFiltersEmpty = null;
// Events
this.aggregate( { update: 'filterItemUpdate' } );
* @param {Object} filters Filter group definition
*/
mw.rcfilters.dm.FiltersViewModel.prototype.initializeFilters = function ( filters ) {
- var i, filterItem, excludedFilters,
+ var i, filterItem, selectedFilterNames, excludedFilters,
model = this,
items = [],
addToMap = function ( excludedFilters ) {
model.groups[ group ].separator = data.separator || '|';
model.groups[ group ].exclusionType = data.exclusionType || 'default';
+ selectedFilterNames = [];
for ( i = 0; i < data.filters.length; i++ ) {
excludedFilters = data.filters[ i ].excludes || [];
label: data.filters[ i ].label,
description: data.filters[ i ].description,
selected: data.filters[ i ].selected,
- excludes: excludedFilters
+ excludes: excludedFilters,
+ 'default': data.filters[ i ].default
} );
// Map filters and what excludes them
addToMap( excludedFilters );
+ if ( data.type === 'send_unselected_if_any' ) {
+ // Store the default parameter state
+ // For this group type, parameter values are direct
+ model.defaultParams[ data.filters[ i ].name ] = Number( !!data.filters[ i ].default );
+ } else if (
+ data.type === 'string_options' &&
+ data.filters[ i ].default
+ ) {
+ selectedFilterNames.push( data.filters[ i ].name );
+ }
+
model.groups[ group ].filters.push( filterItem );
items.push( filterItem );
}
+
+ if ( data.type === 'string_options' ) {
+ // Store the default parameter group state
+ // For this group, the parameter is group name and value is the names
+ // of selected items
+ model.defaultParams[ group ] = model.sanitizeStringOptionGroup( group, selectedFilterNames ).join( model.groups[ group ].separator );
+ }
} );
this.addItems( items );
+
this.emit( 'initialize' );
};
return result;
};
+ /**
+ * Get the default parameters object
+ *
+ * @return {Object} Default parameter values
+ */
+ mw.rcfilters.dm.FiltersViewModel.prototype.getDefaultParams = function () {
+ return this.defaultParams;
+ };
+
+ /**
+ * Set all filter states to default values
+ */
+ mw.rcfilters.dm.FiltersViewModel.prototype.setFiltersToDefaults = function () {
+ var defaultFilterStates = this.getFiltersFromParameters( this.getDefaultParams() );
+
+ this.updateFilters( defaultFilterStates );
+ };
+
/**
* Analyze the groups and their filters and output an object representing
* the state of the parameters they represent.
*
+ * @param {Object} [filterGroups] An object defining the filter groups to
+ * translate to parameters. Its structure must follow that of this.groups
+ * see #getFilterGroups
* @return {Object} Parameter state object
*/
- mw.rcfilters.dm.FiltersViewModel.prototype.getParametersFromFilters = function () {
+ mw.rcfilters.dm.FiltersViewModel.prototype.getParametersFromFilters = function ( filterGroups ) {
var i, filterItems, anySelected, values,
result = {},
- groupItems = this.getFilterGroups();
+ groupItems = filterGroups || this.getFilterGroups();
$.each( groupItems, function ( group, data ) {
filterItems = data.filters;
* Remove duplicates and make sure to only use valid
* values.
*
+ * @private
* @param {string} groupName Group name
* @param {string[]} valueArray Array of values
* @return {string[]} Array of valid values
return result;
};
+ /**
+ * Check whether the current filter state is set to all false.
+ *
+ * @return {boolean} Current filters are all empty
+ */
+ mw.rcfilters.dm.FiltersViewModel.prototype.areCurrentFiltersEmpty = function () {
+ var currFilters = this.getSelectedState();
+
+ return Object.keys( currFilters ).every( function ( filterName ) {
+ return !currFilters[ filterName ];
+ } );
+ };
+
+ /**
+ * Check whether the default values of the filters are all false.
+ *
+ * @return {boolean} Default filters are all false
+ */
+ mw.rcfilters.dm.FiltersViewModel.prototype.areDefaultFiltersEmpty = function () {
+ var defaultFilters;
+
+ if ( this.defaultFiltersEmpty !== null ) {
+ // We only need to do this test once,
+ // because defaults are set once per session
+ defaultFilters = this.getFiltersFromParameters();
+ this.defaultFiltersEmpty = Object.keys( defaultFilters ).every( function ( filterName ) {
+ return !defaultFilters[ filterName ];
+ } );
+ }
+
+ return this.defaultFiltersEmpty;
+ };
+
/**
* This is the opposite of the #getParametersFromFilters method; this goes over
- * the parameters and translates into a selected/unselected value in the filters.
+ * the given parameters and translates into a selected/unselected value in the filters.
*
* @param {Object} params Parameters query object
* @return {Object} Filter state object
var i, filterItem,
groupMap = {},
model = this,
- base = this.getParametersFromFilters(),
- // Start with current state
- result = this.getSelectedState();
+ base = this.getDefaultParams(),
+ result = {};
params = $.extend( {}, base, params );
} )[ 0 ];
};
+ /**
+ * Set all filters to false or empty/all
+ * This is equivalent to display all.
+ */
+ mw.rcfilters.dm.FiltersViewModel.prototype.emptyAllFilters = function () {
+ var filters = {};
+
+ this.getItems().forEach( function ( filterItem ) {
+ filters[ filterItem.getName() ] = false;
+ } );
+
+ // Update filters
+ this.updateFilters( filters );
+ };
+
/**
* Toggle selected state of items by their names
*
*/
mw.rcfilters.Controller = function MwRcfiltersController( model ) {
this.model = model;
-
// TODO: When we are ready, update the URL when a filter is updated
// this.model.connect( this, { itemUpdate: 'updateURL' } );
};
mw.rcfilters.Controller.prototype.initialize = function () {
var uri = new mw.Uri();
+ // Give the model a full parameter state from which to
+ // update the filters
this.model.updateFilters(
// Translate the url params to filter select states
this.model.getFiltersFromParameters( uri.query )
);
};
+ /**
+ * Reset to default filters
+ */
+ mw.rcfilters.Controller.prototype.resetToDefaults = function () {
+ this.model.setFiltersToDefaults();
+ };
+
+ /**
+ * Empty all selected filters
+ */
+ mw.rcfilters.Controller.prototype.emptyFilters = function () {
+ this.model.emptyAllFilters();
+ };
+
/**
* Update the state of a filter
*
description: mw.msg( 'rcfilters-filter-registered-description' )
},
{
- name: 'hideanon',
+ name: 'hideanons',
label: mw.msg( 'rcfilters-filter-unregistered-label' ),
description: mw.msg( 'rcfilters-filter-unregistered-description' )
}
{
name: 'hidebots',
label: mw.msg( 'rcfilters-filter-bots-label' ),
- description: mw.msg( 'rcfilters-filter-bots-description' )
+ description: mw.msg( 'rcfilters-filter-bots-description' ),
+ 'default': true
},
{
name: 'hidehumans',
label: mw.msg( 'rcfilters-filter-humans-label' ),
- description: mw.msg( 'rcfilters-filter-humans-description' )
+ description: mw.msg( 'rcfilters-filter-humans-description' ),
+ 'default': false
}
]
},
{
name: 'hidepageedits',
label: mw.msg( 'rcfilters-filter-pageedits-label' ),
- description: mw.msg( 'rcfilters-filter-pageedits-description' )
+ description: mw.msg( 'rcfilters-filter-pageedits-description' ),
+ 'default': false
},
{
name: 'hidenewpages',
label: mw.msg( 'rcfilters-filter-newpages-label' ),
- description: mw.msg( 'rcfilters-filter-newpages-description' )
+ description: mw.msg( 'rcfilters-filter-newpages-description' ),
+ 'default': false
},
{
name: 'hidecategorization',
label: mw.msg( 'rcfilters-filter-categorization-label' ),
- description: mw.msg( 'rcfilters-filter-categorization-description' )
+ description: mw.msg( 'rcfilters-filter-categorization-description' ),
+ 'default': true
},
{
name: 'hidelog',
label: mw.msg( 'rcfilters-filter-logactions-label' ),
- description: mw.msg( 'rcfilters-filter-logactions-description' )
+ description: mw.msg( 'rcfilters-filter-logactions-description' ),
+ 'default': false
}
]
}
// Initialize values
controller.initialize();
+ // HACK: Remove old-style filter links for filters handled by the widget
+ // Ideally the widget would handle all filters and we'd just remove .rcshowhide entirely
+ $( '.rcshowhide' ).children().each( function () {
+ // HACK: Interpret the class name to get the filter name
+ // This should really be set as a data attribute
+ var i,
+ name = null,
+ // Some of the older browsers we support don't have .classList,
+ // so we have to interpret the class attribute manually.
+ classes = this.getAttribute( 'class' ).split( ' ' );
+ for ( i = 0; i < classes.length; i++ ) {
+ if ( classes[ i ].substr( 0, 'rcshow'.length ) === 'rcshow' ) {
+ name = classes[ i ].substr( 'rcshow'.length );
+ break;
+ }
+ }
+ if ( name === null ) {
+ return;
+ }
+ if ( name === 'hidemine' ) {
+ // HACK: the span for hidemyself is called hidemine
+ name = 'hidemyself';
+ }
+ // This span corresponds to a filter that's in our model, so remove it
+ if ( model.getItemByName( name ) ) {
+ // HACK: Remove the text node after the span.
+ // If there isn't one, we're at the end, so remove the text node before the span.
+ // This would be unnecessary if we added separators with CSS.
+ if ( this.nextSibling && this.nextSibling.nodeType === Node.TEXT_NODE ) {
+ this.parentNode.removeChild( this.nextSibling );
+ } else if ( this.previousSibling && this.previousSibling.nodeType === Node.TEXT_NODE ) {
+ this.parentNode.removeChild( this.previousSibling );
+ }
+ // Remove the span itself
+ this.parentNode.removeChild( this );
+ }
+ } );
+
$( '.rcoptions form' ).submit( function () {
var $form = $( this );
+++ /dev/null
-.rcshowhidemine {
- // HACK: Hide this filter since it already appears in
- // the new filter drop-down.
- display: none;
-}
opacity: 0.5;
}
+ &-emptyFilters {
+ color: #72777d;
+ }
+
+ &-table {
+ display: table;
+ width: 100%;
+ }
+
+ &-row {
+ display: table-row;
+ }
+
+ &-cell {
+ display: table-cell;
+
+ &:last-child {
+ text-align: right;
+ }
+ }
+
.oo-ui-capsuleItemWidget {
color: #222;
background-color: #fff;
&-popup {
// We have to override OOUI's definition, which is set
// on the inline style of the popup
- margin-top: 2em !important;
+ margin-top: 2.4em !important;
max-width: 650px;
}
* @extends OO.ui.CapsuleMultiselectWidget
*
* @constructor
+ * @param {mw.rcfilters.Controller} controller RCFilters controller
+ * @param {mw.rcfilters.dm.FiltersViewModel} model RCFilters view model
* @param {OO.ui.InputWidget} filterInput A filter input that focuses the capsule widget
* @param {Object} config Configuration object
*/
- mw.rcfilters.ui.FilterCapsuleMultiselectWidget = function MwRcfiltersUiFilterCapsuleMultiselectWidget( filterInput, config ) {
+ mw.rcfilters.ui.FilterCapsuleMultiselectWidget = function MwRcfiltersUiFilterCapsuleMultiselectWidget( controller, model, filterInput, config ) {
// Parent
mw.rcfilters.ui.FilterCapsuleMultiselectWidget.parent.call( this, $.extend( {
$autoCloseIgnore: filterInput.$element
}, config ) );
+ this.controller = controller;
+ this.model = model;
this.filterInput = filterInput;
this.$content.prepend(
.text( mw.msg( 'rcfilters-activefilters' ) )
);
+ this.resetButton = new OO.ui.ButtonWidget( {
+ icon: 'trash',
+ framed: false,
+ title: mw.msg( 'rcfilters-clear-all-filters' ),
+ classes: [ 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-resetButton' ]
+ } );
+
+ this.emptyFilterMessage = new OO.ui.LabelWidget( {
+ label: mw.msg( 'rcfilters-empty-filter' ),
+ classes: [ 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-emptyFilters' ]
+ } );
+
// Events
+ this.resetButton.connect( this, { click: 'onResetButtonClick' } );
+ this.model.connect( this, { itemUpdate: 'onModelItemUpdate' } );
// Add the filterInput as trigger
this.filterInput.$input
.on( 'focus', this.focus.bind( this ) );
+ // Initialize
+ this.$content.append( this.emptyFilterMessage.$element );
+ this.$handle
+ .append(
+ // The content and button should appear side by side regardless of how
+ // wide the button is; the button also changes its width depending
+ // on language and its state, so the safest way to present both side
+ // by side is with a table layout
+ $( '<div>' )
+ .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-table' )
+ .append(
+ $( '<div>' )
+ .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-row' )
+ .append(
+ $( '<div>' )
+ .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-content' )
+ .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-cell' )
+ .append( this.$content ),
+ $( '<div>' )
+ .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-cell' )
+ .append( this.resetButton.$element )
+ )
+ )
+ );
+
this.$element
.addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget' );
+
+ this.reevaluateResetRestoreState();
};
/* Initialization */
/* Methods */
+ mw.rcfilters.ui.FilterCapsuleMultiselectWidget.prototype.onModelItemUpdate = function () {
+ // Re-evaluate reset state
+ this.reevaluateResetRestoreState();
+ };
+
+ /**
+ * Respond to click event on the reset button
+ */
+ mw.rcfilters.ui.FilterCapsuleMultiselectWidget.prototype.onResetButtonClick = function () {
+ if ( this.model.areCurrentFiltersEmpty() ) {
+ // Reset to default filters
+ this.controller.resetToDefaults();
+ } else {
+ // Reset to have no filters
+ this.controller.emptyFilters();
+ }
+ };
+
+ /**
+ * Reevaluate the restore state for the widget between setting to defaults and clearing all filters
+ */
+ mw.rcfilters.ui.FilterCapsuleMultiselectWidget.prototype.reevaluateResetRestoreState = function () {
+ var defaultsAreEmpty = this.model.areDefaultFiltersEmpty(),
+ currFiltersAreEmpty = this.model.areCurrentFiltersEmpty(),
+ hideResetButton = currFiltersAreEmpty && defaultsAreEmpty;
+
+ this.resetButton.setIcon(
+ currFiltersAreEmpty ? 'history' : 'trash'
+ );
+
+ this.resetButton.setLabel(
+ currFiltersAreEmpty ? mw.msg( 'rcfilters-restore-default-filters' ) : ''
+ );
+
+ this.resetButton.toggle( !hideResetButton );
+ this.emptyFilterMessage.toggle( currFiltersAreEmpty );
+ };
+
/**
* @inheritdoc
*/
placeholder: mw.msg( 'rcfilters-search-placeholder' )
} );
- this.capsule = new mw.rcfilters.ui.FilterCapsuleMultiselectWidget( this.textInput, {
+ this.capsule = new mw.rcfilters.ui.FilterCapsuleMultiselectWidget( controller, this.model, this.textInput, {
popup: {
$content: this.filterPopup.$element,
classes: [ 'mw-rcfilters-ui-filterWrapperWidget-popup' ]
*/
mw.rcfilters.ui.FilterWrapperWidget.prototype.onModelInitialize = function () {
var items,
+ wrapper = this,
filters = this.model.getItems();
// Reset
} );
this.capsule.getMenu().addItems( items );
+
+ // Add defaults to capsule. We have to do this
+ // after we added to the capsule menu, since that's
+ // how the capsule multiselect widget knows which
+ // object to add
+ filters.forEach( function ( filterItem ) {
+ if ( filterItem.isSelected() ) {
+ wrapper.addCapsuleItemFromName( filterItem.getName() );
+ }
+ } );
};
/**
var widget = this;
if ( item.isSelected() ) {
- this.capsule.addItemsFromData( [ item.getName() ] );
-
- // Deal with active/inactive capsule filter items
- this.capsule.getItemFromData( item.getName() ).$element
- .toggleClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-item-inactive', !item.isActive() );
+ this.addCapsuleItemFromName( item.getName() );
} else {
this.capsule.removeItemsFromData( [ item.getName() ] );
}
}
} );
};
+
+ /**
+ * Add a capsule item by its filter name
+ *
+ * @param {string} itemName Filter name
+ */
+ mw.rcfilters.ui.FilterWrapperWidget.prototype.addCapsuleItemFromName = function ( itemName ) {
+ var item = this.model.getItemByName( itemName );
+
+ this.capsule.addItemsFromData( [ itemName ] );
+
+ // Deal with active/inactive capsule filter items
+ this.capsule.getItemFromData( itemName ).$element
+ .toggleClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-item-inactive', !item.isActive() );
+ };
}( mediaWiki ) );
/* Images */
/* @noflip */div.floatright, table.floatright {
margin: 0 0 .5em .5em;
- border: 0;
}
div.floatright p {
/* @noflip */div.floatleft, table.floatleft {
margin: 0 .5em .5em 0;
- border: 0;
}
div.floatleft p {
.oo-ui-textInputWidget.oo-ui-widget-enabled > .oo-ui-indicatorElement-indicator.mw-apisandbox-clickable-indicator {
cursor: pointer;
}
+
+.mw-apisandbox-textInputCode .oo-ui-inputWidget-input {
+ font-family: monospace, monospace;
+ font-size: 0.8125em;
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+}
'use strict';
var ApiSandbox, Util, WidgetMethods, Validators,
$content, panel, booklet, oldhash, windowManager, fullscreenButton,
+ formatDropdown,
api = new mw.Api(),
bookletPages = [],
availableFormats = {},
.filter( '[href]:not([target])' )
.attr( 'target', '_blank' );
return $html;
+ },
+
+ /**
+ * Format a request and return a bunch of menu option widgets
+ *
+ * @param {Object} displayParams Query parameters, sanitized for display.
+ * @param {Object} rawParams Query parameters. You should probably use displayParams instead.
+ * @return {OO.ui.MenuOptionWidget[]} Each item's data should be an OO.ui.FieldLayout
+ */
+ formatRequest: function ( displayParams, rawParams ) {
+ var jsonInput,
+ items = [
+ new OO.ui.MenuOptionWidget( {
+ label: Util.parseMsg( 'apisandbox-request-format-url-label' ),
+ data: new OO.ui.FieldLayout(
+ new OO.ui.TextInputWidget( {
+ readOnly: true,
+ value: mw.util.wikiScript( 'api' ) + '?' + $.param( displayParams )
+ } ), {
+ label: Util.parseMsg( 'apisandbox-request-url-label' )
+ }
+ )
+ } ),
+ new OO.ui.MenuOptionWidget( {
+ label: Util.parseMsg( 'apisandbox-request-format-json-label' ),
+ data: new OO.ui.FieldLayout(
+ jsonInput = new OO.ui.TextInputWidget( {
+ classes: [ 'mw-apisandbox-textInputCode' ],
+ readOnly: true,
+ multiline: true,
+ autosize: true,
+ maxRows: 6,
+ value: JSON.stringify( displayParams, null, '\t' )
+ } ), {
+ label: Util.parseMsg( 'apisandbox-request-json-label' )
+ }
+ ).on( 'toggle', function ( visible ) {
+ if ( visible ) {
+ // Call updatePosition instead of adjustSize
+ // because the latter has weird caching
+ // behavior and the former bypasses it.
+ jsonInput.updatePosition();
+ }
+ } )
+ } )
+ ];
+
+ mw.hook( 'apisandbox.formatRequest' ).fire( items, displayParams, rawParams );
+
+ return items;
+ },
+
+ /**
+ * Event handler for when formatDropdown's selection changes
+ */
+ onFormatDropdownChange: function () {
+ var i,
+ menu = formatDropdown.getMenu(),
+ items = menu.getItems(),
+ selectedField = menu.getSelectedItem() ? menu.getSelectedItem().getData() : null;
+
+ for ( i = 0; i < items.length; i++ ) {
+ items[ i ].getData().toggle( items[ i ].getData() === selectedField );
+ }
}
};
}
$.when.apply( $, deferreds ).done( function () {
+ var formatItems, menu, selectedLabel;
+
if ( $.inArray( false, arguments ) !== -1 ) {
windowManager.openWindow( 'errorAlert', {
title: Util.parseMsg( 'apisandbox-submit-invalid-fields-title' ),
query = $.param( displayParams );
+ formatItems = Util.formatRequest( displayParams, params );
+
// Force a 'fm' format with wrappedhtml=1, if available
if ( params.format !== undefined ) {
if ( availableFormats.hasOwnProperty( params.format + 'fm' ) ) {
page.setupOutlineItem = function () {
this.outlineItem.setLabel( mw.message( 'apisandbox-results' ).text() );
};
+
+ if ( !formatDropdown ) {
+ formatDropdown = new OO.ui.DropdownWidget( {
+ menu: { items: [] }
+ } );
+ formatDropdown.getMenu().on( 'choose', Util.onFormatDropdownChange );
+ }
+
+ menu = formatDropdown.getMenu();
+ selectedLabel = menu.getSelectedItem() ? menu.getSelectedItem().getLabel() : '';
+ if ( typeof selectedLabel !== 'string' ) {
+ selectedLabel = selectedLabel.text();
+ }
+ menu.clearItems().addItems( formatItems );
+ menu.chooseItem( menu.getItemFromLabel( selectedLabel ) || menu.getFirstSelectableItem() );
+
+ // Fire the event to update field visibilities
+ Util.onFormatDropdownChange();
+
page.$element.empty()
.append(
new OO.ui.FieldLayout(
- new OO.ui.TextInputWidget( {
- readOnly: true,
- value: mw.util.wikiScript( 'api' ) + '?' + query
- } ), {
- label: Util.parseMsg( 'apisandbox-request-url-label' )
+ formatDropdown, {
+ label: Util.parseMsg( 'apisandbox-request-selectformat-label' )
}
).$element,
+ $.map( formatItems, function ( item ) {
+ return item.getData().$element;
+ } ),
$result
);
ApiSandbox.updateUI();
--- /dev/null
+/*!
+ * Styling for Special:UserRights
+ */
+.mw-userrights-nested {
+ margin-left: 1.2em;
+}
+
+.mw-userrights-nested span {
+ margin-left: 0.3em;
+ display: inline-block;
+ vertical-align: middle;
+}
/*!
* JavaScript for Special:UserRights
*/
-( function () {
+( function ( $ ) {
var convertmessagebox = require( 'mediawiki.notification.convertmessagebox' );
// Replace successbox with notifications
convertmessagebox();
-}() );
+
+ // Dynamically show/hide the expiry selection underneath each checkbox
+ $( '#mw-userrights-form2 input[type=checkbox]' ).on( 'change', function ( e ) {
+ $( '#mw-userrights-nested-' + e.target.id ).toggle( e.target.checked );
+ } ).trigger( 'change' );
+
+ // Also dynamically show/hide the "other time" input under each dropdown
+ $( '.mw-userrights-nested select' ).on( 'change', function ( e ) {
+ $( e.target.parentNode ).find( 'input' ).toggle( $( e.target ).val() === 'other' );
+ } ).trigger( 'change' );
+}( jQuery ) );
'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ),
'wgLanguageCode' => $langCode,
'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ),
- 'wgNamespacesWithSubpages' => [ 0 => isset( $opts['subpage'] ) ],
+ 'wgNamespacesWithSubpages' => [
+ 0 => isset( $opts['subpage'] ),
+ 2 => isset( $opts['subpage'] ),
+ ],
'wgMaxTocLevel' => $maxtoclevel,
'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ),
'wgThumbLimits' => [ self::getOptionValue( 'thumbsize', $opts, 180 ) ],
###
### multiple quote sequences in a line
###
+
!! test
Italics and bold: multiple quote sequences: (2,4,2)
!! options
!! html/*
<p><i>foo'<b>bar</b></i>
</p>
-!!end
-
+!! end
# same html as previous, but wikitext adjusted to match parsoid html2wt
!! test
</p>
!! end
-
!! test
Italics and bold: multiple quote sequences: (2,4,3)
!! options
!! html/*
<p><i>foo'<b>bar</b></i>
</p>
-!!end
-
+!! end
# same html as previous, but wikitext adjusted to match parsoid html2wt
!! test
</p>
!! end
-
!! test
Italics and bold: multiple quote sequences: (2,4,4)
!! options
!! html/*
<p><i>foo'<b>bar'</b></i>
</p>
-!!end
-
+!! end
# same html as previous, but wikitext adjusted to match parsoid html2wt
!! test
</p>
!! end
-
# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
!! test
Italics and bold: multiple quote sequences: (3,4,2)
!! html/parsoid
<p><b>foo'</b>bar<i></i>
</p>
-!!end
+!! end
# same html as previous, but wikitext adjusted to match parsoid html2wt
!! test
Italics and bold: multiple quote sequences: (3,4,2+2) w/ nowiki
-!! options
-parsoid
!! wikitext
-'''<nowiki>foo'</nowiki>'''bar''<nowiki/>''
+'''foo''''bar''<nowiki/>''
!! html/php
<p><b>foo'</b>bar
</p>
!! html/parsoid
-<p><b><span typeof="mw:Nowiki">foo'</span></b>bar<i></i>
+<p><b>foo'</b>bar<i></i>
</p>
!! end
-
# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
!! test
Italics and bold: multiple quote sequences: (3,4,3)
!! html/parsoid
<p><b>foo'</b>bar<b></b>
</p>
-!!end
+!! end
# same html as previous, but wikitext adjusted to match parsoid html2wt
!! test
Italics and bold: multiple quote sequences: (3,4,3+3) w/ nowiki
!! wikitext
-'''<nowiki>foo'</nowiki>'''bar'''<nowiki/>'''
+'''foo''''bar'''<nowiki/>'''
!! html/php
<p><b>foo'</b>bar
</p>
!! html/parsoid
-<p><b><span typeof="mw:Nowiki">foo'</span></b>bar<b></b>
+<p><b>foo'</b>bar<b></b>
</p>
!! end
<p>The <i><a href="/wiki/Main_Page" title="Main Page">Main Page</a>'</i>s talk page.
</p>
!! html/parsoid
-<p>The <i><a rel="mw:WikiLink" href="Main_Page" title="Main Page">Main Page</a>'</i>s talk page.</p>
+<p>The <i><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a>'</i>s talk page.</p>
!! end
!! test
!! html/php+tidy
<p><a rel="nofollow" class="external free" href="http://foo.com/a%7Cb">http://foo.com/a%7Cb</a></p>
!! html/parsoid
-<p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
+<p><a rel="mw:ExtLink" href="http://foo.com/a%7Cb" about="#mwt1"
typeof="mw:Transclusion"
-data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a&#124;b"}},"i":0}}]}'>http://foo.com/a|b</a></p>
+data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a&#124;b"}},"i":0}}]}'>http://foo.com/a%7Cb</a></p>
!! end
!! test
<p><a rel="mw:ExtLink" href="news:'a'b">news:'a'b</a><i>c</i>d e</p>
!! end
+!! test
+External links: with entity
+!! wikitext
+[http:// www.librarieswithoutborders.org Libraries without borders]
+!! html/php
+<p><a rel="nofollow" class="external text" href="http://+www.librarieswithoutborders.org">Libraries without borders</a>
+</p>
+!! html/parsoid
+<p><a rel="mw:ExtLink" href="http://+www.librarieswithoutborders.org" data-parsoid='{"a":{"href":"http://+www.librarieswithoutborders.org"},"sa":{"href":"http://&#x20;www.librarieswithoutborders.org"}}'>Libraries without borders</a></p>
+!! end
+
!! test
External links: Lone protocols are never linked (T105697)
!! wikitext
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a></p>
-<p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid[]=bar">http://example.com/index.php?foozoid[]=bar</a></p>
+<p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid%5B%5D=bar" data-parsoid='{"stx":"url","a":{"href":"http://example.com/index.php?foozoid%5B%5D=bar"},"sa":{"href":"http://example.com/index.php?foozoid&#x5B;&#x5D;=bar"}}'>http://example.com/index.php?foozoid%5B%5D=bar</a></p>
!! end
!! test
!! html/parsoid
<table><tbody>
<tr>
-<td data-parsoid='{"startTagSrc":"| ","attrSepSrc":"|","autoInsertedEnd":true}'><a rel="mw:ExtLink" href="ftp://|x||"></a>" onmouseover="alert(document.cookie)">test</td></tr></tbody></table>
+<td data-parsoid='{"startTagSrc":"| ","attrSepSrc":"|","autoInsertedEnd":true}'>[<a rel="mw:ExtLink" href="ftp://%7Cx" data-parsoid='{"stx":"url","a":{"href":"ftp://%7Cx"},"sa":{"href":"ftp://|x"}}'>ftp://%7Cx</a></td><td data-parsoid='{"stx_v":"row","autoInsertedEnd":true}'>]" onmouseover="alert(document.cookie)">test</td></tr></tbody></table>
!! end
!! test
<p><a href="/wiki/Main_Page" title="Main Page">|The|Main|Page|</a>
</p>
!! html/parsoid
-<p><a rel="mw:WikiLink" href="Main_Page" title="Main Page">|The|Main|Page|</a></p>
+<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">|The|Main|Page|</a></p>
!! end
!! test
<p><a rel="mw:WikiLink" href="./Lista_d''e_paise_d''o_munno" title="Lista d''e paise d''o munno">Lista d''e paise d''o munno</a></p>
!! end
+!! test
+Link containing double quotes and spaces
+!! wikitext
+[[Cool "Gator"]]
+!! html/php
+<p><a href="/index.php?title=Cool_%22Gator%22&action=edit&redlink=1" class="new" title="Cool "Gator" (page does not exist)">Cool "Gator"</a>
+</p>
+!! html/parsoid
+<p><a rel="mw:WikiLink" href="./Cool_%22Gator%22" title='Cool "Gator"'>Cool "Gator"</a></p>
+!! end
+
!! test
Link containing double-single-quotes '' in text (bug 4598 sanity check)
!! wikitext
<p>Some <a href="/index.php?title=Link&action=edit&redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!
</p>
!! html/parsoid
-<p>Some <a rel="mw:WikiLink" href="Link" title="Link">pretty <i>italics</i> and stuff</a>!</p>
+<p>Some <a rel="mw:WikiLink" href="./Link" title="Link">pretty <i>italics</i> and stuff</a>!</p>
!! end
!! test
</p>
!! html/parsoid
<p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}]}'><a href="./File:Denys_Savchenko_''Pentecoste''.jpg"><img resource="./File:Denys_Savchenko_''Pentecoste''.jpg" src="./Special:FilePath/Denys_Savchenko_''Pentecoste''.jpg" height="220" width="220"/></a></span></p>
-<p><a rel="mw:WikiLink" href="''Pentecoste''" title="''Pentecoste''">''Pentecoste''</a></p>
-<p><a rel="mw:WikiLink" href="''Pentecoste''" title="''Pentecoste''">Pentecoste</a></p>
-<p><a rel="mw:WikiLink" href="''Pentecoste''" title="''Pentecoste''"><i>Pentecoste</i></a></p>
+<p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''">''Pentecoste''</a></p>
+<p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''">Pentecoste</a></p>
+<p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''"><i>Pentecoste</i></a></p>
!! end
!! test
<p>Piped link to URL: [<a rel="nofollow" class="external text" href="http://www.example.com%7Can">example URL</a>]
</p>
!! html/parsoid
-<p>Piped link to URL: [<a rel="mw:ExtLink" href="http://www.example.com|an">example URL</a>]</p>
+<p>Piped link to URL: [<a rel="mw:ExtLink" href="http://www.example.com%7Can" data-parsoid='{"a":{"href":"http://www.example.com%7Can"},"sa":{"href":"http://www.example.com|an"}}'>example URL</a>]</p>
!! end
!! test
Handle title parsing for subpages
!! options
title=[[/123123]]
+subpage
!! wikitext
123
+!! html/php
+<p>123
+</p>
!! html/parsoid
<p>123</p>
!! end
-## FIXME: Add a working php section here
+!! article
+User:Test/123
+!! text
+test 123
+!! endarticle
+
!! test
Link to a subpage from a namespace other than main
!! options
-title=[[User:test]]
+title=[[User:Test]]
+subpage
!! wikitext
[[/123]]
+!! html/php
+<p><a href="/wiki/User:Test/123" title="User:Test/123">/123</a>
+</p>
!! html/parsoid
<p><a rel="mw:WikiLink" href="./User:Test/123" title="User:Test/123" data-parsoid='{"stx":"simple","a":{"href":"./User:Test/123"},"sa":{"href":"/123"}}'>/123</a></p>
!! end
!! test
Purely hash wikilink
!! options
-title=[[User:test/123]]
+title=[[User:Test/123]]
+subpage
!! wikitext
[[#a|b]]
!! html/php
!! test
1. Interaction of linktrail and template encapsulation
-!! options
-parsoid
!! wikitext
{{echo|[[Foo]]}}l
-!! html
-<p><a rel="mw:WikiLink" href="Foo" title="Foo" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Foo]]"}},"i":0}},"l"]}'>Fool</a></p>
+!! html/parsoid
+<p><a rel="mw:WikiLink" href="./Foo" title="Foo" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Foo]]"}},"i":0}},"l"]}'>Fool</a></p>
!! end
!! test
!! options
parsoid=html2wt,html2html
!! html/parsoid
-<p><a rel="mw:WikiLink" href="Apple" title="Apple">apple</a>s</p>
+<p><a rel="mw:WikiLink" href="./Apple" title="Apple">apple</a>s</p>
!! wikitext
[[apple]]<nowiki/>s
!! end
language=is
parsoid=html2wt,html2html
!! html/parsoid
-<p>Aðrir mótmælenda<a rel="mw:WikiLink" href="Söfnuður" title="Söfnuður">söfnuður</a></p>
+<p>Aðrir mótmælenda<a rel="mw:WikiLink" href="./Söfnuður" title="Söfnuður">söfnuður</a></p>
!! wikitext
Aðrir mótmælenda<nowiki/>[[söfnuður]]
!! end
!! test
Parsoid: Scoped parsing should handle mixed transclusions and plain text
-!! options
-parsoid
!! wikitext
[[Foo|{{echo|a}} b {{echo|c}}]]
-!! html
-<p><a rel="mw:WikiLink" href="Foo" title="Foo"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}}]}'>a</span> b <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"c"}},"i":0}}]}'>c</span></a></p>
+!! html/parsoid
+<p><a rel="mw:WikiLink" href="./Foo" title="Foo"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}}]}'>a</span> b <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"c"}},"i":0}}]}'>c</span></a></p>
!! end
!! test
!! options
parsoid={ "modes": ["html2wt"], "suppressErrors": true }
!! html/parsoid
-<p>He&nbsp;llo <a href="Foo" rel="mw:WikiLink">He&nbsp;llo</a></p>
-<p>He&nbsp;llo <a href="He&nbsp;llo" rel="mw:WikiLink">He&nbsp;llo</a></p>
+<p>He&nbsp;llo <a href="./Foo" rel="mw:WikiLink">He&nbsp;llo</a></p>
+<p>He&nbsp;llo <a href="./He&nbsp;llo" rel="mw:WikiLink">He&nbsp;llo</a></p>
!! wikitext
He&nbsp;llo [[Foo|He&nbsp;llo]]
!! wikitext
{{DISPLAYTITLE:''{{PAGENAME}}''}}
!! html/parsoid
-<meta property="mw:PageProp/displaytitle" content="Main Page" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"src":"{{DISPLAYTITLE:''{{PAGENAME}}''}}"}' data-mw='{"attribs":[[{"txt":"content"},{"html":"<i data-parsoid='{\"dsr\":[15,31,2,2]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[17,29,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAME\",\"function\":\"pagename\"},\"params\":{},\"i\":0}}]}'>Main Page</span></i>"}]]}'/>
+<meta property="mw:PageProp/displaytitle" content="Main Page" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"src":"{{DISPLAYTITLE:''{{PAGENAME}}''}}"}' data-mw='{"attribs":[[{"txt":"content"},{"html":"<i data-parsoid='{\"dsr\":[15,31,2,2]}'><span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[17,29,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAME\",\"function\":\"pagename\"},\"params\":{},\"i\":0}}]}'>Main Page</span></i>"}]]}'/>
!! end
!! test
<p><a href="/wiki/Main_Page" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
</p>
!! html/parsoid
-<p><span class="mw-default-size" typeof="mw:Image"><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
+<p><span class="mw-default-size" typeof="mw:Image"><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
!! end
# parsoid bug 49293 (part 1)
<p><a href="/wiki/Main_Page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
</p>
!! html/parsoid
-<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
+<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
!! end
!! test
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
!! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
!! end
!! test
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="alttext" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
!! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="Main_Page"><img alt="alttext" resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./Main_Page"><img alt="alttext" resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
!! end
!! test
<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
!! html/parsoid
-<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="Main_Page" title="Main Page">Main Page</a></figcaption></figure>
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure>
!! end
!! test
<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
!! html/parsoid
-<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img alt="Altitude" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="Main_Page" title="Main Page">Main Page</a></figcaption></figure>
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img alt="Altitude" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure>
!! end
!! test
<p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a href="/wiki/Main_Page" title="Main Page">this</a> is just an ordinary link.
</p>
!! html/parsoid
-<p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a rel="mw:WikiLink" href="Main_Page" title="Main Page">this</a> is just an ordinary link.</p>
+<p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">this</a> is just an ordinary link.</p>
!! end
!! test
<div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/Foo" title="Foo"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/Archivo:Foobar.jpg" class="internal" title="Aumentar"></a></div>caption</div></div></div>
!! html/parsoid
-<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="Foo"><img resource="./Archivo:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="./Foo"><img resource="./Archivo:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
!! end
!! test
</p><p><a href="/wiki/Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage test/1/2/subpage</a>
</p>
!! html/parsoid
-<p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">subpage</a></p>
-<p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage_test/1/2/subpage</a></p>
+<p><a rel="mw:WikiLink" href="./Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">subpage</a></p>
+<p><a rel="mw:WikiLink" href="./Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage_test/1/2/subpage</a></p>
!! end
!! test
Bar
</p>
!! html/parsoid
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Category:Baz]]"}},"i":0}}]}'/></p>
-<link rel="mw:PageProp/Category" href="Category:Baz"/>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Category:Baz]]"}},"i":0}}]}'/></p>
+<link rel="mw:PageProp/Category" href="./Category:Baz"/>
!! end
## We used to, but no longer wt2wt this test since the default serializer
!! wikitext
<div title="{}">Foo</div>
!! html/php
-<div title="{}">Foo</div>
+<div title="{}">Foo</div>
!! html/parsoid
<div title="{}">Foo</div>
Bug 2304: HTML attribute safety (safe template; regression bug 2309)
!! wikitext
<div title="{{test}}"></div>
-!! html
+!! html/php
<div title="This is a test template"></div>
+!! html/parsoid
+<div title="This is a test template" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":"This is a test template"},"sa":{"title":"{{test}}"}}' data-mw='{"attribs":[[{"txt":"title"},{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[12,20,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"test\",\"href\":\"./Template:Test\"},\"params\":{},\"i\":0}}]}'>This is a test template</span>"}]]}'></div>
!! end
# Parsoid has enough context to handle this case
Bug 2304: HTML attribute safety (dangerous style template; 2309)
!! wikitext
<div style="{{dangerous style attribute}}"></div>
-!! html
+!! html/php
<div style="/* insecure input */"></div>
+!! html/parsoid
+<div style="/* insecure input */" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"{{dangerous style attribute}}"}}' data-mw='{"attribs":[[{"txt":"style"},{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[12,41,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"dangerous style attribute\",\"href\":\"./Template:Dangerous_style_attribute\"},\"params\":{},\"i\":0}}]}'>border-size: expression(alert(document.cookie))</span>"}]]}'></div>
!! end
!! test
Bug 2304: HTML attribute safety (safe parameter; 2309)
!! wikitext
{{div style|width: 200px}}
-!! html
+!! html/php
<div style="float: right; width: 200px">Magic div</div>
+!! html/parsoid
+<div style="float: right; width: 200px" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","a":{"style":"float: right; width: 200px"},"sa":{"style":"float: right; {{{1}}}"},"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"div style","href":"./Template:Div_style"},"params":{"1":{"wt":"width: 200px"}},"i":0}}]}'>Magic div</div>
!! end
!! test
Bug 2304: HTML attribute safety (unsafe parameter; 2309)
!! wikitext
{{div style|width: expression(alert(document.cookie))}}
-!! html
+!! html/php
<div style="/* insecure input */">Magic div</div>
+!! html/parsoid
+<div style="/* insecure input */" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"float: right; {{{1}}}"},"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"div style","href":"./Template:Div_style"},"params":{"1":{"wt":"width: expression(alert(document.cookie))"}},"i":0}}]}'>Magic div</div>
!! end
+## Parsoid output here differs; needs investigation.
!! test
Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
!! wikitext
!! end
+## Parsoid output here differs; needs investigation.
!! test
Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
!! wikitext
!! end
-
!! test
Bug 2304: HTML attribute safety (ISBN)
!! wikitext
Bug 3244: HTML attribute safety (extension; safe)
!! wikitext
<div style="<nowiki>background:blue</nowiki>"></div>
-!! html
+!! html/php
<div style="background:blue"></div>
+!! html/parsoid
+<div style="background:blue" data-parsoid='{"stx":"html","a":{"style":"background:blue"},"sa":{"style":"<nowiki>background:blue</nowiki>"}}'></div>
!! end
!! test
Bug 3244: HTML attribute safety (extension; unsafe)
!! wikitext
<div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
-!! html
+!! html/php
<div style="/* insecure input */"></div>
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"<nowiki>border-left:expression(alert(document.cookie))</nowiki>"}}'></div>
!! end
# More MSIE fun discovered by Tom Gilder
MSIE CSS safety test: spurious slash
!! wikitext
<div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
-!! html
+!! html/php
<div style="/* insecure input */">evil</div>
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:u\\rl(javascript:alert('boo'))"}}'>evil</div>
!! end
!! test
MSIE CSS safety test: hex code
!! wikitext
<div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
-!! html
+!! html/php
<div style="/* insecure input */">evil</div>
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:u\\72l(javascript:alert('boo'))"}}'>evil</div>
!! end
!! test
MSIE CSS safety test: comment in url
!! wikitext
<div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
-!! html
+!! html/php
<div style="background-image:u rl(javascript:alert('boo'))">evil</div>
+!! html/parsoid
+<div style="background-image:u rl(javascript:alert('boo'))" data-parsoid='{"stx":"html","a":{"style":"background-image:u rl(javascript:alert('boo'))"},"sa":{"style":"background-image:u/**/rl(javascript:alert('boo'))"}}'>evil</div>
!! end
!! test
MSIE CSS safety test: comment in expression
!! wikitext
<div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
-!! html
+!! html/php
<div style="background-image:expres sion(alert('boo4'))">evil4</div>
+!! html/parsoid
+<div style="background-image:expres sion(alert('boo4'))" data-parsoid='{"stx":"html","a":{"style":"background-image:expres sion(alert('boo4'))"},"sa":{"style":"background-image:expres/**/sion(alert('boo4'))"}}'>evil4</div>
!! end
!! test
CSS safety test (all browsers): vertical tab (bug 55332 / CVE-2013-4567)
!! wikitext
<p style="font-size: 100px; background-image:url\b(https://www.google.com/images/srpr/logo6w.png)">A</p>
-!! html
+!! html/php
<p style="/* invalid control char */">A</p>
+!! html/parsoid
+<p style="/* invalid control char */" data-parsoid='{"stx":"html","a":{"style":"/* invalid control char */"},"sa":{"style":"font-size: 100px; background-image:url\\b(https://www.google.com/images/srpr/logo6w.png)"}}'>A</p>
!! end
!! test
!! wikitext
<p style="font-size: 100px; color: expression((title='XSSed'),'red')">A</p>
<div style="top:EXPRESSION(alert())">B</div>
-!! html
+!! html/php
<p style="/* insecure input */">A</p>
<div style="/* insecure input */">B</div>
+!! html/parsoid
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expression((title='XSSed'),'red')"}}'>A</p>
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"top:EXPRESSION(alert())"}}'>B</div>
!! end
!! test
!! wikitext
<div style="background-image:uʀʟ(javascript:alert())">A</div>
<p style="font-size: 100px; color: expʀessɪoɴ((title='XSSed'),'red')">B</p>
-!! html
+!! html/php
<div style="/* insecure input */">A</div>
<p style="/* insecure input */">B</p>
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:uʀʟ(javascript:alert())"}}'>A</div>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expʀessɪoɴ((title='XSSed'),'red')"}}'>B</p>
!! end
!! test
<div style="background-image:url⁽javascript:alert())">A</div>
<div style="background-image:url₍javascript:alert())">B</div>
<p style="font-size: 100px; color: expressioⁿ((title='XSSed'),'red')">C</p>
-!! html
+!! html/php
<div style="/* insecure input */">A</div>
<div style="/* insecure input */">B</div>
<p style="/* insecure input */">C</p>
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:url⁽javascript:alert())"}}'>A</div>
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:url₍javascript:alert())"}}'>B</div>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expressioⁿ((title='XSSed'),'red')"}}'>C</p>
!! end
-# FIXME: Parsoid fails to sanitize this! See T58846.
!! test
Opera -o-link CSS
+!! options
+parsoid=wt2html,html2html
!! wikitext
<div
title="data:text/html,<img src=1 onerror=alert(1)>"
style="-o-link:attr(title);-o-link-source:current">X</div>
-!! html
+!! html/php
<div title="data:text/html,<img src=1 onerror=alert(1)>" style="/* insecure input */">X</div>
+!! html/parsoid
+<div title="data:text/html,<img src=1 onerror=alert(1)>" style="/* insecure input */" data-parsoid='{"stx":"html","a":{"title":"data:text/html,<img src=1 onerror=alert(1)>","style":"/* insecure input */"},"sa":{"title":"&#100;&#97;&#116;&#97;&#58;&#116;&#101;&#120;&#116;&#47;&#104;&#116;&#109;&#108;&#44;&#60;&#105;&#109;&#103;&#32;&#115;&#114;&#99;&#61;&#49;&#32;&#111;&#110;&#101;&#114;&#114;&#111;&#114;&#61;&#97;&#108;&#101;&#114;&#116;&#40;&#49;&#41;&#62;","style":"-o-link:attr(title);-o-link-source:current"}}'>X</div>
!! end
!! test
<p style="font-size: 100px; color: expresﹽion((title='XSSed'),'red')">E</p>
<p style="font-size: 100px; color: expresﹼion((title='XSSed'),'red')">F</p>
<p style="font-size: 100px; color: expresーion((title='XSSed'),'red')">G</p>
-!! html
+!! html/php
<p style="/* insecure input */">A</p>
<p style="/* insecure input */">B</p>
<p style="/* insecure input */">C</p>
<p style="/* insecure input */">F</p>
<p style="/* insecure input */">G</p>
+!! html/parsoid
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expres〱ion((title='XSSed'),'red')"}}'>A</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresゝion((title='XSSed'),'red')"}}'>B</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresーion((title='XSSed'),'red')"}}'>C</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresヽion((title='XSSed'),'red')"}}'>D</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresﹽion((title='XSSed'),'red')"}}'>E</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresﹼion((title='XSSed'),'red')"}}'>F</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresーion((title='XSSed'),'red')"}}'>G</p>
!! end
!! test
!! end
-
!! test
Expansion of multi-line templates in attribute values (bug 6255 sanity check)
!! wikitext
###
### Parser hooks (see tests/parser/parserTestsParserHook.php for the <tag> extension)
###
+
!! test
Parser hook: empty input
!! wikitext
xxx
!! end
-
!! test
Handling of 
 in URLs
!! wikitext
<ul><li><ul><li> <a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul></li></ul>
!! html/parsoid
-<ul><li><ul><li> <a rel="mw:ExtLink" href="irc://
-a">irc://
-a</a></li></ul></li></ul>
+<ul><li><ul><li> <a rel="mw:ExtLink" href="irc://%0Aa" data-parsoid='{"stx":"url","a":{"href":"irc://%0Aa"},"sa":{"href":"irc://&#x0A;a"}}'>irc://%0Aa</a></li></ul></li></ul>
!! end
!! test
<ul><li><ul><li> <a rel="mw:ExtLink" href="irc://%0Aa">irc://%0Aa</a></li></ul></li></ul>
!! end
-
# The PHP parser strips the empty tags out for giggles; parsoid doesn't.
!! test
5 quotes, code coverage +1 line
</ul>
!! end
+!! test
+Gallery override link with absolute external link with LanguageConverter
+!! options
+language=zh
+!! input
+<gallery>
+File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
+</gallery>
+!! result
+<ul class="gallery mw-gallery-traditional">
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
+ <div class="gallerytext">
+<p>caption
+</p>
+ </div>
+ </div></li>
+</ul>
+
+!! end
+
!! test
Gallery override link with malicious javascript (T36852)
!! options
!! html/parsoid
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span typeof="mw:Image" style="vertical-align: middle; display: inline-block;"><a href="./"_onclick="alert('malicious_javascript_code!');"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span typeof="mw:Image" style="vertical-align: middle; display: inline-block;"><a href="./%22_onclick=%22alert('malicious_javascript_code!');"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext"></div></li>
</ul>
!! end
</ul>
!! end
+!! test
+Serialize gallery without attrs in data-mw
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "nativeGallery": true
+}
+!! html/parsoid
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","body":{}}'>
+<li class="gallerycaption">123</li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span style="vertical-align: middle; display: inline-block;">File:Test.png</span></div><div class="gallerytext"></div></li>
+</ul>
+!! wikitext
+<gallery caption="123">
+File:Test.png
+</gallery>
+!! end
+
!! test
HTML Hex character encoding (spells the word "JavaScript")
!! options
!!end
-
# Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
!! test
Images with the "|" character in the comment
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&param2=%7Cx">external</a> URL</div></div></div>
!! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>An <a rel="mw:ExtLink" href="http://test/?param1=|left|&param2=|x">external</a> URL</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>An <a rel="mw:ExtLink" href="http://test/?param1=%7Cleft%7C&param2=%7Cx" data-parsoid='{"a":{"href":"http://test/?param1=%7Cleft%7C&param2=%7Cx"},"sa":{"href":"http://test/?param1=|left|&param2=|x"}}'>external</a> URL</figcaption></figure>
!! end
!! test
!! html/php
cat=分类 sort=
!! html/parsoid
-<p><a rel="mw:WikiLink" href="A" title="A">A</a></p>
-<link rel="mw:PageProp/Category" href="Category:分类"/>
+<p><a rel="mw:WikiLink" href="./A" title="A">A</a></p>
+<link rel="mw:PageProp/Category" href="./Category:分类"/>
!! end
!! test
# Since Parsoid is starting to emit canonical wikitext for links,
# [http://example.com http://example.com] will not RT back to that
# form anymore.
+!! test
+HTML markups with conversion syntax in attribs, nested in other conversion blocks
+!! options
+language=zh variant=zh-cn
+!! wikitext
+-{zh;zh-hans;zh-hant|<span title="-{X}-">A</span>}-
+!! html
+<p><span title="X">A</span>
+</p>
+!! end
+
+!! test
+HTML markups with conversion syntax in attribs, nested in other conversion blocks (not working yet)
+!! options
+language=zh variant=zh-cn disabled
+!! wikitext
+-{<span title="-{X}-">A</span>}-
+!! html
+<p><span title="X">A</span>
+</p>
+!! end
+
!! test
Proper conversion of text in external links
!! options
!! end
-!!test
-Gallery override link with absolute external link (bug 34852)
-!! wikitext
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
-</gallery>
-!! html
-<ul class="gallery mw-gallery-traditional">
- <li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
- <div class="gallerytext">
-<p>caption
-</p>
- </div>
- </div></li>
-</ul>
-
-!! end
-
-!! test
-Gallery override link with absolute external link with LanguageConverter
-!! options
-language=zh
-!! input
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
-</gallery>
-!! result
-<ul class="gallery mw-gallery-traditional">
- <li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
- <div class="gallerytext">
-<p>caption
-</p>
- </div>
- </div></li>
-</ul>
-
-!! end
-
-!!test
-Gallery override link with malicious javascript (bug 34852)
-!! wikitext
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
-</gallery>
-!! html
-<ul class="gallery mw-gallery-traditional">
- <li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
- <div class="gallerytext">
-<p>caption
-</p>
- </div>
- </div></li>
-</ul>
-
-!! end
-
-!!test
-Gallery with invalid title as link (bug 43964)
-!! wikitext
-<gallery>
-File:foobar.jpg|link=<
-</gallery>
-!! html
-<ul class="gallery mw-gallery-traditional">
- <li class="gallerybox" style="width: 155px"><div style="width: 155px">
- <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
- <div class="gallerytext">
- </div>
- </div></li>
-</ul>
-
-!! end
-
!!test
Language parser function
!! wikitext
<p>A <span about="#mwt2" class="mw-ref" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="./Main_Page#cite_note-1"><span class="mw-reflink-text">[1]</span></a></span></p>
<ol class="mw-references" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{}}'>
-<li about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">This is a <b><a rel="mw:WikiLink" href="Bolded_link" title="Bolded link">bolded link</a></b> and this is a <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span>
+<li about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">This is a <b><a rel="mw:WikiLink" href="./Bolded_link" title="Bolded link">bolded link</a></b> and this is a <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span>
</span></li>
</ol>
!!end
];
}
+ public function testReplaceMsg() {
+ global $wgContLang;
+
+ $messageCache = MessageCache::singleton();
+ $message = 'go';
+ $uckey = $wgContLang->ucfirst( $message );
+ $oldText = $messageCache->get( $message ); // "Ausführen"
+
+ $dbw = wfGetDB( DB_MASTER );
+ $dbw->startAtomic( __METHOD__ ); // simulate request and block deferred updates
+ $messageCache->replace( $uckey, 'Allez!' );
+ $this->assertEquals( 'Allez!',
+ $messageCache->getMsgFromNamespace( $uckey, 'de' ),
+ 'Updates are reflected in-process immediately' );
+ $this->assertEquals( 'Allez!',
+ $messageCache->get( $message ),
+ 'Updates are reflected in-process immediately' );
+ $this->makePage( 'Go', 'de', 'Race!' );
+ $dbw->endAtomic( __METHOD__ );
+
+ $this->assertEquals( 0,
+ DeferredUpdates::pendingUpdatesCount(),
+ 'Post-commit deferred update triggers a run of all updates' );
+
+ $this->assertEquals( 'Race!', $messageCache->get( $message ), 'Correct final contents' );
+
+ $this->makePage( 'Go', 'de', $oldText );
+ $messageCache->replace( $uckey, $oldText ); // deferred update runs immediately
+ $this->assertEquals( $oldText, $messageCache->get( $message ), 'Content restored' );
+ }
+
/**
* There's a fallback case where the message key is given as fully qualified -- this
* should ignore the passed $lang and use the language from the key
$this->assertArrayHasKey( 'external_link', $fields );
$this->assertArrayHasKey( 'outgoing_link', $fields );
$this->assertArrayHasKey( 'template', $fields );
+ $this->assertArrayHasKey( 'content_model', $fields );
}
private function newSearchEngine() {
$this->assertArrayHasKey( 'language', $data );
$this->assertArrayHasKey( 'testDataField', $data );
$this->assertEquals( 'test content', $data['testDataField'] );
+ $this->assertEquals( 'wikitext', $data['content_model'] );
}
/**
$this->assertGreaterThan( -5.1, $curTTL, "Correct CTL" );
}
+ /**
+ * @covers WANObjectCache::reap()
+ * @covers WANObjectCache::reapCheckKey()
+ */
+ public function testReap() {
+ $vKey1 = wfRandomString();
+ $vKey2 = wfRandomString();
+ $tKey1 = wfRandomString();
+ $tKey2 = wfRandomString();
+ $value = 'moo';
+
+ $knownPurge = time() - 60;
+ $goodTime = microtime( true ) - 5;
+ $badTime = microtime( true ) - 300;
+
+ $this->internalCache->set(
+ WANObjectCache::VALUE_KEY_PREFIX . $vKey1,
+ [
+ WANObjectCache::FLD_VERSION => WANObjectCache::VERSION,
+ WANObjectCache::FLD_VALUE => $value,
+ WANObjectCache::FLD_TTL => 3600,
+ WANObjectCache::FLD_TIME => $goodTime
+ ]
+ );
+ $this->internalCache->set(
+ WANObjectCache::VALUE_KEY_PREFIX . $vKey2,
+ [
+ WANObjectCache::FLD_VERSION => WANObjectCache::VERSION,
+ WANObjectCache::FLD_VALUE => $value,
+ WANObjectCache::FLD_TTL => 3600,
+ WANObjectCache::FLD_TIME => $badTime
+ ]
+ );
+ $this->internalCache->set(
+ WANObjectCache::TIME_KEY_PREFIX . $tKey1,
+ WANObjectCache::PURGE_VAL_PREFIX . $goodTime
+ );
+ $this->internalCache->set(
+ WANObjectCache::TIME_KEY_PREFIX . $tKey2,
+ WANObjectCache::PURGE_VAL_PREFIX . $badTime
+ );
+
+ $this->assertEquals( $value, $this->cache->get( $vKey1 ) );
+ $this->assertEquals( $value, $this->cache->get( $vKey2 ) );
+ $this->cache->reap( $vKey1, $knownPurge, $bad1 );
+ $this->cache->reap( $vKey2, $knownPurge, $bad2 );
+
+ $this->assertFalse( $bad1 );
+ $this->assertTrue( $bad2 );
+
+ $this->cache->reapCheckKey( $tKey1, $knownPurge, $tBad1 );
+ $this->cache->reapCheckKey( $tKey2, $knownPurge, $tBad2 );
+ $this->assertFalse( $tBad1 );
+ $this->assertTrue( $tBad2 );
+ }
+
/**
* @covers WANObjectCache::set()
*/
$wanCache->getMulti( [ 'x', 'y' ], $ctls, [ 'check2' ] );
$wanCache->getWithSetCallback( 'p', 30, $valFunc );
$wanCache->getCheckKeyTime( 'zzz' );
+ $wanCache->reap( 'x', time() - 300 );
+ $wanCache->reap( 'zzz', time() - 300 );
}
/**
public static function provideRightsLogDatabaseRows() {
return [
// Current format
+ [
+ [
+ 'type' => 'rights',
+ 'action' => 'rights',
+ 'comment' => 'rights comment',
+ 'user' => 0,
+ 'user_text' => 'Sysop',
+ 'namespace' => NS_USER,
+ 'title' => 'User',
+ 'params' => [
+ '4::oldgroups' => [],
+ '5::newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'expiry' => null ],
+ [ 'expiry' => '20160101123456' ]
+ ],
+ ],
+ ],
+ [
+ 'text' => 'Sysop changed group membership for User from (none) to '
+ . 'bureaucrat (temporary, until 12:34, 1 January 2016) and administrator',
+ 'api' => [
+ 'oldgroups' => [],
+ 'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => '2016-01-01T12:34:56Z' ],
+ ],
+ ],
+ ],
+ ],
+
+ // Previous format (oldgroups and newgroups as arrays, no metadata)
[
[
'type' => 'rights',
'api' => [
'oldgroups' => [],
'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
],
],
],
- // Legacy format
+ // Legacy format (oldgroups and newgroups as numeric-keyed strings)
[
[
'type' => 'rights',
'api' => [
'oldgroups' => [],
'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
],
],
],
'api' => [
'oldgroups' => [ 'sysop' ],
'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ ],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
],
],
],
'api' => [
'oldgroups' => [ 'sysop' ],
'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ ],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
],
],
],
$this->assertEquals( 'Admin', $rev1->getUserText() );
# now, try the actual rollback
+ $admin->addToDatabase();
$admin->addGroup( "sysop" ); # XXX: make the test user a sysop...
$token = $admin->getEditToken(
[ $page->getTitle()->getPrefixedText(), $user2->getName() ],
public function testDoRollback() {
$admin = new User();
$admin->setName( "Admin" );
+ $admin->addToDatabase();
$text = "one";
$page = $this->newPage( "WikiPageTest_testDoRollback" );
# now, try the rollback
$admin->addGroup( "sysop" ); # XXX: make the test user a sysop...
- $token = $admin->getEditToken(
- [ $page->getTitle()->getPrefixedText(), $user1->getName() ],
- null
- );
+ $token = $admin->getEditToken( 'rollback' );
$errors = $page->doRollback(
$user1->getName(),
"testing revert",
public function testDoRollbackFailureSameContent() {
$admin = new User();
$admin->setName( "Admin" );
+ $admin->addToDatabase();
$admin->addGroup( "sysop" ); # XXX: make the test user a sysop...
$text = "one";
$user1 = new User();
$user1->setName( "127.0.1.11" );
+ $user1->addToDatabase();
$user1->addGroup( "sysop" ); # XXX: make the test user a sysop...
$text .= "\n\ntwo";
$page = new WikiPage( $page->getTitle() );
# now, do a the rollback from the same user was doing the edit before
$resultDetails = [];
- $token = $user1->getEditToken(
- [ $page->getTitle()->getPrefixedText(), $user1->getName() ],
- null
- );
+ $token = $user1->getEditToken( 'rollback' );
$errors = $page->doRollback(
$user1->getName(),
"testing revert same user",
# now, try the rollback
$resultDetails = [];
- $token = $admin->getEditToken(
- [ $page->getTitle()->getPrefixedText(), $user1->getName() ],
- null
- );
+ $token = $admin->getEditToken( 'rollback' );
$errors = $page->doRollback(
$user1->getName(),
"testing revert",
$upp = $this->getUserPasswordPolicy();
$user = User::newFromName( 'TestUserPolicy' );
+ $user->addToDatabase();
$user->addGroup( 'sysop' );
$this->assertArrayEquals(
$upp = $this->getUserPasswordPolicy();
$user = User::newFromName( $username );
+ $user->addToDatabase();
foreach ( $groups as $group ) {
$user->addGroup( $group );
}
--- /dev/null
+<?php
+
+class RCFeedIntegrationTest extends MediaWikiTestCase {
+ protected function setUp() {
+ parent::setUp();
+ $this->setMwGlobals( [
+ 'wgCanonicalServer' => 'https://example.org',
+ 'wgServerName' => 'example.org',
+ 'wgScriptPath' => '/w',
+ 'wgDBname' => 'example',
+ 'wgDBprefix' => '',
+ 'wgRCFeeds' => [],
+ 'wgRCEngines' => [],
+ ] );
+ }
+
+ /**
+ * @covers RecentChange::notifyRCFeeds
+ * @covers RecentChange::getEngine
+ * @covers RCFeedEngine
+ * @covers JSONRCFeedFormatter::formatArray
+ * @covers MachineReadableRCFeedFormatter::getLine
+ */
+ public function testNotify() {
+ $feed = $this->getMockBuilder( 'RCFeedEngine' )
+ ->setConstructorArgs( [ [ 'formatter' => 'JSONRCFeedFormatter' ] ] )
+ ->setMethods( [ 'send' ] )
+ ->getMock();
+
+ $feed->method( 'send' )
+ ->willReturn( true );
+
+ $feed->expects( $this->once() )
+ ->method( 'send' )
+ ->with( $this->anything(), $this->callback( function ( $line ) {
+ $this->assertJsonStringEqualsJsonString(
+ json_encode( [
+ 'id' => null,
+ 'type' => 'log',
+ 'namespace' => 0,
+ 'title' => 'Example',
+ 'comment' => '',
+ 'timestamp' => 1301644800,
+ 'user' => 'UTSysop',
+ 'bot' => false,
+ 'log_id' => 0,
+ 'log_type' => 'move',
+ 'log_action' => 'move',
+ 'log_params' => [
+ 'color' => 'green',
+ 'nr' => 42,
+ 'pet' => 'cat',
+ ],
+ 'log_action_comment' => '',
+ 'server_url' => 'https://example.org',
+ 'server_name' => 'example.org',
+ 'server_script_path' => '/w',
+ 'wiki' => 'example',
+ ] ),
+ $line
+ );
+ return true;
+ } ) );
+
+ $this->setMwGlobals( [
+ 'wgRCFeeds' => [
+ 'myfeed' => [
+ 'uri' => 'test://localhost:1234',
+ 'formatter' => 'JSONRCFeedFormatter',
+ ],
+ ],
+ 'wgRCEngines' => [
+ 'test' => $feed,
+ ],
+ ] );
+ $logpage = SpecialPage::getTitleFor( 'Log', 'move' );
+ $user = $this->getTestSysop()->getUser();
+ $rc = RecentChange::newLogEntry(
+ '20110401080000',
+ $logpage, // &$title
+ $user, // &$user
+ '', // $actionComment
+ '127.0.0.1', // $ip
+ 'move', // $type
+ 'move', // $action
+ Title::makeTitle( 0, 'Example' ), // $target
+ '', // $logComment
+ LogEntryBase::makeParamBlob( [
+ '4::color' => 'green',
+ '5:number:nr' => 42,
+ 'pet' => 'cat',
+ ] )
+ );
+ $rc->notifyRCFeeds();
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * @group Database
+ */
+class UserGroupMembershipTest extends MediaWikiTestCase {
+ /**
+ * @var User Belongs to no groups
+ */
+ protected $userNoGroups;
+ /**
+ * @var User Belongs to the 'unittesters' group indefinitely, and the
+ * 'testwriters' group with expiry
+ */
+ protected $userTester;
+ /**
+ * @var string The timestamp, in TS_MW format, of the expiry of $userTester's
+ * membership in the 'testwriters' group
+ */
+ protected $expiryTime;
+
+ protected function setUp() {
+ parent::setUp();
+
+ $this->setMwGlobals( [
+ 'wgGroupPermissions' => [
+ 'unittesters' => [
+ 'runtest' => true,
+ ],
+ 'testwriters' => [
+ 'writetest' => true,
+ ]
+ ]
+ ] );
+
+ $this->userNoGroups = new User;
+ $this->userNoGroups->setName( 'NoGroups' );
+ $this->userNoGroups->addToDatabase();
+
+ $this->userTester = new User;
+ $this->userTester->setName( 'Tester' );
+ $this->userTester->addToDatabase();
+ $this->userTester->addGroup( 'unittesters' );
+ $this->expiryTime = wfTimestamp( TS_MW, time() + 100500 );
+ $this->userTester->addGroup( 'testwriters', $this->expiryTime );
+ }
+
+ /**
+ * @covers UserGroupMembership::insert
+ * @covers UserGroupMembership::delete
+ */
+ public function testAddAndRemoveGroups() {
+ $user = new User;
+ $user->addToDatabase();
+
+ // basic tests
+ $ugm = new UserGroupMembership( $user->getId(), 'unittesters' );
+ $this->assertTrue( $ugm->insert() );
+ $user->clearInstanceCache();
+ $this->assertContains( 'unittesters', $user->getGroups() );
+ $this->assertArrayHasKey( 'unittesters', $user->getGroupMemberships() );
+ $this->assertTrue( $user->isAllowed( 'runtest' ) );
+
+ // try updating without allowUpdate. Should fail
+ $ugm = new UserGroupMembership( $user->getId(), 'unittesters', $this->expiryTime );
+ $this->assertFalse( $ugm->insert() );
+
+ // now try updating with allowUpdate
+ $this->assertTrue( $ugm->insert( 2 ) );
+ $user->clearInstanceCache();
+ $this->assertContains( 'unittesters', $user->getGroups() );
+ $this->assertArrayHasKey( 'unittesters', $user->getGroupMemberships() );
+ $this->assertTrue( $user->isAllowed( 'runtest' ) );
+
+ // try removing the group
+ $ugm->delete();
+ $user->clearInstanceCache();
+ $this->assertThat( $user->getGroups(),
+ $this->logicalNot( $this->contains( 'unittesters' ) ) );
+ $this->assertThat( $user->getGroupMemberships(),
+ $this->logicalNot( $this->arrayHasKey( 'unittesters' ) ) );
+ $this->assertFalse( $user->isAllowed( 'runtest' ) );
+
+ // check that the user group is now in user_former_groups
+ $this->assertContains( 'unittesters', $user->getFormerGroups() );
+ }
+
+ private function addUserTesterToExpiredGroup() {
+ // put $userTester in a group with expiry in the past
+ $ugm = new UserGroupMembership( $this->userTester->getId(), 'sysop', '20010102030405' );
+ $ugm->insert();
+ }
+
+ /**
+ * @covers UserGroupMembership::getMembershipsForUser
+ */
+ public function testGetMembershipsForUser() {
+ $this->addUserTesterToExpiredGroup();
+
+ // check that the user in no groups has no group memberships
+ $ugms = UserGroupMembership::getMembershipsForUser( $this->userNoGroups->getId() );
+ $this->assertEmpty( $ugms );
+
+ // check that the user in 2 groups has 2 group memberships
+ $testerUserId = $this->userTester->getId();
+ $ugms = UserGroupMembership::getMembershipsForUser( $testerUserId );
+ $this->assertCount( 2, $ugms );
+
+ // check that the required group memberships are present on $userTester,
+ // with the correct user IDs and expiries
+ $expectedGroups = [ 'unittesters', 'testwriters' ];
+
+ foreach ( $expectedGroups as $group ) {
+ $this->assertArrayHasKey( $group, $ugms );
+ $this->assertEquals( $ugms[$group]->getUserId(), $testerUserId );
+ $this->assertEquals( $ugms[$group]->getGroup(), $group );
+
+ if ( $group === 'unittesters' ) {
+ $this->assertNull( $ugms[$group]->getExpiry() );
+ } elseif ( $group === 'testwriters' ) {
+ $this->assertEquals( $ugms[$group]->getExpiry(), $this->expiryTime );
+ }
+ }
+ }
+
+ /**
+ * @covers UserGroupMembership::getMembership
+ */
+ public function testGetMembership() {
+ $this->addUserTesterToExpiredGroup();
+
+ // groups that the user doesn't belong to shouldn't be returned
+ $ugm = UserGroupMembership::getMembership( $this->userNoGroups->getId(), 'sysop' );
+ $this->assertFalse( $ugm );
+
+ // implicit groups shouldn't be returned
+ $ugm = UserGroupMembership::getMembership( $this->userNoGroups->getId(), 'user' );
+ $this->assertFalse( $ugm );
+
+ // expired groups shouldn't be returned
+ $ugm = UserGroupMembership::getMembership( $this->userTester->getId(), 'sysop' );
+ $this->assertFalse( $ugm );
+
+ // groups that the user does belong to should be returned with correct properties
+ $ugm = UserGroupMembership::getMembership( $this->userTester->getId(), 'unittesters' );
+ $this->assertInstanceOf( UserGroupMembership::class, $ugm );
+ $this->assertEquals( $ugm->getUserId(), $this->userTester->getId() );
+ $this->assertEquals( $ugm->getGroup(), 'unittesters' );
+ $this->assertNull( $ugm->getExpiry() );
+ }
+}
$this->setUpPermissionGlobals();
$this->user = new User;
+ $this->user->addToDatabase();
$this->user->addGroup( 'unittesters' );
}
*/
public function testUserGetRightsHooks() {
$user = new User;
+ $user->addToDatabase();
$user->addGroup( 'unittesters' );
$user->addGroup( 'testwriters' );
$userWrapper = TestingAccessWrapper::newFromObject( $user );
* @covers Language::translateBlockExpiry()
* @dataProvider provideTranslateBlockExpiry
*/
- public function testTranslateBlockExpiry( $expectedData, $str, $desc ) {
+ public function testTranslateBlockExpiry( $expectedData, $str, $now, $desc ) {
$lang = $this->getLang();
if ( is_array( $expectedData ) ) {
list( $func, $arg ) = $expectedData;
} else {
$expected = $expectedData;
}
- $this->assertEquals( $expected, $lang->translateBlockExpiry( $str ), $desc );
+ $this->assertEquals( $expected, $lang->translateBlockExpiry( $str, null, $now ), $desc );
}
public static function provideTranslateBlockExpiry() {
return [
- [ '2 hours', '2 hours', 'simple data from ipboptions' ],
- [ 'indefinite', 'infinite', 'infinite from ipboptions' ],
- [ 'indefinite', 'infinity', 'alternative infinite from ipboptions' ],
- [ 'indefinite', 'indefinite', 'another alternative infinite from ipboptions' ],
- [ [ 'formatDuration', 1023 * 60 * 60 ], '1023 hours', 'relative' ],
- [ [ 'formatDuration', -1023 ], '-1023 seconds', 'negative relative' ],
- [ [ 'formatDuration', 0 ], 'now', 'now' ],
+ [ '2 hours', '2 hours', 0, 'simple data from ipboptions' ],
+ [ 'indefinite', 'infinite', 0, 'infinite from ipboptions' ],
+ [ 'indefinite', 'infinity', 0, 'alternative infinite from ipboptions' ],
+ [ 'indefinite', 'indefinite', 0, 'another alternative infinite from ipboptions' ],
+ [ [ 'formatDuration', 1023 * 60 * 60 ], '1023 hours', 0, 'relative' ],
+ [ [ 'formatDuration', -1023 ], '-1023 seconds', 0, 'negative relative' ],
+ [
+ [ 'formatDuration', 1023 * 60 * 60 ],
+ '1023 hours',
+ wfTimestamp( TS_UNIX, '19910203040506' ),
+ 'relative with initial timestamp'
+ ],
+ [ [ 'formatDuration', 0 ], 'now', 0, 'now' ],
[
[ 'timeanddate', '20120102070000' ],
'2012-1-1 7:00 +1 day',
+ 0,
'mixed, handled as absolute'
],
- [ [ 'timeanddate', '19910203040506' ], '1991-2-3 4:05:06', 'absolute' ],
- [ [ 'timeanddate', '19700101000000' ], '1970-1-1 0:00:00', 'absolute at epoch' ],
- [ [ 'timeanddate', '19691231235959' ], '1969-12-31 23:59:59', 'time before epoch' ],
- [ 'dummy', 'dummy', 'return garbage as is' ],
+ [ [ 'timeanddate', '19910203040506' ], '1991-2-3 4:05:06', 0, 'absolute' ],
+ [ [ 'timeanddate', '19700101000000' ], '1970-1-1 0:00:00', 0, 'absolute at epoch' ],
+ [ [ 'timeanddate', '19691231235959' ], '1969-12-31 23:59:59', 0, 'time before epoch' ],
+ [
+ [ 'timeanddate', '19910910000000' ],
+ '10 september',
+ wfTimestamp( TS_UNIX, '19910203040506' ),
+ 'partial'
+ ],
+ [ 'dummy', 'dummy', 0, 'return garbage as is' ],
];
}
{
name: 'hidefilter1',
label: 'Show filter 1',
- description: 'Description of Filter 1 in Group 1'
+ description: 'Description of Filter 1 in Group 1',
+ default: true
},
{
name: 'hidefilter2',
{
name: 'hidefilter3',
label: 'Show filter 3',
- description: 'Description of Filter 3 in Group 1'
+ description: 'Description of Filter 3 in Group 1',
+ default: true
}
]
},
{
name: 'hidefilter5',
label: 'Show filter 5',
- description: 'Description of Filter 2 in Group 2'
+ description: 'Description of Filter 2 in Group 2',
+ default: true
},
{
name: 'hidefilter6',
{
name: 'filter8',
label: 'Group 3: Filter 2',
- description: 'Description of Filter 2 in Group 3'
+ description: 'Description of Filter 2 in Group 3',
+ default: true
},
{
name: 'filter9',
]
}
},
+ defaultFilterRepresentation = {
+ // Group 1 and 2, "send_unselected_if_any", the values of the filters are "flipped" from the values of the parameters
+ hidefilter1: false,
+ hidefilter2: true,
+ hidefilter3: false,
+ hidefilter4: true,
+ hidefilter5: false,
+ hidefilter6: true,
+ // Group 3, "string_options", default values correspond to parameters and filters
+ filter7: false,
+ filter8: true,
+ filter9: false
+ },
model = new mw.rcfilters.dm.FiltersViewModel();
model.initializeFilters( definition );
- // Empty query = empty filter definition
+ // Empty query = only default values
assert.deepEqual(
model.getFiltersFromParameters( {} ),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
- filter7: false,
- filter8: false,
- filter9: false
- },
- 'Empty parameter query results in filters in initial state'
+ defaultFilterRepresentation,
+ 'Empty parameter query results in filters in initial default state'
);
assert.deepEqual(
model.getFiltersFromParameters( {
- hidefilter1: '1'
- } ),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: true, // The text is "show filter 2"
- hidefilter3: true, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
- filter7: false,
- filter8: false,
- filter9: false
- },
- 'One falsey parameter in a group makes the rest of the filters in the group truthy (checked) in the interface'
- );
-
- assert.deepEqual(
- model.getFiltersFromParameters( {
- hidefilter1: '1',
hidefilter2: '1'
} ),
- {
+ $.extend( {}, defaultFilterRepresentation, {
hidefilter1: false, // The text is "show filter 1"
hidefilter2: false, // The text is "show filter 2"
- hidefilter3: true, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
- filter7: false,
- filter8: false,
- filter9: false
- },
- 'Two falsey parameters in a \'send_unselected_if_any\' group makes the rest of the filters in the group truthy (checked) in the interface'
+ hidefilter3: false // The text is "show filter 3"
+ } ),
+ 'One truthy parameter in a group whose other parameters are true by default makes the rest of the filters in the group false (unchecked)'
);
assert.deepEqual(
hidefilter2: '1',
hidefilter3: '1'
} ),
- {
- // TODO: This will have to be represented as a different state, though.
+ $.extend( {}, defaultFilterRepresentation, {
hidefilter1: false, // The text is "show filter 1"
hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
- filter7: false,
- filter8: false,
- filter9: false
- },
+ hidefilter3: false // The text is "show filter 3"
+ } ),
'All paremeters in the same \'send_unselected_if_any\' group false is equivalent to none are truthy (checked) in the interface'
);
// The ones above don't update the model, so we have a clean state.
-
+ // getFiltersFromParameters is stateless; any change is unaffected by the current state
+ // This test is demonstrating wrong usage of the method;
+ // We should be aware that getFiltersFromParameters is stateless,
+ // so each call gives us a filter state that only reflects the query given.
+ // This means that the two calls to updateFilters() below collide.
+ // The result of the first is overridden by the result of the second,
+ // since both get a full state object from getFiltersFromParameters that **only** relates
+ // to the input it receives.
model.updateFilters(
model.getFiltersFromParameters( {
hidefilter1: '1'
model.updateFilters(
model.getFiltersFromParameters( {
- hidefilter3: '1'
+ hidefilter6: '1'
} )
);
- // 1 and 3 are separately unchecked via hide parameters, 2 should still be
- // checked.
- // This can simulate separate filters in the same group being hidden different
- // ways (e.g. preferences and URL).
+ // The result here is ignoring the first updateFilters call
+ // We should receive default values + hidefilter6 as false
assert.deepEqual(
model.getSelectedState(),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: true, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
- filter7: false,
- filter8: false,
- filter9: false
- },
- 'After unchecking 2 of 3 \'send_unselected_if_any\' filters via separate updateFilters calls, only the remaining one is still checked.'
+ $.extend( {}, defaultFilterRepresentation, {
+ hidefilter5: false,
+ hidefilter6: false
+ } ),
+ 'getFiltersFromParameters does not care about previous or existing state.'
);
// Reset
model.updateFilters(
model.getFiltersFromParameters( {
- hidefilter1: '1'
+ hidefilter1: '0'
} )
);
model.updateFilters(
model.getFiltersFromParameters( {
- hidefilter1: '0'
+ hidefilter1: '1'
} )
);
// override.
assert.deepEqual(
model.getSelectedState(),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
- filter7: false,
- filter8: false,
- filter9: false
- },
- 'After unchecking then checking a \'send_unselected_if_any\' filter (without touching other filters in that group), all are checked'
+ defaultFilterRepresentation,
+ 'After checking and then unchecking a \'send_unselected_if_any\' filter (without touching other filters in that group), results are default'
);
model.updateFilters(
);
assert.deepEqual(
model.getSelectedState(),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
+ $.extend( {}, defaultFilterRepresentation, {
filter7: true,
filter8: false,
filter9: false
- },
+ } ),
'A \'string_options\' parameter containing 1 value, results in the corresponding filter as checked'
);
);
assert.deepEqual(
model.getSelectedState(),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
+ $.extend( {}, defaultFilterRepresentation, {
filter7: true,
filter8: true,
filter9: false
- },
+ } ),
'A \'string_options\' parameter containing 2 values, results in both corresponding filters as checked'
);
);
assert.deepEqual(
model.getSelectedState(),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
+ $.extend( {}, defaultFilterRepresentation, {
filter7: false,
filter8: false,
filter9: false
- },
+ } ),
'A \'string_options\' parameter containing all values, results in all filters of the group as unchecked.'
);
model.updateFilters(
model.getFiltersFromParameters( {
- group3: 'filter7,filter8,filter9'
+ group3: 'filter7,all,filter9'
} )
);
assert.deepEqual(
model.getSelectedState(),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
+ $.extend( {}, defaultFilterRepresentation, {
filter7: false,
filter8: false,
filter9: false
- },
+ } ),
'A \'string_options\' parameter containing the value \'all\', results in all filters of the group as unchecked.'
);
);
assert.deepEqual(
model.getSelectedState(),
- {
- hidefilter1: false, // The text is "show filter 1"
- hidefilter2: false, // The text is "show filter 2"
- hidefilter3: false, // The text is "show filter 3"
- hidefilter4: false, // The text is "show filter 4"
- hidefilter5: false, // The text is "show filter 5"
- hidefilter6: false, // The text is "show filter 6"
+ $.extend( {}, defaultFilterRepresentation, {
filter7: true,
filter8: false,
filter9: true
- },
+ } ),
'A \'string_options\' parameter containing an invalid value, results in the invalid value ignored and the valid corresponding filters checked.'
);
} );
);
} );
- QUnit.test( 'reapplyActiveFilters - "default" exclusion rules', function ( assert ) {
+ QUnit.test( 'setFiltersToDefaults', function ( assert ) {
var definition = {
group1: {
title: 'Group 1',
{
name: 'hidefilter1',
label: 'Show filter 1',
- description: 'Description of Filter 1 in Group 1'
+ description: 'Description of Filter 1 in Group 1',
+ default: true
},
{
name: 'hidefilter2',
{
name: 'hidefilter3',
label: 'Show filter 3',
- description: 'Description of Filter 3 in Group 1'
+ description: 'Description of Filter 3 in Group 1',
+ default: true
}
]
},
{
name: 'hidefilter5',
label: 'Show filter 5',
- description: 'Description of Filter 2 in Group 2'
+ description: 'Description of Filter 2 in Group 2',
+ default: true
},
{
name: 'hidefilter6',
model.getFullState(),
{
// Group 1
- hidefilter1: { selected: false, active: true },
+ hidefilter1: { selected: true, active: true },
hidefilter2: { selected: false, active: true },
- hidefilter3: { selected: false, active: true },
+ hidefilter3: { selected: true, active: true },
// Group 2
hidefilter4: { selected: false, active: true },
- hidefilter5: { selected: false, active: true },
+ hidefilter5: { selected: true, active: true },
hidefilter6: { selected: false, active: true },
},
- 'Initial state: all filters are active.'
+ 'Initial state: all filters are active, and select states are default.'
);
// Default behavior for 'exclusion' type with only 1 item selected, means that:
]
}
},
+ defaultFilterRepresentation = {
+ // Group 1 and 2, "send_unselected_if_any", the values of the filters are "flipped" from the values of the parameters
+ hidefilter1: false,
+ hidefilter2: true,
+ hidefilter3: false,
+ hidefilter4: true,
+ hidefilter5: false,
+ hidefilter6: true,
+ // Group 3, "string_options", default values correspond to parameters and filters
+ filter7: false,
+ filter8: true,
+ filter9: false
+ },
model = new mw.rcfilters.dm.FiltersViewModel();
model.initializeFilters( definition );