X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialRecentchanges.php;h=2744cd8f559edb7ac9e2d70cf6e1b9ffd25204a3;hb=af7be3b1b7b2f9e1aa32007857a21df3c6a0cfc0;hp=ef03d36e54c85221dc7c14171dc36a8929656380;hpb=200640038bf66f898557ec29b599a2132555e782;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index ef03d36e54..2744cd8f55 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -1,14 +1,13 @@ getVal( 'feed' ); - /* Checkbox values can't be true be default, because + /* Checkbox values can't be true by default, because * we cannot differentiate between unset and not set at all */ $defaults = array( @@ -58,7 +57,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { if( $feedFormat ) { global $wgFeedLimit; if( $limit > $wgFeedLimit ) { - $options['limit'] = $wgFeedLimit; + $limit = $wgFeedLimit; } } else { @@ -105,7 +104,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { # Database connection and caching - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $recentchanges, $watchlist ) = $dbr->tableNamesN( 'recentchanges', 'watchlist' ); @@ -221,8 +220,6 @@ function wfSpecialRecentchanges( $par, $specialPage ) { } // And now for the content - $wgOut->setSyndicated( true ); - $list = ChangesList::newFromUser( $wgUser ); if ( $wgAllowCategorizedRecentChanges ) { @@ -270,8 +267,6 @@ function wfSpecialRecentchanges( $par, $specialPage ) { } function rcFilterByCategories ( &$rows , $categories , $any ) { - require_once ( 'Categoryfinder.php' ) ; - # Filter categories $cats = array () ; foreach ( $categories AS $cat ) { @@ -332,9 +327,17 @@ function rcOutputFeed( $rows, $feedFormat, $limit, $hideminor, $lastmod ) { ' [' . $wgContLanguageCode . ']'; $feed = new $wgFeedClasses[$feedFormat]( $feedTitle, - htmlspecialchars( wfMsgForContent( 'recentchangestext' ) ), + htmlspecialchars( wfMsgForContent( 'recentchanges-feed-description' ) ), $wgTitle->getFullUrl() ); + //purge cache if requested + global $wgRequest, $wgUser; + $purge = $wgRequest->getVal( 'action' ) == 'purge'; + if ( $purge && $wgUser->isAllowed('purge') ) { + $messageMemc->delete( $timekey ); + $messageMemc->delete( $key ); + } + /** * Bumping around loading up diffs can be pretty slow, so where * possible we want to cache the feed output so the next visitor @@ -470,7 +473,7 @@ function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall /** * Makes change an option link which carries all the other options - * @param $title @see Title + * @param $title see Title * @param $override * @param $options */ @@ -625,7 +628,13 @@ function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment ) { $skin = $wgUser->getSkin(); $completeText = '

' . $skin->formatComment( $comment ) . "

\n"; - if( $title->getNamespace() >= 0 ) { + //NOTE: Check permissions for anonymous users, not current user. + // No "privileged" version should end up in the cache. + // Most feed readers will not log in anway. + $anon = new User(); + $accErrors = $title->getUserPermissionsErrors( 'read', $anon, true ); + + if( $title->getNamespace() >= 0 && !$accErrors ) { if( $oldid ) { wfProfileIn( "$fname-dodiff" ); @@ -686,13 +695,13 @@ function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment ) { */ function rcApplyDiffStyle( $text ) { $styles = array( - 'diff' => 'background-color: white;', - 'diff-otitle' => 'background-color: white;', - 'diff-ntitle' => 'background-color: white;', - 'diff-addedline' => 'background: #cfc; font-size: smaller;', - 'diff-deletedline' => 'background: #ffa; font-size: smaller;', - 'diff-context' => 'background: #eee; font-size: smaller;', - 'diffchange' => 'color: red; font-weight: bold;', + 'diff' => 'background-color: white; color:black;', + 'diff-otitle' => 'background-color: white; color:black;', + 'diff-ntitle' => 'background-color: white; color:black;', + 'diff-addedline' => 'background: #cfc; color:black; font-size: smaller;', + 'diff-deletedline' => 'background: #ffa; color:black; font-size: smaller;', + 'diff-context' => 'background: #eee; color:black; font-size: smaller;', + 'diffchange' => 'color: red; font-weight: bold; text-decoration: none;', ); foreach( $styles as $class => $style ) { @@ -703,4 +712,4 @@ function rcApplyDiffStyle( $text ) { return $text; } -?> +