diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-04-14 16:28:36 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-04-14 16:29:11 +0200 |
commit | 721311c9099780ecc22b6b186ed79dc5c9c92271 (patch) | |
tree | 9e26f111433d33834d3cc741f56a9eb0ef105915 /lib/l10n.php | |
parent | 926b2b78fe444f5facfb21a625a6cd01123d2fb2 (diff) | |
download | nextcloud-server-721311c9099780ecc22b6b186ed79dc5c9c92271.tar.gz nextcloud-server-721311c9099780ecc22b6b186ed79dc5c9c92271.zip |
some minor optimizations
Diffstat (limited to 'lib/l10n.php')
-rw-r--r-- | lib/l10n.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/l10n.php b/lib/l10n.php index 636326f9864..00bff08bf7f 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -261,17 +261,14 @@ class OC_L10N{ public static function findAvailableLanguages($app=null){ $available=array('en');//english is always available $dir = self::findI18nDir($app); - if(file_exists($dir)){ - $dh = opendir($dir); - while(($file = readdir($dh)) !== false){ - if(substr($file, -4, 4) == '.php' and (strlen($file) == 6 || strlen($file) == 9)){ + if(is_dir($dir)){ + $files=scandir($dir); + foreach($files as $file){ + if(substr($file, -4, 4) == '.php'){ $i = substr($file, 0, -4); - if($i != ''){ - $available[] = $i; - } + $available[] = $i; } } - closedir($dh); } return $available; } |