Explorar el Código

[Translator] fixed recursion when using a fallback that is the same as the locale

Fabien Potencier hace 13 años
padre
commit
64d44fbb93
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/Symfony/Component/Translation/Translator.php

+ 3 - 1
src/Symfony/Component/Translation/Translator.php

@@ -180,7 +180,9 @@ class Translator implements TranslatorInterface
             $this->loadCatalogue($fallback);
         }
 
-        $this->catalogues[$locale]->addFallbackCatalogue($this->catalogues[$fallback]);
+        if ($fallback != $locale) {
+            $this->catalogues[$locale]->addFallbackCatalogue($this->catalogues[$fallback]);
+        }
     }
 
     private function computeFallbackLocale($locale)