Merge "Rename BlockRestriction -> BlockRestrictionStore and wire it up as a service"
[lhc/web/wiklou.git] / includes / context / RequestContext.php
index 16c304c..aada514 100644 (file)
@@ -257,6 +257,8 @@ class RequestContext implements IContextSource, MutableContext {
         */
        public function setUser( User $user ) {
                $this->user = $user;
+               // Invalidate cached user interface language
+               $this->lang = null;
        }
 
        /**
@@ -343,12 +345,8 @@ class RequestContext implements IContextSource, MutableContext {
                                        $obj = Language::factory( $code );
                                        $this->lang = $obj;
                                }
-
-                               unset( $this->recursion );
-                       }
-                       catch ( Exception $ex ) {
+                       } finally {
                                unset( $this->recursion );
-                               throw $ex;
                        }
                }
 
@@ -370,7 +368,7 @@ class RequestContext implements IContextSource, MutableContext {
                if ( $this->skin === null ) {
                        $skin = null;
                        Hooks::run( 'RequestContextCreateSkin', [ $this, &$skin ] );
-                       $factory = SkinFactory::getDefaultInstance();
+                       $factory = MediaWikiServices::getInstance()->getSkinFactory();
 
                        // If the hook worked try to set a skin from it
                        if ( $skin instanceof Skin ) {