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 "Remove dead code from RCCacheEntryFactory"
[lhc/web/wiklou.git]
/
includes
/
logging
/
ProtectLogFormatter.php
diff --git
a/includes/logging/ProtectLogFormatter.php
b/includes/logging/ProtectLogFormatter.php
index
9e5eea5
..
6e3b26b
100644
(file)
--- a/
includes/logging/ProtectLogFormatter.php
+++ b/
includes/logging/ProtectLogFormatter.php
@@
-18,9
+18,10
@@
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @license
http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or
later
+ * @license
GPL-2.0-or-
later
* @since 1.26
*/
* @since 1.26
*/
+
use MediaWiki\MediaWikiServices;
/**
use MediaWiki\MediaWikiServices;
/**
@@
-78,7
+79,7
@@
class ProtectLogFormatter extends LogFormatter {
}
public function getActionLinks() {
}
public function getActionLinks() {
- $linkRenderer =
MediaWikiServices::getInstance()
->getLinkRenderer();
+ $linkRenderer =
$this
->getLinkRenderer();
$subtype = $this->entry->getSubtype();
if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
|| $subtype === 'move_prot' // the move log entry has the right action link
$subtype = $this->entry->getSubtype();
if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
|| $subtype === 'move_prot' // the move log entry has the right action link
@@
-100,7
+101,10
@@
class ProtectLogFormatter extends LogFormatter {
];
// Show change protection link
];
// Show change protection link
- if ( $this->context->getUser()->isAllowed( 'protect' ) ) {
+ if ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->context->getUser(), 'protect' )
+ ) {
$links[] = $linkRenderer->makeKnownLink(
$title,
$this->msg( 'protect_change' )->text(),
$links[] = $linkRenderer->makeKnownLink(
$title,
$this->msg( 'protect_change' )->text(),
@@
-147,13
+151,13
@@
class ProtectLogFormatter extends LogFormatter {
}
public function formatParametersForApi() {
}
public function formatParametersForApi() {
- global $wgContLang;
-
$ret = parent::formatParametersForApi();
if ( isset( $ret['details'] ) && is_array( $ret['details'] ) ) {
$ret = parent::formatParametersForApi();
if ( isset( $ret['details'] ) && is_array( $ret['details'] ) ) {
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
foreach ( $ret['details'] as &$detail ) {
if ( isset( $detail['expiry'] ) ) {
foreach ( $ret['details'] as &$detail ) {
if ( isset( $detail['expiry'] ) ) {
- $detail['expiry'] = $wgContLang->formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' );
+ $detail['expiry'] = $contLang->
+ formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' );
}
}
}
}
}
}