Last modified: 2011-08-18 16:41:29 UTC
The current language fallback loop detection code (in languages/Language.php) actually doesn't detect a loop, but rather stops a fallback chain when it gets larger than 5 items. It would be more logical (and more flexible) to keep track of what languages have been "visited" and break the loop if we return to one of them. In any case, it wouldn't be possible to build an infinite chain of unique language codes, so no arbitrary limit to feedback chains needs to be enforced.
I think this doesn't actually block 30217, since the current mechanism would allow such a fallback loop to work (actually, it'd be treated as a chain and would be cutoff after 5 iterations, in case none of the localizations exist).
Except that the cutoff is an exception which halts code execution :/
Created attachment 8890 [details] Proposed patch Here is patch that makes the fallbacks a flat list instead of recursive chains. This way we avoid the problems with cycles, because we don't have them anymore. Not included in the patch: updating $fallback in message files nor updating callers of getFallbackFor (which I plan to deprecate, perhaps with some heuristics to avoid causing loops for callers)
r94907.