Merge "Skin: Make skins aware of their registered skin name"
[lhc/web/wiklou.git] / includes / skins / Skin.php
index 8fb0d1c..07964a4 100644 (file)
@@ -34,7 +34,11 @@ use MediaWiki\MediaWikiServices;
  * @ingroup Skins
  */
 abstract class Skin extends ContextSource {
+       /**
+        * @var string|null
+        */
        protected $skinname = null;
+
        protected $mRelevantTitle = null;
        protected $mRelevantUser = null;
 
@@ -134,7 +138,17 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @return string Skin name
+        * @since 1.31
+        * @param string|null $skinname
+        */
+       public function __construct( $skinname = null ) {
+               if ( is_string( $skinname ) ) {
+                       $this->skinname = $skinname;
+               }
+       }
+
+       /**
+        * @return string|null Skin name
         */
        public function getSkinName() {
                return $this->skinname;
@@ -1095,7 +1109,7 @@ abstract class Skin extends ContextSource {
                $title = Title::newMainPage();
                self::checkTitle( $title, '' );
 
-               return $title->getLocalURL( $urlaction );
+               return $title->getLinkURL( $urlaction );
        }
 
        /**