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 "Declare dynamic properties"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialEditTags.php
diff --git
a/includes/specials/SpecialEditTags.php
b/includes/specials/SpecialEditTags.php
index
6ef6cb3
..
48357aa
100644
(file)
--- a/
includes/specials/SpecialEditTags.php
+++ b/
includes/specials/SpecialEditTags.php
@@
-19,6
+19,8
@@
* @ingroup SpecialPage
*/
* @ingroup SpecialPage
*/
+use MediaWiki\Permissions\PermissionManager;
+
/**
* Special page for adding and removing change tags to individual revisions.
* A lot of this is copied out of SpecialRevisiondelete.
/**
* Special page for adding and removing change tags to individual revisions.
* A lot of this is copied out of SpecialRevisiondelete.
@@
-51,8
+53,18
@@
class SpecialEditTags extends UnlistedSpecialPage {
/** @var string */
private $reason;
/** @var string */
private $reason;
- public function __construct() {
+ /** @var PermissionManager */
+ private $permissionManager;
+
+ /**
+ * @inheritDoc
+ *
+ * @param PermissionManager $permissionManager
+ */
+ public function __construct( PermissionManager $permissionManager ) {
parent::__construct( 'EditTags', 'changetags' );
parent::__construct( 'EditTags', 'changetags' );
+
+ $this->permissionManager = $permissionManager;
}
public function doesWrites() {
}
public function doesWrites() {
@@
-67,13
+79,6
@@
class SpecialEditTags extends UnlistedSpecialPage {
$user = $this->getUser();
$request = $this->getRequest();
$user = $this->getUser();
$request = $this->getRequest();
- // Check blocks
- // @TODO Use PermissionManager::isBlockedFrom() instead.
- $block = $user->getBlock();
- if ( $block ) {
- throw new UserBlockedError( $block );
- }
-
$this->setHeaders();
$this->outputHeader();
$this->setHeaders();
$this->outputHeader();
@@
-124,7
+129,7
@@
class SpecialEditTags extends UnlistedSpecialPage {
$this->ids
);
$this->ids
);
- $this->isAllowed = $
user->isAllowed(
'changetags' );
+ $this->isAllowed = $
this->permissionManager->userHasRight( $user,
'changetags' );
$this->reason = $request->getVal( 'wpReason' );
// We need a target page!
$this->reason = $request->getVal( 'wpReason' );
// We need a target page!
@@
-132,6
+137,12
@@
class SpecialEditTags extends UnlistedSpecialPage {
$output->addWikiMsg( 'undelete-header' );
return;
}
$output->addWikiMsg( 'undelete-header' );
return;
}
+
+ // Check blocks
+ if ( $this->permissionManager->isBlockedFrom( $user, $this->targetObj ) ) {
+ throw new UserBlockedError( $user->getBlock() );
+ }
+
// Give a link to the logs/hist for this page
$this->showConvenienceLinks();
// Give a link to the logs/hist for this page
$this->showConvenienceLinks();
@@
-261,8
+272,7
@@
class SpecialEditTags extends UnlistedSpecialPage {
// HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
// (e.g. emojis) count for two each. This limit is overridden in JS to instead count
// Unicode codepoints.
// HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
// (e.g. emojis) count for two each. This limit is overridden in JS to instead count
// Unicode codepoints.
- // "- 155" is to leave room for the auto-generated part of the log entry.
- 'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT - 155,
+ 'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT,
] ) .
'</td>' .
"</tr><tr>\n" .
] ) .
'</td>' .
"</tr><tr>\n" .