(bug 26809) Uploading files with multiple extensions where one of the extensions...
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index d0eda25..757671e 100644 (file)
@@ -98,8 +98,6 @@ function wfSpecialWatchlist( $par ) {
        /* ?     */ 'invert'    => false,
        );
 
-       extract($defaults);
-
        # Extract variables from the request, falling back to user preferences or
        # other default values if these don't exist
        $prefs['days']      = floatval( $wgUser->getOption( 'watchlistdays' ) );
@@ -174,9 +172,7 @@ function wfSpecialWatchlist( $par ) {
        # Possible where conditions
        $conds = array();
 
-       if( $days <= 0 ) {
-               $andcutoff = '';
-       } else {
+       if( $days > 0 ) {
                $conds[] = "rc_timestamp > '".$dbr->timestamp( time() - intval( $days * 86400 ) )."'";
        }
 
@@ -241,7 +237,7 @@ function wfSpecialWatchlist( $par ) {
                                        'id' => 'mw-watchlist-resetbutton' ) ) .
                                wfMsgExt( 'wlheader-showupdated', array( 'parseinline' ) ) . ' ' .
                                Xml::submitButton( wfMsg( 'enotif_reset' ), array( 'name' => 'dummy' ) ) .
-                               Xml::hidden( 'reset', 'all' ) .
+                               Html::hidden( 'reset', 'all' ) .
                                Xml::closeElement( 'form' );
        }
        $form .= '<hr />';
@@ -316,23 +312,21 @@ function wfSpecialWatchlist( $par ) {
        $form .= Xml::namespaceSelector( $nameSpace, '' ) . '&#160;';
        $form .= Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $invert ) . '&#160;';
        $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</p>';
-       $form .= Xml::hidden( 'days', $days );
+       $form .= Html::hidden( 'days', $days );
        if( $hideMinor )
-               $form .= Xml::hidden( 'hideMinor', 1 );
+               $form .= Html::hidden( 'hideMinor', 1 );
        if( $hideBots )
-               $form .= Xml::hidden( 'hideBots', 1 );
+               $form .= Html::hidden( 'hideBots', 1 );
        if( $hideAnons )
-               $form .= Xml::hidden( 'hideAnons', 1 );
+               $form .= Html::hidden( 'hideAnons', 1 );
        if( $hideLiu )
-               $form .= Xml::hidden( 'hideLiu', 1 );
+               $form .= Html::hidden( 'hideLiu', 1 );
        if( $hideOwn )
-               $form .= Xml::hidden( 'hideOwn', 1 );
+               $form .= Html::hidden( 'hideOwn', 1 );
        $form .= Xml::closeElement( 'form' );
        $form .= Xml::closeElement( 'fieldset' );
        $wgOut->addHTML( $form );
 
-       $wgOut->addHTML( ChangesList::flagLegend() );
-
        # If there's nothing to show, stop here
        if( $numRows == 0 ) {
                $wgOut->addWikiMsg( 'watchnochange' );
@@ -343,7 +337,7 @@ function wfSpecialWatchlist( $par ) {
 
        /* Do link batch query */
        $linkBatch = new LinkBatch;
-       while ( $row = $dbr->fetchObject( $res ) ) {
+       foreach ( $res as $row ) {
                $userNameUnderscored = str_replace( ' ', '_', $row->rc_user_text );
                if ( $row->rc_user != 0 ) {
                        $linkBatch->add( NS_USER, $userNameUnderscored );
@@ -360,7 +354,7 @@ function wfSpecialWatchlist( $par ) {
        
        $s = $list->beginRecentChangesList();
        $counter = 1;
-       while ( $obj = $dbr->fetchObject( $res ) ) {
+       foreach ( $res as $obj ) {
                # Make RC entry
                $rc = RecentChange::newFromRow( $obj );
                $rc->counter = $counter++;