1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

[3.1.0] Fixed bug with fallback languages in LanguageFactory

- Also, reverted bogus Generator changes

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1723 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-05-15 23:04:46 +00:00
parent 00ea2062d4
commit 86b1da9b6f
7 changed files with 60 additions and 27 deletions

View File

@@ -104,14 +104,13 @@ class HTMLPurifier_LanguageFactory
$lang = new $class($config, $context);
} else {
// Go fallback
$fallback = $this->getFallbackFor($code);
// If a language doesn't exist, English's language settings
// file will automatically be used, which DOESN'T have any
// fallback defined. This is fine for settings merging, but
// not so good for figuring out a class to use.
if ($fallback === false) $fallback = 'en';
$raw_fallback = $this->getFallbackFor($code);
$fallback = $raw_fallback ? $raw_fallback : 'en';
$depth++;
$lang = $this->create($config, $context, $fallback);
if (!$raw_fallback) {
$lang->error = true;
}
$depth--;
}
}