Use exec and silently fail in languagedetection, fixes #831, fixes #830

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-07-11 17:28:10 +02:00
parent 026f8503ab
commit 0808bacb39

View File

@@ -78,7 +78,10 @@ class languageSelect
# See for which language the codepages are compiled
foreach ($this->availableLanguages as $lang)
{
preg_match_all("/[^|\w]".$lang.'.*/', `locale -a`, $matches);
$tmplng = array();
@exec("locale -a", $tmplng);
$tmplng = join("\n", $tmplng);
preg_match_all("/[^|\w]".$lang.'.*/', $tmplng, $matches);
foreach($matches[0] as $m)
{
if(preg_match('/utf8/', $m))