From 851df4f1462cc61f68a1918ba0223a8e32c62aa4 Mon Sep 17 00:00:00 2001 From: Filip Komar Date: Fri, 3 Aug 2012 10:30:58 +0000 Subject: creating subdirectories in lang and patching one error about that --- langs/lib.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'langs/lib.php') 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; -- cgit v1.2.1