X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FFeedUtils.php;h=071a3db98fa4f29cf49f6a64766b5d12bf2089d8;hb=f9a86b01c975b4863fd7c9bc039353a5b8753f3c;hp=b058975b736f0e898380087277f2329c81bcbe0c;hpb=1d489846c1691d2ba93220e09891c990543dabb1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index b058975b73..071a3db98f 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -39,6 +39,7 @@ class FeedUtils { global $wgRequest, $wgUser; $purge = $wgRequest->getVal( 'action' ) === 'purge'; + // Allow users with 'purge' right to clear feed caches if ( $purge && $wgUser->isAllowed( 'purge' ) ) { $cache = ObjectCache::getMainWANInstance(); $cache->delete( $timekey, 1 ); @@ -111,9 +112,9 @@ class FeedUtils { // log entries $completeText = '

' . implode( ' ', array_filter( - array( + [ $actiontext, - Linker::formatComment( $comment ) ) ) ) . "

\n"; + Linker::formatComment( $comment ) ] ) ) . "

\n"; // NOTE: Check permissions for anonymous users, not current user. // No "privileged" version should end up in the cache. @@ -218,13 +219,13 @@ class FeedUtils { * @return string */ protected static function getDiffLink( Title $title, $newid, $oldid = null ) { - $queryParameters = array( 'diff' => $newid ); + $queryParameters = [ 'diff' => $newid ]; if ( $oldid != null ) { $queryParameters['oldid'] = $oldid; } $diffUrl = $title->getFullURL( $queryParameters ); - $diffLink = Html::element( 'a', array( 'href' => $diffUrl ), + $diffLink = Html::element( 'a', [ 'href' => $diffUrl ], wfMessage( 'showdiff' )->inContentLanguage()->text() ); return $diffLink; @@ -239,7 +240,7 @@ class FeedUtils { * @return string Modified HTML */ public static function applyDiffStyle( $text ) { - $styles = array( + $styles = [ 'diff' => 'background-color: white; color:black;', 'diff-otitle' => 'background-color: white; color:black; text-align: center;', 'diff-ntitle' => 'background-color: white; color:black; text-align: center;', @@ -253,7 +254,7 @@ class FeedUtils { . 'border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; ' . 'border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;', 'diffchange' => 'font-weight: bold; text-decoration: none;', - ); + ]; foreach ( $styles as $class => $style ) { $text = preg_replace( "/(<[^>]+)class=(['\"])$class\\2([^>]*>)/",