Merge pull request #2845 from Icinga/fix/translation-excludes
GetTextTranslationHelper: Make sure we ignore any dotfile or vendor dir
This commit is contained in:
commit
cc4fcaefad
|
@ -467,10 +467,13 @@ class GettextTranslationHelper
|
||||||
|
|
||||||
$subdirs = array();
|
$subdirs = array();
|
||||||
while (($filename = readdir($directoryHandle)) !== false) {
|
while (($filename = readdir($directoryHandle)) !== false) {
|
||||||
|
if ($filename[0] === '.' || $filename === 'vendor') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$filepath = $directory . DIRECTORY_SEPARATOR . $filename;
|
$filepath = $directory . DIRECTORY_SEPARATOR . $filename;
|
||||||
if (preg_match('@^[^\.].+\.(' . implode('|', $this->sourceExtensions) . ')$@', $filename)) {
|
if (preg_match('@^[^\.].+\.(' . implode('|', $this->sourceExtensions) . ')$@', $filename)) {
|
||||||
$file->fwrite($filepath . PHP_EOL);
|
$file->fwrite($filepath . PHP_EOL);
|
||||||
} elseif (is_dir($filepath) && !preg_match('@^(\.|\.\.)$@', $filename)) {
|
} elseif (! is_link($filepath) && is_dir($filepath)) {
|
||||||
$subdirs[] = $filepath;
|
$subdirs[] = $filepath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue