MrBlueSky has uploaded a new change for review.
https://gerrit.wikimedia.org/r/108287
Change subject: Special:Contributions: add all params to feed URL
......................................................................
Special:Contributions: add all params to feed URL
On Special:Contributions, the parameters namespace, year, month, tagfilter,
deletedonly, toponly are not applied to the feed link in the toolbox
(action=feedcontributions).
Bug 54093
Change-Id: Ib070b53786360d1c4911e0e4b50e61140466526c
---
M includes/specials/SpecialContributions.php
1 file changed, 26 insertions(+), 26 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/87/108287/1
diff --git a/includes/specials/SpecialContributions.php
b/includes/specials/SpecialContributions.php
index 6b56c2f..737f325 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -130,35 +130,35 @@
$this->opts['month'] = $request->getIntOrNull( 'month'
);
}
+ $feedParams = array(
+ 'action' => 'feedcontributions',
+ 'user' => $target,
+ );
+ if ( $this->opts['topOnly'] ) {
+ $feedParams['toponly'] = true;
+ }
+ if ( $this->opts['deletedOnly'] ) {
+ $feedParams['deletedonly'] = true;
+ }
+ if ( $this->opts['tagfilter'] !== '' ) {
+ $feedParams['tagfilter'] = $this->opts['tagfilter'];
+ }
+ if ( $this->opts['namespace'] !== '' ) {
+ $feedParams['namespace'] = $this->opts['namespace'];
+ }
+ if ( $this->opts['year'] !== null ) {
+ $feedParams['year'] = $this->opts['year'];
+ }
+ if ( $this->opts['month'] !== null ) {
+ $feedParams['month'] = $this->opts['month'];
+ }
+
$feedType = $request->getVal( 'feed' );
if ( $feedType ) {
// Maintain some level of backwards compatability
// If people request feeds using the old parameters,
redirect to API
- $apiParams = array(
- 'action' => 'feedcontributions',
- 'feedformat' => $feedType,
- 'user' => $target,
- );
- if ( $this->opts['topOnly'] ) {
- $apiParams['toponly'] = true;
- }
- if ( $this->opts['deletedOnly'] ) {
- $apiParams['deletedonly'] = true;
- }
- if ( $this->opts['tagfilter'] !== '' ) {
- $apiParams['tagfilter'] =
$this->opts['tagfilter'];
- }
- if ( $this->opts['namespace'] !== '' ) {
- $apiParams['namespace'] =
$this->opts['namespace'];
- }
- if ( $this->opts['year'] !== null ) {
- $apiParams['year'] = $this->opts['year'];
- }
- if ( $this->opts['month'] !== null ) {
- $apiParams['month'] = $this->opts['month'];
- }
-
- $url = wfAppendQuery( wfScript( 'api' ), $apiParams );
+ $feedParams['feedformat'] = $feedType;
+ $url = wfAppendQuery( wfScript( 'api' ), $feedParams );
$out->redirect( $url, '301' );
@@ -166,7 +166,7 @@
}
// Add RSS/atom links
- $this->addFeedLinks( array( 'action' => 'feedcontributions',
'user' => $target ) );
+ $this->addFeedLinks( $feedParams );
if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array(
$id, $userObj, $this ) ) ) {
$out->addHTML( $this->getForm() );
--
To view, visit https://gerrit.wikimedia.org/r/108287
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib070b53786360d1c4911e0e4b50e61140466526c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MrBlueSky <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits