From 20cdb6e0b8039409468704351b5c90a0ba924a03 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 25 Jun 2014 11:37:37 +0200 Subject: [PATCH] Revert "Util\Translator: show correct language list" This reverts commit b7521f48b960d27c1600aab5e79cf90d34ef8b68. --- library/Icinga/Util/Translator.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/library/Icinga/Util/Translator.php b/library/Icinga/Util/Translator.php index c2aeccddd..8d6e60e19 100644 --- a/library/Icinga/Util/Translator.php +++ b/library/Icinga/Util/Translator.php @@ -133,19 +133,10 @@ class Translator $codes = array(); foreach (array_values(self::$knownDomains) as $directory) { - if ($directory[0] === '.') continue; - - $dir = realpath($directory); - if (!is_dir($dir)) { - $dir = realpath($dir . '/LC_MESSAGES'); - if (!is_dir($dir)) continue; - } - $dh = opendir($dir); + $dh = opendir($directory); while (false !== ($name = readdir($dh))) { - if (substr($name, 0, 1) === '.') continue; - if ($name === 'LC_MESSAGES') continue; - if (is_dir($dir . DIRECTORY_SEPARATOR . $name)) { - $codes[] = substr($name, 0, strpos($name, '.')); + if (!preg_match('@\.|\.\.@', $name) && is_dir($directory . DIRECTORY_SEPARATOR . $name)) { + $codes[] = $name; } } }