Use finally instead of try-catch-throw
[lhc/web/wiklou.git] / includes / context / RequestContext.php
index 16c304c..a4225a1 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;
                        }
                }