Merge "SpecialWatchlist: Don't display '0' in the selector when 'all' is chosen"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 7 Dec 2015 10:17:22 +0000 (10:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 7 Dec 2015 10:17:22 +0000 (10:17 +0000)
includes/specials/SpecialWatchlist.php

index b5382a6..b5e614d 100644 (file)
@@ -523,13 +523,13 @@ class SpecialWatchlist extends ChangesListSpecialPage {
 
                $userWatchlistOption = (string)$this->getUser()->getOption( 'watchlistdays' );
                // add the user preference, if it isn't available already
-               if ( !in_array( $userWatchlistOption, $days ) ) {
+               if ( !in_array( $userWatchlistOption, $days ) && $userWatchlistOption !== '0' ) {
                        $days[] = $userWatchlistOption;
                }
 
                $selected = (string)$options['days'];
                // add the currently selected value, if it isn't available already
-               if ( !in_array( $selected, $days ) ) {
+               if ( !in_array( $selected, $days ) && $selected !== '0' ) {
                        $days[] = $selected;
                }
 
@@ -547,7 +547,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
 
                // 'all' option
                $name = $this->msg( 'watchlistall2' )->text();
-               $value = 0;
+               $value = '0';
                $select->addOption( $name, $value );
 
                return $select->getHTML() . "\n<br />\n";