From: jenkins-bot Date: Wed, 31 Jul 2019 23:07:22 +0000 (+0000) Subject: Merge "context: Use getRawVal instead of getVal for 'uselang' and 'useskin'" X-Git-Tag: 1.34.0-rc.0~822 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/D%D1%83%D0%BD%D0%B0?a=commitdiff_plain;h=66ac8dbd43543041370ad0c1d783eb450ba66170;p=lhc%2Fweb%2Fwiklou.git Merge "context: Use getRawVal instead of getVal for 'uselang' and 'useskin'" --- 66ac8dbd43543041370ad0c1d783eb450ba66170 diff --cc includes/context/RequestContext.php index afc7045e49,23a6f68d1a..6eeac1c72d --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@@ -379,12 -379,18 +380,13 @@@ class RequestContext implements IContex // 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' ); }