aboutsummaryrefslogtreecommitdiffstats
path: root/langs/lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'langs/lib.php')
-rw-r--r--langs/lib.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/langs/lib.php b/langs/lib.php
index 81e231673..71b25f1c7 100644
--- a/langs/lib.php
+++ b/langs/lib.php
@@ -64,9 +64,20 @@ if ( ! function_exists('glob_recursive'))
{
$files = glob($pattern, $flags);
+// removing dirs from $files as they are not files ;)
+ $files_wo_dirs = array();
+ foreach ($files as $single_file) {
+ $single_file_as_string = str_split($single_file);
+ $last_sign = array_pop($single_file_as_string);
+ if($last_sign != '/') {
+ $files_wo_dirs[] = $single_file;
+ };
+ }
+ $files = $files_wo_dirs;
+
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)
{
- $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags));
+ $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags));
}
return $files;