Use varargs for MessageLocalizer::msg and similar
[lhc/web/wiklou.git] / includes / specialpage / SpecialPage.php
index d7e39d5..1400d35 100644 (file)
@@ -278,7 +278,9 @@ class SpecialPage implements MessageLocalizer {
         */
        public function isRestricted() {
                // DWIM: If anons can do something, then it is not restricted
-               return $this->mRestriction != '' && !User::groupHasPermission( '*', $this->mRestriction );
+               return $this->mRestriction != '' && !MediaWikiServices::getInstance()
+                               ->getPermissionManager()
+                               ->groupHasPermission( '*', $this->mRestriction );
        }
 
        /**
@@ -290,7 +292,9 @@ class SpecialPage implements MessageLocalizer {
         * @return bool Does the user have permission to view the page?
         */
        public function userCanExecute( User $user ) {
-               return $user->isAllowed( $this->mRestriction );
+               return MediaWikiServices::getInstance()
+                       ->getPermissionManager()
+                       ->userHasRight( $user, $this->mRestriction );
        }
 
        /**
@@ -780,11 +784,13 @@ class SpecialPage implements MessageLocalizer {
         * Wrapper around wfMessage that sets the current context.
         *
         * @since 1.16
+        * @param string|string[]|MessageSpecifier $key
+        * @param mixed ...$params
         * @return Message
         * @see wfMessage
         */
-       public function msg( $key /* $args */ ) {
-               $message = $this->getContext()->msg( ...func_get_args() );
+       public function msg( $key, ...$params ) {
+               $message = $this->getContext()->msg( $key, ...$params );
                // RequestContext passes context to wfMessage, and the language is set from
                // the context, but setting the language for Message class removes the
                // interface message status, which breaks for example usernameless gender