aboutsummaryrefslogtreecommitdiffstats
path: root/langs/lib.php
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2012-08-03 10:30:58 +0000
committerFilip Komar <filip@mageia.org>2012-08-03 10:30:58 +0000
commit851df4f1462cc61f68a1918ba0223a8e32c62aa4 (patch)
treef860a4ea695501a9dd5b7c6ae637cbcaef98d6d6 /langs/lib.php
parent771c24ee98fac713a732b71aeaeea09bdf7783a6 (diff)
downloadwww-851df4f1462cc61f68a1918ba0223a8e32c62aa4.tar
www-851df4f1462cc61f68a1918ba0223a8e32c62aa4.tar.gz
www-851df4f1462cc61f68a1918ba0223a8e32c62aa4.tar.bz2
www-851df4f1462cc61f68a1918ba0223a8e32c62aa4.tar.xz
www-851df4f1462cc61f68a1918ba0223a8e32c62aa4.zip
creating subdirectories in lang and patching one error about that
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;