Remove usages of Title::quickUserCan
[lhc/web/wiklou.git] / includes / changes / ChangesList.php
index 5ced294..0382d73 100644 (file)
@@ -232,6 +232,13 @@ class ChangesList extends ContextSource {
                $classes[] = Sanitizer::escapeClass( self::CSS_CLASS_PREFIX . 'ns-' .
                        $rc->mAttribs['rc_namespace'] );
 
+               $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
+               $classes[] = Sanitizer::escapeClass(
+                       self::CSS_CLASS_PREFIX .
+                       'ns-' .
+                       ( $nsInfo->isTalk( $rc->mAttribs['rc_namespace'] ) ? 'talk' : 'subject' )
+               );
+
                if ( $this->filterGroups !== null ) {
                        foreach ( $this->filterGroups as $filterGroup ) {
                                foreach ( $filterGroup->getFilters() as $filter ) {
@@ -707,8 +714,11 @@ class ChangesList extends ContextSource {
                ) {
                        $title = $rc->getTitle();
                        /** Check for rollback permissions, disallow special pages, and only
-                        * show a link on the top-most revision */
-                       if ( $title->quickUserCan( 'rollback', $this->getUser() ) ) {
+                        * show a link on the top-most revision
+                        */
+                       if ( MediaWikiServices::getInstance()->getPermissionManager()
+                               ->quickUserCan( 'rollback', $this->getUser(), $title )
+                       ) {
                                $rev = new Revision( [
                                        'title' => $title,
                                        'id' => $rc->mAttribs['rc_this_oldid'],