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
Use OutputPage::wrapWikiTextAsInterface() to add safe <div> wrappers
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialUserrights.php
diff --git
a/includes/specials/SpecialUserrights.php
b/includes/specials/SpecialUserrights.php
index
a05452d
..
f63c884
100644
(file)
--- a/
includes/specials/SpecialUserrights.php
+++ b/
includes/specials/SpecialUserrights.php
@@
-87,11
+87,7
@@
class UserrightsPage extends SpecialPage {
$out->addModules( [ 'mediawiki.special.userrights' ] );
$out->addModules( [ 'mediawiki.special.userrights' ] );
- if ( $par !== null ) {
- $this->mTarget = $par;
- } else {
- $this->mTarget = $request->getVal( 'user' );
- }
+ $this->mTarget = $par ?? $request->getVal( 'user' );
if ( is_string( $this->mTarget ) ) {
$this->mTarget = trim( $this->mTarget );
if ( is_string( $this->mTarget ) ) {
$this->mTarget = trim( $this->mTarget );
@@
-164,7
+160,7
@@
class UserrightsPage extends SpecialPage {
// save settings
if ( !$fetchedStatus->isOK() ) {
// save settings
if ( !$fetchedStatus->isOK() ) {
- $this->getOutput()->addWikiText( $fetchedStatus->getWikiText() );
+ $this->getOutput()->addWikiText
AsInterface
( $fetchedStatus->getWikiText() );
return;
}
return;
}
@@
-193,7
+189,7
@@
class UserrightsPage extends SpecialPage {
return;
} else {
// Print an error message and redisplay the form
return;
} else {
// Print an error message and redisplay the form
- $out->
addWikiText( '<div class="error">' . $status->getWikiText() . '</div>'
);
+ $out->
wrapWikiTextAsInterface( 'error', $status->getWikiText()
);
}
}
}
}
}
}
@@
-373,7
+369,7
@@
class UserrightsPage extends SpecialPage {
}
if ( $add ) {
foreach ( $add as $index => $group ) {
}
if ( $add ) {
foreach ( $add as $index => $group ) {
- $expiry =
isset( $groupExpiries[$group] ) ? $groupExpiries[$group] :
null;
+ $expiry =
$groupExpiries[$group] ??
null;
if ( !$user->addGroup( $group, $expiry ) ) {
unset( $add[$index] );
}
if ( !$user->addGroup( $group, $expiry ) ) {
unset( $add[$index] );
}
@@
-472,7
+468,7
@@
class UserrightsPage extends SpecialPage {
function editUserGroupsForm( $username ) {
$status = $this->fetchUser( $username, true );
if ( !$status->isOK() ) {
function editUserGroupsForm( $username ) {
$status = $this->fetchUser( $username, true );
if ( !$status->isOK() ) {
- $this->getOutput()->addWikiText( $status->getWikiText() );
+ $this->getOutput()->addWikiText
AsInterface
( $status->getWikiText() );
return;
} else {
return;
} else {
@@
-658,7
+654,7
@@
class UserrightsPage extends SpecialPage {
)->escaped();
$grouplist = '';
)->escaped();
$grouplist = '';
- $count = count( $list );
+ $count = count( $list )
+ count( $tempList )
;
if ( $count > 0 ) {
$grouplist = $this->msg( 'userrights-groupsmember' )
->numParams( $count )
if ( $count > 0 ) {
$grouplist = $this->msg( 'userrights-groupsmember' )
->numParams( $count )