jenkins-bot has submitted this change and it was merged.

Change subject: SpecialWatchlist: Remove dead cutoff code
......................................................................


SpecialWatchlist: Remove dead cutoff code

Added back in r1532, it got broken in one of the numerous refactors
since then and now only triggers when 'days' request parameter is
passed explicitly and is malformed.

Just use floatval() instead.

Change-Id: I20c1e816a11fca5037af93bf81b46839f2a5efb0
---
M includes/specials/SpecialWatchlist.php
1 file changed, 2 insertions(+), 14 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 59f0dfe..6987f6f 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -100,7 +100,7 @@
 
                // @todo use FormOptions!
                $defaults = array(
-               /* float */ 'days' => floatval( $user->getOption( 
'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */
+               /* float */ 'days' => floatval( $user->getOption( 
'watchlistdays' ) ),
                /* bool  */ 'hideMinor' => (int)$user->getBoolOption( 
'watchlisthideminor' ),
                /* bool  */ 'hideBots' => (int)$user->getBoolOption( 
'watchlisthidebots' ),
                /* bool  */ 'hideAnons' => (int)$user->getBoolOption( 
'watchlisthideanons' ),
@@ -121,7 +121,7 @@
                # Extract variables from the request, falling back to user 
preferences or
                # other default values if these don't exist
                $values = array();
-               $values['days'] = $request->getVal( 'days', $defaults['days'] );
+               $values['days'] = floatval( $request->getVal( 'days', 
$defaults['days'] ) );
                $values['hideMinor'] = (int)$request->getBool( 'hideMinor', 
$defaults['hideMinor'] );
                $values['hideBots'] = (int)$request->getBool( 'hideBots', 
$defaults['hideBots'] );
                $values['hideAnons'] = (int)$request->getBool( 'hideAnons', 
$defaults['hideAnons'] );
@@ -157,18 +157,6 @@
                $values['namespace'] = $nameSpace;
                $values['invert'] = $invert;
                $values['associated'] = $associated;
-
-               if ( is_null( $values['days'] ) || !is_numeric( $values['days'] 
) ) {
-                       $big = 1000; /* The magical big */
-                       if ( $nitems > $big ) {
-                               # Set default cutoff shorter
-                               $values['days'] = $defaults['days'] = ( 12.0 / 
24.0 ); # 12 hours...
-                       } else {
-                               $values['days'] = $defaults['days']; # default 
cutoff for shortlisters
-                       }
-               } else {
-                       $values['days'] = floatval( $values['days'] );
-               }
 
                // Dump everything here
                $nondefaults = array();

-- 
To view, visit https://gerrit.wikimedia.org/r/89324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I20c1e816a11fca5037af93bf81b46839f2a5efb0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to