$this->skin = $request->getRawVal( 'skin' );
$skinnames = Skin::getSkinNames();
- // If no skin is specified, or we don't recognize the skin, use the default skin
if ( !$this->skin || !isset( $skinnames[$this->skin] ) ) {
- $this->skin = $this->getConfig()->get( 'DefaultSkin' );
+ // The 'skin' parameter is required. (Not yet enforced.)
+ // For requests without a known skin specified,
+ // use MediaWiki's 'fallback' skin for skin-specific decisions.
+ $this->skin = 'fallback';
}
}
}
/**
+ * @deprecated since 1.34 Use ResourceLoaderModule::getConfig instead
+ * inside module methods. Use ResourceLoader::getConfig elsewhere.
* @return Config
*/
public function getConfig() {
}
/**
+ * @deprecated since 1.34 Use ResourceLoaderModule::getLogger instead
+ * inside module methods. Use ResourceLoader::getLogger elsewhere.
* @since 1.27
* @return \Psr\Log\LoggerInterface
*/
$lang = $this->getRequest()->getRawVal( 'lang', '' );
// Stricter version of RequestContext::sanitizeLangCode()
if ( !Language::isValidBuiltInCode( $lang ) ) {
- $lang = $this->getConfig()->get( 'LanguageCode' );
+ // The 'lang' parameter is required. (Not yet enforced.)
+ // If omitted, localise with the dummy language code.
+ $lang = 'qqx';
}
$this->language = $lang;
}
*/
public function getDirection() {
if ( $this->direction === null ) {
- $this->direction = $this->getRequest()->getRawVal( 'dir' );
- if ( !$this->direction ) {
+ $direction = $this->getRequest()->getRawVal( 'dir' );
+ if ( $direction === 'ltr' || $direction === 'rtl' ) {
+ $this->direction = $direction;
+ } else {
// Determine directionality based on user language (T8100)
$this->direction = Language::factory( $this->getLanguage() )->getDir();
}