*/
$wgUseRCPatrol = true;
-/**
- * Whether a preference is displayed for structured change filters.
- * If false, no preference is displayed and structured change filters are disabled.
- * If true, structured change filters are *enabled* by default, and a preference is displayed
- * that lets users disable them.
- *
- * Temporary variable during development and will be removed.
- *
- * @since 1.30
- */
-$wgStructuredChangeFiltersShowPreference = false;
-
-/**
- * Whether a preference is displayed for structured change filters on watchlist.
- * Works just like $wgStructuredChangeFiltersShowPreference.
- *
- * Temporary variable during development and will be removed
- * @since 1.32
- */
-$wgStructuredChangeFiltersShowWatchlistPreference = false;
-
-/**
- * Whether to enable RCFilters app on Special:Watchlist
- *
- * Temporary variable during development and will be removed.
- */
-$wgStructuredChangeFiltersOnWatchlist = false;
-
/**
* Polling rate, in seconds, used by the 'live update' and 'view newest' features
* of the RCFilters app on SpecialRecentChanges and Special:Watchlist.
* [ 'y' ]
* ]
*
- * @param array $array1,...
+ * @param array ...$args
* @return array
*/
-function wfMergeErrorArrays( /*...*/ ) {
- $args = func_get_args();
+function wfMergeErrorArrays( ...$args ) {
$out = [];
foreach ( $args as $errors ) {
foreach ( $errors as $params ) {
* (https://bugs.php.net/bug.php?id=26285) and the locale problems on Linux in
* PHP 5.2.6+ (bug backported to earlier distro releases of PHP).
*
- * @param string $args,... strings to escape and glue together,
+ * @param string|string[] ...$args strings to escape and glue together,
* or a single array of strings parameter
* @return string
* @deprecated since 1.30 use MediaWiki\Shell::escape()
*/
-function wfEscapeShellArg( /*...*/ ) {
- return Shell::escape( ...func_get_args() );
+function wfEscapeShellArg( ...$args ) {
+ return Shell::escape( ...$args );
}
/**
* Make a cache key for the local wiki.
*
* @deprecated since 1.30 Call makeKey on a BagOStuff instance
- * @param string $args,...
+ * @param string ...$args
* @return string
*/
-function wfMemcKey( /*...*/ ) {
- return ObjectCache::getLocalClusterInstance()->makeKey( ...func_get_args() );
+function wfMemcKey( ...$args ) {
+ return ObjectCache::getLocalClusterInstance()->makeKey( ...$args );
}
/**
*
* @param string $db
* @param string $prefix
- * @param string $args,...
+ * @param string ...$args
* @return string
*/
-function wfForeignMemcKey( $db, $prefix /*...*/ ) {
- $args = array_slice( func_get_args(), 2 );
+function wfForeignMemcKey( $db, $prefix, ...$args ) {
$keyspace = $prefix ? "$db-$prefix" : $db;
return ObjectCache::getLocalClusterInstance()->makeKeyInternal( $keyspace, $args );
}
*
* @deprecated since 1.30 Call makeGlobalKey on a BagOStuff instance
* @since 1.26
- * @param string $args,...
+ * @param string ...$args
* @return string
*/
-function wfGlobalCacheKey( /*...*/ ) {
- return ObjectCache::getLocalClusterInstance()->makeGlobalKey( ...func_get_args() );
+function wfGlobalCacheKey( ...$args ) {
+ return ObjectCache::getLocalClusterInstance()->makeGlobalKey( ...$args );
}
/**
];
}
- if ( $this->config->get( 'StructuredChangeFiltersShowPreference' ) ) {
- $defaultPreferences['rcenhancedfilters-disable'] = [
- 'type' => 'toggle',
- 'section' => 'rc/optoutrc',
- 'label-message' => 'rcfilters-preference-label',
- 'help-message' => 'rcfilters-preference-help',
- ];
- }
+ $defaultPreferences['rcenhancedfilters-disable'] = [
+ 'type' => 'toggle',
+ 'section' => 'rc/optoutrc',
+ 'label-message' => 'rcfilters-preference-label',
+ 'help-message' => 'rcfilters-preference-help',
+ ];
}
/**
];
}
- if ( $this->config->get( 'StructuredChangeFiltersShowWatchlistPreference' ) ) {
- $defaultPreferences['wlenhancedfilters-disable'] = [
- 'type' => 'toggle',
- 'section' => 'watchlist/optoutwatchlist',
- 'label-message' => 'rcfilters-watchlist-preference-label',
- 'help-message' => 'rcfilters-watchlist-preference-help',
- ];
- }
+ $defaultPreferences['wlenhancedfilters-disable'] = [
+ 'type' => 'toggle',
+ 'section' => 'watchlist/optoutwatchlist',
+ 'label-message' => 'rcfilters-watchlist-preference-label',
+ 'help-message' => 'rcfilters-watchlist-preference-help',
+ ];
}
/**
* @return bool
*/
public function isStructuredFilterUiEnabledByDefault() {
- if ( $this->getConfig()->get( 'StructuredChangeFiltersShowPreference' ) ) {
- return !$this->getUser()->getDefaultOption( 'rcenhancedfilters-disable' );
- } else {
- return $this->getUser()->getDefaultOption( 'rcenhancedfilters' );
- }
+ return true;
}
/**
* @return bool
*/
public static function checkStructuredFilterUiEnabled( Config $config, User $user ) {
- if ( $config->get( 'StructuredChangeFiltersShowPreference' ) ) {
- return !$user->getOption( 'rcenhancedfilters-disable' );
- } else {
- return $user->getOption( 'rcenhancedfilters' );
- }
+ return !$user->getOption( 'rcenhancedfilters-disable' );
}
/**
}
public static function checkStructuredFilterUiEnabled( Config $config, User $user ) {
- if ( !$config->get( 'StructuredChangeFiltersOnWatchlist' ) ) {
- return false;
- }
-
- if ( $config->get( 'StructuredChangeFiltersShowWatchlistPreference' ) ) {
- return !$user->getOption( 'wlenhancedfilters-disable' );
- } else {
- return $user->getOption( 'rcenhancedfilters' );
- }
+ return !$user->getOption( 'wlenhancedfilters-disable' );
}
/**
* @return bool
*/
public function setPassword( $str ) {
+ wfDeprecated( __METHOD__, '1.27' );
return $this->setPasswordInternal( $str );
}
* through the web interface.
*/
public function setInternalPassword( $str ) {
+ wfDeprecated( __METHOD__, '1.27' );
$this->setPasswordInternal( $str );
}
* @return bool True if the given password is correct, otherwise False
*/
public function checkPassword( $password ) {
+ wfDeprecated( __METHOD__, '1.27' );
+
$manager = AuthManager::singleton();
$reqs = AuthenticationRequest::loadRequestsFromSubmission(
$manager->getAuthenticationRequests( AuthManager::ACTION_LOGIN ),
* @return bool True if matches, false otherwise
*/
public function checkTemporaryPassword( $plaintext ) {
+ wfDeprecated( __METHOD__, '1.27' );
// Can't check the temporary password individually.
return $this->checkPassword( $plaintext );
}
};
/**
- * Category selector capsule item widget. Extends OO.ui.CapsuleItemWidget with the ability to link
+ * Category selector tag item widget. Extends OO.ui.TagItemWidget with the ability to link
* to the given page, and to show its existence status (i.e., whether it is a redlink).
*
* @class mw.widgets.CategoryTagItemWidget
.addClass( 'new' );
}
};
-
- // For backwards compatibility. See T183299.
- mw.widgets.CategoryCapsuleItemWidget = mw.widgets.CategoryTagItemWidget;
}() );
/**
* @dataProvider validateOptionsProvider
*/
- public function testValidateOptions( $optionsToSet, $expectedRedirect, $expectedRedirectOptions ) {
+ public function testValidateOptions(
+ $optionsToSet,
+ $expectedRedirect,
+ $expectedRedirectOptions,
+ $rcfilters
+ ) {
$redirectQuery = [];
$redirected = false;
$output = $this->getMockBuilder( OutputPage::class )
// Give users patrol permissions so we can test that.
$user = $this->getTestSysop()->getUser();
+ $user->setOption( 'rcenhancedfilters-disable', $rcfilters ? 0 : 1 );
$ctx->setUser( $user );
// Disable this hook or it could break changeType
* @covers ChangesListSpecialPage
*/
class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase {
- public function setUp() {
- parent::setUp();
- $this->setMwGlobals( [
- 'wgStructuredChangeFiltersShowPreference' => true,
- ] );
- }
-
protected function getPage() {
$mock = $this->getMockBuilder( ChangesListSpecialPage::class )
->setConstructorArgs(
[ 'hideanons' => 1, 'hideliu' => 1, 'hidebots' => 1 ],
true,
[ 'userExpLevel' => 'unregistered', 'hidebots' => 1, ],
+ true,
],
[
[ 'hideanons' => 1, 'hideliu' => 1, 'hidebots' => 0 ],
true,
[ 'hidebots' => 0, 'hidehumans' => 1 ],
+ true,
],
[
[ 'hideanons' => 1 ],
true,
- [ 'userExpLevel' => 'registered' ]
+ [ 'userExpLevel' => 'registered' ],
+ true,
],
[
[ 'hideliu' => 1 ],
true,
- [ 'userExpLevel' => 'unregistered' ]
+ [ 'userExpLevel' => 'unregistered' ],
+ true,
],
[
[ 'hideanons' => 1, 'hidebots' => 1 ],
true,
- [ 'userExpLevel' => 'registered', 'hidebots' => 1 ]
+ [ 'userExpLevel' => 'registered', 'hidebots' => 1 ],
+ true,
],
[
[ 'hideliu' => 1, 'hidebots' => 0 ],
true,
- [ 'userExpLevel' => 'unregistered', 'hidebots' => 0 ]
+ [ 'userExpLevel' => 'unregistered', 'hidebots' => 0 ],
+ true,
],
[
[ 'hidemyself' => 1, 'hidebyothers' => 1 ],
true,
[],
+ true,
],
[
[ 'hidebots' => 1, 'hidehumans' => 1 ],
true,
[],
+ true,
],
[
[ 'hidepatrolled' => 1, 'hideunpatrolled' => 1 ],
true,
[],
+ true,
],
[
[ 'hideminor' => 1, 'hidemajor' => 1 ],
true,
[],
+ true,
],
[
// changeType
[ 'hidepageedits' => 1, 'hidenewpages' => 1, 'hidecategorization' => 1, 'hidelog' => 1, ],
true,
[],
+ true,
],
];
}
[ 'hideanons' => 1, 'hideliu' => 1 ],
true,
[ 'hideliu' => 1 ],
+ false,
],
];
}