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:
@@ -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--;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user