Revert r35848 per Brion's WONTFIX of bug 14536: "This would just mean that there...
[lhc/web/wiklou.git] / includes / SpecialRecentchanges.php
index aec7fdd..cd1dac0 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- *
- * @addtogroup SpecialPage
+ * @file
+ * @ingroup SpecialPage
  */
 
 /**
@@ -16,7 +16,6 @@ function wfSpecialRecentchanges( $par, $specialPage ) {
        global $wgUser, $wgOut, $wgRequest, $wgUseRCPatrol;
        global $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
        global $wgAllowCategorizedRecentChanges ;
-       $fname = 'wfSpecialRecentchanges';
 
        # Get query parameters
        $feedFormat = $wgRequest->getVal( 'feed' );
@@ -56,10 +55,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) {
        # As a feed, use limited settings only
        if( $feedFormat ) {
                global $wgFeedLimit;
-               if( $limit > $wgFeedLimit ) {
-                       $limit = $wgFeedLimit;
-               }
-
+               $limit = min( $wgFeedLimit, $limit );
        } else {
 
                $namespace = $wgRequest->getIntOrNull( 'namespace' );
@@ -119,7 +115,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) {
 
        # Get last modified date, for client caching
        # Don't use this if we are using the patrol feature, patrol changes don't update the timestamp
-       $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, $fname );
+       $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __FUNCTION__ );
        if ( $feedFormat || !$wgUseRCPatrol ) {
                if( $lastmod && $wgOut->checkLastModified( $lastmod ) ){
                        # Client cache fresh and headers sent, nothing more to do.
@@ -149,15 +145,15 @@ function wfSpecialRecentchanges( $par, $specialPage ) {
        $hidem .= $forcebot ? ' AND rc_bot = 1' : '';
 
        if( $hidemyself ) {
-               if( $wgUser->getID() ) {
-                       $hidem .= ' AND rc_user != ' . $wgUser->getID();
+               if( $wgUser->getId() ) {
+                       $hidem .= ' AND rc_user != ' . $wgUser->getId();
                } else {
                        $hidem .= ' AND rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() );
                }
        }
 
        // JOIN on watchlist for users
-       $uid = $wgUser->getID();
+       $uid = $wgUser->getId();
        if( $uid ) {
                $tables = array( 'recentchanges', 'watchlist' );
                $join_conds = array( 'watchlist' => array('LEFT JOIN',"wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace") );
@@ -509,6 +505,7 @@ function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall
        if ($more != '') $more .= '&';
        
        # Sort data for display and make sure it's unique after we've added user data.
+       # FIXME: why does this piss around with globals like this? Why is $limit added on globally?
        $wgRCLinkLimits[] = $limit;
        $wgRCLinkDays[] = $days;
        sort($wgRCLinkLimits);
@@ -712,8 +709,7 @@ function rcFormatDiff( $row ) {
 
 function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext='' ) {
        global $wgFeedDiffCutoff, $wgContLang, $wgUser;
-       $fname = 'rcFormatDiff';
-       wfProfileIn( $fname );
+       wfProfileIn( __FUNCTION__ );
 
        $skin = $wgUser->getSkin();
        # log enties
@@ -730,7 +726,7 @@ function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiont
 
        if( $title->getNamespace() >= 0 && !$accErrors ) {
                if( $oldid ) {
-                       wfProfileIn( "$fname-dodiff" );
+                       wfProfileIn( __FUNCTION__."-dodiff" );
 
                        $de = new DifferenceEngine( $title, $oldid, $newid );
                        #$diffText = $de->getDiff( wfMsg( 'revisionasof',
@@ -760,7 +756,7 @@ function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiont
                                $diffText = UtfNormal::cleanUp( $diffText );
                                $diffText = rcApplyDiffStyle( $diffText );
                        }
-                       wfProfileOut( "$fname-dodiff" );
+                       wfProfileOut( __FUNCTION__."-dodiff" );
                } else {
                        $rev = Revision::newFromId( $newid );
                        if( is_null( $rev ) ) {
@@ -774,7 +770,7 @@ function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiont
                $completeText .= $diffText;
        }
 
-       wfProfileOut( $fname );
+       wfProfileOut( __FUNCTION__ );
        return $completeText;
 }