// Normalize the key, just in case the hook did something weird.
$normalized = Skin::normalizeKey( $skin );
$this->skin = $factory->makeSkin( $normalized );
- }
-
- // If this is still null (the hook didn't run or didn't work)
- // then go through the normal processing to load a skin
- if ( $this->skin === null ) {
+ } else {
+ // No hook override, go through normal processing
if ( !in_array( 'skin', $this->getConfig()->get( 'HiddenPrefs' ) ) ) {
- # get the user skin
$userSkin = $this->getUser()->getOption( 'skin' );
- $userSkin = $this->getRequest()->getVal( 'useskin', $userSkin );
+ // Optimisation: Avoid slow getVal(), this isn't user-generated content.
+ $userSkin = $this->getRequest()->getRawVal( 'useskin', $userSkin );
} else {
- # if we're not allowing users to override, then use the default
$userSkin = $this->getConfig()->get( 'DefaultSkin' );
}