Merge "resourceloader: Throw exception when config serialization fails"
[lhc/web/wiklou.git] / languages / Language.php
index 5897241..fb78f13 100644 (file)
@@ -703,6 +703,14 @@ class Language {
                        }
 
                        $this->namespaceAliases = $aliases + $convertedNames;
+
+                       # Filter out aliases to namespaces that don't exist, e.g. from extensions
+                       # that aren't loaded here but are included in the l10n cache.
+                       # (array_intersect preserves keys from its first argument)
+                       $this->namespaceAliases = array_intersect(
+                               $this->namespaceAliases,
+                               array_keys( $this->getNamespaces() )
+                       );
                }
 
                return $this->namespaceAliases;
@@ -4499,6 +4507,7 @@ class Language {
 
        /**
         * @param string $code
+        * @deprecated since 1.32, use Language::factory to create a new object instead.
         */
        public function setCode( $code ) {
                $this->mCode = $code;