* of a specific loader request.
*/
class ResourceLoaderContext implements MessageLocalizer {
+ const DEFAULT_LANG = 'qqx';
+ const DEFAULT_SKIN = 'fallback';
+
protected $resourceLoader;
protected $request;
protected $logger;
// 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';
+ $this->skin = self::DEFAULT_SKIN;
}
}
if ( !Language::isValidBuiltInCode( $lang ) ) {
// The 'lang' parameter is required. (Not yet enforced.)
// If omitted, localise with the dummy language code.
- $lang = 'qqx';
+ $lang = self::DEFAULT_LANG;
}
$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();
}