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
Declare dynamic properties
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialEditTags.php
diff --git
a/includes/specials/SpecialEditTags.php
b/includes/specials/SpecialEditTags.php
index
ed398de
..
1dd1969
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();
@@
-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();
@@
-227,6
+238,9
@@
class SpecialEditTags extends UnlistedSpecialPage {
$list = $this->getList();
for ( $list->reset(); $list->current(); $list->next() ) {
$item = $list->current();
$list = $this->getList();
for ( $list->reset(); $list->current(); $list->next() ) {
$item = $list->current();
+ if ( !$item->canView() ) {
+ throw new ErrorPageError( 'permissionserrors', 'tags-update-no-permission' );
+ }
$numRevisions++;
$out->addHTML( $item->getHTML() );
}
$numRevisions++;
$out->addHTML( $item->getHTML() );
}
@@
-258,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" .