dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryWatchlist.php
diff --git
a/includes/api/ApiQueryWatchlist.php
b/includes/api/ApiQueryWatchlist.php
index
42ea55d
..
f8f6e7d
100644
(file)
--- a/
includes/api/ApiQueryWatchlist.php
+++ b/
includes/api/ApiQueryWatchlist.php
@@
-82,7
+82,7
@@
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
if ( $this->fld_patrol ) {
if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
if ( $this->fld_patrol ) {
if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
- $this->die
Usage( 'patrol property is not available
', 'patrol' );
+ $this->die
WithError( 'apierror-permissiondenied-patrolflag
', 'patrol' );
}
}
}
}
}
}
@@
-134,7
+134,7
@@
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
/* Check for conflicting parameters. */
if ( $this->showParamsConflicting( $show ) ) {
/* Check for conflicting parameters. */
if ( $this->showParamsConflicting( $show ) ) {
- $this->die
UsageMsg( '
show' );
+ $this->die
WithError( 'apierror-
show' );
}
// Check permissions.
}
// Check permissions.
@@
-142,10
+142,7
@@
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
|| isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] )
) {
if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
|| isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] )
) {
if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
- $this->dieUsage(
- 'You need the patrol right to request the patrolled flag',
- 'permissiondenied'
- );
+ $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
}
}
}
}
@@
-154,15
+151,16
@@
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
if ( !is_null( $params['type'] ) ) {
try {
if ( !is_null( $params['type'] ) ) {
try {
- $options['rcTypes'] = RecentChange::parseToRCType( $params['type'] );
+ $rcTypes = RecentChange::parseToRCType( $params['type'] );
+ if ( $rcTypes ) {
+ $options['rcTypes'] = $rcTypes;
+ }
} catch ( Exception $e ) {
ApiBase::dieDebug( __METHOD__, $e->getMessage() );
}
}
} catch ( Exception $e ) {
ApiBase::dieDebug( __METHOD__, $e->getMessage() );
}
}
- if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
- $this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
- }
+ $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
if ( !is_null( $params['user'] ) ) {
$options['onlyByUser'] = $params['user'];
}
if ( !is_null( $params['user'] ) ) {
$options['onlyByUser'] = $params['user'];
}
@@
-477,7
+475,8
@@
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
ApiBase::PARAM_TYPE => 'user'
],
'token' => [
ApiBase::PARAM_TYPE => 'user'
],
'token' => [
- ApiBase::PARAM_TYPE => 'string'
+ ApiBase::PARAM_TYPE => 'string',
+ ApiBase::PARAM_SENSITIVE => true,
],
'continue' => [
ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
],
'continue' => [
ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
@@
-503,6
+502,6
@@
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
}
public function getHelpUrls() {
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Watchlist';
+ return 'https://www.mediawiki.org/wiki/
Special:MyLanguage/
API:Watchlist';
}
}
}
}