Merge "Sanitizer: Allow attribute names to use any Unicode "Letter" or "Number""
[lhc/web/wiklou.git] / includes / specials / SpecialListgrouprights.php
index d64306b..7a25e55 100644 (file)
@@ -71,6 +71,8 @@ class SpecialListGroupRights extends SpecialPage {
                ) );
                asort( $allGroups );
 
+               $linkRenderer = $this->getLinkRenderer();
+
                foreach ( $allGroups as $group ) {
                        $permissions = isset( $groupPermissions[$group] )
                                ? $groupPermissions[$group]
@@ -92,22 +94,22 @@ class SpecialListGroupRights extends SpecialPage {
                                // Do not make a link for the generic * group or group with invalid group page
                                $grouppage = htmlspecialchars( $groupnameLocalized );
                        } else {
-                               $grouppage = Linker::link(
+                               $grouppage = $linkRenderer->makeLink(
                                        $grouppageLocalizedTitle,
-                                       htmlspecialchars( $groupnameLocalized )
+                                       $groupnameLocalized
                                );
                        }
 
                        if ( $group === 'user' ) {
                                // Link to Special:listusers for implicit group 'user'
-                               $grouplink = '<br />' . Linker::linkKnown(
+                               $grouplink = '<br />' . $linkRenderer->makeKnownLink(
                                        SpecialPage::getTitleFor( 'Listusers' ),
-                                       $this->msg( 'listgrouprights-members' )->escaped()
+                                       $this->msg( 'listgrouprights-members' )->text()
                                );
                        } elseif ( !in_array( $group, $config->get( 'ImplicitGroups' ) ) ) {
-                               $grouplink = '<br />' . Linker::linkKnown(
+                               $grouplink = '<br />' . $linkRenderer->makeKnownLink(
                                        SpecialPage::getTitleFor( 'Listusers' ),
-                                       $this->msg( 'listgrouprights-members' )->escaped(),
+                                       $this->msg( 'listgrouprights-members' )->text(),
                                        [],
                                        [ 'group' => $group ]
                                );
@@ -165,7 +167,7 @@ class SpecialListGroupRights extends SpecialPage {
                                $this->msg( 'listgrouprights-namespaceprotection-restrictedto' )->text()
                        )
                );
-
+               $linkRenderer = $this->getLinkRenderer();
                ksort( $namespaceProtection );
                foreach ( $namespaceProtection as $namespace => $rights ) {
                        if ( !in_array( $namespace, MWNamespace::getValidNamespaces() ) ) {
@@ -183,9 +185,9 @@ class SpecialListGroupRights extends SpecialPage {
                                Html::rawElement(
                                        'td',
                                        [],
-                                       Linker::link(
+                                       $linkRenderer->makeLink(
                                                SpecialPage::getTitleFor( 'Allpages' ),
-                                               htmlspecialchars( $namespaceText ),
+                                               $namespaceText,
                                                [],
                                                [ 'namespace' => $namespace ]
                                        )
@@ -271,12 +273,14 @@ class SpecialListGroupRights extends SpecialPage {
                        } elseif ( is_array( $changeGroup ) ) {
                                $changeGroup = array_intersect( array_values( array_unique( $changeGroup ) ), $allGroups );
                                if ( count( $changeGroup ) ) {
+                                       $groupLinks = [];
+                                       foreach ( $changeGroup as $group ) {
+                                               $groupLinks[] = UserGroupMembership::getLink( $group, $this->getContext(), 'wiki' );
+                                       }
                                        // For grep: listgrouprights-addgroup, listgrouprights-removegroup,
                                        // listgrouprights-addgroup-self, listgrouprights-removegroup-self
                                        $r[] = $this->msg( 'listgrouprights-' . $messageKey,
-                                               $lang->listToText( array_map( [ 'User', 'makeGroupLinkWiki' ], $changeGroup ) ),
-                                               count( $changeGroup )
-                                       )->parse();
+                                               $lang->listToText( $groupLinks ), count( $changeGroup ) )->parse();
                                }
                        }
                }