/* Methods */
/**
- * @param $resourceLoader ResourceLoader
- * @param $request WebRequest
+ * @param ResourceLoader $resourceLoader
+ * @param WebRequest $request
*/
public function __construct( $resourceLoader, WebRequest $request ) {
global $wgDefaultSkin, $wgResourceLoaderDebug;
* an array of module names like array( 'jquery.foo', 'jquery.bar',
* 'jquery.ui.baz', 'jquery.ui.quux' )
* @param string $modules Packed module name list
- * @return array of module names
+ * @return array Array of module names
*/
public static function expandModuleNames( $modules ) {
$retval = array();
*/
public function getLanguage() {
if ( $this->language === null ) {
- global $wgLang;
- $this->language = $this->request->getVal( 'lang' );
- if ( !$this->language ) {
- $this->language = $wgLang->getCode();
- }
+ // Must be a valid language code after this point (bug 62849)
+ $this->language = RequestContext::sanitizeLangCode( $this->request->getVal( 'lang' ) );
}
return $this->language;
}
if ( $this->direction === null ) {
$this->direction = $this->request->getVal( 'dir' );
if ( !$this->direction ) {
- # directionality based on user language (see bug 6100)
+ // Determine directionality based on user language (bug 6100)
$this->direction = Language::factory( $this->getLanguage() )->getDir();
}
}
}
/**
- * @return String|null
+ * @return string|null
*/
public function getOnly() {
return $this->only;
}
/**
- * @return String|null
+ * @return string|null
*/
public function getVersion() {
return $this->version;