dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix Revi's mailmap email address"
[lhc/web/wiklou.git]
/
includes
/
FeedUtils.php
diff --git
a/includes/FeedUtils.php
b/includes/FeedUtils.php
index
b058975
..
96a88d3
100644
(file)
--- a/
includes/FeedUtils.php
+++ b/
includes/FeedUtils.php
@@
-39,6
+39,7
@@
class FeedUtils {
global $wgRequest, $wgUser;
$purge = $wgRequest->getVal( 'action' ) === 'purge';
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 );
if ( $purge && $wgUser->isAllowed( 'purge' ) ) {
$cache = ObjectCache::getMainWANInstance();
$cache->delete( $timekey, 1 );
@@
-111,9
+112,9
@@
class FeedUtils {
// log entries
$completeText = '<p>' . implode( ' ',
array_filter(
// log entries
$completeText = '<p>' . implode( ' ',
array_filter(
- array(
+ [
$actiontext,
$actiontext,
- Linker::formatComment( $comment )
)
) ) . "</p>\n";
+ Linker::formatComment( $comment )
]
) ) . "</p>\n";
// NOTE: Check permissions for anonymous users, not current user.
// No "privileged" version should end up in the cache.
// NOTE: Check permissions for anonymous users, not current user.
// No "privileged" version should end up in the cache.
@@
-128,13
+129,6
@@
class FeedUtils {
}
if ( $oldid ) {
}
if ( $oldid ) {
-
- # $diffText = $de->getDiff( wfMessage( 'revisionasof',
- # $wgLang->timeanddate( $timestamp ),
- # $wgLang->date( $timestamp ),
- # $wgLang->time( $timestamp ) )->text(),
- # wfMessage( 'currentrev' )->text() );
-
$diffText = '';
// Don't bother generating the diff if we won't be able to show it
if ( $wgFeedDiffCutoff > 0 ) {
$diffText = '';
// Don't bother generating the diff if we won't be able to show it
if ( $wgFeedDiffCutoff > 0 ) {
@@
-194,8
+188,7
@@
class FeedUtils {
}
if ( $html === null ) {
}
if ( $html === null ) {
-
- // Omit large new page diffs, bug 29110
+ // Omit large new page diffs, T31110
// Also use diff link for non-textual content
$diffText = self::getDiffLink( $title, $newid );
} else {
// Also use diff link for non-textual content
$diffText = self::getDiffLink( $title, $newid );
} else {
@@
-218,13
+211,13
@@
class FeedUtils {
* @return string
*/
protected static function getDiffLink( Title $title, $newid, $oldid = null ) {
* @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 );
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;
wfMessage( 'showdiff' )->inContentLanguage()->text() );
return $diffLink;
@@
-239,7
+232,7
@@
class FeedUtils {
* @return string Modified HTML
*/
public static function applyDiffStyle( $text ) {
* @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;',
'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
+246,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;',
. '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([^>]*>)/",
foreach ( $styles as $class => $style ) {
$text = preg_replace( "/(<[^>]+)class=(['\"])$class\\2([^>]*>)/",